[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 14/50] mutli-process: build remote command line args
From: |
Elena Ufimtseva |
Subject: |
Re: [PATCH v5 14/50] mutli-process: build remote command line args |
Date: |
Mon, 2 Mar 2020 14:39:37 -0800 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
On Mon, Mar 02, 2020 at 05:47:45PM +0000, Daniel P. Berrangé wrote:
> On Mon, Mar 02, 2020 at 06:36:13PM +0100, Philippe Mathieu-Daudé wrote:
> > typo "multi" in patch subject.
> >
Thank Philippe, will fix.
> > On 2/24/20 9:55 PM, Jagannathan Raman wrote:
> > > From: Elena Ufimtseva <address@hidden>
> > >
> > > Signed-off-by: Elena Ufimtseva <address@hidden>
> > > Signed-off-by: Jagannathan Raman <address@hidden>
> > > Signed-off-by: John G Johnson <address@hidden>
> > > ---
> > > v4 -> v5:
> > > - Added "exec" suboption to get the executable's name
> > > - Addressed feedback about variable names
> > > - Removed redundant check for spawning a process
> > >
> > > hw/proxy/qemu-proxy.c | 68
> > > +++++++++++++++++++++++++++++++++----------
> > > include/hw/proxy/qemu-proxy.h | 2 +-
> > > 2 files changed, 54 insertions(+), 16 deletions(-)
> > >
> > > diff --git a/hw/proxy/qemu-proxy.c b/hw/proxy/qemu-proxy.c
> > > index 828bbd7..d792e86 100644
> > > --- a/hw/proxy/qemu-proxy.c
> > > +++ b/hw/proxy/qemu-proxy.c
> > > @@ -19,19 +19,50 @@
> > > static void pci_proxy_dev_realize(PCIDevice *dev, Error **errp);
> > > +static int add_argv(char *opts_str, char **argv, int argc)
> > > +{
> > > + int max_args = 64;
> > > +
> > > + if (argc < max_args - 1) {
> > > + argv[argc++] = opts_str;
> > > + argv[argc] = 0;
> > > + } else {
> > > + return 0;
> > > + }
> > > +
> > > + return argc;
> > > +}
> > > +
> > > +static int make_argv(char *opts_str, char **argv, int argc)
> > > +{
> > > + int max_args = 64;
> > > +
> > > + char *p2 = strtok(opts_str, " ");
> > > + while (p2 && argc < max_args - 1) {
> > > + argv[argc++] = p2;
> > > + p2 = strtok(0, " ");
> > > + }
> > > + argv[argc] = 0;
> >
> > Is there a GLib function to do that?
>
Hi Daniel
> g_shell_parse_argv() perhaps
>
Thanks for the suggestion.
> https://developer.gnome.org/glib/stable/glib-Shell-related-Utilities.html
>
>
> Though my preference would be to avoid the need to do this at all, by
> not accepting a raw shell command line string in the first place.
>
Can you please clarify? Did you mean that it would be better if Qemu somehow
verifies the options and then passes it to a remote process via a message?
Thanks!
Elena
>
> Regards,
> Daniel
> --
> |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org -o- https://fstop138.berrange.com :|
> |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
>
- Re: [PATCH v5 14/50] mutli-process: build remote command line args, Philippe Mathieu-Daudé, 2020/03/02
- Re: [PATCH v5 14/50] mutli-process: build remote command line args, Daniel P . Berrangé, 2020/03/02
- Re: [PATCH v5 14/50] mutli-process: build remote command line args,
Elena Ufimtseva <=
- Re: [PATCH v5 14/50] mutli-process: build remote command line args, Daniel P . Berrangé, 2020/03/04
- Re: [PATCH v5 14/50] mutli-process: build remote command line args, Elena Ufimtseva, 2020/03/04
- Re: [PATCH v5 14/50] mutli-process: build remote command line args, Daniel P . Berrangé, 2020/03/04
- Re: [PATCH v5 14/50] mutli-process: build remote command line args, Elena Ufimtseva, 2020/03/04
- Re: [PATCH v5 14/50] mutli-process: build remote command line args, Daniel P . Berrangé, 2020/03/05
- Re: [PATCH v5 14/50] mutli-process: build remote command line args, Stefan Hajnoczi, 2020/03/06