[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[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>
diff --git a/src/driver.h b/src/driver.h
index 62d6fbc..88c2b0a 100644
--- a/src/driver.h
+++ b/src/driver.h
@@ -351,7 +351,6 @@ struct _virDriver {
     virDrvGetType			type;
     virDrvGetVersion		version;
     virDrvGetHostname       getHostname;
-    virDrvGetURI            getURI;
     virDrvGetMaxVcpus		getMaxVcpus;
     virDrvNodeGetInfo		nodeGetInfo;
     virDrvGetCapabilities		getCapabilities;
diff --git a/src/libvirt.c b/src/libvirt.c
index f29df6b..d6de773 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -1321,15 +1321,6 @@ virConnectGetURI (virConnectPtr conn)
         return NULL;
     }
 
-    /* Drivers may override getURI, but if they don't then
-     * we provide a default implementation.
-     */
-    if (conn->driver->getURI) {
-        name = conn->driver->getURI (conn);
-        if (!name)
-            goto error;
-    }
-
     name = (char *)xmlSaveUri(conn->uri);
     if (!name) {
         virReportOOMError (conn);
diff --git a/src/lxc_driver.c b/src/lxc_driver.c
index 999c8b4..9cfe7e0 100644
--- a/src/lxc_driver.c
+++ b/src/lxc_driver.c
@@ -1414,7 +1414,6 @@ static virDriver lxcDriver = {
     NULL, /* type */
     lxcVersion, /* version */
     NULL, /* getHostname */
-    NULL, /* getURI */
     NULL, /* getMaxVcpus */
     NULL, /* nodeGetInfo */
     NULL, /* getCapabilities */
diff --git a/src/openvz_driver.c b/src/openvz_driver.c
index f50ebdf..755e449 100644
--- a/src/openvz_driver.c
+++ b/src/openvz_driver.c
@@ -1315,7 +1315,6 @@ static virDriver openvzDriver = {
     openvzGetType, /* type */
     openvzGetVersion, /* version */
     NULL, /* getHostname */
-    NULL, /* getURI */
     openvzGetMaxVCPUs, /* getMaxVcpus */
     openvzGetNodeInfo, /* nodeGetInfo */
     openvzGetCapabilities, /* getCapabilities */
diff --git a/src/proxy_internal.c b/src/proxy_internal.c
index 6a34e7e..56e8db8 100644
--- a/src/proxy_internal.c
+++ b/src/proxy_internal.c
@@ -50,7 +50,6 @@ struct xenUnifiedDriver xenProxyDriver = {
     xenProxyClose, /* close */
     xenProxyGetVersion, /* version */
     NULL, /* hostname */
-    NULL, /* URI */
     xenProxyNodeGetInfo, /* nodeGetInfo */
     xenProxyGetCapabilities, /* getCapabilities */
     xenProxyListDomains, /* listDomains */
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index de6512d..8408d97 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -5036,7 +5036,6 @@ static virDriver qemuDriver = {
     qemudGetType, /* type */
     qemudGetVersion, /* version */
     qemudGetHostname, /* getHostname */
-    NULL, /* getURI  */
     qemudGetMaxVCPUs, /* getMaxVcpus */
     qemudGetNodeInfo, /* nodeGetInfo */
     qemudGetCapabilities, /* getCapabilities */
diff --git a/src/remote_internal.c b/src/remote_internal.c
index c6fa562..200dd4a 100644
--- a/src/remote_internal.c
+++ b/src/remote_internal.c
@@ -6845,7 +6845,6 @@ static virDriver driver = {
     remoteType, /* type */
     remoteGetVersion, /* version */
     remoteGetHostname, /* getHostname */
-    NULL, /* getURI */
     remoteGetMaxVcpus, /* getMaxVcpus */
     remoteNodeGetInfo, /* nodeGetInfo */
     remoteGetCapabilities, /* getCapabilities */
diff --git a/src/test.c b/src/test.c
index b0de44c..a5422e9 100644
--- a/src/test.c
+++ b/src/test.c
@@ -3475,7 +3475,6 @@ static virDriver testDriver = {
     NULL, /* type */
     testGetVersion, /* version */
     testGetHostname, /* getHostname */
-    NULL, /* getURI */
     testGetMaxVCPUs, /* getMaxVcpus */
     testNodeGetInfo, /* nodeGetInfo */
     testGetCapabilities, /* getCapabilities */
diff --git a/src/uml_driver.c b/src/uml_driver.c
index 01d5d9c..0457f13 100644
--- a/src/uml_driver.c
+++ b/src/uml_driver.c
@@ -1830,7 +1830,6 @@ static virDriver umlDriver = {
     umlGetType, /* type */
     umlGetVersion, /* version */
     umlGetHostname, /* getHostname */
-    NULL, /* getURI  */
     NULL, /* getMaxVcpus */
     umlGetNodeInfo, /* nodeGetInfo */
     umlGetCapabilities, /* getCapabilities */
diff --git a/src/xen_inotify.c b/src/xen_inotify.c
index b3677c8..f4716ca 100644
--- a/src/xen_inotify.c
+++ b/src/xen_inotify.c
@@ -54,7 +54,6 @@ struct xenUnifiedDriver xenInotifyDriver = {
     xenInotifyClose, /* close */
     NULL, /* version */
     NULL, /* hostname */
-    NULL, /* URI */
     NULL, /* nodeGetInfo */
     NULL, /* getCapabilities */
     NULL, /* listDomains */
diff --git a/src/xen_internal.c b/src/xen_internal.c
index a866af1..7a88ca2 100644
--- a/src/xen_internal.c
+++ b/src/xen_internal.c
@@ -697,7 +697,6 @@ struct xenUnifiedDriver xenHypervisorDriver = {
     xenHypervisorClose, /* close */
     xenHypervisorGetVersion, /* version */
     NULL, /* hostname */
-    NULL, /* URI */
     NULL, /* nodeGetInfo */
     xenHypervisorGetCapabilities, /* getCapabilities */
     xenHypervisorListDomains, /* listDomains */
diff --git a/src/xen_unified.c b/src/xen_unified.c
index 4d0c973..04b3119 100644
--- a/src/xen_unified.c
+++ b/src/xen_unified.c
@@ -1432,7 +1432,6 @@ static virDriver xenUnifiedDriver = {
     xenUnifiedType, /* type */
     xenUnifiedGetVersion, /* version */
     xenUnifiedGetHostname, /* getHostname */
-    NULL, /* getURI */
     xenUnifiedGetMaxVcpus, /* getMaxVcpus */
     xenUnifiedNodeGetInfo, /* nodeGetInfo */
     xenUnifiedGetCapabilities, /* getCapabilities */
diff --git a/src/xen_unified.h b/src/xen_unified.h
index 3123bd7..6ec19c1 100644
--- a/src/xen_unified.h
+++ b/src/xen_unified.h
@@ -61,7 +61,6 @@ struct xenUnifiedDriver {
         virDrvClose			close;
         virDrvGetVersion		version;
     virDrvGetHostname       getHostname;
-    virDrvGetURI            getURI;
         virDrvNodeGetInfo		nodeGetInfo;
         virDrvGetCapabilities		getCapabilities;
         virDrvListDomains		listDomains;
diff --git a/src/xend_internal.c b/src/xend_internal.c
index c6d6fa4..cc2e803 100644
--- a/src/xend_internal.c
+++ b/src/xend_internal.c
@@ -4839,7 +4839,6 @@ struct xenUnifiedDriver xenDaemonDriver = {
     xenDaemonClose,              /* close */
     xenDaemonGetVersion,         /* version */
     NULL,                        /* hostname */
-    NULL,                        /* URI */
     xenDaemonNodeGetInfo,        /* nodeGetInfo */
     NULL,                        /* getCapabilities */
     xenDaemonListDomains,        /* listDomains */
diff --git a/src/xm_internal.c b/src/xm_internal.c
index 8519391..5456a8d 100644
--- a/src/xm_internal.c
+++ b/src/xm_internal.c
@@ -82,7 +82,6 @@ struct xenUnifiedDriver xenXMDriver = {
     xenXMClose, /* close */
     NULL, /* version */
     NULL, /* hostname */
-    NULL, /* URI */
     NULL, /* nodeGetInfo */
     NULL, /* getCapabilities */
     NULL, /* listDomains */
diff --git a/src/xs_internal.c b/src/xs_internal.c
index 50cc575..1f54b1f 100644
--- a/src/xs_internal.c
+++ b/src/xs_internal.c
@@ -49,7 +49,6 @@ struct xenUnifiedDriver xenStoreDriver = {
     xenStoreClose, /* close */
     NULL, /* version */
     NULL, /* hostname */
-    NULL, /* URI */
     NULL, /* nodeGetInfo */
     NULL, /* getCapabilities */
     xenStoreListDomains, /* listDomains */

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]