[libvirt] [PATCH] Report error more accurate if failes on attaching device.

Eric Blake eblake at redhat.com
Fri Jan 28 03:26:10 UTC 2011


On 01/27/2011 08:14 PM, Eric Blake wrote:
> s/error more accurate if failes on attaching/more accurate error on
> failure to attach/
> 
> On 01/27/2011 12:21 AM, Hu Tao wrote:
>> When attaching device from a xml file and the device is mis-configured,
>> virsh gives mis-leading message "out of memory". This patch fixes this.
> 
> And if you got an actual out of memory condition, you could get the
> error message twice (once in callee, once in caller).  ACK and pushed.

I also squashed this in (the error is user-visible, so it needs to be
translated and not use INTERNAL_ERROR).

diff --git c/src/qemu/qemu_command.c i/src/qemu/qemu_command.c
index 4064e65..1ce8941 100644
--- c/src/qemu/qemu_command.c
+++ i/src/qemu/qemu_command.c
@@ -1496,7 +1496,8 @@
qemuBuildControllerDevStr(virDomainControllerDefPtr def)
     /* We always get an IDE controller, whether we want it or not. */
     case VIR_DOMAIN_CONTROLLER_TYPE_IDE:
     default:
-        qemuReportError(VIR_ERR_INTERNAL_ERROR, "Unknown controller
type: %s\n",
+        qemuReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+                        _("Unknown controller type: %s"),
                         virDomainControllerTypeToString(def->type));
         goto error;
     }


'make syntax-check' would have caught this, except that commit caa805ea
(Feb 2010) renamed the function without updating cfg.mk.  And fixing
that caught a lot more, too; followup patch coming soon (under the
build-breaker rule).

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110127/4227e9e7/attachment-0001.sig>


More information about the libvir-list mailing list