[libvirt] [PATCH] xen: Fix bogus error when attaching a device

Jiri Denemark jdenemar at redhat.com
Tue Oct 5 11:44:19 UTC 2010


The xm internal xen driver only supports disk and network devices to be
added to a guest. On an attempt to attach any other device the xm driver
used VIR_ERR_XML_ERROR which resulted in a completely bogus error
message:

error: Failed to attach device from pci.xml
error: XML description for unknown device is not well formed or invalid
---
 src/xen/xm_internal.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/xen/xm_internal.c b/src/xen/xm_internal.c
index fcc9378..00f0df8 100644
--- a/src/xen/xm_internal.c
+++ b/src/xen/xm_internal.c
@@ -2980,8 +2980,8 @@ xenXMDomainAttachDeviceFlags(virDomainPtr domain, const char *xml,
     }
 
     default:
-        xenXMError(VIR_ERR_XML_ERROR,
-                   "%s", _("unknown device"));
+        xenXMError(VIR_ERR_OPERATION_INVALID, "%s",
+                   _("Xm driver only supports adding disk or network devices"));
         goto cleanup;
     }
 
-- 
1.7.3.1




More information about the libvir-list mailing list