The virError() class in the python bindings will either pick up the global
error details, or will extract them from the virConnect private error
details. For the latter to work, you must pass in a virConnect object
when creating the virError. I'd previously fixed up the generator so that
was done correctly for any method on virConnectPtr, however, I forgot that
a similar fix was needed for the virDomainPtr / virNetworkPtr related
methods. Currently we're getting back zero useful information in the python
layer with a virDomain* or virNetwork* method fails.
Unfortunately, given a virDomainPtr / virNetworkPtr object in python, there
is no easy way to get back the virConnectPtr object. So this patch does
two things - it passes the virConnect python object into the constructor
of the virDomain / virNetwork python objects, and then stores it in a
private _conn attribute. Then, the virNetwork/virDomain objects are passed
into the virError() classes when needeed so it can get hold of the private
error details.
So with this patch, virt-manager will get sensible error information when
attempting to start an inactive guest, or when doing device hot-add/remove.
BTW, since we now store an explicit reference to the virConnect object,
I removed the generic 'self.ref' back-reference.
Regards,
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 -=|