[libvirt] [PATCH] Fix incorrect use of private data in remote driver

For upstream bug https://bugzilla.redhat.com/show_bug.cgi?id=576796 The remote driver is using the wrong privateData field in a couple of functions. THis is harmless for stateful drivers like QEMU/UML/LXC, but will crash with Xen * src/remote/remote_driver.c: Fix use of privateData field --- src/remote/remote_driver.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index 7052bf1..c9129b1 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -4067,7 +4067,7 @@ remoteNetworkIsActive(virNetworkPtr network) int rv = -1; remote_network_is_active_args args; remote_network_is_active_ret ret; - struct private_data *priv = network->conn->privateData; + struct private_data *priv = network->conn->networkPrivateData; remoteDriverLock(priv); @@ -4091,7 +4091,7 @@ remoteNetworkIsPersistent(virNetworkPtr network) int rv = -1; remote_network_is_persistent_args args; remote_network_is_persistent_ret ret; - struct private_data *priv = network->conn->privateData; + struct private_data *priv = network->conn->networkPrivateData; remoteDriverLock(priv); @@ -4622,7 +4622,7 @@ remoteInterfaceIsActive(virInterfacePtr iface) int rv = -1; remote_interface_is_active_args args; remote_interface_is_active_ret ret; - struct private_data *priv = iface->conn->privateData; + struct private_data *priv = iface->conn->interfacePrivateData; remoteDriverLock(priv); @@ -5127,7 +5127,7 @@ remoteStoragePoolIsActive(virStoragePoolPtr pool) int rv = -1; remote_storage_pool_is_active_args args; remote_storage_pool_is_active_ret ret; - struct private_data *priv = pool->conn->privateData; + struct private_data *priv = pool->conn->storagePrivateData; remoteDriverLock(priv); @@ -5151,7 +5151,7 @@ remoteStoragePoolIsPersistent(virStoragePoolPtr pool) int rv = -1; remote_storage_pool_is_persistent_args args; remote_storage_pool_is_persistent_ret ret; - struct private_data *priv = pool->conn->privateData; + struct private_data *priv = pool->conn->storagePrivateData; remoteDriverLock(priv); -- 1.5.5.6 -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

Hello, Am Donnerstag 22 Juli 2010 11:37:06 schrieb Daniel P. Berrange:
For upstream bug
https://bugzilla.redhat.com/show_bug.cgi?id=576796
The remote driver is using the wrong privateData field in a couple of functions. THis is harmless for stateful drivers like QEMU/UML/LXC, but will crash with Xen
* src/remote/remote_driver.c: Fix use of privateData field
Your patch seems to fix the problem; doing a quick test doesn't SEGV anymore. #!/usr/bin/python import libvirt c = libvirt.open('xen:///') n = c.networkLookupByName('default') n.isPersistent() n.isActive() Thank you for your work. Sincerely Philipp -- Philipp Hahn Open Source Software Engineer hahn@univention.de Univention GmbH Linux for Your Business fon: +49 421 22 232- 0 Mary-Somerville-Str.1 28359 Bremen fax: +49 421 22 232-99 http://www.univention.de

On Thu, Jul 22, 2010 at 10:37:06AM +0100, Daniel P. Berrange wrote:
For upstream bug
https://bugzilla.redhat.com/show_bug.cgi?id=576796
The remote driver is using the wrong privateData field in a couple of functions. THis is harmless for stateful drivers like QEMU/UML/LXC, but will crash with Xen
* src/remote/remote_driver.c: Fix use of privateData field
Ouch :-) 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/
participants (3)
-
Daniel P. Berrange
-
Daniel Veillard
-
Philipp Hahn