mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 07:05:28 +00:00
xen: cleanup callback struct
Using C99 initializers and xen-specific prefixes will make it so that future patches are less likely to add callback members to the xenUnifiedDriver struct, since the goal is to get rid of the callback struct in the first place. * src/xen/xen_driver.h (xenUnifiedDriver): Rename all struct members, to make it obvious which ones are still in use. * src/xen/xen_driver.c: Update all callers. * src/xen/xen_hypervisor.c (xenHypervisorDriver): Rewrite with C99 initializers. * src/xen/xend_internal.c (xenDaemonDriver): Likewise. * src/xen/xs_internal.c (xenStoreDriver): Likewise. * src/xen/xm_internal.c (xenXMDriver): Likewise. * src/xen/xen_inotify.c (xenInotifyDriver): Likewise.
This commit is contained in:
parent
eb1e3143da
commit
f859919fed
@ -351,7 +351,7 @@ xenUnifiedOpen (virConnectPtr conn, virConnectAuthPtr auth, unsigned int flags)
|
|||||||
/* Hypervisor is only run with privilege & required to succeed */
|
/* Hypervisor is only run with privilege & required to succeed */
|
||||||
if (xenHavePrivilege()) {
|
if (xenHavePrivilege()) {
|
||||||
VIR_DEBUG("Trying hypervisor sub-driver");
|
VIR_DEBUG("Trying hypervisor sub-driver");
|
||||||
if (drivers[XEN_UNIFIED_HYPERVISOR_OFFSET]->open(conn, auth, flags) ==
|
if (drivers[XEN_UNIFIED_HYPERVISOR_OFFSET]->xenOpen(conn, auth, flags) ==
|
||||||
VIR_DRV_OPEN_SUCCESS) {
|
VIR_DRV_OPEN_SUCCESS) {
|
||||||
VIR_DEBUG("Activated hypervisor sub-driver");
|
VIR_DEBUG("Activated hypervisor sub-driver");
|
||||||
priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET] = 1;
|
priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET] = 1;
|
||||||
@ -360,7 +360,7 @@ xenUnifiedOpen (virConnectPtr conn, virConnectAuthPtr auth, unsigned int flags)
|
|||||||
|
|
||||||
/* XenD is required to succeed if privileged */
|
/* XenD is required to succeed if privileged */
|
||||||
VIR_DEBUG("Trying XenD sub-driver");
|
VIR_DEBUG("Trying XenD sub-driver");
|
||||||
if (drivers[XEN_UNIFIED_XEND_OFFSET]->open(conn, auth, flags) ==
|
if (drivers[XEN_UNIFIED_XEND_OFFSET]->xenOpen(conn, auth, flags) ==
|
||||||
VIR_DRV_OPEN_SUCCESS) {
|
VIR_DRV_OPEN_SUCCESS) {
|
||||||
VIR_DEBUG("Activated XenD sub-driver");
|
VIR_DEBUG("Activated XenD sub-driver");
|
||||||
priv->opened[XEN_UNIFIED_XEND_OFFSET] = 1;
|
priv->opened[XEN_UNIFIED_XEND_OFFSET] = 1;
|
||||||
@ -369,14 +369,14 @@ xenUnifiedOpen (virConnectPtr conn, virConnectAuthPtr auth, unsigned int flags)
|
|||||||
* succeed if root, optional otherwise */
|
* succeed if root, optional otherwise */
|
||||||
if (priv->xendConfigVersion <= 2) {
|
if (priv->xendConfigVersion <= 2) {
|
||||||
VIR_DEBUG("Trying XM sub-driver");
|
VIR_DEBUG("Trying XM sub-driver");
|
||||||
if (drivers[XEN_UNIFIED_XM_OFFSET]->open(conn, auth, flags) ==
|
if (drivers[XEN_UNIFIED_XM_OFFSET]->xenOpen(conn, auth, flags) ==
|
||||||
VIR_DRV_OPEN_SUCCESS) {
|
VIR_DRV_OPEN_SUCCESS) {
|
||||||
VIR_DEBUG("Activated XM sub-driver");
|
VIR_DEBUG("Activated XM sub-driver");
|
||||||
priv->opened[XEN_UNIFIED_XM_OFFSET] = 1;
|
priv->opened[XEN_UNIFIED_XM_OFFSET] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
VIR_DEBUG("Trying XS sub-driver");
|
VIR_DEBUG("Trying XS sub-driver");
|
||||||
if (drivers[XEN_UNIFIED_XS_OFFSET]->open(conn, auth, flags) ==
|
if (drivers[XEN_UNIFIED_XS_OFFSET]->xenOpen(conn, auth, flags) ==
|
||||||
VIR_DRV_OPEN_SUCCESS) {
|
VIR_DRV_OPEN_SUCCESS) {
|
||||||
VIR_DEBUG("Activated XS sub-driver");
|
VIR_DEBUG("Activated XS sub-driver");
|
||||||
priv->opened[XEN_UNIFIED_XS_OFFSET] = 1;
|
priv->opened[XEN_UNIFIED_XS_OFFSET] = 1;
|
||||||
@ -404,7 +404,7 @@ xenUnifiedOpen (virConnectPtr conn, virConnectAuthPtr auth, unsigned int flags)
|
|||||||
#if WITH_XEN_INOTIFY
|
#if WITH_XEN_INOTIFY
|
||||||
if (xenHavePrivilege()) {
|
if (xenHavePrivilege()) {
|
||||||
VIR_DEBUG("Trying Xen inotify sub-driver");
|
VIR_DEBUG("Trying Xen inotify sub-driver");
|
||||||
if (drivers[XEN_UNIFIED_INOTIFY_OFFSET]->open(conn, auth, flags) ==
|
if (drivers[XEN_UNIFIED_INOTIFY_OFFSET]->xenOpen(conn, auth, flags) ==
|
||||||
VIR_DRV_OPEN_SUCCESS) {
|
VIR_DRV_OPEN_SUCCESS) {
|
||||||
VIR_DEBUG("Activated Xen inotify sub-driver");
|
VIR_DEBUG("Activated Xen inotify sub-driver");
|
||||||
priv->opened[XEN_UNIFIED_INOTIFY_OFFSET] = 1;
|
priv->opened[XEN_UNIFIED_INOTIFY_OFFSET] = 1;
|
||||||
@ -419,7 +419,7 @@ fail:
|
|||||||
clean:
|
clean:
|
||||||
VIR_DEBUG("Failed to activate a mandatory sub-driver");
|
VIR_DEBUG("Failed to activate a mandatory sub-driver");
|
||||||
for (i = 0 ; i < XEN_UNIFIED_NR_DRIVERS ; i++)
|
for (i = 0 ; i < XEN_UNIFIED_NR_DRIVERS ; i++)
|
||||||
if (priv->opened[i]) drivers[i]->close(conn);
|
if (priv->opened[i]) drivers[i]->xenClose(conn);
|
||||||
virMutexDestroy(&priv->lock);
|
virMutexDestroy(&priv->lock);
|
||||||
VIR_FREE(priv);
|
VIR_FREE(priv);
|
||||||
conn->privateData = NULL;
|
conn->privateData = NULL;
|
||||||
@ -439,8 +439,8 @@ xenUnifiedClose (virConnectPtr conn)
|
|||||||
virDomainEventCallbackListFree(priv->domainEventCallbacks);
|
virDomainEventCallbackListFree(priv->domainEventCallbacks);
|
||||||
|
|
||||||
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
||||||
if (priv->opened[i] && drivers[i]->close)
|
if (priv->opened[i] && drivers[i]->xenClose)
|
||||||
(void) drivers[i]->close (conn);
|
(void) drivers[i]->xenClose (conn);
|
||||||
|
|
||||||
virMutexDestroy(&priv->lock);
|
virMutexDestroy(&priv->lock);
|
||||||
VIR_FREE(conn->privateData);
|
VIR_FREE(conn->privateData);
|
||||||
@ -493,8 +493,8 @@ xenUnifiedGetVersion (virConnectPtr conn, unsigned long *hvVer)
|
|||||||
|
|
||||||
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
||||||
if (priv->opened[i] &&
|
if (priv->opened[i] &&
|
||||||
drivers[i]->version &&
|
drivers[i]->xenVersion &&
|
||||||
drivers[i]->version (conn, hvVer) == 0)
|
drivers[i]->xenVersion (conn, hvVer) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@ -546,8 +546,8 @@ xenUnifiedNodeGetInfo (virConnectPtr conn, virNodeInfoPtr info)
|
|||||||
|
|
||||||
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
||||||
if (priv->opened[i] &&
|
if (priv->opened[i] &&
|
||||||
drivers[i]->nodeGetInfo &&
|
drivers[i]->xenNodeGetInfo &&
|
||||||
drivers[i]->nodeGetInfo (conn, info) == 0)
|
drivers[i]->xenNodeGetInfo (conn, info) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@ -630,8 +630,8 @@ xenUnifiedDomainCreateXML (virConnectPtr conn,
|
|||||||
virDomainPtr ret;
|
virDomainPtr ret;
|
||||||
|
|
||||||
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
||||||
if (priv->opened[i] && drivers[i]->domainCreateXML) {
|
if (priv->opened[i] && drivers[i]->xenDomainCreateXML) {
|
||||||
ret = drivers[i]->domainCreateXML (conn, xmlDesc, flags);
|
ret = drivers[i]->xenDomainCreateXML (conn, xmlDesc, flags);
|
||||||
if (ret) return ret;
|
if (ret) return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -835,13 +835,13 @@ xenUnifiedDomainSuspend (virDomainPtr dom)
|
|||||||
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
||||||
if (i != XEN_UNIFIED_HYPERVISOR_OFFSET &&
|
if (i != XEN_UNIFIED_HYPERVISOR_OFFSET &&
|
||||||
priv->opened[i] &&
|
priv->opened[i] &&
|
||||||
drivers[i]->domainSuspend &&
|
drivers[i]->xenDomainSuspend &&
|
||||||
drivers[i]->domainSuspend (dom) == 0)
|
drivers[i]->xenDomainSuspend (dom) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET] &&
|
if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET] &&
|
||||||
drivers[XEN_UNIFIED_HYPERVISOR_OFFSET]->domainSuspend &&
|
drivers[XEN_UNIFIED_HYPERVISOR_OFFSET]->xenDomainSuspend &&
|
||||||
drivers[XEN_UNIFIED_HYPERVISOR_OFFSET]->domainSuspend (dom) == 0)
|
drivers[XEN_UNIFIED_HYPERVISOR_OFFSET]->xenDomainSuspend (dom) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@ -859,13 +859,13 @@ xenUnifiedDomainResume (virDomainPtr dom)
|
|||||||
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
||||||
if (i != XEN_UNIFIED_HYPERVISOR_OFFSET &&
|
if (i != XEN_UNIFIED_HYPERVISOR_OFFSET &&
|
||||||
priv->opened[i] &&
|
priv->opened[i] &&
|
||||||
drivers[i]->domainResume &&
|
drivers[i]->xenDomainResume &&
|
||||||
drivers[i]->domainResume (dom) == 0)
|
drivers[i]->xenDomainResume (dom) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET] &&
|
if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET] &&
|
||||||
drivers[XEN_UNIFIED_HYPERVISOR_OFFSET]->domainResume &&
|
drivers[XEN_UNIFIED_HYPERVISOR_OFFSET]->xenDomainResume &&
|
||||||
drivers[XEN_UNIFIED_HYPERVISOR_OFFSET]->domainResume (dom) == 0)
|
drivers[XEN_UNIFIED_HYPERVISOR_OFFSET]->xenDomainResume (dom) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@ -879,8 +879,8 @@ xenUnifiedDomainShutdown (virDomainPtr dom)
|
|||||||
|
|
||||||
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
||||||
if (priv->opened[i] &&
|
if (priv->opened[i] &&
|
||||||
drivers[i]->domainShutdown &&
|
drivers[i]->xenDomainShutdown &&
|
||||||
drivers[i]->domainShutdown (dom) == 0)
|
drivers[i]->xenDomainShutdown (dom) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@ -894,8 +894,8 @@ xenUnifiedDomainReboot (virDomainPtr dom, unsigned int flags)
|
|||||||
|
|
||||||
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
||||||
if (priv->opened[i] &&
|
if (priv->opened[i] &&
|
||||||
drivers[i]->domainReboot &&
|
drivers[i]->xenDomainReboot &&
|
||||||
drivers[i]->domainReboot (dom, flags) == 0)
|
drivers[i]->xenDomainReboot (dom, flags) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@ -916,13 +916,13 @@ xenUnifiedDomainDestroyFlags(virDomainPtr dom,
|
|||||||
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
||||||
if (i != XEN_UNIFIED_HYPERVISOR_OFFSET &&
|
if (i != XEN_UNIFIED_HYPERVISOR_OFFSET &&
|
||||||
priv->opened[i] &&
|
priv->opened[i] &&
|
||||||
drivers[i]->domainDestroyFlags &&
|
drivers[i]->xenDomainDestroyFlags &&
|
||||||
drivers[i]->domainDestroyFlags(dom, flags) == 0)
|
drivers[i]->xenDomainDestroyFlags(dom, flags) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET] &&
|
if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET] &&
|
||||||
drivers[XEN_UNIFIED_HYPERVISOR_OFFSET]->domainDestroyFlags&&
|
drivers[XEN_UNIFIED_HYPERVISOR_OFFSET]->xenDomainDestroyFlags&&
|
||||||
drivers[XEN_UNIFIED_HYPERVISOR_OFFSET]->domainDestroyFlags(dom,
|
drivers[XEN_UNIFIED_HYPERVISOR_OFFSET]->xenDomainDestroyFlags(dom,
|
||||||
flags) == 0)
|
flags) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@ -943,8 +943,8 @@ xenUnifiedDomainGetOSType (virDomainPtr dom)
|
|||||||
char *ret;
|
char *ret;
|
||||||
|
|
||||||
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
||||||
if (priv->opened[i] && drivers[i]->domainGetOSType) {
|
if (priv->opened[i] && drivers[i]->xenDomainGetOSType) {
|
||||||
ret = drivers[i]->domainGetOSType (dom);
|
ret = drivers[i]->xenDomainGetOSType (dom);
|
||||||
if (ret) return ret;
|
if (ret) return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -959,8 +959,8 @@ xenUnifiedDomainGetMaxMemory (virDomainPtr dom)
|
|||||||
unsigned long ret;
|
unsigned long ret;
|
||||||
|
|
||||||
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
||||||
if (priv->opened[i] && drivers[i]->domainGetMaxMemory) {
|
if (priv->opened[i] && drivers[i]->xenDomainGetMaxMemory) {
|
||||||
ret = drivers[i]->domainGetMaxMemory (dom);
|
ret = drivers[i]->xenDomainGetMaxMemory (dom);
|
||||||
if (ret != 0) return ret;
|
if (ret != 0) return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -982,8 +982,8 @@ xenUnifiedDomainSetMaxMemory (virDomainPtr dom, unsigned long memory)
|
|||||||
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
||||||
if (i != XEN_UNIFIED_XEND_OFFSET &&
|
if (i != XEN_UNIFIED_XEND_OFFSET &&
|
||||||
priv->opened[i] &&
|
priv->opened[i] &&
|
||||||
drivers[i]->domainSetMaxMemory &&
|
drivers[i]->xenDomainSetMaxMemory &&
|
||||||
drivers[i]->domainSetMaxMemory (dom, memory) == 0)
|
drivers[i]->xenDomainSetMaxMemory (dom, memory) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@ -997,8 +997,8 @@ xenUnifiedDomainSetMemory (virDomainPtr dom, unsigned long memory)
|
|||||||
|
|
||||||
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
||||||
if (priv->opened[i] &&
|
if (priv->opened[i] &&
|
||||||
drivers[i]->domainSetMemory &&
|
drivers[i]->xenDomainSetMemory &&
|
||||||
drivers[i]->domainSetMemory (dom, memory) == 0)
|
drivers[i]->xenDomainSetMemory (dom, memory) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@ -1012,8 +1012,8 @@ xenUnifiedDomainGetInfo (virDomainPtr dom, virDomainInfoPtr info)
|
|||||||
|
|
||||||
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
||||||
if (priv->opened[i] &&
|
if (priv->opened[i] &&
|
||||||
drivers[i]->domainGetInfo &&
|
drivers[i]->xenDomainGetInfo &&
|
||||||
drivers[i]->domainGetInfo (dom, info) == 0)
|
drivers[i]->xenDomainGetInfo (dom, info) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@ -1076,8 +1076,8 @@ xenUnifiedDomainSaveFlags(virDomainPtr dom, const char *to, const char *dxml,
|
|||||||
|
|
||||||
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
||||||
if (priv->opened[i] &&
|
if (priv->opened[i] &&
|
||||||
drivers[i]->domainSave &&
|
drivers[i]->xenDomainSave &&
|
||||||
drivers[i]->domainSave (dom, to) == 0)
|
drivers[i]->xenDomainSave (dom, to) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@ -1105,8 +1105,8 @@ xenUnifiedDomainRestoreFlags(virConnectPtr conn, const char *from,
|
|||||||
|
|
||||||
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
||||||
if (priv->opened[i] &&
|
if (priv->opened[i] &&
|
||||||
drivers[i]->domainRestore &&
|
drivers[i]->xenDomainRestore &&
|
||||||
drivers[i]->domainRestore (conn, from) == 0)
|
drivers[i]->xenDomainRestore (conn, from) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@ -1126,8 +1126,8 @@ xenUnifiedDomainCoreDump (virDomainPtr dom, const char *to, unsigned int flags)
|
|||||||
|
|
||||||
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
||||||
if (priv->opened[i] &&
|
if (priv->opened[i] &&
|
||||||
drivers[i]->domainCoreDump &&
|
drivers[i]->xenDomainCoreDump &&
|
||||||
drivers[i]->domainCoreDump (dom, to, flags) == 0)
|
drivers[i]->xenDomainCoreDump (dom, to, flags) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@ -1205,8 +1205,8 @@ xenUnifiedDomainPinVcpu (virDomainPtr dom, unsigned int vcpu,
|
|||||||
|
|
||||||
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
||||||
if (priv->opened[i] &&
|
if (priv->opened[i] &&
|
||||||
drivers[i]->domainPinVcpu &&
|
drivers[i]->xenDomainPinVcpu &&
|
||||||
drivers[i]->domainPinVcpu (dom, vcpu, cpumap, maplen) == 0)
|
drivers[i]->xenDomainPinVcpu (dom, vcpu, cpumap, maplen) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@ -1221,8 +1221,8 @@ xenUnifiedDomainGetVcpus (virDomainPtr dom,
|
|||||||
int i, ret;
|
int i, ret;
|
||||||
|
|
||||||
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
||||||
if (priv->opened[i] && drivers[i]->domainGetVcpus) {
|
if (priv->opened[i] && drivers[i]->xenDomainGetVcpus) {
|
||||||
ret = drivers[i]->domainGetVcpus (dom, info, maxinfo, cpumaps, maplen);
|
ret = drivers[i]->xenDomainGetVcpus (dom, info, maxinfo, cpumaps, maplen);
|
||||||
if (ret > 0)
|
if (ret > 0)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -1495,8 +1495,8 @@ xenUnifiedListDefinedDomains (virConnectPtr conn, char **const names,
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
||||||
if (priv->opened[i] && drivers[i]->listDefinedDomains) {
|
if (priv->opened[i] && drivers[i]->xenListDefinedDomains) {
|
||||||
ret = drivers[i]->listDefinedDomains (conn, names, maxnames);
|
ret = drivers[i]->xenListDefinedDomains (conn, names, maxnames);
|
||||||
if (ret >= 0) return ret;
|
if (ret >= 0) return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1511,8 +1511,8 @@ xenUnifiedNumOfDefinedDomains (virConnectPtr conn)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
||||||
if (priv->opened[i] && drivers[i]->numOfDefinedDomains) {
|
if (priv->opened[i] && drivers[i]->xenNumOfDefinedDomains) {
|
||||||
ret = drivers[i]->numOfDefinedDomains (conn);
|
ret = drivers[i]->xenNumOfDefinedDomains (conn);
|
||||||
if (ret >= 0) return ret;
|
if (ret >= 0) return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1528,8 +1528,8 @@ xenUnifiedDomainCreateWithFlags (virDomainPtr dom, unsigned int flags)
|
|||||||
virCheckFlags(0, -1);
|
virCheckFlags(0, -1);
|
||||||
|
|
||||||
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
||||||
if (priv->opened[i] && drivers[i]->domainCreate &&
|
if (priv->opened[i] && drivers[i]->xenDomainCreate &&
|
||||||
drivers[i]->domainCreate (dom) == 0)
|
drivers[i]->xenDomainCreate (dom) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@ -1549,8 +1549,8 @@ xenUnifiedDomainDefineXML (virConnectPtr conn, const char *xml)
|
|||||||
virDomainPtr ret;
|
virDomainPtr ret;
|
||||||
|
|
||||||
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
||||||
if (priv->opened[i] && drivers[i]->domainDefineXML) {
|
if (priv->opened[i] && drivers[i]->xenDomainDefineXML) {
|
||||||
ret = drivers[i]->domainDefineXML (conn, xml);
|
ret = drivers[i]->xenDomainDefineXML (conn, xml);
|
||||||
if (ret) return ret;
|
if (ret) return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1565,8 +1565,8 @@ xenUnifiedDomainUndefineFlags (virDomainPtr dom, unsigned int flags)
|
|||||||
|
|
||||||
virCheckFlags(0, -1);
|
virCheckFlags(0, -1);
|
||||||
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
||||||
if (priv->opened[i] && drivers[i]->domainUndefine &&
|
if (priv->opened[i] && drivers[i]->xenDomainUndefine &&
|
||||||
drivers[i]->domainUndefine (dom) == 0)
|
drivers[i]->xenDomainUndefine (dom) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@ -1594,8 +1594,8 @@ xenUnifiedDomainAttachDevice (virDomainPtr dom, const char *xml)
|
|||||||
flags |= VIR_DOMAIN_DEVICE_MODIFY_CONFIG;
|
flags |= VIR_DOMAIN_DEVICE_MODIFY_CONFIG;
|
||||||
|
|
||||||
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
||||||
if (priv->opened[i] && drivers[i]->domainAttachDeviceFlags &&
|
if (priv->opened[i] && drivers[i]->xenDomainAttachDeviceFlags &&
|
||||||
drivers[i]->domainAttachDeviceFlags(dom, xml, flags) == 0)
|
drivers[i]->xenDomainAttachDeviceFlags(dom, xml, flags) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@ -1609,8 +1609,8 @@ xenUnifiedDomainAttachDeviceFlags (virDomainPtr dom, const char *xml,
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
||||||
if (priv->opened[i] && drivers[i]->domainAttachDeviceFlags &&
|
if (priv->opened[i] && drivers[i]->xenDomainAttachDeviceFlags &&
|
||||||
drivers[i]->domainAttachDeviceFlags(dom, xml, flags) == 0)
|
drivers[i]->xenDomainAttachDeviceFlags(dom, xml, flags) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@ -1633,8 +1633,8 @@ xenUnifiedDomainDetachDevice (virDomainPtr dom, const char *xml)
|
|||||||
flags |= VIR_DOMAIN_DEVICE_MODIFY_CONFIG;
|
flags |= VIR_DOMAIN_DEVICE_MODIFY_CONFIG;
|
||||||
|
|
||||||
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
||||||
if (priv->opened[i] && drivers[i]->domainDetachDeviceFlags &&
|
if (priv->opened[i] && drivers[i]->xenDomainDetachDeviceFlags &&
|
||||||
drivers[i]->domainDetachDeviceFlags(dom, xml, flags) == 0)
|
drivers[i]->xenDomainDetachDeviceFlags(dom, xml, flags) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@ -1648,8 +1648,8 @@ xenUnifiedDomainDetachDeviceFlags (virDomainPtr dom, const char *xml,
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
||||||
if (priv->opened[i] && drivers[i]->domainDetachDeviceFlags &&
|
if (priv->opened[i] && drivers[i]->xenDomainDetachDeviceFlags &&
|
||||||
drivers[i]->domainDetachDeviceFlags(dom, xml, flags) == 0)
|
drivers[i]->xenDomainDetachDeviceFlags(dom, xml, flags) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@ -1663,8 +1663,8 @@ xenUnifiedDomainUpdateDeviceFlags (virDomainPtr dom, const char *xml,
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
|
||||||
if (priv->opened[i] && drivers[i]->domainUpdateDeviceFlags &&
|
if (priv->opened[i] && drivers[i]->xenDomainUpdateDeviceFlags &&
|
||||||
drivers[i]->domainUpdateDeviceFlags(dom, xml, flags) == 0)
|
drivers[i]->xenDomainUpdateDeviceFlags(dom, xml, flags) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@ -1712,8 +1712,8 @@ xenUnifiedDomainGetSchedulerType (virDomainPtr dom, int *nparams)
|
|||||||
char *schedulertype;
|
char *schedulertype;
|
||||||
|
|
||||||
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; i++) {
|
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; i++) {
|
||||||
if (priv->opened[i] && drivers[i]->domainGetSchedulerType) {
|
if (priv->opened[i] && drivers[i]->xenDomainGetSchedulerType) {
|
||||||
schedulertype = drivers[i]->domainGetSchedulerType (dom, nparams);
|
schedulertype = drivers[i]->xenDomainGetSchedulerType (dom, nparams);
|
||||||
if (schedulertype != NULL)
|
if (schedulertype != NULL)
|
||||||
return(schedulertype);
|
return(schedulertype);
|
||||||
}
|
}
|
||||||
@ -1733,8 +1733,8 @@ xenUnifiedDomainGetSchedulerParametersFlags(virDomainPtr dom,
|
|||||||
virCheckFlags(0, -1);
|
virCheckFlags(0, -1);
|
||||||
|
|
||||||
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i) {
|
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i) {
|
||||||
if (priv->opened[i] && drivers[i]->domainGetSchedulerParameters) {
|
if (priv->opened[i] && drivers[i]->xenDomainGetSchedulerParameters) {
|
||||||
ret = drivers[i]->domainGetSchedulerParameters(dom, params, nparams);
|
ret = drivers[i]->xenDomainGetSchedulerParameters(dom, params, nparams);
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
@ -1764,8 +1764,8 @@ xenUnifiedDomainSetSchedulerParametersFlags(virDomainPtr dom,
|
|||||||
|
|
||||||
/* do the hypervisor call last to get better error */
|
/* do the hypervisor call last to get better error */
|
||||||
for (i = XEN_UNIFIED_NR_DRIVERS - 1; i >= 0; i--) {
|
for (i = XEN_UNIFIED_NR_DRIVERS - 1; i >= 0; i--) {
|
||||||
if (priv->opened[i] && drivers[i]->domainSetSchedulerParameters) {
|
if (priv->opened[i] && drivers[i]->xenDomainSetSchedulerParameters) {
|
||||||
ret = drivers[i]->domainSetSchedulerParameters(dom, params, nparams);
|
ret = drivers[i]->xenDomainSetSchedulerParameters(dom, params, nparams);
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -81,44 +81,44 @@ extern int xenRegister (void);
|
|||||||
* structure with direct calls in xen_unified.c.
|
* structure with direct calls in xen_unified.c.
|
||||||
*/
|
*/
|
||||||
struct xenUnifiedDriver {
|
struct xenUnifiedDriver {
|
||||||
virDrvOpen open;
|
virDrvOpen xenOpen;
|
||||||
virDrvClose close;
|
virDrvClose xenClose;
|
||||||
virDrvGetVersion version;
|
virDrvGetVersion xenVersion;
|
||||||
virDrvGetHostname getHostname;
|
virDrvGetHostname xenGetHostname;
|
||||||
virDrvNodeGetInfo nodeGetInfo;
|
virDrvNodeGetInfo xenNodeGetInfo;
|
||||||
virDrvGetCapabilities getCapabilities;
|
virDrvGetCapabilities xenGetCapabilities;
|
||||||
virDrvListDomains listDomains;
|
virDrvListDomains xenListDomains;
|
||||||
virDrvNumOfDomains numOfDomains;
|
virDrvNumOfDomains xenNumOfDomains;
|
||||||
virDrvDomainCreateXML domainCreateXML;
|
virDrvDomainCreateXML xenDomainCreateXML;
|
||||||
virDrvDomainSuspend domainSuspend;
|
virDrvDomainSuspend xenDomainSuspend;
|
||||||
virDrvDomainResume domainResume;
|
virDrvDomainResume xenDomainResume;
|
||||||
virDrvDomainShutdown domainShutdown;
|
virDrvDomainShutdown xenDomainShutdown;
|
||||||
virDrvDomainReboot domainReboot;
|
virDrvDomainReboot xenDomainReboot;
|
||||||
virDrvDomainDestroyFlags domainDestroyFlags;
|
virDrvDomainDestroyFlags xenDomainDestroyFlags;
|
||||||
virDrvDomainGetOSType domainGetOSType;
|
virDrvDomainGetOSType xenDomainGetOSType;
|
||||||
virDrvDomainGetMaxMemory domainGetMaxMemory;
|
virDrvDomainGetMaxMemory xenDomainGetMaxMemory;
|
||||||
virDrvDomainSetMaxMemory domainSetMaxMemory;
|
virDrvDomainSetMaxMemory xenDomainSetMaxMemory;
|
||||||
virDrvDomainSetMemory domainSetMemory;
|
virDrvDomainSetMemory xenDomainSetMemory;
|
||||||
virDrvDomainGetInfo domainGetInfo;
|
virDrvDomainGetInfo xenDomainGetInfo;
|
||||||
virDrvDomainSave domainSave;
|
virDrvDomainSave xenDomainSave;
|
||||||
virDrvDomainRestore domainRestore;
|
virDrvDomainRestore xenDomainRestore;
|
||||||
virDrvDomainCoreDump domainCoreDump;
|
virDrvDomainCoreDump xenDomainCoreDump;
|
||||||
virDrvDomainScreenshot domainScreenshot;
|
virDrvDomainScreenshot xenDomainScreenshot;
|
||||||
virDrvDomainPinVcpu domainPinVcpu;
|
virDrvDomainPinVcpu xenDomainPinVcpu;
|
||||||
virDrvDomainGetVcpus domainGetVcpus;
|
virDrvDomainGetVcpus xenDomainGetVcpus;
|
||||||
virDrvListDefinedDomains listDefinedDomains;
|
virDrvListDefinedDomains xenListDefinedDomains;
|
||||||
virDrvNumOfDefinedDomains numOfDefinedDomains;
|
virDrvNumOfDefinedDomains xenNumOfDefinedDomains;
|
||||||
virDrvDomainCreate domainCreate;
|
virDrvDomainCreate xenDomainCreate;
|
||||||
virDrvDomainDefineXML domainDefineXML;
|
virDrvDomainDefineXML xenDomainDefineXML;
|
||||||
virDrvDomainUndefine domainUndefine;
|
virDrvDomainUndefine xenDomainUndefine;
|
||||||
virDrvDomainAttachDeviceFlags domainAttachDeviceFlags;
|
virDrvDomainAttachDeviceFlags xenDomainAttachDeviceFlags;
|
||||||
virDrvDomainDetachDeviceFlags domainDetachDeviceFlags;
|
virDrvDomainDetachDeviceFlags xenDomainDetachDeviceFlags;
|
||||||
virDrvDomainUpdateDeviceFlags domainUpdateDeviceFlags;
|
virDrvDomainUpdateDeviceFlags xenDomainUpdateDeviceFlags;
|
||||||
virDrvDomainGetAutostart domainGetAutostart;
|
virDrvDomainGetAutostart xenDomainGetAutostart;
|
||||||
virDrvDomainSetAutostart domainSetAutostart;
|
virDrvDomainSetAutostart xenDomainSetAutostart;
|
||||||
virDrvDomainGetSchedulerType domainGetSchedulerType;
|
virDrvDomainGetSchedulerType xenDomainGetSchedulerType;
|
||||||
virDrvDomainGetSchedulerParameters domainGetSchedulerParameters;
|
virDrvDomainGetSchedulerParameters xenDomainGetSchedulerParameters;
|
||||||
virDrvDomainSetSchedulerParameters domainSetSchedulerParameters;
|
virDrvDomainSetSchedulerParameters xenDomainSetSchedulerParameters;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct xenXMConfCache *xenXMConfCachePtr;
|
typedef struct xenXMConfCache *xenXMConfCachePtr;
|
||||||
|
@ -802,44 +802,24 @@ typedef struct xen_op_v2_dom xen_op_v2_dom;
|
|||||||
static unsigned long xenHypervisorGetMaxMemory(virDomainPtr domain);
|
static unsigned long xenHypervisorGetMaxMemory(virDomainPtr domain);
|
||||||
|
|
||||||
struct xenUnifiedDriver xenHypervisorDriver = {
|
struct xenUnifiedDriver xenHypervisorDriver = {
|
||||||
xenHypervisorOpen, /* open */
|
.xenOpen = xenHypervisorOpen,
|
||||||
xenHypervisorClose, /* close */
|
.xenClose = xenHypervisorClose,
|
||||||
xenHypervisorGetVersion, /* version */
|
.xenVersion = xenHypervisorGetVersion,
|
||||||
NULL, /* hostname */
|
.xenGetCapabilities = xenHypervisorGetCapabilities,
|
||||||
NULL, /* nodeGetInfo */
|
.xenListDomains = xenHypervisorListDomains,
|
||||||
xenHypervisorGetCapabilities, /* getCapabilities */
|
.xenNumOfDomains = xenHypervisorNumOfDomains,
|
||||||
xenHypervisorListDomains, /* listDomains */
|
.xenDomainSuspend = xenHypervisorPauseDomain,
|
||||||
xenHypervisorNumOfDomains, /* numOfDomains */
|
.xenDomainResume = xenHypervisorResumeDomain,
|
||||||
NULL, /* domainCreateXML */
|
.xenDomainDestroyFlags = xenHypervisorDestroyDomainFlags,
|
||||||
xenHypervisorPauseDomain, /* domainSuspend */
|
.xenDomainGetOSType = xenHypervisorDomainGetOSType,
|
||||||
xenHypervisorResumeDomain, /* domainResume */
|
.xenDomainGetMaxMemory = xenHypervisorGetMaxMemory,
|
||||||
NULL, /* domainShutdown */
|
.xenDomainSetMaxMemory = xenHypervisorSetMaxMemory,
|
||||||
NULL, /* domainReboot */
|
.xenDomainGetInfo = xenHypervisorGetDomainInfo,
|
||||||
xenHypervisorDestroyDomainFlags, /* domainDestroyFlags */
|
.xenDomainPinVcpu = xenHypervisorPinVcpu,
|
||||||
xenHypervisorDomainGetOSType, /* domainGetOSType */
|
.xenDomainGetVcpus = xenHypervisorGetVcpus,
|
||||||
xenHypervisorGetMaxMemory, /* domainGetMaxMemory */
|
.xenDomainGetSchedulerType = xenHypervisorGetSchedulerType,
|
||||||
xenHypervisorSetMaxMemory, /* domainSetMaxMemory */
|
.xenDomainGetSchedulerParameters = xenHypervisorGetSchedulerParameters,
|
||||||
NULL, /* domainSetMemory */
|
.xenDomainSetSchedulerParameters = xenHypervisorSetSchedulerParameters,
|
||||||
xenHypervisorGetDomainInfo, /* domainGetInfo */
|
|
||||||
NULL, /* domainSave */
|
|
||||||
NULL, /* domainRestore */
|
|
||||||
NULL, /* domainCoreDump */
|
|
||||||
NULL, /* domainScreenshot */
|
|
||||||
xenHypervisorPinVcpu, /* domainPinVcpu */
|
|
||||||
xenHypervisorGetVcpus, /* domainGetVcpus */
|
|
||||||
NULL, /* listDefinedDomains */
|
|
||||||
NULL, /* numOfDefinedDomains */
|
|
||||||
NULL, /* domainCreate */
|
|
||||||
NULL, /* domainDefineXML */
|
|
||||||
NULL, /* domainUndefine */
|
|
||||||
NULL, /* domainAttachDeviceFlags */
|
|
||||||
NULL, /* domainDetachDeviceFlags */
|
|
||||||
NULL, /* domainUpdateDeviceFlags */
|
|
||||||
NULL, /* domainGetAutostart */
|
|
||||||
NULL, /* domainSetAutostart */
|
|
||||||
xenHypervisorGetSchedulerType, /* domainGetSchedulerType */
|
|
||||||
xenHypervisorGetSchedulerParameters, /* domainGetSchedulerParameters */
|
|
||||||
xenHypervisorSetSchedulerParameters, /* domainSetSchedulerParameters */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define virXenError(code, ...) \
|
#define virXenError(code, ...) \
|
||||||
|
@ -49,44 +49,8 @@
|
|||||||
__FUNCTION__, __LINE__, __VA_ARGS__)
|
__FUNCTION__, __LINE__, __VA_ARGS__)
|
||||||
|
|
||||||
struct xenUnifiedDriver xenInotifyDriver = {
|
struct xenUnifiedDriver xenInotifyDriver = {
|
||||||
xenInotifyOpen, /* open */
|
.xenOpen = xenInotifyOpen,
|
||||||
xenInotifyClose, /* close */
|
.xenClose = xenInotifyClose,
|
||||||
NULL, /* version */
|
|
||||||
NULL, /* hostname */
|
|
||||||
NULL, /* nodeGetInfo */
|
|
||||||
NULL, /* getCapabilities */
|
|
||||||
NULL, /* listDomains */
|
|
||||||
NULL, /* numOfDomains */
|
|
||||||
NULL, /* domainCreateLinux */
|
|
||||||
NULL, /* domainSuspend */
|
|
||||||
NULL, /* domainResume */
|
|
||||||
NULL, /* domainShutdown */
|
|
||||||
NULL, /* domainReboot */
|
|
||||||
NULL, /* domainDestroyFlags */
|
|
||||||
NULL, /* domainGetOSType */
|
|
||||||
NULL, /* domainGetMaxMemory */
|
|
||||||
NULL, /* domainSetMaxMemory */
|
|
||||||
NULL, /* domainSetMemory */
|
|
||||||
NULL, /* domainGetInfo */
|
|
||||||
NULL, /* domainSave */
|
|
||||||
NULL, /* domainRestore */
|
|
||||||
NULL, /* domainCoreDump */
|
|
||||||
NULL, /* domainScreenshot */
|
|
||||||
NULL, /* domainPinVcpu */
|
|
||||||
NULL, /* domainGetVcpus */
|
|
||||||
NULL, /* listDefinedDomains */
|
|
||||||
NULL, /* numOfDefinedDomains */
|
|
||||||
NULL, /* domainCreate */
|
|
||||||
NULL, /* domainDefineXML */
|
|
||||||
NULL, /* domainUndefine */
|
|
||||||
NULL, /* domainAttachDeviceFlags */
|
|
||||||
NULL, /* domainDetachDeviceFlags */
|
|
||||||
NULL, /* domainUpdateDeviceFlags */
|
|
||||||
NULL, /* domainGetAutostart */
|
|
||||||
NULL, /* domainSetAutostart */
|
|
||||||
NULL, /* domainGetSchedulerType */
|
|
||||||
NULL, /* domainGetSchedulerParameters */
|
|
||||||
NULL, /* domainSetSchedulerParameters */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -3934,44 +3934,41 @@ xenDaemonDomainBlockPeek (virDomainPtr domain, const char *path,
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct xenUnifiedDriver xenDaemonDriver = {
|
struct xenUnifiedDriver xenDaemonDriver = {
|
||||||
xenDaemonOpen, /* open */
|
.xenOpen = xenDaemonOpen,
|
||||||
xenDaemonClose, /* close */
|
.xenClose = xenDaemonClose,
|
||||||
xenDaemonGetVersion, /* version */
|
.xenVersion = xenDaemonGetVersion,
|
||||||
NULL, /* hostname */
|
.xenNodeGetInfo = xenDaemonNodeGetInfo,
|
||||||
xenDaemonNodeGetInfo, /* nodeGetInfo */
|
.xenListDomains = xenDaemonListDomains,
|
||||||
NULL, /* getCapabilities */
|
.xenNumOfDomains = xenDaemonNumOfDomains,
|
||||||
xenDaemonListDomains, /* listDomains */
|
.xenDomainCreateXML = xenDaemonCreateXML,
|
||||||
xenDaemonNumOfDomains, /* numOfDomains */
|
.xenDomainSuspend = xenDaemonDomainSuspend,
|
||||||
xenDaemonCreateXML, /* domainCreateXML */
|
.xenDomainResume = xenDaemonDomainResume,
|
||||||
xenDaemonDomainSuspend, /* domainSuspend */
|
.xenDomainShutdown = xenDaemonDomainShutdown,
|
||||||
xenDaemonDomainResume, /* domainResume */
|
.xenDomainReboot = xenDaemonDomainReboot,
|
||||||
xenDaemonDomainShutdown, /* domainShutdown */
|
.xenDomainDestroyFlags = xenDaemonDomainDestroyFlags,
|
||||||
xenDaemonDomainReboot, /* domainReboot */
|
.xenDomainGetOSType = xenDaemonDomainGetOSType,
|
||||||
xenDaemonDomainDestroyFlags, /* domainDestroyFlags */
|
.xenDomainGetMaxMemory = xenDaemonDomainGetMaxMemory,
|
||||||
xenDaemonDomainGetOSType, /* domainGetOSType */
|
.xenDomainSetMaxMemory = xenDaemonDomainSetMaxMemory,
|
||||||
xenDaemonDomainGetMaxMemory, /* domainGetMaxMemory */
|
.xenDomainSetMemory = xenDaemonDomainSetMemory,
|
||||||
xenDaemonDomainSetMaxMemory, /* domainSetMaxMemory */
|
.xenDomainGetInfo = xenDaemonDomainGetInfo,
|
||||||
xenDaemonDomainSetMemory, /* domainMaxMemory */
|
.xenDomainSave = xenDaemonDomainSave,
|
||||||
xenDaemonDomainGetInfo, /* domainGetInfo */
|
.xenDomainRestore = xenDaemonDomainRestore,
|
||||||
xenDaemonDomainSave, /* domainSave */
|
.xenDomainCoreDump = xenDaemonDomainCoreDump,
|
||||||
xenDaemonDomainRestore, /* domainRestore */
|
.xenDomainPinVcpu = xenDaemonDomainPinVcpu,
|
||||||
xenDaemonDomainCoreDump, /* domainCoreDump */
|
.xenDomainGetVcpus = xenDaemonDomainGetVcpus,
|
||||||
NULL, /* domainScreenshot */
|
.xenListDefinedDomains = xenDaemonListDefinedDomains,
|
||||||
xenDaemonDomainPinVcpu, /* domainPinVcpu */
|
.xenNumOfDefinedDomains = xenDaemonNumOfDefinedDomains,
|
||||||
xenDaemonDomainGetVcpus, /* domainGetVcpus */
|
.xenDomainCreate = xenDaemonDomainCreate,
|
||||||
xenDaemonListDefinedDomains, /* listDefinedDomains */
|
.xenDomainDefineXML = xenDaemonDomainDefineXML,
|
||||||
xenDaemonNumOfDefinedDomains,/* numOfDefinedDomains */
|
.xenDomainUndefine = xenDaemonDomainUndefine,
|
||||||
xenDaemonDomainCreate, /* domainCreate */
|
.xenDomainAttachDeviceFlags = xenDaemonAttachDeviceFlags,
|
||||||
xenDaemonDomainDefineXML, /* domainDefineXML */
|
.xenDomainDetachDeviceFlags = xenDaemonDetachDeviceFlags,
|
||||||
xenDaemonDomainUndefine, /* domainUndefine */
|
.xenDomainUpdateDeviceFlags = xenDaemonUpdateDeviceFlags,
|
||||||
xenDaemonAttachDeviceFlags, /* domainAttachDeviceFlags */
|
.xenDomainGetAutostart = xenDaemonDomainGetAutostart,
|
||||||
xenDaemonDetachDeviceFlags, /* domainDetachDeviceFlags */
|
.xenDomainSetAutostart = xenDaemonDomainSetAutostart,
|
||||||
xenDaemonUpdateDeviceFlags, /* domainUpdateDeviceFlags */
|
.xenDomainGetSchedulerType = xenDaemonGetSchedulerType,
|
||||||
xenDaemonDomainGetAutostart, /* domainGetAutostart */
|
.xenDomainGetSchedulerParameters = xenDaemonGetSchedulerParameters,
|
||||||
xenDaemonDomainSetAutostart, /* domainSetAutostart */
|
.xenDomainSetSchedulerParameters = xenDaemonSetSchedulerParameters,
|
||||||
xenDaemonGetSchedulerType, /* domainGetSchedulerType */
|
|
||||||
xenDaemonGetSchedulerParameters, /* domainGetSchedulerParameters */
|
|
||||||
xenDaemonSetSchedulerParameters, /* domainSetSchedulerParameters */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -81,44 +81,20 @@ static int xenXMDomainDetachDeviceFlags(virDomainPtr domain, const char *xml,
|
|||||||
#define XM_XML_ERROR "Invalid xml"
|
#define XM_XML_ERROR "Invalid xml"
|
||||||
|
|
||||||
struct xenUnifiedDriver xenXMDriver = {
|
struct xenUnifiedDriver xenXMDriver = {
|
||||||
xenXMOpen, /* open */
|
.xenOpen = xenXMOpen,
|
||||||
xenXMClose, /* close */
|
.xenClose = xenXMClose,
|
||||||
NULL, /* version */
|
.xenDomainGetMaxMemory = xenXMDomainGetMaxMemory,
|
||||||
NULL, /* hostname */
|
.xenDomainSetMaxMemory = xenXMDomainSetMaxMemory,
|
||||||
NULL, /* nodeGetInfo */
|
.xenDomainSetMemory = xenXMDomainSetMemory,
|
||||||
NULL, /* getCapabilities */
|
.xenDomainGetInfo = xenXMDomainGetInfo,
|
||||||
NULL, /* listDomains */
|
.xenDomainPinVcpu = xenXMDomainPinVcpu,
|
||||||
NULL, /* numOfDomains */
|
.xenListDefinedDomains = xenXMListDefinedDomains,
|
||||||
NULL, /* domainCreateXML */
|
.xenNumOfDefinedDomains = xenXMNumOfDefinedDomains,
|
||||||
NULL, /* domainSuspend */
|
.xenDomainCreate = xenXMDomainCreate,
|
||||||
NULL, /* domainResume */
|
.xenDomainDefineXML = xenXMDomainDefineXML,
|
||||||
NULL, /* domainShutdown */
|
.xenDomainUndefine = xenXMDomainUndefine,
|
||||||
NULL, /* domainReboot */
|
.xenDomainAttachDeviceFlags = xenXMDomainAttachDeviceFlags,
|
||||||
NULL, /* domainDestroyFlags */
|
.xenDomainDetachDeviceFlags = xenXMDomainDetachDeviceFlags,
|
||||||
NULL, /* domainGetOSType */
|
|
||||||
xenXMDomainGetMaxMemory, /* domainGetMaxMemory */
|
|
||||||
xenXMDomainSetMaxMemory, /* domainSetMaxMemory */
|
|
||||||
xenXMDomainSetMemory, /* domainMaxMemory */
|
|
||||||
xenXMDomainGetInfo, /* domainGetInfo */
|
|
||||||
NULL, /* domainSave */
|
|
||||||
NULL, /* domainRestore */
|
|
||||||
NULL, /* domainCoreDump */
|
|
||||||
NULL, /* domainScreenshot */
|
|
||||||
xenXMDomainPinVcpu, /* domainPinVcpu */
|
|
||||||
NULL, /* domainGetVcpus */
|
|
||||||
xenXMListDefinedDomains, /* listDefinedDomains */
|
|
||||||
xenXMNumOfDefinedDomains, /* numOfDefinedDomains */
|
|
||||||
xenXMDomainCreate, /* domainCreate */
|
|
||||||
xenXMDomainDefineXML, /* domainDefineXML */
|
|
||||||
xenXMDomainUndefine, /* domainUndefine */
|
|
||||||
xenXMDomainAttachDeviceFlags, /* domainAttachDeviceFlags */
|
|
||||||
xenXMDomainDetachDeviceFlags, /* domainDetachDeviceFlags */
|
|
||||||
NULL, /* domainUpdateDeviceFlags */
|
|
||||||
NULL, /* domainGetAutostart */
|
|
||||||
NULL, /* domainSetAutostart */
|
|
||||||
NULL, /* domainGetSchedulerType */
|
|
||||||
NULL, /* domainGetSchedulerParameters */
|
|
||||||
NULL, /* domainSetSchedulerParameters */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define xenXMError(code, ...) \
|
#define xenXMError(code, ...) \
|
||||||
|
@ -42,44 +42,15 @@ static void xenStoreWatchEvent(int watch, int fd, int events, void *data);
|
|||||||
static void xenStoreWatchListFree(xenStoreWatchListPtr list);
|
static void xenStoreWatchListFree(xenStoreWatchListPtr list);
|
||||||
|
|
||||||
struct xenUnifiedDriver xenStoreDriver = {
|
struct xenUnifiedDriver xenStoreDriver = {
|
||||||
xenStoreOpen, /* open */
|
.xenOpen = xenStoreOpen,
|
||||||
xenStoreClose, /* close */
|
.xenClose = xenStoreClose,
|
||||||
NULL, /* version */
|
.xenListDomains = xenStoreListDomains,
|
||||||
NULL, /* hostname */
|
.xenDomainShutdown = xenStoreDomainShutdown,
|
||||||
NULL, /* nodeGetInfo */
|
.xenDomainReboot = xenStoreDomainReboot,
|
||||||
NULL, /* getCapabilities */
|
.xenDomainGetOSType = xenStoreDomainGetOSType,
|
||||||
xenStoreListDomains, /* listDomains */
|
.xenDomainGetMaxMemory = xenStoreDomainGetMaxMemory,
|
||||||
NULL, /* numOfDomains */
|
.xenDomainSetMemory = xenStoreDomainSetMemory,
|
||||||
NULL, /* domainCreateXML */
|
.xenDomainGetInfo = xenStoreGetDomainInfo,
|
||||||
NULL, /* domainSuspend */
|
|
||||||
NULL, /* domainResume */
|
|
||||||
xenStoreDomainShutdown, /* domainShutdown */
|
|
||||||
xenStoreDomainReboot, /* domainReboot */
|
|
||||||
NULL, /* domainDestroyFlags */
|
|
||||||
xenStoreDomainGetOSType, /* domainGetOSType */
|
|
||||||
xenStoreDomainGetMaxMemory, /* domainGetMaxMemory */
|
|
||||||
NULL, /* domainSetMaxMemory */
|
|
||||||
xenStoreDomainSetMemory, /* domainSetMemory */
|
|
||||||
xenStoreGetDomainInfo, /* domainGetInfo */
|
|
||||||
NULL, /* domainSave */
|
|
||||||
NULL, /* domainRestore */
|
|
||||||
NULL, /* domainCoreDump */
|
|
||||||
NULL, /* domainScreenshot */
|
|
||||||
NULL, /* domainPinVcpu */
|
|
||||||
NULL, /* domainGetVcpus */
|
|
||||||
NULL, /* listDefinedDomains */
|
|
||||||
NULL, /* numOfDefinedDomains */
|
|
||||||
NULL, /* domainCreate */
|
|
||||||
NULL, /* domainDefineXML */
|
|
||||||
NULL, /* domainUndefine */
|
|
||||||
NULL, /* domainAttachDeviceFlags */
|
|
||||||
NULL, /* domainDetachDeviceFlags */
|
|
||||||
NULL, /* domainUpdateDeviceFlags */
|
|
||||||
NULL, /* domainGetAutostart */
|
|
||||||
NULL, /* domainSetAutostart */
|
|
||||||
NULL, /* domainGetSchedulerType */
|
|
||||||
NULL, /* domainGetSchedulerParameters */
|
|
||||||
NULL, /* domainSetSchedulerParameters */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define virXenStoreError(code, ...) \
|
#define virXenStoreError(code, ...) \
|
||||||
|
Loading…
Reference in New Issue
Block a user