[PATCH 4/4] xen: drop unused callbacks

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

 



Found by:

for f in $(sed -n 's/.*Drv[^ ]* \([^;]*\);.*/\1/p' src/xen/xen_driver.h)
do
  git grep "\(\.\|->\)$f\b" src/xen
done | cat

and looking through the resulting list to see which callback struct
members are still necessary.

* src/xen/xen_driver.h (xenUnifiedDriver): Drop all callbacks that
are only used directly.
* src/xen/xen_hypervisor.c (xenHypervisorDriver): Shrink list.
* src/xen/xen_inotify.c (xenInotifyDriver): Likewise.
* src/xen/xend_internal.c (xenDaemonDriver): Likewise.
* src/xen/xm_internal.c (xenXMDriver): Likewise.
* src/xen/xs_internal.c (xenStoreDriver): Likewise.
---
 src/xen/xen_driver.h     |   15 +--------------
 src/xen/xen_hypervisor.c |    4 ----
 src/xen/xen_inotify.c    |    1 -
 src/xen/xend_internal.c  |   11 -----------
 src/xen/xm_internal.c    |    1 -
 src/xen/xs_internal.c    |    2 --
 6 files changed, 1 insertions(+), 33 deletions(-)

diff --git a/src/xen/xen_driver.h b/src/xen/xen_driver.h
index 256d148..ca711d4 100644
--- a/src/xen/xen_driver.h
+++ b/src/xen/xen_driver.h
@@ -81,15 +81,9 @@ extern int xenRegister (void);
  * structure with direct calls in xen_unified.c.
  */
 struct xenUnifiedDriver {
-    virDrvOpen xenOpen;
-    virDrvClose xenClose;
+    virDrvClose xenClose; /* Only mandatory callback; all others may be NULL */
     virDrvGetVersion  xenVersion;
     virDrvGetHostname xenGetHostname;
-    virDrvNodeGetInfo xenNodeGetInfo;
-    virDrvGetCapabilities xenGetCapabilities;
-    virDrvListDomains xenListDomains;
-    virDrvNumOfDomains xenNumOfDomains;
-    virDrvDomainCreateXML xenDomainCreateXML;
     virDrvDomainSuspend xenDomainSuspend;
     virDrvDomainResume xenDomainResume;
     virDrvDomainShutdown xenDomainShutdown;
@@ -100,10 +94,6 @@ struct xenUnifiedDriver {
     virDrvDomainSetMaxMemory xenDomainSetMaxMemory;
     virDrvDomainSetMemory xenDomainSetMemory;
     virDrvDomainGetInfo xenDomainGetInfo;
-    virDrvDomainSave xenDomainSave;
-    virDrvDomainRestore xenDomainRestore;
-    virDrvDomainCoreDump xenDomainCoreDump;
-    virDrvDomainScreenshot xenDomainScreenshot;
     virDrvDomainPinVcpu xenDomainPinVcpu;
     virDrvDomainGetVcpus xenDomainGetVcpus;
     virDrvListDefinedDomains xenListDefinedDomains;
@@ -113,9 +103,6 @@ struct xenUnifiedDriver {
     virDrvDomainUndefine xenDomainUndefine;
     virDrvDomainAttachDeviceFlags xenDomainAttachDeviceFlags;
     virDrvDomainDetachDeviceFlags xenDomainDetachDeviceFlags;
-    virDrvDomainUpdateDeviceFlags xenDomainUpdateDeviceFlags;
-    virDrvDomainGetAutostart xenDomainGetAutostart;
-    virDrvDomainSetAutostart xenDomainSetAutostart;
     virDrvDomainGetSchedulerType xenDomainGetSchedulerType;
     virDrvDomainGetSchedulerParameters xenDomainGetSchedulerParameters;
     virDrvDomainSetSchedulerParameters xenDomainSetSchedulerParameters;
diff --git a/src/xen/xen_hypervisor.c b/src/xen/xen_hypervisor.c
index 1304e28..cb22b89 100644
--- a/src/xen/xen_hypervisor.c
+++ b/src/xen/xen_hypervisor.c
@@ -802,12 +802,8 @@ typedef struct xen_op_v2_dom xen_op_v2_dom;
 static unsigned long xenHypervisorGetMaxMemory(virDomainPtr domain);

 struct xenUnifiedDriver xenHypervisorDriver = {
-    .xenOpen = xenHypervisorOpen,
     .xenClose = xenHypervisorClose,
     .xenVersion = xenHypervisorGetVersion,
-    .xenGetCapabilities = xenHypervisorGetCapabilities,
-    .xenListDomains = xenHypervisorListDomains,
-    .xenNumOfDomains = xenHypervisorNumOfDomains,
     .xenDomainSuspend = xenHypervisorPauseDomain,
     .xenDomainResume = xenHypervisorResumeDomain,
     .xenDomainDestroyFlags = xenHypervisorDestroyDomainFlags,
diff --git a/src/xen/xen_inotify.c b/src/xen/xen_inotify.c
index 73384fe..d0cd907 100644
--- a/src/xen/xen_inotify.c
+++ b/src/xen/xen_inotify.c
@@ -49,7 +49,6 @@
                              __FUNCTION__, __LINE__, __VA_ARGS__)

 struct xenUnifiedDriver xenInotifyDriver = {
-    .xenOpen = xenInotifyOpen,
     .xenClose = xenInotifyClose,
 };

diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
index f56beb9..6d5a854 100644
--- a/src/xen/xend_internal.c
+++ b/src/xen/xend_internal.c
@@ -3934,13 +3934,8 @@ xenDaemonDomainBlockPeek (virDomainPtr domain, const char *path,
 }

 struct xenUnifiedDriver xenDaemonDriver = {
-    .xenOpen = xenDaemonOpen,
     .xenClose = xenDaemonClose,
     .xenVersion = xenDaemonGetVersion,
-    .xenNodeGetInfo = xenDaemonNodeGetInfo,
-    .xenListDomains = xenDaemonListDomains,
-    .xenNumOfDomains = xenDaemonNumOfDomains,
-    .xenDomainCreateXML = xenDaemonCreateXML,
     .xenDomainSuspend = xenDaemonDomainSuspend,
     .xenDomainResume = xenDaemonDomainResume,
     .xenDomainShutdown = xenDaemonDomainShutdown,
@@ -3951,9 +3946,6 @@ struct xenUnifiedDriver xenDaemonDriver = {
     .xenDomainSetMaxMemory = xenDaemonDomainSetMaxMemory,
     .xenDomainSetMemory = xenDaemonDomainSetMemory,
     .xenDomainGetInfo = xenDaemonDomainGetInfo,
-    .xenDomainSave = xenDaemonDomainSave,
-    .xenDomainRestore = xenDaemonDomainRestore,
-    .xenDomainCoreDump = xenDaemonDomainCoreDump,
     .xenDomainPinVcpu = xenDaemonDomainPinVcpu,
     .xenDomainGetVcpus = xenDaemonDomainGetVcpus,
     .xenListDefinedDomains = xenDaemonListDefinedDomains,
@@ -3963,9 +3955,6 @@ struct xenUnifiedDriver xenDaemonDriver = {
     .xenDomainUndefine = xenDaemonDomainUndefine,
     .xenDomainAttachDeviceFlags = xenDaemonAttachDeviceFlags,
     .xenDomainDetachDeviceFlags = xenDaemonDetachDeviceFlags,
-    .xenDomainUpdateDeviceFlags = xenDaemonUpdateDeviceFlags,
-    .xenDomainGetAutostart = xenDaemonDomainGetAutostart,
-    .xenDomainSetAutostart = xenDaemonDomainSetAutostart,
     .xenDomainGetSchedulerType = xenDaemonGetSchedulerType,
     .xenDomainGetSchedulerParameters = xenDaemonGetSchedulerParameters,
     .xenDomainSetSchedulerParameters = xenDaemonSetSchedulerParameters,
diff --git a/src/xen/xm_internal.c b/src/xen/xm_internal.c
index cfb2754..95387c9 100644
--- a/src/xen/xm_internal.c
+++ b/src/xen/xm_internal.c
@@ -81,7 +81,6 @@ static int xenXMDomainDetachDeviceFlags(virDomainPtr domain, const char *xml,
 #define XM_XML_ERROR "Invalid xml"

 struct xenUnifiedDriver xenXMDriver = {
-    .xenOpen = xenXMOpen,
     .xenClose = xenXMClose,
     .xenDomainGetMaxMemory = xenXMDomainGetMaxMemory,
     .xenDomainSetMaxMemory = xenXMDomainSetMaxMemory,
diff --git a/src/xen/xs_internal.c b/src/xen/xs_internal.c
index 0856498..21018fd 100644
--- a/src/xen/xs_internal.c
+++ b/src/xen/xs_internal.c
@@ -42,9 +42,7 @@ static void xenStoreWatchEvent(int watch, int fd, int events, void *data);
 static void xenStoreWatchListFree(xenStoreWatchListPtr list);

 struct xenUnifiedDriver xenStoreDriver = {
-    .xenOpen = xenStoreOpen,
     .xenClose = xenStoreClose,
-    .xenListDomains = xenStoreListDomains,
     .xenDomainShutdown = xenStoreDomainShutdown,
     .xenDomainReboot = xenStoreDomainReboot,
     .xenDomainGetOSType = xenStoreDomainGetOSType,
-- 
1.7.4.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]