From 0eecdd685a75ab7d258442ab9fb092892b3cb6e9 Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Wed, 28 Apr 2010 15:14:47 +0100 Subject: [PATCH] Fix detection of disk in IO events When using -device syntax, the IO event will have a different prefix, 'drive-' that needs to be skipped over before matching against the libvirt disk alias * src/qemu/qemu_driver.c: Skip QEMU_DRIVE_HOST_PREFIX in IO event --- src/qemu/qemu_driver.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 54c3f34953..c2902ac1dd 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -764,6 +764,9 @@ findDomainDiskByAlias(virDomainObjPtr vm, { int i; + if (STRPREFIX(alias, QEMU_DRIVE_HOST_PREFIX)) + alias += strlen(QEMU_DRIVE_HOST_PREFIX); + for (i = 0; i < vm->def->ndisks; i++) { virDomainDiskDefPtr disk; -- GitLab