[libvirt] [PATCH 3/4] qemu: Remove unnecessary virtio disk detach info.alias check

Ján Tomko jtomko at redhat.com
Fri Oct 20 12:21:39 UTC 2017


On Fri, Oct 20, 2017 at 08:03:29AM -0400, John Ferlan wrote:
>Since qemuAssignDeviceDiskAlias checks whether the input info.alias
>is already present, no need to check here as well.
>
>Signed-off-by: John Ferlan <jferlan at redhat.com>
>---
> src/qemu/qemu_hotplug.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
>diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
>index 51a7a68f84..9fbb3a0712 100644
>--- a/src/qemu/qemu_hotplug.c
>+++ b/src/qemu/qemu_hotplug.c
>@@ -4447,10 +4447,8 @@ qemuDomainDetachVirtioDiskDevice(virQEMUDriverPtr driver,
>         goto cleanup;
>     }
>
>-    if (!detach->info.alias) {
>-        if (qemuAssignDeviceDiskAlias(vm->def, detach, priv->qemuCaps) < 0)
>-            goto cleanup;
>-    }
>+    if (qemuAssignDeviceDiskAlias(vm->def, detach, priv->qemuCaps) < 0)
>+        goto cleanup;
>

All the calls assigning aliases in the Detach functions are
unnecessary. At this point, all the domain's devices should have their
aliases assigned. If by any case they do not, it is an error in other
part of the libvirt code.

I was going to send patches cleaning these up, but I could not decide
whether to report an error if we find a device without an alias,
or to just quietly assume that an alias. And I did not want to conflict
with Michal's series again.

Jan

>     qemuDomainMarkDeviceForRemoval(vm, &detach->info);
>
>-- 
>2.13.6
>
>--
>libvir-list mailing list
>libvir-list at redhat.com
>https://www.redhat.com/mailman/listinfo/libvir-list
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20171020/f218d2ae/attachment-0001.sig>


More information about the libvir-list mailing list