Hi On Tue, Jan 17, 2023 at 9:07 PM John Berberian, Jr <[email protected]> wrote: > > Apologies for the late response, I was traveling most of yesterday. > > On 1/16/23 4:22 AM, Daniel P. Berrangé wrote: > > When we introduce a new QAPI format for migration args though, I've > > suggested we drop support for passing exec via shell, and require an > > explicit argv[] array: > > > > https://lists.gnu.org/archive/html/qemu-devel/2023-01/msg01434.html > > > > For Windows since we don't have back compat to worry about, we > > can avoid passing via cmd.exe from the start. > > I think we should keep the behavior the same on all platforms. If such a > change is to occur, it should happen at the same time on Windows and > Unix-like systems. Platform-dependent ifdefs should be used to overcome > platform-specific differences (e.g. the location of the shell), rather > than give one platform entirely different functionality - otherwise we > introduce needless confusion when someone accustomed to Linux tries to > use an exec migration on Windows and it doesn't work the same way at all.
I agree with Daniel, we should make the migrate/exec command take an argv[] (not run through the shell) and deprecate support for "exec:.." in QMP. The "exec:..." form support could later be moved to HMP... Tbh, allowing fork/exec from QEMU is not a great thing in the first place (although with GSpawn using posix_spawn on modern systems, that should help.. and win32 has a different API). Instead, QMP/HMP clients could handle consumer process creation, and passing FDs via 'getfd,' and using the migrate 'fd:fdname' form (that is not really possible on win32 today, but I am adding support for importing sockets in a series on the list. This should do the job now that win32 supports unix sockets. We could also add support for pipes for older windows, and other kind of handles too). I admit this is not as convenient as the current "exec:cmdline" form... I don't know whether we have enough motivation to push those changes... I see it fitting with the goal to make HMP a human-friendly QMP client though. In the meantime, I guess we should take the proposed patch. Stefan, as win32 maintainer, any opinion? -- Marc-André Lureau
