qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] qemu-img: fix regression copying secrets during


From: Daniel P . Berrangé
Subject: Re: [Qemu-devel] [PATCH] qemu-img: fix regression copying secrets during convert
Date: Tue, 14 Aug 2018 13:38:22 +0100
User-agent: Mutt/1.10.1 (2018-07-13)

On Tue, Aug 14, 2018 at 01:38:24PM +0200, Kevin Wolf wrote:
> Am 14.08.2018 um 11:35 hat Daniel P. Berrangé geschrieben:
> > When the convert command is creating an output file that needs
> > secrets, we need to ensure those secrets are passed to both the
> > blk_new_open and bdrv_create API calls.
> > 
> > This is done by qemu-img extracting all opts matching the name
> > suffix "key-secret". Unfortunately the code doing this was run after the
> > call to bdrv_create(), which meant the QemuOpts it was extracting
> > secrets from was now empty.
> > 
> > Previously this worked by luks as a bug meant the "key-secret"
> > parameters were not purged from the QemuOpts. This bug was fixed in
> > 
> >   commit b76b4f604521e59f857d6177bc55f6f2e41fd392
> >   Author: Kevin Wolf <address@hidden>
> >   Date:   Thu Jan 11 16:18:08 2018 +0100
> > 
> >     qcow2: Use visitor for options in qcow2_create()
> > 
> > Exposing the latent bug in qemu-img. This fix simply moves the copying
> > of secrets to before the bdrv_create() call.
> > 
> > Signed-off-by: Daniel P. Berrangé <address@hidden>
> 
> Cc: address@hidden
> 
> > @@ -2461,9 +2458,9 @@ out:
> >          qemu_progress_print(100, 0);
> >      }
> >      qemu_progress_end();
> > -    qemu_opts_del(opts);
> 
> Why don't we need to free opts any more?

Urgh, that's a mistake, I deleted the wrong line. v2 arriving soon....

> 
> >      qemu_opts_free(create_opts);
> >      qemu_opts_del(sn_opts);
> > +    qobject_unref(open_opts);
> >      blk_unref(s.target);
> >      if (s.src) {
> >          for (bs_i = 0; bs_i < s.src_num; bs_i++) {

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]