If you recall the current driver model, which looks like this: libvirt.c | (virDriver) | V +---- xen_unified.c | (virDriver) | V +---- xen_internal.c | +---- xend_internal.c etc. The interface between libvirt.c and xen_unified.c is virDriver. And currently the same interface is reused between xen_unified.c and its underlying drivers. This patch defines a new structure called xenUnifiedDriver, which begins as a subset of virDriver, and eventually will go away in favour of direct calls from xen_unified to the underlying parts (much simpler to understand what's going on that way, and we won't need the current driver ordering hacks, and anyway the xen drivers call each other semi-randomly). libvirt.c | (virDriver) | V +---- xen_unified.c | (xenUnifiedDriver + direct calls) | V +---- xen_internal.c | +---- xend_internal.c etc. This patch starts by removing the id, name and version fields from virDriver. It also removes getMaxVcpus and the domainLookup* fields, which will make more sense when you see patches #6 and #7 in this series. Rich. -- Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/ Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 03798903
diff -urN --exclude=CVS --exclude=.git --exclude='*.pem' --exclude=demoCA --exclude=.gitignore --exclude='*.orig' --exclude='*.bak' libvirt-domain-lookup-1/src/proxy_internal.c libvirt-domain-lookup-2/src/proxy_internal.c --- libvirt-domain-lookup-1/src/proxy_internal.c 2007-07-03 11:21:57.000000000 +0100 +++ libvirt-domain-lookup-2/src/proxy_internal.c 2007-07-03 14:16:19.000000000 +0100 @@ -35,35 +35,23 @@ static char *xenProxyGetCapabilities(virConnectPtr conn); static int xenProxyListDomains(virConnectPtr conn, int *ids, int maxids); static int xenProxyNumOfDomains(virConnectPtr conn); -static virDomainPtr xenProxyLookupByID(virConnectPtr conn, int id); -static virDomainPtr xenProxyLookupByUUID(virConnectPtr conn, - const unsigned char *uuid); -static virDomainPtr xenProxyDomainLookupByName(virConnectPtr conn, - const char *domname); static unsigned long xenProxyDomainGetMaxMemory(virDomainPtr domain); static int xenProxyDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info); static char *xenProxyDomainDumpXML(virDomainPtr domain, int flags); static char *xenProxyDomainGetOSType(virDomainPtr domain); -virDriver xenProxyDriver = { - -1, - "XenProxy", - 0, +struct xenUnifiedDriver xenProxyDriver = { xenProxyOpen, /* open */ xenProxyClose, /* close */ NULL, /* type */ xenProxyGetVersion, /* version */ NULL, /* hostname */ NULL, /* URI */ - NULL, /* getMaxVcpus */ xenProxyNodeGetInfo, /* nodeGetInfo */ xenProxyGetCapabilities, /* getCapabilities */ xenProxyListDomains, /* listDomains */ xenProxyNumOfDomains, /* numOfDomains */ NULL, /* domainCreateLinux */ - xenProxyLookupByID, /* domainLookupByID */ - xenProxyLookupByUUID, /* domainLookupByUUID */ - xenProxyDomainLookupByName, /* domainLookupByName */ NULL, /* domainSuspend */ NULL, /* domainResume */ NULL, /* domainShutdown */ @@ -799,7 +787,7 @@ * * Returns a new domain object or NULL in case of failure */ -static virDomainPtr +virDomainPtr xenProxyLookupByID(virConnectPtr conn, int id) { virProxyPacket req; @@ -850,7 +838,7 @@ * * Returns a new domain object or NULL in case of failure */ -static virDomainPtr +virDomainPtr xenProxyLookupByUUID(virConnectPtr conn, const unsigned char *uuid) { virProxyFullPacket req; @@ -889,7 +877,7 @@ } /** - * xenProxyDomainLookupByName: + * xenProxyLookupByName: * @conn: A xend instance * @name: The name of the domain * @@ -897,8 +885,8 @@ * * Returns a new domain object or NULL in case of failure */ -static virDomainPtr -xenProxyDomainLookupByName(virConnectPtr conn, const char *name) +virDomainPtr +xenProxyLookupByName(virConnectPtr conn, const char *name) { virProxyFullPacket req; int ret, len; diff -urN --exclude=CVS --exclude=.git --exclude='*.pem' --exclude=demoCA --exclude=.gitignore --exclude='*.orig' --exclude='*.bak' libvirt-domain-lookup-1/src/proxy_internal.h libvirt-domain-lookup-2/src/proxy_internal.h --- libvirt-domain-lookup-1/src/proxy_internal.h 2007-04-30 17:58:26.000000000 +0100 +++ libvirt-domain-lookup-2/src/proxy_internal.h 2007-07-03 14:12:45.000000000 +0100 @@ -86,8 +86,15 @@ typedef struct _virProxyFullPacket virProxyFullPacket; typedef virProxyFullPacket *virProxyFullPacketPtr; -extern virDriver xenProxyDriver; -int xenProxyInit (void); +/* xen_unified makes direct calls or indirect calls through here. */ +extern struct xenUnifiedDriver xenProxyDriver; +extern int xenProxyInit (void); + +extern virDomainPtr xenProxyLookupByID(virConnectPtr conn, int id); +extern virDomainPtr xenProxyLookupByUUID(virConnectPtr conn, + const unsigned char *uuid); +extern virDomainPtr xenProxyLookupByName(virConnectPtr conn, + const char *domname); #ifdef __cplusplus } diff -urN --exclude=CVS --exclude=.git --exclude='*.pem' --exclude=demoCA --exclude=.gitignore --exclude='*.orig' --exclude='*.bak' libvirt-domain-lookup-1/src/xend_internal.c libvirt-domain-lookup-2/src/xend_internal.c --- libvirt-domain-lookup-1/src/xend_internal.c 2007-07-03 12:43:44.000000000 +0100 +++ libvirt-domain-lookup-2/src/xend_internal.c 2007-07-03 14:16:05.000000000 +0100 @@ -50,9 +50,6 @@ static int xenDaemonNumOfDomains(virConnectPtr conn); static int xenDaemonListDefinedDomains(virConnectPtr conn, char **const names, int maxnames); static int xenDaemonNumOfDefinedDomains(virConnectPtr conn); -static virDomainPtr xenDaemonLookupByID(virConnectPtr conn, int id); -static virDomainPtr xenDaemonLookupByUUID(virConnectPtr conn, - const unsigned char *uuid); static virDomainPtr xenDaemonCreateLinux(virConnectPtr conn, const char *xmlDesc, unsigned int flags); @@ -64,27 +61,18 @@ #endif /* PROXY */ #ifndef PROXY -virDriver xenDaemonDriver = { - -1, - "XenDaemon", - (DOM0_INTERFACE_VERSION >> 24) * 1000000 + - ((DOM0_INTERFACE_VERSION >> 16) & 0xFF) * 1000 + - (DOM0_INTERFACE_VERSION & 0xFFFF), +struct xenUnifiedDriver xenDaemonDriver = { xenDaemonOpen, /* open */ xenDaemonClose, /* close */ xenDaemonGetType, /* type */ xenDaemonGetVersion, /* version */ NULL, /* hostname */ NULL, /* URI */ - NULL, /* getMaxVcpus */ xenDaemonNodeGetInfo, /* nodeGetInfo */ NULL, /* getCapabilities */ xenDaemonListDomains, /* listDomains */ xenDaemonNumOfDomains, /* numOfDomains */ xenDaemonCreateLinux, /* domainCreateLinux */ - xenDaemonLookupByID, /* domainLookupByID */ - xenDaemonLookupByUUID, /* domainLookupByUUID */ - xenDaemonDomainLookupByName, /* domainLookupByName */ xenDaemonDomainSuspend, /* domainSuspend */ xenDaemonDomainResume, /* domainResume */ xenDaemonDomainShutdown, /* domainShutdown */ @@ -2513,7 +2501,7 @@ #ifndef PROXY /** - * xenDaemonDomainLookupByName: + * xenDaemonLookupByName: * @conn: A xend instance * @name: The name of the domain * @@ -2524,7 +2512,7 @@ * Returns domain info on success; NULL (with errno) on error */ virDomainPtr -xenDaemonDomainLookupByName(virConnectPtr conn, const char *domname) +xenDaemonLookupByName(virConnectPtr conn, const char *domname) { struct sexpr *root; virDomainPtr ret = NULL; @@ -2729,7 +2717,7 @@ * * Returns a new domain object or NULL in case of failure */ -static virDomainPtr +virDomainPtr xenDaemonLookupByID(virConnectPtr conn, int id) { char *name = NULL; unsigned char uuid[VIR_UUID_BUFLEN]; @@ -2930,7 +2918,7 @@ * * Returns a new domain object or NULL in case of failure */ -static virDomainPtr +virDomainPtr xenDaemonLookupByUUID(virConnectPtr conn, const unsigned char *uuid) { virDomainPtr ret; diff -urN --exclude=CVS --exclude=.git --exclude='*.pem' --exclude=demoCA --exclude=.gitignore --exclude='*.orig' --exclude='*.bak' libvirt-domain-lookup-1/src/xend_internal.h libvirt-domain-lookup-2/src/xend_internal.h --- libvirt-domain-lookup-1/src/xend_internal.h 2007-04-04 15:19:49.000000000 +0100 +++ libvirt-domain-lookup-2/src/xend_internal.h 2007-07-03 14:14:27.000000000 +0100 @@ -177,9 +177,6 @@ char *xend_parse_domain_sexp(virConnectPtr conn, char *root, int xendConfigVersion); -extern virDriver xenDaemonDriver; -int xenDaemonInit (void); - /* refactored ones */ int xenDaemonOpen(virConnectPtr conn, const char *name, int flags); int xenDaemonClose(virConnectPtr conn); @@ -196,7 +193,6 @@ int xenDaemonDomainSetMaxMemory(virDomainPtr domain, unsigned long memory); int xenDaemonDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info); char *xenDaemonDomainDumpXML(virDomainPtr domain, int flags); -virDomainPtr xenDaemonDomainLookupByName(virConnectPtr conn, const char *domname); unsigned long xenDaemonDomainGetMaxMemory(virDomainPtr domain); char **xenDaemonListDomainsOld(virConnectPtr xend); @@ -216,6 +212,14 @@ unsigned char *cpumaps, int maplen); +/* xen_unified calls through here. */ +extern struct xenUnifiedDriver xenDaemonDriver; +int xenDaemonInit (void); + +virDomainPtr xenDaemonLookupByID(virConnectPtr conn, int id); +virDomainPtr xenDaemonLookupByUUID(virConnectPtr conn, const unsigned char *uuid); +virDomainPtr xenDaemonLookupByName(virConnectPtr conn, const char *domname); + #ifdef __cplusplus } #endif diff -urN --exclude=CVS --exclude=.git --exclude='*.pem' --exclude=demoCA --exclude=.gitignore --exclude='*.orig' --exclude='*.bak' libvirt-domain-lookup-1/src/xen_internal.c libvirt-domain-lookup-2/src/xen_internal.c --- libvirt-domain-lookup-1/src/xen_internal.c 2007-07-03 11:21:59.000000000 +0100 +++ libvirt-domain-lookup-2/src/xen_internal.c 2007-07-03 14:15:40.000000000 +0100 @@ -587,27 +587,18 @@ #endif #ifndef PROXY -virDriver xenHypervisorDriver = { - -1, - "Xen", - (DOM0_INTERFACE_VERSION >> 24) * 1000000 + - ((DOM0_INTERFACE_VERSION >> 16) & 0xFF) * 1000 + - (DOM0_INTERFACE_VERSION & 0xFFFF), +struct xenUnifiedDriver xenHypervisorDriver = { xenHypervisorOpen, /* open */ xenHypervisorClose, /* close */ xenHypervisorGetType, /* type */ xenHypervisorGetVersion, /* version */ NULL, /* hostname */ NULL, /* URI */ - xenHypervisorGetMaxVcpus, /* getMaxVcpus */ NULL, /* nodeGetInfo */ xenHypervisorGetCapabilities, /* getCapabilities */ xenHypervisorListDomains, /* listDomains */ xenHypervisorNumOfDomains, /* numOfDomains */ NULL, /* domainCreateLinux */ - NULL, /* domainLookupByID */ - NULL, /* domainLookupByUUID */ - NULL, /* domainLookupByName */ xenHypervisorPauseDomain, /* domainSuspend */ xenHypervisorResumeDomain, /* domainResume */ NULL, /* domainShutdown */ diff -urN --exclude=CVS --exclude=.git --exclude='*.pem' --exclude=demoCA --exclude=.gitignore --exclude='*.orig' --exclude='*.bak' libvirt-domain-lookup-1/src/xen_internal.h libvirt-domain-lookup-2/src/xen_internal.h --- libvirt-domain-lookup-1/src/xen_internal.h 2007-06-05 13:06:09.000000000 +0100 +++ libvirt-domain-lookup-2/src/xen_internal.h 2007-07-03 12:59:04.000000000 +0100 @@ -15,7 +15,7 @@ extern "C" { #endif -extern virDriver xenHypervisorDriver; +extern struct xenUnifiedDriver xenHypervisorDriver; int xenHypervisorInit (void); /* The following calls are made directly by the Xen proxy: */ diff -urN --exclude=CVS --exclude=.git --exclude='*.pem' --exclude=demoCA --exclude=.gitignore --exclude='*.orig' --exclude='*.bak' libvirt-domain-lookup-1/src/xen_unified.c libvirt-domain-lookup-2/src/xen_unified.c --- libvirt-domain-lookup-1/src/xen_unified.c 2007-07-03 11:21:59.000000000 +0100 +++ libvirt-domain-lookup-2/src/xen_unified.c 2007-07-03 14:51:21.000000000 +0100 @@ -17,12 +17,6 @@ * xend_internal, xs_internal and xm_internal). Historically * the body of libvirt.c handled the five Xen drivers, * and contained Xen-specific code. - * - * The interface between Xen drivers and xen_unified is - * the same as for "ordinary" libvirt drivers (ie. virDriverPtr), - * however this is just for convenience and may be changed - * in future. Libvirt.c should no longer call directly - * to the five underlying Xen drivers. */ #include <stdint.h> @@ -44,15 +38,13 @@ #include "xm_internal.h" /* The five Xen drivers below us. */ -static virDriverPtr drivers[XEN_UNIFIED_NR_DRIVERS] = { - &xenHypervisorDriver, - &xenProxyDriver, - &xenDaemonDriver, - &xenStoreDriver, - &xenXMDriver +static struct xenUnifiedDriver *drivers[XEN_UNIFIED_NR_DRIVERS] = { + [XEN_UNIFIED_HYPERVISOR_OFFSET] = &xenHypervisorDriver, + [XEN_UNIFIED_PROXY_OFFSET] = &xenProxyDriver, + [XEN_UNIFIED_XEND_OFFSET] = &xenDaemonDriver, + [XEN_UNIFIED_XS_OFFSET] = &xenStoreDriver, + [XEN_UNIFIED_XM_OFFSET] = &xenXMDriver, }; -static const int hypervisor_offset = 0; -static const int proxy_offset = 1; /** * xenUnifiedError: @@ -161,7 +153,7 @@ continue; /* Ignore proxy for root */ - if (i == proxy_offset && getuid() == 0) + if (i == XEN_UNIFIED_PROXY_OFFSET && getuid() == 0) continue; if (drivers[i]->open && @@ -170,7 +162,8 @@ /* If as root, then all drivers must succeed. If non-root, then only proxy must succeed */ - if (!priv->opened[i] && (getuid() == 0 || i == proxy_offset)) { + if (!priv->opened[i] && + (getuid() == 0 || i == XEN_UNIFIED_PROXY_OFFSET)) { for (j = 0; j < i; ++j) if (priv->opened[j]) drivers[j]->close (conn); free (priv->name); @@ -427,15 +482,15 @@ * as a last resort. */ for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i) - if (i != hypervisor_offset && + if (i != XEN_UNIFIED_HYPERVISOR_OFFSET && priv->opened[i] && drivers[i]->domainSuspend && drivers[i]->domainSuspend (dom) == 0) return 0; - if (priv->opened[hypervisor_offset] && - drivers[hypervisor_offset]->domainSuspend && - drivers[hypervisor_offset]->domainSuspend (dom) == 0) + if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET] && + drivers[XEN_UNIFIED_HYPERVISOR_OFFSET]->domainSuspend && + drivers[XEN_UNIFIED_HYPERVISOR_OFFSET]->domainSuspend (dom) == 0) return 0; return -1; @@ -451,15 +506,15 @@ * as a last resort. */ for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i) - if (i != hypervisor_offset && + if (i != XEN_UNIFIED_HYPERVISOR_OFFSET && priv->opened[i] && drivers[i]->domainResume && drivers[i]->domainResume (dom) == 0) return 0; - if (priv->opened[hypervisor_offset] && - drivers[hypervisor_offset]->domainResume && - drivers[hypervisor_offset]->domainResume (dom) == 0) + if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET] && + drivers[XEN_UNIFIED_HYPERVISOR_OFFSET]->domainResume && + drivers[XEN_UNIFIED_HYPERVISOR_OFFSET]->domainResume (dom) == 0) return 0; return -1; @@ -505,15 +560,15 @@ * as a last resort. */ for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i) - if (i != hypervisor_offset && + if (i != XEN_UNIFIED_HYPERVISOR_OFFSET && priv->opened[i] && drivers[i]->domainDestroy && drivers[i]->domainDestroy (dom) == 0) return 0; if (priv->opened[i] && - drivers[hypervisor_offset]->domainDestroy && - drivers[hypervisor_offset]->domainDestroy (dom) == 0) + drivers[XEN_UNIFIED_HYPERVISOR_OFFSET]->domainDestroy && + drivers[XEN_UNIFIED_HYPERVISOR_OFFSET]->domainDestroy (dom) == 0) return 0; return -1; @@ -651,15 +706,15 @@ * as a last resort. */ for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i) - if (i != hypervisor_offset && + if (i != XEN_UNIFIED_HYPERVISOR_OFFSET && priv->opened[i] && drivers[i]->domainSetVcpus && drivers[i]->domainSetVcpus (dom, nvcpus) == 0) return 0; - if (priv->opened[hypervisor_offset] && - drivers[hypervisor_offset]->domainSetVcpus && - drivers[hypervisor_offset]->domainSetVcpus (dom, nvcpus) == 0) + if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET] && + drivers[XEN_UNIFIED_HYPERVISOR_OFFSET]->domainSetVcpus && + drivers[XEN_UNIFIED_HYPERVISOR_OFFSET]->domainSetVcpus (dom, nvcpus) == 0) return 0; return -1; diff -urN --exclude=CVS --exclude=.git --exclude='*.pem' --exclude=demoCA --exclude=.gitignore --exclude='*.orig' --exclude='*.bak' libvirt-domain-lookup-1/src/xen_unified.h libvirt-domain-lookup-2/src/xen_unified.h --- libvirt-domain-lookup-1/src/xen_unified.h 2007-07-03 11:21:59.000000000 +0100 +++ libvirt-domain-lookup-2/src/xen_unified.h 2007-07-03 13:06:34.000000000 +0100 @@ -19,8 +19,67 @@ extern int xenUnifiedRegister (void); +#define XEN_UNIFIED_HYPERVISOR_OFFSET 0 +#define XEN_UNIFIED_PROXY_OFFSET 1 +#define XEN_UNIFIED_XEND_OFFSET 2 +#define XEN_UNIFIED_XS_OFFSET 3 +#define XEN_UNIFIED_XM_OFFSET 4 #define XEN_UNIFIED_NR_DRIVERS 5 +/* _xenUnifiedDriver: + * + * Entry points into the underlying Xen drivers. This structure + * will eventually go away and instead xen unified will make direct + * calls to the underlying Xen drivers. + * + * To reiterate - the goal is to remove elements from this structure + * until it is empty, replacing indirect calls through this + * structure with direct calls in xen_unified.c. + */ +struct xenUnifiedDriver { + virDrvOpen open; + virDrvClose close; + virDrvGetType type; + virDrvGetVersion version; + virDrvGetHostname getHostname; + virDrvGetURI getURI; + virDrvNodeGetInfo nodeGetInfo; + virDrvGetCapabilities getCapabilities; + virDrvListDomains listDomains; + virDrvNumOfDomains numOfDomains; + virDrvDomainCreateLinux domainCreateLinux; + virDrvDomainSuspend domainSuspend; + virDrvDomainResume domainResume; + virDrvDomainShutdown domainShutdown; + virDrvDomainReboot domainReboot; + virDrvDomainDestroy domainDestroy; + virDrvDomainGetOSType domainGetOSType; + virDrvDomainGetMaxMemory domainGetMaxMemory; + virDrvDomainSetMaxMemory domainSetMaxMemory; + virDrvDomainSetMemory domainSetMemory; + virDrvDomainGetInfo domainGetInfo; + virDrvDomainSave domainSave; + virDrvDomainRestore domainRestore; + virDrvDomainCoreDump domainCoreDump; + virDrvDomainSetVcpus domainSetVcpus; + virDrvDomainPinVcpu domainPinVcpu; + virDrvDomainGetVcpus domainGetVcpus; + virDrvDomainGetMaxVcpus domainGetMaxVcpus; + virDrvDomainDumpXML domainDumpXML; + virDrvListDefinedDomains listDefinedDomains; + virDrvNumOfDefinedDomains numOfDefinedDomains; + virDrvDomainCreate domainCreate; + virDrvDomainDefineXML domainDefineXML; + virDrvDomainUndefine domainUndefine; + virDrvDomainAttachDevice domainAttachDevice; + virDrvDomainDetachDevice domainDetachDevice; + virDrvDomainGetAutostart domainGetAutostart; + virDrvDomainSetAutostart domainSetAutostart; + virDrvDomainGetSchedulerType domainGetSchedulerType; + virDrvDomainGetSchedulerParameters domainGetSchedulerParameters; + virDrvDomainSetSchedulerParameters domainSetSchedulerParameters; +}; + /* xenUnifiedPrivatePtr: * * Per-connection private data, stored in conn->privateData. All Xen diff -urN --exclude=CVS --exclude=.git --exclude='*.pem' --exclude=demoCA --exclude=.gitignore --exclude='*.orig' --exclude='*.bak' libvirt-domain-lookup-1/src/xm_internal.c libvirt-domain-lookup-2/src/xm_internal.c --- libvirt-domain-lookup-1/src/xm_internal.c 2007-07-03 11:21:59.000000000 +0100 +++ libvirt-domain-lookup-2/src/xm_internal.c 2007-07-03 15:09:32.000000000 +0100 @@ -72,27 +74,18 @@ #define XEND_PCI_CONFIG_PREFIX "xend-pci-" #define QEMU_IF_SCRIPT "qemu-ifup" -virDriver xenXMDriver = { - -1, - "XenXM", - (DOM0_INTERFACE_VERSION >> 24) * 1000000 + - ((DOM0_INTERFACE_VERSION >> 16) & 0xFF) * 1000 + - (DOM0_INTERFACE_VERSION & 0xFFFF), +struct xenUnifiedDriver xenXMDriver = { xenXMOpen, /* open */ xenXMClose, /* close */ xenXMGetType, /* type */ NULL, /* version */ NULL, /* hostname */ NULL, /* URI */ - NULL, /* getMaxVcpus */ NULL, /* nodeGetInfo */ NULL, /* getCapabilities */ NULL, /* listDomains */ NULL, /* numOfDomains */ NULL, /* domainCreateLinux */ - NULL, /* domainLookupByID */ - xenXMDomainLookupByUUID, /* domainLookupByUUID */ - xenXMDomainLookupByName, /* domainLookupByName */ NULL, /* domainSuspend */ NULL, /* domainResume */ NULL, /* domainShutdown */ diff -urN --exclude=CVS --exclude=.git --exclude='*.pem' --exclude=demoCA --exclude=.gitignore --exclude='*.orig' --exclude='*.bak' libvirt-domain-lookup-1/src/xm_internal.h libvirt-domain-lookup-2/src/xm_internal.h --- libvirt-domain-lookup-1/src/xm_internal.h 2007-04-04 15:19:49.000000000 +0100 +++ libvirt-domain-lookup-2/src/xm_internal.h 2007-07-03 12:59:33.000000000 +0100 @@ -33,7 +33,7 @@ extern "C" { #endif -extern virDriver xenXMDriver; +extern struct xenUnifiedDriver xenXMDriver; int xenXMInit (void); int xenXMOpen(virConnectPtr conn, const char *name, int flags); diff -urN --exclude=CVS --exclude=.git --exclude='*.pem' --exclude=demoCA --exclude=.gitignore --exclude='*.orig' --exclude='*.bak' libvirt-domain-lookup-1/src/xs_internal.c libvirt-domain-lookup-2/src/xs_internal.c --- libvirt-domain-lookup-1/src/xs_internal.c 2007-07-03 11:21:59.000000000 +0100 +++ libvirt-domain-lookup-2/src/xs_internal.c 2007-07-03 14:41:21.000000000 +0100 @@ -36,27 +36,18 @@ #ifndef PROXY static char *xenStoreDomainGetOSType(virDomainPtr domain); -virDriver xenStoreDriver = { - -1, - "XenStore", - (DOM0_INTERFACE_VERSION >> 24) * 1000000 + - ((DOM0_INTERFACE_VERSION >> 16) & 0xFF) * 1000 + - (DOM0_INTERFACE_VERSION & 0xFFFF), +struct xenUnifiedDriver xenStoreDriver = { xenStoreOpen, /* open */ xenStoreClose, /* close */ NULL, /* type */ NULL, /* version */ NULL, /* hostname */ NULL, /* URI */ - NULL, /* getMaxVcpus */ NULL, /* nodeGetInfo */ NULL, /* getCapabilities */ xenStoreListDomains, /* listDomains */ NULL, /* numOfDomains */ NULL, /* domainCreateLinux */ - NULL, /* domainLookupByID */ - NULL, /* domainLookupByUUID */ - xenStoreDomainLookupByName, /* domainLookupByName */ NULL, /* domainSuspend */ NULL, /* domainResume */ xenStoreDomainShutdown, /* domainShutdown */ @@ -591,7 +582,7 @@ } /** - * xenStoreDomainLookupByName: + * xenStoreLookupByName: * @conn: A xend instance * @name: The name of the domain * @@ -600,7 +591,7 @@ * Returns a new domain object or NULL in case of failure */ virDomainPtr -xenStoreDomainLookupByName(virConnectPtr conn, const char *name) +xenStoreLookupByName(virConnectPtr conn, const char *name) { virDomainPtr ret = NULL; unsigned int num, i, len; diff -urN --exclude=CVS --exclude=.git --exclude='*.pem' --exclude=demoCA --exclude=.gitignore --exclude='*.orig' --exclude='*.bak' libvirt-domain-lookup-1/src/xs_internal.h libvirt-domain-lookup-2/src/xs_internal.h --- libvirt-domain-lookup-1/src/xs_internal.h 2007-04-04 15:19:49.000000000 +0100 +++ libvirt-domain-lookup-2/src/xs_internal.h 2007-07-03 14:08:03.000000000 +0100 @@ -15,7 +15,7 @@ extern "C" { #endif -extern virDriver xenStoreDriver; +extern struct xenUnifiedDriver xenStoreDriver; int xenStoreInit (void); int xenStoreOpen (virConnectPtr conn, @@ -28,7 +28,7 @@ int xenStoreListDomains (virConnectPtr conn, int *ids, int maxids); -virDomainPtr xenStoreDomainLookupByName(virConnectPtr conn, +virDomainPtr xenStoreLookupByName(virConnectPtr conn, const char *name); unsigned long xenStoreGetMaxMemory (virDomainPtr domain); int xenStoreDomainSetMemory (virDomainPtr domain,
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature
-- Libvir-list mailing list Libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list