[libvirt] [PATCH 12/13] Fix QEMU hotplug device alias assignment

Matthias Bolte matthias.bolte at googlemail.com
Tue Feb 2 09:17:17 UTC 2010


2010/2/1 Daniel P. Berrange <berrange at redhat.com>:
> To allow devices to be hot(un-)plugged it is neccessary to ensure
> they all have a unique device aliases. This fixes the hotplug
> methods to assign device aliases before invoking the monitor
> commands which need them
>
> * src/qemu/qemu_conf.c, src/qemu/qemu_conf.h: Expose methods
>  for assigning device aliases for disks, host devices and
>  controllers
> * src/qemu/qemu_driver.c: Assign device aliases when hotplugging
>  all types of device
> * tests/qemuxml2argvdata/qemuxml2argv-hostdev-pci-address-device.args,
>  tests/qemuxml2argvdata/qemuxml2argv-hostdev-usb-address-device.args:
>  Update for changed hostdev naming scheme
> ---

> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index 23bbd6b..5e58ce2 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c

> @@ -5428,17 +5433,7 @@ static int qemudDomainAttachSCSIDisk(virConnectPtr conn,
>         driver->securityDriver->domainSetSecurityImageLabel(conn, vm, disk) < 0)
>         return -1;
>
> -    /* This func allocates the bus/unit IDs so must be before
> -     * we search for controller
> -     */
> -    if (!(drivestr = qemuBuildDriveStr(disk, 0, qemuCmdFlags)))
> -        goto error;
> -
> -    if ((qemuCmdFlags & QEMUD_CMD_FLAG_DEVICE) &&
> -        !(devstr = qemuBuildDriveDevStr(NULL, disk)))
> -        goto error;
> -
> -    /* We should have an adddress now, so make sure */
> +    /* We should have an adddress already, so make sure */

You could fix the ddd typo here.

>     if (disk->info.type != VIR_DOMAIN_DEVICE_ADDRESS_TYPE_DRIVE) {
>         qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
>                          _("unexpected disk address type %s"),

ACK

Matthias




More information about the libvir-list mailing list