Re: [PATCH v2 14/15] qemu: Add secinfo for hotplug virtio disk

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

 



On Thu, Jun 23, 2016 at 13:29:10 -0400, John Ferlan wrote:
> Commit id 'a1344f70a' added AES secret processing for RBD when starting
> up a guest. As such, when the hotplug code calls qemuDomainSecretDiskPrepare
> an AES secret could be added to the disk about to be hotplugged. If an AES
> secret was added, then the hotplug code would need to generate the secret
> object because qemuBuildDriveStr would add the "password-secret=" to the
> returned 'driveStr' rather than the base64 encoded password.
> 
> Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
> ---
>  src/qemu/qemu_hotplug.c | 44 ++++++++++++++++++++++++++++++++++++++------
>  1 file changed, 38 insertions(+), 6 deletions(-)

[...]

> @@ -3422,12 +3446,14 @@ qemuDomainDetachVirtioDiskDevice(virQEMUDriverPtr driver,
>      qemuDomainMarkDeviceForRemoval(vm, &detach->info);
>  
>      qemuDomainObjEnterMonitor(driver, vm);
> -    if (qemuMonitorDelDevice(priv->mon, detach->info.alias) < 0) {
> -        if (qemuDomainObjExitMonitor(driver, vm) < 0)
> -            goto cleanup;
> -        virDomainAuditDisk(vm, detach->src, NULL, "detach", false);
> -        goto cleanup;
> +    if (secinfo && secinfo->type == VIR_DOMAIN_SECRET_INFO_TYPE_AES) {
> +        if (qemuMonitorDelObject(priv->mon, secinfo->s.aes.alias) < 0)

Additionally to the complaint about secinfo not being initialized. This
is the incorrect place to delete this. You need to do it in
qemuDomainRemoveDiskDevice.

Also at that point you can't make the failure to delete the object
fatal.

> +            goto faildel;
>      }
> +
> +    if (qemuMonitorDelDevice(priv->mon, detach->info.alias) < 0)
> +        goto faildel;
> +

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]