[libvirt] [PATCH RFC 2/5] qemu_hotplug: use a recalculated usb address set

Ján Tomko jtomko at redhat.com
Tue Aug 23 13:48:43 UTC 2016


On Sat, Aug 20, 2016 at 04:53:04PM +0200, Tomasz Flendrich wrote:
>Since we now have a way of relculating the usb address set, all the
>places that previously used the cached set now use the recalculated one.
>---
> src/qemu/qemu_hotplug.c | 38 +++++++++++++++++++-------------------
> 1 file changed, 19 insertions(+), 19 deletions(-)
>
>diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
>index 51f06bc..078d936 100644
>--- a/src/qemu/qemu_hotplug.c
>+++ b/src/qemu/qemu_hotplug.c
>@@ -738,13 +738,13 @@ qemuDomainAttachUSBMassStorageDevice(virQEMUDriverPtr driver,
>     bool driveAdded = false;
>     virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver);
>     const char *src = virDomainDiskGetSource(disk);
>-    bool releaseaddr = false;
>+    virDomainUSBAddressSetPtr usbaddrs = NULL;
>
>-    if (priv->usbaddrs) {

This condition was only true when we assigned the domain addresses on
domain startup (if it's a new domain, not migrated)...

>-        if (virDomainUSBAddressEnsure(priv->usbaddrs, &disk->info) < 0)
>-            goto cleanup;
>-        releaseaddr = true;
>-    }
>+    if (!(usbaddrs = qemuDomainUSBAddrSetCreateFromDomain(vm->def)))
>+        goto cleanup;

but this new helper does it unconditionally.

Jan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20160823/d6401f40/attachment-0001.sig>


More information about the libvir-list mailing list