Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > ebe084c140192657f9094e135a84202c > files > 151

libvirt-0.8.2-29.el5.src.rpm

From 6d19b0576a4296069ff005008445e19a99a3a3cd Mon Sep 17 00:00:00 2001
Message-Id: <6d19b0576a4296069ff005008445e19a99a3a3cd.1287067706.git.jdenemar@redhat.com>
From: Jiri Denemark <jdenemar@redhat.com>
Date: Tue, 5 Oct 2010 13:39:37 +0200
Subject: [PATCH] xen: Fix bogus error when attaching a device

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=638472

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

(cherry picked from commit ad4cb9056a173f057553403b17836859fd33b408)
---
 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 fb58383..cc24da1 100644
--- a/src/xen/xm_internal.c
+++ b/src/xen/xm_internal.c
@@ -2974,8 +2974,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;
     }
 
-- 
1.7.3.1