qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v5 1/3] tests/libqtest: Introduce qtest_init_wit


From: Daniel P . Berrangé
Subject: Re: [Qemu-devel] [PATCH v5 1/3] tests/libqtest: Introduce qtest_init_with_serial()
Date: Wed, 23 Jan 2019 14:56:44 +0000
User-agent: Mutt/1.10.1 (2018-07-13)

On Wed, Jan 23, 2019 at 08:44:12AM -0600, Eric Blake wrote:
> On 1/23/19 8:20 AM, Alex Bennée wrote:
> > 
> > Julia Suvorova <address@hidden> writes:
> > 
> >> Run qtest with a socket that connects QEMU chardev and test code.
> >>
> >> Signed-off-by: Julia Suvorova <address@hidden>
> >> Reviewed-by: Stefan Hajnoczi <address@hidden>
> > 
> > Reviewed-by: Alex Bennée <address@hidden>
> > 
> 
> >> +QTestState *qtest_init_with_serial(const char *extra_args, int *sock_fd)
> >> +{
> >> +    int sock_fd_init;
> >> +    char *sock_path, sock_dir[] = "/tmp/qtest-serial-XXXXXX";
> >> +    QTestState *qts;
> >> +
> >> +    g_assert_true(mkdtemp(sock_dir) != NULL);
> >> +    sock_path = g_strdup_printf("%s/sock", sock_dir);
> >> +
> >> +    sock_fd_init = init_socket(sock_path);
> >> +
> >> +    qts = qtest_initf("-chardev socket,id=s0,path=%s -serial chardev:s0 
> >> %s",
> >> +                      sock_path, extra_args);
> 
> EWWWW.  Please, let's not bake in this interface.  Relying on shell
> splitting is nasty.

qtest_initf() is long a standing interface that's relied on
shell splitting for years :-( I agree we should fix that, but
its a pre-existing problem that this patch doesn't make worse.


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 :|



reply via email to

[Prev in Thread] Current Thread [Next in Thread]