[libvirt] [PATCH 2/2]: Remove getURI internal driver call

This patch removes the internal getURI() driver callback. It was *never* overridden by any of the drivers, so it seems kind of pointless (I even checked the "in-progress" VirtualBox, OpenNebula, and Power Hypervisor drivers). In addition, the code to actually use it in src/libvirt.c:virConnectGetURI() was buggy; if a driver did decide to have their own callback, then their callback would be called, and then immediately overwritten by the generic stuff. This wouldn't do what the driver expected, and would also probably leak memory. Just rip out this internal callback; if a future driver ever needs it, we can add it back in. Signed-off-by: Chris Lalancette <clalance@redhat.com>

On Mon, Mar 30, 2009 at 02:10:13PM +0200, Chris Lalancette wrote:
This patch removes the internal getURI() driver callback. It was *never* overridden by any of the drivers, so it seems kind of pointless (I even checked the "in-progress" VirtualBox, OpenNebula, and Power Hypervisor drivers). In addition, the code to actually use it in src/libvirt.c:virConnectGetURI() was buggy; if a driver did decide to have their own callback, then their callback would be called, and then immediately overwritten by the generic stuff. This wouldn't do what the driver expected, and would also probably leak memory. Just rip out this internal callback; if a future driver ever needs it, we can add it back in.
Agreed if the entry point is not used let's remove it, ACK ! 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 Tue, Mar 31, 2009 at 11:41:58AM +0200, Daniel Veillard wrote:
On Mon, Mar 30, 2009 at 02:10:13PM +0200, Chris Lalancette wrote:
This patch removes the internal getURI() driver callback. It was *never* overridden by any of the drivers, so it seems kind of pointless (I even checked the "in-progress" VirtualBox, OpenNebula, and Power Hypervisor drivers). In addition, the code to actually use it in src/libvirt.c:virConnectGetURI() was buggy; if a driver did decide to have their own callback, then their callback would be called, and then immediately overwritten by the generic stuff. This wouldn't do what the driver expected, and would also probably leak memory. Just rip out this internal callback; if a future driver ever needs it, we can add it back in.
Agreed if the entry point is not used let's remove it, ACK !
ACK. It was used in the past, but I guess I made it unneccessary when I patched virConnectPtr to include a full xmlURIPtr object. 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 :|

Daniel P. Berrange wrote:
On Tue, Mar 31, 2009 at 11:41:58AM +0200, Daniel Veillard wrote:
On Mon, Mar 30, 2009 at 02:10:13PM +0200, Chris Lalancette wrote:
This patch removes the internal getURI() driver callback. It was *never* overridden by any of the drivers, so it seems kind of pointless (I even checked the "in-progress" VirtualBox, OpenNebula, and Power Hypervisor drivers). In addition, the code to actually use it in src/libvirt.c:virConnectGetURI() was buggy; if a driver did decide to have their own callback, then their callback would be called, and then immediately overwritten by the generic stuff. This wouldn't do what the driver expected, and would also probably leak memory. Just rip out this internal callback; if a future driver ever needs it, we can add it back in. Agreed if the entry point is not used let's remove it, ACK !
ACK. It was used in the past, but I guess I made it unneccessary when I patched virConnectPtr to include a full xmlURIPtr object.
Ah, understood. Committed now. -- Chris Lalancette
participants (3)
-
Chris Lalancette
-
Daniel P. Berrange
-
Daniel Veillard