]> xenbits.xensource.com Git - libvirt.git/commitdiff
xen: Fix bogus error when attaching a device
authorJiri Denemark <jdenemar@redhat.com>
Tue, 5 Oct 2010 11:39:37 +0000 (13:39 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Tue, 5 Oct 2010 17:08:46 +0000 (19:08 +0200)
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

index b9cb4c337ee7c62c4317322dfe54b5323befe46f..4c62072bd84cf92340a16bc1a4aed7faf0bee230 100644 (file)
@@ -2975,8 +2975,8 @@ xenXMDomainAttachDeviceFlags(virDomainPtr domain, const char *xml,
     }
 
     default:
-        xenXMError(VIR_ERR_XML_ERROR,
-                   "%s", _("unknown device"));
+        xenXMError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+                   _("Xm driver only supports adding disk or network devices"));
         goto cleanup;
     }