[Libvir] PATCH: Report errors against virConnectPtr object

The QEMU driver is not passing in a virConnectPtr object for many of the places it calls virRaiseError. This means the errors aren't getting fed back to the client correctly - particularly when starting a VM / network. This patch passes around a virConnectPtr object so errors get reported correctly Instead of: $ ~/usr/bin/virsh --connect qemu://celery.virt.boston.redhat.com/system start demo error: Failed to start domain demo It now gives $ ~/usr/bin/virsh --connect qemu://celery.virt.boston.redhat.com/system start demo libvir: QEMU error : QEMU quit during console startup qemu: could not open hard disk image '/root/demo.img' error: Failed to start domain demo Dan -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

On Wed, Jul 11, 2007 at 08:55:35PM +0100, Daniel P. Berrange wrote:
The QEMU driver is not passing in a virConnectPtr object for many of the places it calls virRaiseError. This means the errors aren't getting fed back to the client correctly - particularly when starting a VM / network.
This patch passes around a virConnectPtr object so errors get reported correctly
Instead of:
$ ~/usr/bin/virsh --connect qemu://celery.virt.boston.redhat.com/system start demo error: Failed to start domain demo
It now gives
$ ~/usr/bin/virsh --connect qemu://celery.virt.boston.redhat.com/system start demo libvir: QEMU error : QEMU quit during console startup qemu: could not open hard disk image '/root/demo.img' error: Failed to start domain demo
Hum, sounds great, the patch is a bit invasive but I don't see how to really avoid this with the current data structures. +1, Daniel -- Red Hat Virtualization group http://redhat.com/virtualization/ Daniel Veillard | virtualization library http://libvirt.org/ veillard@redhat.com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/ http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/

On Wed, Jul 11, 2007 at 04:19:13PM -0400, Daniel Veillard wrote:
On Wed, Jul 11, 2007 at 08:55:35PM +0100, Daniel P. Berrange wrote:
The QEMU driver is not passing in a virConnectPtr object for many of the places it calls virRaiseError. This means the errors aren't getting fed back to the client correctly - particularly when starting a VM / network.
This patch passes around a virConnectPtr object so errors get reported correctly
Instead of:
$ ~/usr/bin/virsh --connect qemu://celery.virt.boston.redhat.com/system start demo error: Failed to start domain demo
It now gives
$ ~/usr/bin/virsh --connect qemu://celery.virt.boston.redhat.com/system start demo libvir: QEMU error : QEMU quit during console startup qemu: could not open hard disk image '/root/demo.img' error: Failed to start domain demo
Hum, sounds great, the patch is a bit invasive but I don't see how to really avoid this with the current data structures.
Yeah, its a huge PITA that we have two different places for storing errors - one global, one per virConnectPtr object. It would be much easier if there was just the global one, stored in a thread local, but we can't easily change the semantics now. Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

On Wed, Jul 11, 2007 at 04:19:13PM -0400, Daniel Veillard wrote:
On Wed, Jul 11, 2007 at 08:55:35PM +0100, Daniel P. Berrange wrote:
The QEMU driver is not passing in a virConnectPtr object for many of the places it calls virRaiseError. This means the errors aren't getting fed back to the client correctly - particularly when starting a VM / network.
This patch passes around a virConnectPtr object so errors get reported correctly
Instead of:
$ ~/usr/bin/virsh --connect qemu://celery.virt.boston.redhat.com/system start demo error: Failed to start domain demo
It now gives
$ ~/usr/bin/virsh --connect qemu://celery.virt.boston.redhat.com/system start demo libvir: QEMU error : QEMU quit during console startup qemu: could not open hard disk image '/root/demo.img' error: Failed to start domain demo
Hum, sounds great, the patch is a bit invasive but I don't see how to really avoid this with the current data structures.
+1,
Comitted now. Dan. -- |=- Red Hat, Engineering, Emerging Technologies, Boston. +1 978 392 2496 -=| |=- Perl modules: http://search.cpan.org/~danberr/ -=| |=- Projects: http://freshmeat.net/~danielpb/ -=| |=- GnuPG: 7D3B9505 F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 -=|

Daniel P. Berrange wrote:
The QEMU driver is not passing in a virConnectPtr object for many of the places it calls virRaiseError. This means the errors aren't getting fed back to the client correctly - particularly when starting a VM / network.
This patch passes around a virConnectPtr object so errors get reported correctly
+1. One of the more annoying features of virterror ... Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903
participants (3)
-
Daniel P. Berrange
-
Daniel Veillard
-
Richard W.M. Jones