[libvirt] [PATCH] fix device hotplug

Hi, due to some restructuring we free the device structure so devices are plugged correctly but "dumpxml" fails since the dev structure is already freed. Cheers, -- Guido

On Thu, Dec 18, 2008 at 10:26:07AM +0100, Guido G?nther wrote:
Hi, due to some restructuring we free the device structure so devices are plugged correctly but "dumpxml" fails since the dev structure is already
This is a rather over complicated way of fixing it. Why not just do: < cleanup: < virDomainDeviceDefFree(dev) -----------------
cleanup: if (ret < 0) virDomainDeviceDefFree(dev);
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 :|

On Thu, Dec 18, 2008 at 10:51:04AM +0000, Daniel P. Berrange wrote:
On Thu, Dec 18, 2008 at 10:26:07AM +0100, Guido G?nther wrote:
Hi, due to some restructuring we free the device structure so devices are plugged correctly but "dumpxml" fails since the dev structure is already
This is a rather over complicated way of fixing it. Why not just do:
< cleanup: < virDomainDeviceDefFree(dev) -----------------
cleanup: if (ret < 0) virDomainDeviceDefFree(dev); I somehow prefer to keep the cleanup and error targets different, but you're right the above is much simpler. Updated patch attached. -- Guido

On Thu, Dec 18, 2008 at 03:45:04PM +0100, Guido Günther wrote:
On Thu, Dec 18, 2008 at 10:51:04AM +0000, Daniel P. Berrange wrote:
On Thu, Dec 18, 2008 at 10:26:07AM +0100, Guido G?nther wrote:
Hi, due to some restructuring we free the device structure so devices are plugged correctly but "dumpxml" fails since the dev structure is already
This is a rather over complicated way of fixing it. Why not just do:
< cleanup: < virDomainDeviceDefFree(dev) -----------------
cleanup: if (ret < 0) virDomainDeviceDefFree(dev); I somehow prefer to keep the cleanup and error targets different, but you're right the above is much simpler. Updated patch attached.
sure, +1, Daniel -- 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 Thu, Dec 18, 2008 at 05:35:28PM +0100, Daniel Veillard wrote:
On Thu, Dec 18, 2008 at 03:45:04PM +0100, Guido Günther wrote:
On Thu, Dec 18, 2008 at 10:51:04AM +0000, Daniel P. Berrange wrote:
On Thu, Dec 18, 2008 at 10:26:07AM +0100, Guido G?nther wrote:
Hi, due to some restructuring we free the device structure so devices are plugged correctly but "dumpxml" fails since the dev structure is already
This is a rather over complicated way of fixing it. Why not just do:
< cleanup: < virDomainDeviceDefFree(dev) -----------------
cleanup: if (ret < 0) virDomainDeviceDefFree(dev); I somehow prefer to keep the cleanup and error targets different, but you're right the above is much simpler. Updated patch attached.
sure, +1, Applied now. -- Guido
participants (3)
-
Daniel P. Berrange
-
Daniel Veillard
-
Guido Günther