[libvirt] PATCH: Fix error report for unknown node devices

When requesting a non-existant device you currently get # virsh nodedev-dumpxml foo error: Could not find matching device 'foo' error: invalid node device pointer in no node device with matching name This patch fixes that to give # virsh nodedev-dumpxml foo error: Could not find matching device 'foo' error: Node device not found Daniel diff -r 563f92056ffa src/node_device.c --- a/src/node_device.c Tue Mar 31 15:02:30 2009 +0100 +++ b/src/node_device.c Tue Mar 31 15:13:20 2009 +0100 @@ -121,8 +121,7 @@ static virNodeDevicePtr nodeDeviceLookup nodeDeviceUnlock(driver); if (!obj) { - virNodeDeviceReportError(conn, VIR_ERR_INVALID_NODE_DEVICE, - "%s", _("no node device with matching name")); + virNodeDeviceReportError(conn, VIR_ERR_NO_NODE_DEVICE, NULL); goto cleanup; } -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Tue, Mar 31, 2009 at 03:20:40PM +0100, Daniel P. Berrange wrote:
When requesting a non-existant device you currently get
# virsh nodedev-dumpxml foo error: Could not find matching device 'foo' error: invalid node device pointer in no node device with matching name
This patch fixes that to give
# virsh nodedev-dumpxml foo error: Could not find matching device 'foo' error: Node device not found
Cosmetic, but good catch :-) ACK Da niel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On Tue, Mar 31, 2009 at 11:39:23PM +0200, Daniel Veillard wrote:
On Tue, Mar 31, 2009 at 03:20:40PM +0100, Daniel P. Berrange wrote:
When requesting a non-existant device you currently get
# virsh nodedev-dumpxml foo error: Could not find matching device 'foo' error: invalid node device pointer in no node device with matching name
This patch fixes that to give
# virsh nodedev-dumpxml foo error: Could not find matching device 'foo' error: Node device not found
Cosmetic, but good catch :-) ACK
Committed Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
participants (2)
-
Daniel P. Berrange
-
Daniel Veillard