[libvirt] [PATCH v2 07/12] qemu: hotplug: Adjust error path for attach scsi disk

Cole Robinson crobinso at redhat.com
Wed Apr 27 23:17:09 UTC 2016


On 04/16/2016 10:17 AM, John Ferlan wrote:
> Adjust error path logic to make it clearer how to undo the failed add.
> 
> Signed-off-by: John Ferlan <jferlan at redhat.com>
> ---
>  src/qemu/qemu_hotplug.c | 35 +++++++++++++++++++----------------
>  1 file changed, 19 insertions(+), 16 deletions(-)
> 

ACK (one misc bit below)

> diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
> index 11efd7b..ae314be 100644
> --- a/src/qemu/qemu_hotplug.c
> +++ b/src/qemu/qemu_hotplug.c
> @@ -584,29 +584,22 @@ qemuDomainAttachSCSIDisk(virConnectPtr conn,
>      if (VIR_REALLOC_N(vm->def->disks, vm->def->ndisks+1) < 0)
>          goto error;
>  
> +    /* Attach the device - 2 step process */
>      qemuDomainObjEnterMonitor(driver, vm);
>  
> -    ret = qemuMonitorAddDrive(priv->mon, drivestr);
> -    if (ret == 0) {
> -        ret = qemuMonitorAddDevice(priv->mon, devstr);
> -        if (ret < 0) {
> -            VIR_WARN("qemuMonitorAddDevice failed on %s (%s)",
> -                     drivestr, devstr);
> -            /* XXX should call 'drive_del' on error but this does not exist yet */

Old comment... there is a drive_del, and we even have support for it via
qemuMonitorDriveDel :) Not for this patch series though

- Cole




More information about the libvir-list mailing list