[libvirt] [PATCH 1/4] qemu: hotplug: Provide a string of a subsystem type instead of an int

Erik Skultety eskultet at redhat.com
Tue Mar 27 08:57:13 UTC 2018

If one tries to detach a non-existent device, the error they get is:
"Unexpected hostdev type <int>". Let's use ToString conversion, since
the XML parser would have complained already if the type to be unplugged
was unknown to libvirt.

Signed-off-by: Erik Skultety <eskultet at redhat.com>
 src/qemu/qemu_hotplug.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 49af4d4ff..6ec401e21 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -5077,7 +5077,8 @@ int qemuDomainDetachHostDevice(virQEMUDriverPtr driver,
-                           _("unexpected hostdev type %d"), subsys->type);
+                           _("unexpected hostdev type '%s'"),
+                           virDomainHostdevSubsysTypeToString(subsys->type));
         return -1;

More information about the libvir-list mailing list