[libvirt] [PATCH v2 2/4] qemu: Remove disk backend only after frontend is gone

Peter Krempa pkrempa at redhat.com
Tue Jun 3 08:44:41 UTC 2014


On 06/03/14 10:22, Jiri Denemark wrote:
> In general, we should only remove a backend after seeing DEVICE_DELETED
> event for a corresponding frontend. This doesn't make any difference for
> disks attached using -drive or drive_add since QEMU automatically
> removes their backends but it's still better to make our code
> consistent. And it may start making difference in case we switch to
> attaching disks using -blockdev.
> 
> Signed-off-by: Jiri Denemark <jdenemar at redhat.com>
> ---
> 
> Notes:
>     Version 2:
>     - s/frontends/backends/ in the commit message
>     - return int and propagate errors
> 
>  src/qemu/qemu_hotplug.c | 45 ++++++++++++++++++---------------------------
>  1 file changed, 18 insertions(+), 27 deletions(-)
> 
> diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
> index 4d8d3cd..35099e4 100644
> --- a/src/qemu/qemu_hotplug.c
> +++ b/src/qemu/qemu_hotplug.c

...

> @@ -2984,10 +2980,6 @@ qemuDomainDetachDiskDevice(virQEMUDriverPtr driver,
>                             NULL, "detach", false);
>          goto cleanup;
>      }
> -
> -    /* disconnect guest from host device */
> -    qemuMonitorDriveDel(priv->mon, drivestr);
> -
>      qemuDomainObjExitMonitor(driver, vm);
>  
>      rc = qemuDomainWaitForDeviceRemoval(vm);

A few lines below you forgot to propagate the returned value as you've
done in qemuDomainDetachVirtioDiskDevice.


> @@ -2997,7 +2989,6 @@ qemuDomainDetachDiskDevice(virQEMUDriverPtr driver,
>  
>   cleanup:
>      qemuDomainResetDeviceRemoval(vm);
> -    VIR_FREE(drivestr);
>      return ret;
>  }
>  
> 

ACK with the nit resolved.

Peter


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 901 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140603/d4e85473/attachment-0001.sig>


More information about the libvir-list mailing list