提交 1b3765fd 编写于 作者: E Eric Blake

xen: drop unused callbacks

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.
上级 a1e641a5
......@@ -81,15 +81,9 @@ extern int xenRegister (void);
* structure with direct calls in xen_unified.c.
*/
struct xenUnifiedDriver {
virDrvOpen xenOpen; /* Must not be NULL */
virDrvClose xenClose; /* Must not be NULL */
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;
......
......@@ -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,
......
......@@ -49,7 +49,6 @@
__FUNCTION__, __LINE__, __VA_ARGS__)
struct xenUnifiedDriver xenInotifyDriver = {
.xenOpen = xenInotifyOpen,
.xenClose = xenInotifyClose,
};
......
......@@ -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,
......
......@@ -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,
......
......@@ -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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册