diff --git a/ChangeLog b/ChangeLog index 84e78da46064fc525905b24e85b00982cad84219..36abf16747f4140e4cfeadab8f33f6b84db6c95d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ -2008-04-10 Jim Meyering +Thu Apr 10 18:54:03 CEST 2008 Jim Meyering + + Convert TAB-based indentation in C sources to use only spaces. + Done using this command (also includes .c.in and .h.in files): + for i in $(g ls-files|grep -E '\.[ch](\.in)?$'|grep -v gnulib); do + expand -i $i > j && mv j $i;done Remove Vim and Emacs variable settings from C source files. Done with these commands: diff --git a/docs/examples/info1.c b/docs/examples/info1.c index c5b89062b04da3069613e4b2faa3414d56a5e38b..601e9f247e2e185b6bf32179b886d506f783ce54 100644 --- a/docs/examples/info1.c +++ b/docs/examples/info1.c @@ -29,21 +29,21 @@ getDomainInfo(int id) { conn = virConnectOpenReadOnly(NULL); if (conn == NULL) { fprintf(stderr, "Failed to connect to hypervisor\n"); - goto error; + goto error; } /* Find the domain of the given id */ dom = virDomainLookupByID(conn, id); if (dom == NULL) { fprintf(stderr, "Failed to find Domain %d\n", id); - goto error; + goto error; } /* Get the information */ ret = virDomainGetInfo(dom, &info); if (ret < 0) { fprintf(stderr, "Failed to get information for Domain %d\n", id); - goto error; + goto error; } printf("Domains %d: %d CPUs\n", id, info.nrVirtCpu); @@ -52,7 +52,7 @@ error: if (dom != NULL) virDomainFree(dom); if (conn != NULL) - virConnectClose(conn); + virConnectClose(conn); } int main() { diff --git a/docs/examples/suspend.c b/docs/examples/suspend.c index dc069454e5cb58d23e218fca779637726312c40f..bae1b8d6e9c34d2f464b1f71e5bd7fc8499588c9 100644 --- a/docs/examples/suspend.c +++ b/docs/examples/suspend.c @@ -30,7 +30,7 @@ checkDomainState(virDomainPtr dom) { ret = virDomainGetInfo(dom, &info); if (ret < 0) { - return(-1); + return(-1); } return(info.state); } @@ -50,42 +50,42 @@ SuspendAndResumeDomain(int id) { dom = virDomainLookupByID(conn, id); if (dom == NULL) { fprintf(stderr, "Failed to find Domain %d\n", id); - goto error; + goto error; } /* Check state */ state = checkDomainState(dom); if ((state == VIR_DOMAIN_RUNNING) || (state == VIR_DOMAIN_NOSTATE) || - (state == VIR_DOMAIN_BLOCKED)) { - printf("Suspending domain...\n"); - ret = virDomainSuspend(dom); - if (ret < 0) { - fprintf(stderr, "Failed to suspend Domain %d\n", id); - goto error; - } - state = checkDomainState(dom); - if (state != VIR_DOMAIN_PAUSED) { - fprintf(stderr, "Domain %d state is not suspended\n", id); - } else { - printf("Domain suspended, resuming it...\n"); - } - ret = virDomainResume(dom); - if (ret < 0) { - fprintf(stderr, "Failed to resume Domain %d\n", id); - goto error; - } - state = checkDomainState(dom); - if ((state == VIR_DOMAIN_RUNNING) || - (state == VIR_DOMAIN_NOSTATE) || - (state == VIR_DOMAIN_BLOCKED)) { - printf("Domain resumed\n"); - } else { - fprintf(stderr, "Domain %d state indicate it is not resumed\n", id); - } + (state == VIR_DOMAIN_BLOCKED)) { + printf("Suspending domain...\n"); + ret = virDomainSuspend(dom); + if (ret < 0) { + fprintf(stderr, "Failed to suspend Domain %d\n", id); + goto error; + } + state = checkDomainState(dom); + if (state != VIR_DOMAIN_PAUSED) { + fprintf(stderr, "Domain %d state is not suspended\n", id); + } else { + printf("Domain suspended, resuming it...\n"); + } + ret = virDomainResume(dom); + if (ret < 0) { + fprintf(stderr, "Failed to resume Domain %d\n", id); + goto error; + } + state = checkDomainState(dom); + if ((state == VIR_DOMAIN_RUNNING) || + (state == VIR_DOMAIN_NOSTATE) || + (state == VIR_DOMAIN_BLOCKED)) { + printf("Domain resumed\n"); + } else { + fprintf(stderr, "Domain %d state indicate it is not resumed\n", id); + } } else { fprintf(stderr, "Domain %d is not in a state where it should be suspended\n", id); - goto error; + goto error; } error: @@ -100,7 +100,7 @@ int main(int argc, char **argv) { conn = virConnectOpenReadOnly(NULL); if (conn == NULL) { fprintf(stderr, "Failed to connect to hypervisor\n"); - goto error; + goto error; } if (argc > 1) { @@ -108,27 +108,27 @@ int main(int argc, char **argv) { } if (id == 0) { int i, j, ids[10]; - i = virConnectListDomains(conn, &ids[0], 10); - if (i < 0) { - fprintf(stderr, "Failed to list the domains\n"); - goto error; - } - for (j = 0;j < i;j++) { - if (ids[j] != 0) { - id = ids[j]; - break; - } - } + i = virConnectListDomains(conn, &ids[0], 10); + if (i < 0) { + fprintf(stderr, "Failed to list the domains\n"); + goto error; + } + for (j = 0;j < i;j++) { + if (ids[j] != 0) { + id = ids[j]; + break; + } + } } if (id == 0) { - fprintf(stderr, "Failed find a running guest domain\n"); - goto error; + fprintf(stderr, "Failed find a running guest domain\n"); + goto error; } SuspendAndResumeDomain(id); error: if (conn != NULL) - virConnectClose(conn); + virConnectClose(conn); return(0); } diff --git a/include/libvirt/libvirt.h b/include/libvirt/libvirt.h index 6bd7cfe21520fd2ffccd11318d27871cf0936013..ee7568945f02de59007b8279e2c494d1e109b028 100644 --- a/include/libvirt/libvirt.h +++ b/include/libvirt/libvirt.h @@ -178,15 +178,15 @@ typedef virSchedParameter *virSchedParameterPtr; * Fetch scheduler parameters, caller allocates 'params' field of size 'nparams' */ int virDomainGetSchedulerParameters (virDomainPtr domain, - virSchedParameterPtr params, - int *nparams); + virSchedParameterPtr params, + int *nparams); /* * Change scheduler parameters */ int virDomainSetSchedulerParameters (virDomainPtr domain, - virSchedParameterPtr params, - int nparams); + virSchedParameterPtr params, + int nparams); /** * virDomainBlockStats: @@ -253,8 +253,8 @@ typedef enum { /* Domain migration. */ virDomainPtr virDomainMigrate (virDomainPtr domain, virConnectPtr dconn, - unsigned long flags, const char *dname, - const char *uri, unsigned long bandwidth); + unsigned long flags, const char *dname, + const char *uri, unsigned long bandwidth); /** * VIR_NODEINFO_MAXCPUS: @@ -328,8 +328,8 @@ typedef virConnectCredential *virConnectCredentialPtr; * Return 0 if all interactions were filled, or -1 upon error */ typedef int (*virConnectAuthCallbackPtr)(virConnectCredentialPtr cred, - unsigned int ncred, - void *cbdata); + unsigned int ncred, + void *cbdata); struct _virConnectAuth { int *credtype; /* List of supported virConnectCredentialType values */ @@ -375,8 +375,8 @@ extern virConnectAuthPtr virConnectAuthPtrDefault; #define LIBVIR_VERSION_NUMBER 4002 int virGetVersion (unsigned long *libVer, - const char *type, - unsigned long *typeVer); + const char *type, + unsigned long *typeVer); /* * Connection and disconnections to the Hypervisor @@ -386,12 +386,12 @@ int virInitialize (void); virConnectPtr virConnectOpen (const char *name); virConnectPtr virConnectOpenReadOnly (const char *name); virConnectPtr virConnectOpenAuth (const char *name, - virConnectAuthPtr auth, - int flags); + virConnectAuthPtr auth, + int flags); int virConnectClose (virConnectPtr conn); const char * virConnectGetType (virConnectPtr conn); int virConnectGetVersion (virConnectPtr conn, - unsigned long *hvVer); + unsigned long *hvVer); char * virConnectGetHostname (virConnectPtr conn); char * virConnectGetURI (virConnectPtr conn); @@ -401,9 +401,9 @@ char * virConnectGetURI (virConnectPtr conn); */ int virConnectGetMaxVcpus (virConnectPtr conn, - const char *type); + const char *type); int virNodeGetInfo (virConnectPtr conn, - virNodeInfoPtr info); + virNodeInfoPtr info); char * virConnectGetCapabilities (virConnectPtr conn); unsigned long long virNodeGetFreeMemory (virConnectPtr conn); @@ -412,8 +412,8 @@ unsigned long long virNodeGetFreeMemory (virConnectPtr conn); * Gather list of running domains */ int virConnectListDomains (virConnectPtr conn, - int *ids, - int maxids); + int *ids, + int maxids); /* * Number of domains @@ -430,20 +430,20 @@ virConnectPtr virDomainGetConnect (virDomainPtr domain); * Domain creation and destruction */ virDomainPtr virDomainCreateLinux (virConnectPtr conn, - const char *xmlDesc, - unsigned int flags); + const char *xmlDesc, + unsigned int flags); virDomainPtr virDomainLookupByName (virConnectPtr conn, - const char *name); + const char *name); virDomainPtr virDomainLookupByID (virConnectPtr conn, - int id); + int id); virDomainPtr virDomainLookupByUUID (virConnectPtr conn, - const unsigned char *uuid); + const unsigned char *uuid); virDomainPtr virDomainLookupByUUIDString (virConnectPtr conn, - const char *uuid); + const char *uuid); int virDomainShutdown (virDomainPtr domain); int virDomainReboot (virDomainPtr domain, - unsigned int flags); + unsigned int flags); int virDomainDestroy (virDomainPtr domain); int virDomainFree (virDomainPtr domain); @@ -457,28 +457,28 @@ int virDomainResume (virDomainPtr domain); * Domain save/restore */ int virDomainSave (virDomainPtr domain, - const char *to); + const char *to); int virDomainRestore (virConnectPtr conn, - const char *from); + const char *from); /* * Domain core dump */ int virDomainCoreDump (virDomainPtr domain, - const char *to, - int flags); + const char *to, + int flags); /* * Domain runtime information */ int virDomainGetInfo (virDomainPtr domain, - virDomainInfoPtr info); + virDomainInfoPtr info); /* * Return scheduler type in effect 'sedf', 'credit', 'linux' */ char * virDomainGetSchedulerType(virDomainPtr domain, - int *nparams); + int *nparams); /* * Dynamic control of domains @@ -486,15 +486,15 @@ char * virDomainGetSchedulerType(virDomainPtr domain, const char * virDomainGetName (virDomainPtr domain); unsigned int virDomainGetID (virDomainPtr domain); int virDomainGetUUID (virDomainPtr domain, - unsigned char *uuid); + unsigned char *uuid); int virDomainGetUUIDString (virDomainPtr domain, - char *buf); + char *buf); char * virDomainGetOSType (virDomainPtr domain); unsigned long virDomainGetMaxMemory (virDomainPtr domain); int virDomainSetMaxMemory (virDomainPtr domain, - unsigned long memory); + unsigned long memory); int virDomainSetMemory (virDomainPtr domain, - unsigned long memory); + unsigned long memory); int virDomainGetMaxVcpus (virDomainPtr domain); /* @@ -512,34 +512,34 @@ typedef enum { } virDomainXMLFlags; char * virDomainGetXMLDesc (virDomainPtr domain, - int flags); + int flags); int virDomainBlockStats (virDomainPtr dom, - const char *path, - virDomainBlockStatsPtr stats, - size_t size); + const char *path, + virDomainBlockStatsPtr stats, + size_t size); int virDomainInterfaceStats (virDomainPtr dom, - const char *path, - virDomainInterfaceStatsPtr stats, - size_t size); + const char *path, + virDomainInterfaceStatsPtr stats, + size_t size); /* * defined but not running domains */ virDomainPtr virDomainDefineXML (virConnectPtr conn, - const char *xml); + const char *xml); int virDomainUndefine (virDomainPtr domain); int virConnectNumOfDefinedDomains (virConnectPtr conn); int virConnectListDefinedDomains (virConnectPtr conn, - char **const names, - int maxnames); + char **const names, + int maxnames); int virDomainCreate (virDomainPtr domain); int virDomainGetAutostart (virDomainPtr domain, - int *autostart); + int *autostart); int virDomainSetAutostart (virDomainPtr domain, - int autostart); + int autostart); /** * virVcpuInfo: structure for information about a virtual CPU in a domain. @@ -561,12 +561,12 @@ struct _virVcpuInfo { typedef virVcpuInfo *virVcpuInfoPtr; int virDomainSetVcpus (virDomainPtr domain, - unsigned int nvcpus); + unsigned int nvcpus); int virDomainPinVcpu (virDomainPtr domain, - unsigned int vcpu, - unsigned char *cpumap, - int maplen); + unsigned int vcpu, + unsigned char *cpumap, + int maplen); /** * VIR_USE_CPU: @@ -603,10 +603,10 @@ int virDomainPinVcpu (virDomainPtr domain, int virDomainGetVcpus (virDomainPtr domain, - virVcpuInfoPtr info, - int maxinfo, - unsigned char *cpumaps, - int maplen); + virVcpuInfoPtr info, + int maxinfo, + unsigned char *cpumaps, + int maplen); /** * VIR_CPU_USABLE: @@ -621,7 +621,7 @@ int virDomainGetVcpus (virDomainPtr domain, */ #define VIR_CPU_USABLE(cpumaps,maplen,vcpu,cpu) \ - (cpumaps[((vcpu)*(maplen))+((cpu)/8)] & (1<<((cpu)%8))) + (cpumaps[((vcpu)*(maplen))+((cpu)/8)] & (1<<((cpu)%8))) /** * VIR_COPY_CPUMAP: @@ -638,7 +638,7 @@ int virDomainGetVcpus (virDomainPtr domain, * later by virDomainPinVcpu() API. */ #define VIR_COPY_CPUMAP(cpumaps,maplen,vcpu,cpumap) \ - memcpy(cpumap, &(cpumaps[(vcpu)*(maplen)]), (maplen)) + memcpy(cpumap, &(cpumaps[(vcpu)*(maplen)]), (maplen)) /** @@ -661,9 +661,9 @@ int virDomainDetachDevice(virDomainPtr domain, const char *xml); */ int virNodeGetCellsFreeMemory(virConnectPtr conn, - unsigned long long *freeMems, - int startCell, - int maxCells); + unsigned long long *freeMems, + int startCell, + int maxCells); /* * Virtual Networks API @@ -694,38 +694,38 @@ virConnectPtr virNetworkGetConnect (virNetworkPtr network); */ int virConnectNumOfNetworks (virConnectPtr conn); int virConnectListNetworks (virConnectPtr conn, - char **const names, - int maxnames); + char **const names, + int maxnames); /* * List inactive networks */ int virConnectNumOfDefinedNetworks (virConnectPtr conn); int virConnectListDefinedNetworks (virConnectPtr conn, - char **const names, - int maxnames); + char **const names, + int maxnames); /* * Lookup network by name or uuid */ virNetworkPtr virNetworkLookupByName (virConnectPtr conn, - const char *name); + const char *name); virNetworkPtr virNetworkLookupByUUID (virConnectPtr conn, - const unsigned char *uuid); + const unsigned char *uuid); virNetworkPtr virNetworkLookupByUUIDString (virConnectPtr conn, - const char *uuid); + const char *uuid); /* * Create active transient network */ virNetworkPtr virNetworkCreateXML (virConnectPtr conn, - const char *xmlDesc); + const char *xmlDesc); /* * Define inactive persistent network */ virNetworkPtr virNetworkDefineXML (virConnectPtr conn, - const char *xmlDesc); + const char *xmlDesc); /* * Delete persistent network @@ -748,17 +748,17 @@ int virNetworkFree (virNetworkPtr network); */ const char* virNetworkGetName (virNetworkPtr network); int virNetworkGetUUID (virNetworkPtr network, - unsigned char *uuid); + unsigned char *uuid); int virNetworkGetUUIDString (virNetworkPtr network, - char *buf); + char *buf); char * virNetworkGetXMLDesc (virNetworkPtr network, - int flags); + int flags); char * virNetworkGetBridgeName (virNetworkPtr network); int virNetworkGetAutostart (virNetworkPtr network, - int *autostart); + int *autostart); int virNetworkSetAutostart (virNetworkPtr network, - int autostart); + int autostart); /** @@ -854,76 +854,76 @@ virConnectPtr virStoragePoolGetConnect (virStoragePoolPtr pool); */ int virConnectNumOfStoragePools (virConnectPtr conn); int virConnectListStoragePools (virConnectPtr conn, - char **const names, - int maxnames); + char **const names, + int maxnames); /* * List inactive storage pools */ int virConnectNumOfDefinedStoragePools(virConnectPtr conn); int virConnectListDefinedStoragePools(virConnectPtr conn, - char **const names, - int maxnames); + char **const names, + int maxnames); /* * Lookup pool by name or uuid */ virStoragePoolPtr virStoragePoolLookupByName (virConnectPtr conn, - const char *name); + const char *name); virStoragePoolPtr virStoragePoolLookupByUUID (virConnectPtr conn, - const unsigned char *uuid); + const unsigned char *uuid); virStoragePoolPtr virStoragePoolLookupByUUIDString(virConnectPtr conn, - const char *uuid); + const char *uuid); virStoragePoolPtr virStoragePoolLookupByVolume (virStorageVolPtr vol); /* * Creating/destroying pools */ virStoragePoolPtr virStoragePoolCreateXML (virConnectPtr conn, - const char *xmlDesc, - unsigned int flags); + const char *xmlDesc, + unsigned int flags); virStoragePoolPtr virStoragePoolDefineXML (virConnectPtr conn, - const char *xmlDesc, - unsigned int flags); + const char *xmlDesc, + unsigned int flags); int virStoragePoolBuild (virStoragePoolPtr pool, - unsigned int flags); + unsigned int flags); int virStoragePoolUndefine (virStoragePoolPtr pool); int virStoragePoolCreate (virStoragePoolPtr pool, - unsigned int flags); + unsigned int flags); int virStoragePoolDestroy (virStoragePoolPtr pool); int virStoragePoolDelete (virStoragePoolPtr pool, - unsigned int flags); + unsigned int flags); int virStoragePoolFree (virStoragePoolPtr pool); int virStoragePoolRefresh (virStoragePoolPtr pool, - unsigned int flags); + unsigned int flags); /* * StoragePool information */ const char* virStoragePoolGetName (virStoragePoolPtr pool); int virStoragePoolGetUUID (virStoragePoolPtr pool, - unsigned char *uuid); + unsigned char *uuid); int virStoragePoolGetUUIDString (virStoragePoolPtr pool, - char *buf); + char *buf); int virStoragePoolGetInfo (virStoragePoolPtr vol, - virStoragePoolInfoPtr info); + virStoragePoolInfoPtr info); char * virStoragePoolGetXMLDesc (virStoragePoolPtr pool, - unsigned int flags); + unsigned int flags); int virStoragePoolGetAutostart (virStoragePoolPtr pool, - int *autostart); + int *autostart); int virStoragePoolSetAutostart (virStoragePoolPtr pool, - int autostart); + int autostart); /* * List/lookup storage volumes within a pool */ int virStoragePoolNumOfVolumes (virStoragePoolPtr pool); int virStoragePoolListVolumes (virStoragePoolPtr pool, - char **const names, - int maxnames); + char **const names, + int maxnames); virConnectPtr virStorageVolGetConnect (virStorageVolPtr vol); @@ -931,27 +931,27 @@ virConnectPtr virStorageVolGetConnect (virStorageVolPtr vol); * Lookup volumes based on various attributes */ virStorageVolPtr virStorageVolLookupByName (virStoragePoolPtr pool, - const char *name); + const char *name); virStorageVolPtr virStorageVolLookupByKey (virConnectPtr conn, - const char *key); + const char *key); virStorageVolPtr virStorageVolLookupByPath (virConnectPtr conn, - const char *path); + const char *path); const char* virStorageVolGetName (virStorageVolPtr vol); const char* virStorageVolGetKey (virStorageVolPtr vol); virStorageVolPtr virStorageVolCreateXML (virStoragePoolPtr pool, - const char *xmldesc, - unsigned int flags); + const char *xmldesc, + unsigned int flags); int virStorageVolDelete (virStorageVolPtr vol, - unsigned int flags); + unsigned int flags); int virStorageVolFree (virStorageVolPtr vol); int virStorageVolGetInfo (virStorageVolPtr vol, - virStorageVolInfoPtr info); + virStorageVolInfoPtr info); char * virStorageVolGetXMLDesc (virStorageVolPtr pool, - unsigned int flags); + unsigned int flags); char * virStorageVolGetPath (virStorageVolPtr vol); diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in index 30b37dd94bb99e08fc495ea02c5947cbedd13664..4733f071be98cc4dbf400342724f208c5d809966 100644 --- a/include/libvirt/libvirt.h.in +++ b/include/libvirt/libvirt.h.in @@ -178,15 +178,15 @@ typedef virSchedParameter *virSchedParameterPtr; * Fetch scheduler parameters, caller allocates 'params' field of size 'nparams' */ int virDomainGetSchedulerParameters (virDomainPtr domain, - virSchedParameterPtr params, - int *nparams); + virSchedParameterPtr params, + int *nparams); /* * Change scheduler parameters */ int virDomainSetSchedulerParameters (virDomainPtr domain, - virSchedParameterPtr params, - int nparams); + virSchedParameterPtr params, + int nparams); /** * virDomainBlockStats: @@ -253,8 +253,8 @@ typedef enum { /* Domain migration. */ virDomainPtr virDomainMigrate (virDomainPtr domain, virConnectPtr dconn, - unsigned long flags, const char *dname, - const char *uri, unsigned long bandwidth); + unsigned long flags, const char *dname, + const char *uri, unsigned long bandwidth); /** * VIR_NODEINFO_MAXCPUS: @@ -328,8 +328,8 @@ typedef virConnectCredential *virConnectCredentialPtr; * Return 0 if all interactions were filled, or -1 upon error */ typedef int (*virConnectAuthCallbackPtr)(virConnectCredentialPtr cred, - unsigned int ncred, - void *cbdata); + unsigned int ncred, + void *cbdata); struct _virConnectAuth { int *credtype; /* List of supported virConnectCredentialType values */ @@ -375,8 +375,8 @@ extern virConnectAuthPtr virConnectAuthPtrDefault; #define LIBVIR_VERSION_NUMBER @LIBVIRT_VERSION_NUMBER@ int virGetVersion (unsigned long *libVer, - const char *type, - unsigned long *typeVer); + const char *type, + unsigned long *typeVer); /* * Connection and disconnections to the Hypervisor @@ -386,12 +386,12 @@ int virInitialize (void); virConnectPtr virConnectOpen (const char *name); virConnectPtr virConnectOpenReadOnly (const char *name); virConnectPtr virConnectOpenAuth (const char *name, - virConnectAuthPtr auth, - int flags); + virConnectAuthPtr auth, + int flags); int virConnectClose (virConnectPtr conn); const char * virConnectGetType (virConnectPtr conn); int virConnectGetVersion (virConnectPtr conn, - unsigned long *hvVer); + unsigned long *hvVer); char * virConnectGetHostname (virConnectPtr conn); char * virConnectGetURI (virConnectPtr conn); @@ -401,9 +401,9 @@ char * virConnectGetURI (virConnectPtr conn); */ int virConnectGetMaxVcpus (virConnectPtr conn, - const char *type); + const char *type); int virNodeGetInfo (virConnectPtr conn, - virNodeInfoPtr info); + virNodeInfoPtr info); char * virConnectGetCapabilities (virConnectPtr conn); unsigned long long virNodeGetFreeMemory (virConnectPtr conn); @@ -412,8 +412,8 @@ unsigned long long virNodeGetFreeMemory (virConnectPtr conn); * Gather list of running domains */ int virConnectListDomains (virConnectPtr conn, - int *ids, - int maxids); + int *ids, + int maxids); /* * Number of domains @@ -430,20 +430,20 @@ virConnectPtr virDomainGetConnect (virDomainPtr domain); * Domain creation and destruction */ virDomainPtr virDomainCreateLinux (virConnectPtr conn, - const char *xmlDesc, - unsigned int flags); + const char *xmlDesc, + unsigned int flags); virDomainPtr virDomainLookupByName (virConnectPtr conn, - const char *name); + const char *name); virDomainPtr virDomainLookupByID (virConnectPtr conn, - int id); + int id); virDomainPtr virDomainLookupByUUID (virConnectPtr conn, - const unsigned char *uuid); + const unsigned char *uuid); virDomainPtr virDomainLookupByUUIDString (virConnectPtr conn, - const char *uuid); + const char *uuid); int virDomainShutdown (virDomainPtr domain); int virDomainReboot (virDomainPtr domain, - unsigned int flags); + unsigned int flags); int virDomainDestroy (virDomainPtr domain); int virDomainFree (virDomainPtr domain); @@ -457,28 +457,28 @@ int virDomainResume (virDomainPtr domain); * Domain save/restore */ int virDomainSave (virDomainPtr domain, - const char *to); + const char *to); int virDomainRestore (virConnectPtr conn, - const char *from); + const char *from); /* * Domain core dump */ int virDomainCoreDump (virDomainPtr domain, - const char *to, - int flags); + const char *to, + int flags); /* * Domain runtime information */ int virDomainGetInfo (virDomainPtr domain, - virDomainInfoPtr info); + virDomainInfoPtr info); /* * Return scheduler type in effect 'sedf', 'credit', 'linux' */ char * virDomainGetSchedulerType(virDomainPtr domain, - int *nparams); + int *nparams); /* * Dynamic control of domains @@ -486,15 +486,15 @@ char * virDomainGetSchedulerType(virDomainPtr domain, const char * virDomainGetName (virDomainPtr domain); unsigned int virDomainGetID (virDomainPtr domain); int virDomainGetUUID (virDomainPtr domain, - unsigned char *uuid); + unsigned char *uuid); int virDomainGetUUIDString (virDomainPtr domain, - char *buf); + char *buf); char * virDomainGetOSType (virDomainPtr domain); unsigned long virDomainGetMaxMemory (virDomainPtr domain); int virDomainSetMaxMemory (virDomainPtr domain, - unsigned long memory); + unsigned long memory); int virDomainSetMemory (virDomainPtr domain, - unsigned long memory); + unsigned long memory); int virDomainGetMaxVcpus (virDomainPtr domain); /* @@ -512,34 +512,34 @@ typedef enum { } virDomainXMLFlags; char * virDomainGetXMLDesc (virDomainPtr domain, - int flags); + int flags); int virDomainBlockStats (virDomainPtr dom, - const char *path, - virDomainBlockStatsPtr stats, - size_t size); + const char *path, + virDomainBlockStatsPtr stats, + size_t size); int virDomainInterfaceStats (virDomainPtr dom, - const char *path, - virDomainInterfaceStatsPtr stats, - size_t size); + const char *path, + virDomainInterfaceStatsPtr stats, + size_t size); /* * defined but not running domains */ virDomainPtr virDomainDefineXML (virConnectPtr conn, - const char *xml); + const char *xml); int virDomainUndefine (virDomainPtr domain); int virConnectNumOfDefinedDomains (virConnectPtr conn); int virConnectListDefinedDomains (virConnectPtr conn, - char **const names, - int maxnames); + char **const names, + int maxnames); int virDomainCreate (virDomainPtr domain); int virDomainGetAutostart (virDomainPtr domain, - int *autostart); + int *autostart); int virDomainSetAutostart (virDomainPtr domain, - int autostart); + int autostart); /** * virVcpuInfo: structure for information about a virtual CPU in a domain. @@ -561,12 +561,12 @@ struct _virVcpuInfo { typedef virVcpuInfo *virVcpuInfoPtr; int virDomainSetVcpus (virDomainPtr domain, - unsigned int nvcpus); + unsigned int nvcpus); int virDomainPinVcpu (virDomainPtr domain, - unsigned int vcpu, - unsigned char *cpumap, - int maplen); + unsigned int vcpu, + unsigned char *cpumap, + int maplen); /** * VIR_USE_CPU: @@ -603,10 +603,10 @@ int virDomainPinVcpu (virDomainPtr domain, int virDomainGetVcpus (virDomainPtr domain, - virVcpuInfoPtr info, - int maxinfo, - unsigned char *cpumaps, - int maplen); + virVcpuInfoPtr info, + int maxinfo, + unsigned char *cpumaps, + int maplen); /** * VIR_CPU_USABLE: @@ -621,7 +621,7 @@ int virDomainGetVcpus (virDomainPtr domain, */ #define VIR_CPU_USABLE(cpumaps,maplen,vcpu,cpu) \ - (cpumaps[((vcpu)*(maplen))+((cpu)/8)] & (1<<((cpu)%8))) + (cpumaps[((vcpu)*(maplen))+((cpu)/8)] & (1<<((cpu)%8))) /** * VIR_COPY_CPUMAP: @@ -638,7 +638,7 @@ int virDomainGetVcpus (virDomainPtr domain, * later by virDomainPinVcpu() API. */ #define VIR_COPY_CPUMAP(cpumaps,maplen,vcpu,cpumap) \ - memcpy(cpumap, &(cpumaps[(vcpu)*(maplen)]), (maplen)) + memcpy(cpumap, &(cpumaps[(vcpu)*(maplen)]), (maplen)) /** @@ -661,9 +661,9 @@ int virDomainDetachDevice(virDomainPtr domain, const char *xml); */ int virNodeGetCellsFreeMemory(virConnectPtr conn, - unsigned long long *freeMems, - int startCell, - int maxCells); + unsigned long long *freeMems, + int startCell, + int maxCells); /* * Virtual Networks API @@ -694,38 +694,38 @@ virConnectPtr virNetworkGetConnect (virNetworkPtr network); */ int virConnectNumOfNetworks (virConnectPtr conn); int virConnectListNetworks (virConnectPtr conn, - char **const names, - int maxnames); + char **const names, + int maxnames); /* * List inactive networks */ int virConnectNumOfDefinedNetworks (virConnectPtr conn); int virConnectListDefinedNetworks (virConnectPtr conn, - char **const names, - int maxnames); + char **const names, + int maxnames); /* * Lookup network by name or uuid */ virNetworkPtr virNetworkLookupByName (virConnectPtr conn, - const char *name); + const char *name); virNetworkPtr virNetworkLookupByUUID (virConnectPtr conn, - const unsigned char *uuid); + const unsigned char *uuid); virNetworkPtr virNetworkLookupByUUIDString (virConnectPtr conn, - const char *uuid); + const char *uuid); /* * Create active transient network */ virNetworkPtr virNetworkCreateXML (virConnectPtr conn, - const char *xmlDesc); + const char *xmlDesc); /* * Define inactive persistent network */ virNetworkPtr virNetworkDefineXML (virConnectPtr conn, - const char *xmlDesc); + const char *xmlDesc); /* * Delete persistent network @@ -748,17 +748,17 @@ int virNetworkFree (virNetworkPtr network); */ const char* virNetworkGetName (virNetworkPtr network); int virNetworkGetUUID (virNetworkPtr network, - unsigned char *uuid); + unsigned char *uuid); int virNetworkGetUUIDString (virNetworkPtr network, - char *buf); + char *buf); char * virNetworkGetXMLDesc (virNetworkPtr network, - int flags); + int flags); char * virNetworkGetBridgeName (virNetworkPtr network); int virNetworkGetAutostart (virNetworkPtr network, - int *autostart); + int *autostart); int virNetworkSetAutostart (virNetworkPtr network, - int autostart); + int autostart); /** @@ -854,76 +854,76 @@ virConnectPtr virStoragePoolGetConnect (virStoragePoolPtr pool); */ int virConnectNumOfStoragePools (virConnectPtr conn); int virConnectListStoragePools (virConnectPtr conn, - char **const names, - int maxnames); + char **const names, + int maxnames); /* * List inactive storage pools */ int virConnectNumOfDefinedStoragePools(virConnectPtr conn); int virConnectListDefinedStoragePools(virConnectPtr conn, - char **const names, - int maxnames); + char **const names, + int maxnames); /* * Lookup pool by name or uuid */ virStoragePoolPtr virStoragePoolLookupByName (virConnectPtr conn, - const char *name); + const char *name); virStoragePoolPtr virStoragePoolLookupByUUID (virConnectPtr conn, - const unsigned char *uuid); + const unsigned char *uuid); virStoragePoolPtr virStoragePoolLookupByUUIDString(virConnectPtr conn, - const char *uuid); + const char *uuid); virStoragePoolPtr virStoragePoolLookupByVolume (virStorageVolPtr vol); /* * Creating/destroying pools */ virStoragePoolPtr virStoragePoolCreateXML (virConnectPtr conn, - const char *xmlDesc, - unsigned int flags); + const char *xmlDesc, + unsigned int flags); virStoragePoolPtr virStoragePoolDefineXML (virConnectPtr conn, - const char *xmlDesc, - unsigned int flags); + const char *xmlDesc, + unsigned int flags); int virStoragePoolBuild (virStoragePoolPtr pool, - unsigned int flags); + unsigned int flags); int virStoragePoolUndefine (virStoragePoolPtr pool); int virStoragePoolCreate (virStoragePoolPtr pool, - unsigned int flags); + unsigned int flags); int virStoragePoolDestroy (virStoragePoolPtr pool); int virStoragePoolDelete (virStoragePoolPtr pool, - unsigned int flags); + unsigned int flags); int virStoragePoolFree (virStoragePoolPtr pool); int virStoragePoolRefresh (virStoragePoolPtr pool, - unsigned int flags); + unsigned int flags); /* * StoragePool information */ const char* virStoragePoolGetName (virStoragePoolPtr pool); int virStoragePoolGetUUID (virStoragePoolPtr pool, - unsigned char *uuid); + unsigned char *uuid); int virStoragePoolGetUUIDString (virStoragePoolPtr pool, - char *buf); + char *buf); int virStoragePoolGetInfo (virStoragePoolPtr vol, - virStoragePoolInfoPtr info); + virStoragePoolInfoPtr info); char * virStoragePoolGetXMLDesc (virStoragePoolPtr pool, - unsigned int flags); + unsigned int flags); int virStoragePoolGetAutostart (virStoragePoolPtr pool, - int *autostart); + int *autostart); int virStoragePoolSetAutostart (virStoragePoolPtr pool, - int autostart); + int autostart); /* * List/lookup storage volumes within a pool */ int virStoragePoolNumOfVolumes (virStoragePoolPtr pool); int virStoragePoolListVolumes (virStoragePoolPtr pool, - char **const names, - int maxnames); + char **const names, + int maxnames); virConnectPtr virStorageVolGetConnect (virStorageVolPtr vol); @@ -931,27 +931,27 @@ virConnectPtr virStorageVolGetConnect (virStorageVolPtr vol); * Lookup volumes based on various attributes */ virStorageVolPtr virStorageVolLookupByName (virStoragePoolPtr pool, - const char *name); + const char *name); virStorageVolPtr virStorageVolLookupByKey (virConnectPtr conn, - const char *key); + const char *key); virStorageVolPtr virStorageVolLookupByPath (virConnectPtr conn, - const char *path); + const char *path); const char* virStorageVolGetName (virStorageVolPtr vol); const char* virStorageVolGetKey (virStorageVolPtr vol); virStorageVolPtr virStorageVolCreateXML (virStoragePoolPtr pool, - const char *xmldesc, - unsigned int flags); + const char *xmldesc, + unsigned int flags); int virStorageVolDelete (virStorageVolPtr vol, - unsigned int flags); + unsigned int flags); int virStorageVolFree (virStorageVolPtr vol); int virStorageVolGetInfo (virStorageVolPtr vol, - virStorageVolInfoPtr info); + virStorageVolInfoPtr info); char * virStorageVolGetXMLDesc (virStorageVolPtr pool, - unsigned int flags); + unsigned int flags); char * virStorageVolGetPath (virStorageVolPtr vol); diff --git a/include/libvirt/virterror.h b/include/libvirt/virterror.h index 460b42f383cb10374d7f2547c8e5c26c0bfa1880..75ee5f8cb3153f34970ac7eebd434fdaf148d14c 100644 --- a/include/libvirt/virterror.h +++ b/include/libvirt/virterror.h @@ -170,12 +170,12 @@ int virCopyLastError (virErrorPtr to); void virDefaultErrorFunc (virErrorPtr err); void virSetErrorFunc (void *userData, - virErrorFunc handler); + virErrorFunc handler); void virConnSetErrorFunc (virConnectPtr conn, - void *userData, - virErrorFunc handler); + void *userData, + virErrorFunc handler); int virConnCopyLastError (virConnectPtr conn, - virErrorPtr to); + virErrorPtr to); #ifdef __cplusplus } #endif diff --git a/proxy/libvirt_proxy.c b/proxy/libvirt_proxy.c index 75504ef90e6926f826e02563994c7dde9791f107..93b74ab350e1d9f2a107d6f403bd9a488b1864e3 100644 --- a/proxy/libvirt_proxy.c +++ b/proxy/libvirt_proxy.c @@ -93,10 +93,10 @@ proxyInitXen(void) { return(-1); } else { ret = xenHypervisorGetVersion(conn, &xenVersion); - if (ret != 0) { - fprintf(stderr, "Failed to get Xen hypervisor version\n"); - return(-1); - } + if (ret != 0) { + fprintf(stderr, "Failed to get Xen hypervisor version\n"); + return(-1); + } } ret = xenDaemonOpen_unix(conn, "/var/lib/xend/xend-socket"); if (ret < 0) { @@ -110,12 +110,12 @@ proxyInitXen(void) { } ret = xenDaemonGetVersion(conn, &xenVersion2); if (ret != 0) { - fprintf(stderr, "Failed to get Xen daemon version\n"); - return(-1); + fprintf(stderr, "Failed to get Xen daemon version\n"); + return(-1); } if (debug) fprintf(stderr, "Connected to hypervisor %lu and daemon %lu\n", - xenVersion, xenVersion2); + xenVersion, xenVersion2); if (xenVersion2 > xenVersion) xenVersion = xenVersion2; return(0); @@ -168,7 +168,7 @@ proxyListenUnixSocket(const char *path) { fd = socket(PF_UNIX, SOCK_STREAM, 0); if (fd < 0) { fprintf(stderr, "Failed to create unix socket"); - return(-1); + return(-1); } /* @@ -185,13 +185,13 @@ proxyListenUnixSocket(const char *path) { */ if (bind(fd, (struct sockaddr *) &addr, sizeof(addr)) < 0) { fprintf(stderr, "Failed to bind to socket %s\n", path); - close(fd); - return (-1); + close(fd); + return (-1); } if (listen(fd, 30 /* backlog */ ) < 0) { fprintf(stderr, "Failed to listen to socket %s\n", path); - close(fd); - return (-1); + close(fd); + return (-1); } if (debug > 0) @@ -221,28 +221,28 @@ retry: client = accept(pollInfos[0].fd, &client_addr, &client_addrlen); if (client < 0) { if (errno == EINTR) { - if (debug > 0) - fprintf(stderr, "accept connection on socket %d interrupted\n", - pollInfos[0].fd); - goto retry; - } + if (debug > 0) + fprintf(stderr, "accept connection on socket %d interrupted\n", + pollInfos[0].fd); + goto retry; + } fprintf(stderr, "Failed to accept incoming connection on socket %d\n", - pollInfos[0].fd); - done = 1; - return(-1); + pollInfos[0].fd); + done = 1; + return(-1); } if (nbClients >= MAX_CLIENT) { fprintf(stderr, "Too many client registered\n"); - close(client); - return(-1); + close(client); + return(-1); } nbClients++; pollInfos[nbClients].fd = client; pollInfos[nbClients].events = POLLIN | POLLERR | POLLHUP | POLLNVAL; if (debug > 0) - fprintf(stderr, "accept connection on socket %d for client %d\n", - client, nbClients); + fprintf(stderr, "accept connection on socket %d for client %d\n", + client, nbClients); return(client); } @@ -266,14 +266,14 @@ proxyCloseClientSocket(int nr) { ret = close(pollInfos[nr].fd); if (ret != 0) - fprintf(stderr, "Failed to close socket %d from client %d\n", - pollInfos[nr].fd, nr); + fprintf(stderr, "Failed to close socket %d from client %d\n", + pollInfos[nr].fd, nr); else if (debug > 0) - fprintf(stderr, "Closed socket %d from client %d\n", - pollInfos[nr].fd, nr); + fprintf(stderr, "Closed socket %d from client %d\n", + pollInfos[nr].fd, nr); if (nr < nbClients) { memmove(&pollInfos[nr], &pollInfos[nr + 1], - (nbClients - nr) * sizeof(pollInfos[0])); + (nbClients - nr) * sizeof(pollInfos[0])); } nbClients--; return(ret); @@ -290,12 +290,12 @@ proxyCloseClientSockets(void) { for (i = 1;i <= nbClients;i++) { ret = close(pollInfos[i].fd); - if (ret != 0) - fprintf(stderr, "Failed to close socket %d from client %d\n", - pollInfos[i].fd, i); - else if (debug > 0) - fprintf(stderr, "Closed socket %d from client %d\n", - pollInfos[i].fd, i); + if (ret != 0) + fprintf(stderr, "Failed to close socket %d from client %d\n", + pollInfos[i].fd, i); + else if (debug > 0) + fprintf(stderr, "Closed socket %d from client %d\n", + pollInfos[i].fd, i); } nbClients = 0; } @@ -316,37 +316,37 @@ proxyWriteClientSocket(int nr, virProxyPacketPtr req) { if ((nr <= 0) || (nr > nbClients) || (req == NULL) || (req->len < sizeof(virProxyPacket)) || - (req->len > sizeof(virProxyFullPacket)) || - (pollInfos[nr].fd < 0)) { - fprintf(stderr, "write to client %d in error", nr); - proxyCloseClientSocket(nr); - return(-1); + (req->len > sizeof(virProxyFullPacket)) || + (pollInfos[nr].fd < 0)) { + fprintf(stderr, "write to client %d in error", nr); + proxyCloseClientSocket(nr); + return(-1); } ret = safewrite(pollInfos[nr].fd, (char *) req, req->len); if (ret < 0) { fprintf(stderr, "write %d bytes to socket %d from client %d failed\n", - req->len, pollInfos[nr].fd, nr); + req->len, pollInfos[nr].fd, nr); proxyCloseClientSocket(nr); return(-1); } if (ret == 0) { - if (debug) - fprintf(stderr, "end of stream from client %d on socket %d\n", - nr, pollInfos[nr].fd); - proxyCloseClientSocket(nr); - return(-1); + if (debug) + fprintf(stderr, "end of stream from client %d on socket %d\n", + nr, pollInfos[nr].fd); + proxyCloseClientSocket(nr); + return(-1); } if (ret != req->len) { fprintf(stderr, "write %d of %d bytes to socket %d from client %d\n", - ret, req->len, pollInfos[nr].fd, nr); - proxyCloseClientSocket(nr); - return(-1); + ret, req->len, pollInfos[nr].fd, nr); + proxyCloseClientSocket(nr); + return(-1); } if (debug) fprintf(stderr, "wrote %d bytes to client %d on socket %d\n", - ret, nr, pollInfos[nr].fd); + ret, nr, pollInfos[nr].fd); return(0); } @@ -367,32 +367,32 @@ retry: ret = read(pollInfos[nr].fd, req, sizeof(virProxyPacket)); if (ret < 0) { if (errno == EINTR) { - if (debug > 0) - fprintf(stderr, "read socket %d from client %d interrupted\n", - pollInfos[nr].fd, nr); - goto retry; - } + if (debug > 0) + fprintf(stderr, "read socket %d from client %d interrupted\n", + pollInfos[nr].fd, nr); + goto retry; + } fprintf(stderr, "Failed to read socket %d from client %d\n", - pollInfos[nr].fd, nr); - proxyCloseClientSocket(nr); - return(-1); + pollInfos[nr].fd, nr); + proxyCloseClientSocket(nr); + return(-1); } if (ret == 0) { - if (debug) - fprintf(stderr, "end of stream from client %d on socket %d\n", - nr, pollInfos[nr].fd); - proxyCloseClientSocket(nr); - return(-1); + if (debug) + fprintf(stderr, "end of stream from client %d on socket %d\n", + nr, pollInfos[nr].fd); + proxyCloseClientSocket(nr); + return(-1); } if (debug) fprintf(stderr, "read %d bytes from client %d on socket %d\n", - ret, nr, pollInfos[nr].fd); + ret, nr, pollInfos[nr].fd); if ((req->version != PROXY_PROTO_VERSION) || (req->len < sizeof(virProxyPacket)) || - (req->len > sizeof(virProxyFullPacket))) - goto comm_error; + (req->len > sizeof(virProxyFullPacket))) + goto comm_error; if (debug) @@ -404,195 +404,195 @@ retry: */ if (req->len > ret) { int total, extra; - char *base = (char *) &request; + char *base = (char *) &request; total = ret; - while (total < req->len) { - extra = req->len - total; + while (total < req->len) { + extra = req->len - total; retry2: - ret = read(pollInfos[nr].fd, base + total, extra); - if (ret < 0) { - if (errno == EINTR) { - if (debug > 0) - fprintf(stderr, - "read socket %d from client %d interrupted\n", - pollInfos[nr].fd, nr); - goto retry2; - } - fprintf(stderr, "Failed to read socket %d from client %d\n", - pollInfos[nr].fd, nr); - proxyCloseClientSocket(nr); - return(-1); - } - if (ret == 0) { - if (debug) - fprintf(stderr, - "end of stream from client %d on socket %d\n", - nr, pollInfos[nr].fd); - proxyCloseClientSocket(nr); - return(-1); - } - total += ret; - } + ret = read(pollInfos[nr].fd, base + total, extra); + if (ret < 0) { + if (errno == EINTR) { + if (debug > 0) + fprintf(stderr, + "read socket %d from client %d interrupted\n", + pollInfos[nr].fd, nr); + goto retry2; + } + fprintf(stderr, "Failed to read socket %d from client %d\n", + pollInfos[nr].fd, nr); + proxyCloseClientSocket(nr); + return(-1); + } + if (ret == 0) { + if (debug) + fprintf(stderr, + "end of stream from client %d on socket %d\n", + nr, pollInfos[nr].fd); + proxyCloseClientSocket(nr); + return(-1); + } + total += ret; + } } switch (req->command) { - case VIR_PROXY_NONE: - if (req->len != sizeof(virProxyPacket)) - goto comm_error; - break; - case VIR_PROXY_VERSION: - if (req->len != sizeof(virProxyPacket)) - goto comm_error; - req->data.larg = xenVersion; - break; - case VIR_PROXY_LIST: { - int maxids; - - if (req->len != sizeof(virProxyPacket)) - goto comm_error; - maxids = sizeof(request.extra.arg) / sizeof(int); - ret = xenHypervisorListDomains(conn, &request.extra.arg[0], - maxids); - if (ret < 0) { - req->len = sizeof(virProxyPacket); - req->data.arg = 0; - } else { - req->len = sizeof(virProxyPacket) + ret * sizeof(int); - req->data.arg = ret; - } - break; - } - case VIR_PROXY_NUM_DOMAIN: - if (req->len != sizeof(virProxyPacket)) - goto comm_error; - req->data.arg = xenHypervisorNumOfDomains(conn); - break; - case VIR_PROXY_MAX_MEMORY: - if (req->len != sizeof(virProxyPacket)) - goto comm_error; - req->data.larg = xenHypervisorGetDomMaxMemory(conn, req->data.arg); - break; - case VIR_PROXY_DOMAIN_INFO: - if (req->len != sizeof(virProxyPacket)) - goto comm_error; - memset(&request.extra.dinfo, 0, sizeof(virDomainInfo)); - ret = xenHypervisorGetDomInfo(conn, req->data.arg, - &request.extra.dinfo); - if (ret < 0) { - req->data.arg = -1; - } else { - req->len += sizeof(virDomainInfo); - } - break; - case VIR_PROXY_LOOKUP_ID: { - char *name = NULL; - unsigned char uuid[VIR_UUID_BUFLEN]; - int len; - - if (req->len != sizeof(virProxyPacket)) - goto comm_error; - - if (xenDaemonDomainLookupByID(conn, req->data.arg, &name, uuid) < 0) { + case VIR_PROXY_NONE: + if (req->len != sizeof(virProxyPacket)) + goto comm_error; + break; + case VIR_PROXY_VERSION: + if (req->len != sizeof(virProxyPacket)) + goto comm_error; + req->data.larg = xenVersion; + break; + case VIR_PROXY_LIST: { + int maxids; + + if (req->len != sizeof(virProxyPacket)) + goto comm_error; + maxids = sizeof(request.extra.arg) / sizeof(int); + ret = xenHypervisorListDomains(conn, &request.extra.arg[0], + maxids); + if (ret < 0) { + req->len = sizeof(virProxyPacket); + req->data.arg = 0; + } else { + req->len = sizeof(virProxyPacket) + ret * sizeof(int); + req->data.arg = ret; + } + break; + } + case VIR_PROXY_NUM_DOMAIN: + if (req->len != sizeof(virProxyPacket)) + goto comm_error; + req->data.arg = xenHypervisorNumOfDomains(conn); + break; + case VIR_PROXY_MAX_MEMORY: + if (req->len != sizeof(virProxyPacket)) + goto comm_error; + req->data.larg = xenHypervisorGetDomMaxMemory(conn, req->data.arg); + break; + case VIR_PROXY_DOMAIN_INFO: + if (req->len != sizeof(virProxyPacket)) + goto comm_error; + memset(&request.extra.dinfo, 0, sizeof(virDomainInfo)); + ret = xenHypervisorGetDomInfo(conn, req->data.arg, + &request.extra.dinfo); + if (ret < 0) { req->data.arg = -1; } else { - len = strlen(name); - if (len > 1000) { - len = 1000; - name[1000] = 0; - } - req->len += VIR_UUID_BUFLEN + len + 1; - memcpy(&request.extra.str[0], uuid, VIR_UUID_BUFLEN); - strcpy(&request.extra.str[VIR_UUID_BUFLEN], name); - } + req->len += sizeof(virDomainInfo); + } + break; + case VIR_PROXY_LOOKUP_ID: { + char *name = NULL; + unsigned char uuid[VIR_UUID_BUFLEN]; + int len; + + if (req->len != sizeof(virProxyPacket)) + goto comm_error; + + if (xenDaemonDomainLookupByID(conn, req->data.arg, &name, uuid) < 0) { + req->data.arg = -1; + } else { + len = strlen(name); + if (len > 1000) { + len = 1000; + name[1000] = 0; + } + req->len += VIR_UUID_BUFLEN + len + 1; + memcpy(&request.extra.str[0], uuid, VIR_UUID_BUFLEN); + strcpy(&request.extra.str[VIR_UUID_BUFLEN], name); + } free(name); - break; - } - case VIR_PROXY_LOOKUP_UUID: { - char **names; - char **tmp; - int ident, len; - char *name = NULL; - unsigned char uuid[VIR_UUID_BUFLEN]; - - if (req->len != sizeof(virProxyPacket) + VIR_UUID_BUFLEN) - goto comm_error; - - /* - * Xend API forces to collect the full domain list by names, and + break; + } + case VIR_PROXY_LOOKUP_UUID: { + char **names; + char **tmp; + int ident, len; + char *name = NULL; + unsigned char uuid[VIR_UUID_BUFLEN]; + + if (req->len != sizeof(virProxyPacket) + VIR_UUID_BUFLEN) + goto comm_error; + + /* + * Xend API forces to collect the full domain list by names, and * then query each of them until the id is found - */ - names = xenDaemonListDomainsOld(conn); - tmp = names; - - if (names != NULL) { - while (*tmp != NULL) { - ident = xenDaemonDomainLookupByName_ids(conn, *tmp, &uuid[0]); - if (!memcmp(uuid, &request.extra.str[0], VIR_UUID_BUFLEN)) { - name = *tmp; - break; - } - tmp++; - } - } + */ + names = xenDaemonListDomainsOld(conn); + tmp = names; + + if (names != NULL) { + while (*tmp != NULL) { + ident = xenDaemonDomainLookupByName_ids(conn, *tmp, &uuid[0]); + if (!memcmp(uuid, &request.extra.str[0], VIR_UUID_BUFLEN)) { + name = *tmp; + break; + } + tmp++; + } + } if (name == NULL) { - /* not found */ + /* not found */ req->data.arg = -1; - req->len = sizeof(virProxyPacket); + req->len = sizeof(virProxyPacket); } else { - len = strlen(name); - if (len > 1000) { - len = 1000; - name[1000] = 0; - } - req->len = sizeof(virProxyPacket) + len + 1; - strcpy(&request.extra.str[0], name); + len = strlen(name); + if (len > 1000) { + len = 1000; + name[1000] = 0; + } + req->len = sizeof(virProxyPacket) + len + 1; + strcpy(&request.extra.str[0], name); req->data.arg = ident; - } - free(names); - break; - } - case VIR_PROXY_LOOKUP_NAME: { - int ident; - unsigned char uuid[VIR_UUID_BUFLEN]; - - if (req->len > sizeof(virProxyPacket) + 1000) - goto comm_error; - - ident = xenDaemonDomainLookupByName_ids(conn, - &request.extra.str[0], &uuid[0]); - if (ident < 0) { - /* not found */ + } + free(names); + break; + } + case VIR_PROXY_LOOKUP_NAME: { + int ident; + unsigned char uuid[VIR_UUID_BUFLEN]; + + if (req->len > sizeof(virProxyPacket) + 1000) + goto comm_error; + + ident = xenDaemonDomainLookupByName_ids(conn, + &request.extra.str[0], &uuid[0]); + if (ident < 0) { + /* not found */ req->data.arg = -1; - req->len = sizeof(virProxyPacket); - } else { - req->len = sizeof(virProxyPacket) + VIR_UUID_BUFLEN; - memcpy(&request.extra.str[0], uuid, VIR_UUID_BUFLEN); - req->data.arg = ident; - } - break; - } - case VIR_PROXY_NODE_INFO: - if (req->len != sizeof(virProxyPacket)) - goto comm_error; - - /* - * Hum, could we expect those information to be unmutable and - * cache them ? Since it's probably an unfrequent call better - * not make assumption and do the xend RPC each call. - */ - ret = xenDaemonNodeGetInfo(conn, &request.extra.ninfo); - if (ret < 0) { + req->len = sizeof(virProxyPacket); + } else { + req->len = sizeof(virProxyPacket) + VIR_UUID_BUFLEN; + memcpy(&request.extra.str[0], uuid, VIR_UUID_BUFLEN); + req->data.arg = ident; + } + break; + } + case VIR_PROXY_NODE_INFO: + if (req->len != sizeof(virProxyPacket)) + goto comm_error; + + /* + * Hum, could we expect those information to be unmutable and + * cache them ? Since it's probably an unfrequent call better + * not make assumption and do the xend RPC each call. + */ + ret = xenDaemonNodeGetInfo(conn, &request.extra.ninfo); + if (ret < 0) { req->data.arg = -1; - req->len = sizeof(virProxyPacket); - } else { + req->len = sizeof(virProxyPacket); + } else { req->data.arg = 0; - req->len = sizeof(virProxyPacket) + sizeof(virNodeInfo); - } - break; + req->len = sizeof(virProxyPacket) + sizeof(virNodeInfo); + } + break; - case VIR_PROXY_GET_CAPABILITIES: - if (req->len != sizeof(virProxyPacket)) - goto comm_error; + case VIR_PROXY_GET_CAPABILITIES: + if (req->len != sizeof(virProxyPacket)) + goto comm_error; xml = xenHypervisorGetCapabilities (conn); if (!xml) { @@ -612,21 +612,21 @@ retry2: } break; - case VIR_PROXY_DOMAIN_XML: - if (req->len != sizeof(virProxyPacket)) - goto comm_error; + case VIR_PROXY_DOMAIN_XML: + if (req->len != sizeof(virProxyPacket)) + goto comm_error; /* - * Ideally we should get the CPUs used by the domain - * but that information is really node specific and it - * rather hard to get from that code path. So proxy - * users won't see CPU pinning (last NULL arg) - */ - xml = xenDaemonDomainDumpXMLByID(conn, request.data.arg, 0, NULL); + * Ideally we should get the CPUs used by the domain + * but that information is really node specific and it + * rather hard to get from that code path. So proxy + * users won't see CPU pinning (last NULL arg) + */ + xml = xenDaemonDomainDumpXMLByID(conn, request.data.arg, 0, NULL); if (!xml) { req->data.arg = -1; req->len = sizeof(virProxyPacket); - } else { + } else { int xmllen = strlen(xml); if (xmllen > (int) sizeof(request.extra.str)) { req->data.arg = -2; @@ -637,17 +637,17 @@ retry2: req->len = sizeof(virProxyPacket) + xmllen; } free(xml); - } - break; - case VIR_PROXY_DOMAIN_OSTYPE: - if (req->len != sizeof(virProxyPacket)) - goto comm_error; + } + break; + case VIR_PROXY_DOMAIN_OSTYPE: + if (req->len != sizeof(virProxyPacket)) + goto comm_error; - ostype = xenStoreDomainGetOSTypeID(conn, request.data.arg); + ostype = xenStoreDomainGetOSTypeID(conn, request.data.arg); if (!ostype) { req->data.arg = -1; req->len = sizeof(virProxyPacket); - } else { + } else { int ostypelen = strlen(ostype); if (ostypelen > (int) sizeof(request.extra.str)) { req->data.arg = -2; @@ -658,17 +658,17 @@ retry2: req->len = sizeof(virProxyPacket) + ostypelen; } free(ostype); - } - break; - default: - goto comm_error; + } + break; + default: + goto comm_error; } ret = proxyWriteClientSocket(nr, req); return(ret); comm_error: fprintf(stderr, - "Communication error with client %d: malformed packet\n", nr); + "Communication error with client %d: malformed packet\n", nr); proxyCloseClientSocket(nr); return(-1); } @@ -691,59 +691,59 @@ proxyProcessRequests(void) { while (!done) { /* - * wait for requests, with a one second timeout - */ + * wait for requests, with a one second timeout + */ ret = poll(&pollInfos[0], nbClients + 1, 1000); - if (ret == 0) { /* timeout */ - if ((nbClients == 0) && (persist == 0)) { - exit_timeout--; - if (exit_timeout == 0) { - done = 1; - if (debug > 0) { - fprintf(stderr, "Exitting after 30s without clients\n"); - } - } - } else - exit_timeout = 30; - if (debug > 1) - fprintf(stderr, "poll timeout\n"); - continue; - } else if (ret < 0) { - if (errno == EINTR) { - if (debug > 0) - fprintf(stderr, "poll syscall interrupted\n"); - continue; - } - fprintf(stderr, "poll syscall failed\n"); - break; - } - /* - * there have been I/O to process - */ - exit_timeout = 30; - if (pollInfos[0].revents != 0) { - if (pollInfos[0].revents & POLLIN) { - proxyAcceptClientSocket(); - } else { - fprintf(stderr, "Got an error %d on incoming socket %d\n", - pollInfos[0].revents, pollInfos[0].fd); - break; - } - } - - /* - * process the clients in reverse order since on error or disconnect - * pollInfos is compacted to remove the given client. - */ - for (i = nbClients;i > 0;i--) { - if (pollInfos[i].revents & POLLIN) { - proxyReadClientSocket(i); - } else if (pollInfos[i].revents != 0) { - fprintf(stderr, "Got an error %d on client %d socket %d\n", - pollInfos[i].revents, i, pollInfos[i].fd); - proxyCloseClientSocket(i); - } - } + if (ret == 0) { /* timeout */ + if ((nbClients == 0) && (persist == 0)) { + exit_timeout--; + if (exit_timeout == 0) { + done = 1; + if (debug > 0) { + fprintf(stderr, "Exitting after 30s without clients\n"); + } + } + } else + exit_timeout = 30; + if (debug > 1) + fprintf(stderr, "poll timeout\n"); + continue; + } else if (ret < 0) { + if (errno == EINTR) { + if (debug > 0) + fprintf(stderr, "poll syscall interrupted\n"); + continue; + } + fprintf(stderr, "poll syscall failed\n"); + break; + } + /* + * there have been I/O to process + */ + exit_timeout = 30; + if (pollInfos[0].revents != 0) { + if (pollInfos[0].revents & POLLIN) { + proxyAcceptClientSocket(); + } else { + fprintf(stderr, "Got an error %d on incoming socket %d\n", + pollInfos[0].revents, pollInfos[0].fd); + break; + } + } + + /* + * process the clients in reverse order since on error or disconnect + * pollInfos is compacted to remove the given client. + */ + for (i = nbClients;i > 0;i--) { + if (pollInfos[i].revents & POLLIN) { + proxyReadClientSocket(i); + } else if (pollInfos[i].revents != 0) { + fprintf(stderr, "Got an error %d on client %d socket %d\n", + pollInfos[i].revents, i, pollInfos[i].fd); + proxyCloseClientSocket(i); + } + } } } @@ -758,9 +758,9 @@ proxyProcessRequests(void) { static void proxyMainLoop(void) { while (! done) { - if (proxyListenUnixSocket(PROXY_SOCKET_PATH) < 0) - break; - proxyProcessRequests(); + if (proxyListenUnixSocket(PROXY_SOCKET_PATH) < 0) + break; + proxyProcessRequests(); } proxyCloseClientSockets(); } @@ -790,32 +790,32 @@ int main(int argc, char **argv) { if (!setlocale(LC_ALL, "")) { perror("setlocale"); - return -1; + return -1; } if (!bindtextdomain(GETTEXT_PACKAGE, LOCALEBASEDIR)) { perror("bindtextdomain"); - return -1; + return -1; } if (!textdomain(GETTEXT_PACKAGE)) { perror("textdomain"); - return -1; + return -1; } for (i = 1; i < argc; i++) { if (!strcmp(argv[i], "-v")) { - debug++; + debug++; } else if (!strcmp(argv[i], "-no-timeout")) { - persist = 1; - } else { - usage(argv[0]); - exit(1); - } + persist = 1; + } else { + usage(argv[0]); + exit(1); + } } if (geteuid() != 0) { fprintf(stderr, "%s must be run as root or suid\n", argv[0]); - /* exit(1); */ + /* exit(1); */ } /* @@ -832,7 +832,7 @@ int main(int argc, char **argv) { if (proxyListenUnixSocket(PROXY_SOCKET_PATH) < 0) exit(0); if (proxyInitXen() == 0) - proxyMainLoop(); + proxyMainLoop(); sleep(1); proxyCloseUnixSocket(); exit(0); diff --git a/python/libvir.c b/python/libvir.c index 96cbc294d475e49a3e0b5f5e59f34c90ffe31d76..0ca2dca1425cbab470a12e5175709fd3e9c69383 100644 --- a/python/libvir.c +++ b/python/libvir.c @@ -76,7 +76,7 @@ libvirt_virDomainInterfaceStats(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) if (!PyArg_ParseTuple(args, (char *)"Oz:virDomainInterfaceStats", &pyobj_domain,&path)) - return(NULL); + return(NULL); domain = (virDomainPtr) PyvirDomain_Get(pyobj_domain); c_retval = virDomainInterfaceStats(domain, path, &stats, sizeof(stats)); @@ -498,14 +498,14 @@ libvirt_virErrorFuncHandler(ATTRIBUTE_UNUSED void *ctx, virErrorPtr err) Py_XINCREF(libvirt_virPythonErrorFuncCtxt); PyTuple_SetItem(info, 0, PyInt_FromLong((long) err->code)); PyTuple_SetItem(info, 1, PyInt_FromLong((long) err->domain)); - PyTuple_SetItem(info, 2, libvirt_constcharPtrWrap(err->message)); + PyTuple_SetItem(info, 2, libvirt_constcharPtrWrap(err->message)); PyTuple_SetItem(info, 3, PyInt_FromLong((long) err->level)); - PyTuple_SetItem(info, 4, libvirt_constcharPtrWrap(err->str1)); - PyTuple_SetItem(info, 5, libvirt_constcharPtrWrap(err->str2)); - PyTuple_SetItem(info, 6, libvirt_constcharPtrWrap(err->str3)); + PyTuple_SetItem(info, 4, libvirt_constcharPtrWrap(err->str1)); + PyTuple_SetItem(info, 5, libvirt_constcharPtrWrap(err->str2)); + PyTuple_SetItem(info, 6, libvirt_constcharPtrWrap(err->str3)); PyTuple_SetItem(info, 7, PyInt_FromLong((long) err->int1)); PyTuple_SetItem(info, 8, PyInt_FromLong((long) err->int2)); - /* TODO pass conn and dom if available */ + /* TODO pass conn and dom if available */ result = PyEval_CallObject(libvirt_virPythonErrorFuncHandler, list); Py_XDECREF(list); Py_XDECREF(result); @@ -542,14 +542,14 @@ libvirt_virRegisterErrorHandler(ATTRIBUTE_UNUSED PyObject * self, if ((pyobj_f == Py_None) && (pyobj_ctx == Py_None)) { libvirt_virPythonErrorFuncHandler = NULL; - libvirt_virPythonErrorFuncCtxt = NULL; + libvirt_virPythonErrorFuncCtxt = NULL; } else { - Py_XINCREF(pyobj_ctx); - Py_XINCREF(pyobj_f); + Py_XINCREF(pyobj_ctx); + Py_XINCREF(pyobj_f); - /* TODO: check f is a function ! */ - libvirt_virPythonErrorFuncHandler = pyobj_f; - libvirt_virPythonErrorFuncCtxt = pyobj_ctx; + /* TODO: check f is a function ! */ + libvirt_virPythonErrorFuncHandler = pyobj_f; + libvirt_virPythonErrorFuncCtxt = pyobj_ctx; } py_retval = libvirt_intWrap(1); @@ -738,7 +738,7 @@ libvirt_virConnectListDomainsID(PyObject *self ATTRIBUTE_UNUSED, static PyObject * libvirt_virConnectListDefinedDomains(PyObject *self ATTRIBUTE_UNUSED, - PyObject *args) { + PyObject *args) { PyObject *py_retval; char **names = NULL; int c_retval, i; @@ -884,7 +884,7 @@ libvirt_virDomainLookupByUUID(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { static PyObject * libvirt_virConnectListNetworks(PyObject *self ATTRIBUTE_UNUSED, - PyObject *args) { + PyObject *args) { PyObject *py_retval; char **names = NULL; int c_retval, i; @@ -926,7 +926,7 @@ libvirt_virConnectListNetworks(PyObject *self ATTRIBUTE_UNUSED, static PyObject * libvirt_virConnectListDefinedNetworks(PyObject *self ATTRIBUTE_UNUSED, - PyObject *args) { + PyObject *args) { PyObject *py_retval; char **names = NULL; int c_retval, i; @@ -1092,8 +1092,8 @@ error: } py_retval = PyList_New(c_retval); for (i = 0;i < c_retval;i++) { - PyList_SetItem(py_retval, i, - libvirt_longlongWrap((long long) freeMems[i])); + PyList_SetItem(py_retval, i, + libvirt_longlongWrap((long long) freeMems[i])); } free(freeMems); return(py_retval); diff --git a/python/libvirt_wrap.h b/python/libvirt_wrap.h index 3bb42abf99e0642e243246d9745ce000a4fa1907..f8ecb76c55e6c7ef8e0b6e1b8d9d1ba0626bc2c4 100644 --- a/python/libvirt_wrap.h +++ b/python/libvirt_wrap.h @@ -22,7 +22,7 @@ #endif #define PyvirConnect_Get(v) (((v) == Py_None) ? NULL : \ - (((PyvirConnect_Object *)(v))->obj)) + (((PyvirConnect_Object *)(v))->obj)) typedef struct { PyObject_HEAD @@ -31,7 +31,7 @@ typedef struct { #define PyvirDomain_Get(v) (((v) == Py_None) ? NULL : \ - (((PyvirDomain_Object *)(v))->obj)) + (((PyvirDomain_Object *)(v))->obj)) typedef struct { PyObject_HEAD @@ -40,7 +40,7 @@ typedef struct { #define PyvirNetwork_Get(v) (((v) == Py_None) ? NULL : \ - (((PyvirNetwork_Object *)(v))->obj)) + (((PyvirNetwork_Object *)(v))->obj)) typedef struct { PyObject_HEAD @@ -49,7 +49,7 @@ typedef struct { #define PyvirStoragePool_Get(v) (((v) == Py_None) ? NULL : \ - (((PyvirStoragePool_Object *)(v))->obj)) + (((PyvirStoragePool_Object *)(v))->obj)) typedef struct { PyObject_HEAD @@ -58,7 +58,7 @@ typedef struct { #define PyvirStorageVol_Get(v) (((v) == Py_None) ? NULL : \ - (((PyvirStorageVol_Object *)(v))->obj)) + (((PyvirStorageVol_Object *)(v))->obj)) typedef struct { PyObject_HEAD diff --git a/qemud/remote_dispatch_proc_switch.h b/qemud/remote_dispatch_proc_switch.h index 4793c70121d4eb2e1f8cb483a432da8689558570..c2ac3ff3d01ad7c6455092cf6d5c4d96e90c5da1 100644 --- a/qemud/remote_dispatch_proc_switch.h +++ b/qemud/remote_dispatch_proc_switch.h @@ -3,749 +3,749 @@ */ case REMOTE_PROC_AUTH_LIST: - fn = (dispatch_fn) remoteDispatchAuthList; - ret_filter = (xdrproc_t) xdr_remote_auth_list_ret; - ret = (char *) &lv_remote_auth_list_ret; - memset (&lv_remote_auth_list_ret, 0, sizeof lv_remote_auth_list_ret); - break; + fn = (dispatch_fn) remoteDispatchAuthList; + ret_filter = (xdrproc_t) xdr_remote_auth_list_ret; + ret = (char *) &lv_remote_auth_list_ret; + memset (&lv_remote_auth_list_ret, 0, sizeof lv_remote_auth_list_ret); + break; case REMOTE_PROC_AUTH_POLKIT: - fn = (dispatch_fn) remoteDispatchAuthPolkit; - ret_filter = (xdrproc_t) xdr_remote_auth_polkit_ret; - ret = (char *) &lv_remote_auth_polkit_ret; - memset (&lv_remote_auth_polkit_ret, 0, sizeof lv_remote_auth_polkit_ret); - break; + fn = (dispatch_fn) remoteDispatchAuthPolkit; + ret_filter = (xdrproc_t) xdr_remote_auth_polkit_ret; + ret = (char *) &lv_remote_auth_polkit_ret; + memset (&lv_remote_auth_polkit_ret, 0, sizeof lv_remote_auth_polkit_ret); + break; case REMOTE_PROC_AUTH_SASL_INIT: - fn = (dispatch_fn) remoteDispatchAuthSaslInit; - ret_filter = (xdrproc_t) xdr_remote_auth_sasl_init_ret; - ret = (char *) &lv_remote_auth_sasl_init_ret; - memset (&lv_remote_auth_sasl_init_ret, 0, sizeof lv_remote_auth_sasl_init_ret); - break; + fn = (dispatch_fn) remoteDispatchAuthSaslInit; + ret_filter = (xdrproc_t) xdr_remote_auth_sasl_init_ret; + ret = (char *) &lv_remote_auth_sasl_init_ret; + memset (&lv_remote_auth_sasl_init_ret, 0, sizeof lv_remote_auth_sasl_init_ret); + break; case REMOTE_PROC_AUTH_SASL_START: - fn = (dispatch_fn) remoteDispatchAuthSaslStart; - args_filter = (xdrproc_t) xdr_remote_auth_sasl_start_args; - args = (char *) &lv_remote_auth_sasl_start_args; - memset (&lv_remote_auth_sasl_start_args, 0, sizeof lv_remote_auth_sasl_start_args); - ret_filter = (xdrproc_t) xdr_remote_auth_sasl_start_ret; - ret = (char *) &lv_remote_auth_sasl_start_ret; - memset (&lv_remote_auth_sasl_start_ret, 0, sizeof lv_remote_auth_sasl_start_ret); - break; + fn = (dispatch_fn) remoteDispatchAuthSaslStart; + args_filter = (xdrproc_t) xdr_remote_auth_sasl_start_args; + args = (char *) &lv_remote_auth_sasl_start_args; + memset (&lv_remote_auth_sasl_start_args, 0, sizeof lv_remote_auth_sasl_start_args); + ret_filter = (xdrproc_t) xdr_remote_auth_sasl_start_ret; + ret = (char *) &lv_remote_auth_sasl_start_ret; + memset (&lv_remote_auth_sasl_start_ret, 0, sizeof lv_remote_auth_sasl_start_ret); + break; case REMOTE_PROC_AUTH_SASL_STEP: - fn = (dispatch_fn) remoteDispatchAuthSaslStep; - args_filter = (xdrproc_t) xdr_remote_auth_sasl_step_args; - args = (char *) &lv_remote_auth_sasl_step_args; - memset (&lv_remote_auth_sasl_step_args, 0, sizeof lv_remote_auth_sasl_step_args); - ret_filter = (xdrproc_t) xdr_remote_auth_sasl_step_ret; - ret = (char *) &lv_remote_auth_sasl_step_ret; - memset (&lv_remote_auth_sasl_step_ret, 0, sizeof lv_remote_auth_sasl_step_ret); - break; + fn = (dispatch_fn) remoteDispatchAuthSaslStep; + args_filter = (xdrproc_t) xdr_remote_auth_sasl_step_args; + args = (char *) &lv_remote_auth_sasl_step_args; + memset (&lv_remote_auth_sasl_step_args, 0, sizeof lv_remote_auth_sasl_step_args); + ret_filter = (xdrproc_t) xdr_remote_auth_sasl_step_ret; + ret = (char *) &lv_remote_auth_sasl_step_ret; + memset (&lv_remote_auth_sasl_step_ret, 0, sizeof lv_remote_auth_sasl_step_ret); + break; case REMOTE_PROC_CLOSE: - fn = (dispatch_fn) remoteDispatchClose; - break; + fn = (dispatch_fn) remoteDispatchClose; + break; case REMOTE_PROC_DOMAIN_ATTACH_DEVICE: - fn = (dispatch_fn) remoteDispatchDomainAttachDevice; - args_filter = (xdrproc_t) xdr_remote_domain_attach_device_args; - args = (char *) &lv_remote_domain_attach_device_args; - memset (&lv_remote_domain_attach_device_args, 0, sizeof lv_remote_domain_attach_device_args); - break; + fn = (dispatch_fn) remoteDispatchDomainAttachDevice; + args_filter = (xdrproc_t) xdr_remote_domain_attach_device_args; + args = (char *) &lv_remote_domain_attach_device_args; + memset (&lv_remote_domain_attach_device_args, 0, sizeof lv_remote_domain_attach_device_args); + break; case REMOTE_PROC_DOMAIN_BLOCK_STATS: - fn = (dispatch_fn) remoteDispatchDomainBlockStats; - args_filter = (xdrproc_t) xdr_remote_domain_block_stats_args; - args = (char *) &lv_remote_domain_block_stats_args; - memset (&lv_remote_domain_block_stats_args, 0, sizeof lv_remote_domain_block_stats_args); - ret_filter = (xdrproc_t) xdr_remote_domain_block_stats_ret; - ret = (char *) &lv_remote_domain_block_stats_ret; - memset (&lv_remote_domain_block_stats_ret, 0, sizeof lv_remote_domain_block_stats_ret); - break; + fn = (dispatch_fn) remoteDispatchDomainBlockStats; + args_filter = (xdrproc_t) xdr_remote_domain_block_stats_args; + args = (char *) &lv_remote_domain_block_stats_args; + memset (&lv_remote_domain_block_stats_args, 0, sizeof lv_remote_domain_block_stats_args); + ret_filter = (xdrproc_t) xdr_remote_domain_block_stats_ret; + ret = (char *) &lv_remote_domain_block_stats_ret; + memset (&lv_remote_domain_block_stats_ret, 0, sizeof lv_remote_domain_block_stats_ret); + break; case REMOTE_PROC_DOMAIN_CORE_DUMP: - fn = (dispatch_fn) remoteDispatchDomainCoreDump; - args_filter = (xdrproc_t) xdr_remote_domain_core_dump_args; - args = (char *) &lv_remote_domain_core_dump_args; - memset (&lv_remote_domain_core_dump_args, 0, sizeof lv_remote_domain_core_dump_args); - break; + fn = (dispatch_fn) remoteDispatchDomainCoreDump; + args_filter = (xdrproc_t) xdr_remote_domain_core_dump_args; + args = (char *) &lv_remote_domain_core_dump_args; + memset (&lv_remote_domain_core_dump_args, 0, sizeof lv_remote_domain_core_dump_args); + break; case REMOTE_PROC_DOMAIN_CREATE: - fn = (dispatch_fn) remoteDispatchDomainCreate; - args_filter = (xdrproc_t) xdr_remote_domain_create_args; - args = (char *) &lv_remote_domain_create_args; - memset (&lv_remote_domain_create_args, 0, sizeof lv_remote_domain_create_args); - break; + fn = (dispatch_fn) remoteDispatchDomainCreate; + args_filter = (xdrproc_t) xdr_remote_domain_create_args; + args = (char *) &lv_remote_domain_create_args; + memset (&lv_remote_domain_create_args, 0, sizeof lv_remote_domain_create_args); + break; case REMOTE_PROC_DOMAIN_CREATE_LINUX: - fn = (dispatch_fn) remoteDispatchDomainCreateLinux; - args_filter = (xdrproc_t) xdr_remote_domain_create_linux_args; - args = (char *) &lv_remote_domain_create_linux_args; - memset (&lv_remote_domain_create_linux_args, 0, sizeof lv_remote_domain_create_linux_args); - ret_filter = (xdrproc_t) xdr_remote_domain_create_linux_ret; - ret = (char *) &lv_remote_domain_create_linux_ret; - memset (&lv_remote_domain_create_linux_ret, 0, sizeof lv_remote_domain_create_linux_ret); - break; + fn = (dispatch_fn) remoteDispatchDomainCreateLinux; + args_filter = (xdrproc_t) xdr_remote_domain_create_linux_args; + args = (char *) &lv_remote_domain_create_linux_args; + memset (&lv_remote_domain_create_linux_args, 0, sizeof lv_remote_domain_create_linux_args); + ret_filter = (xdrproc_t) xdr_remote_domain_create_linux_ret; + ret = (char *) &lv_remote_domain_create_linux_ret; + memset (&lv_remote_domain_create_linux_ret, 0, sizeof lv_remote_domain_create_linux_ret); + break; case REMOTE_PROC_DOMAIN_DEFINE_XML: - fn = (dispatch_fn) remoteDispatchDomainDefineXml; - args_filter = (xdrproc_t) xdr_remote_domain_define_xml_args; - args = (char *) &lv_remote_domain_define_xml_args; - memset (&lv_remote_domain_define_xml_args, 0, sizeof lv_remote_domain_define_xml_args); - ret_filter = (xdrproc_t) xdr_remote_domain_define_xml_ret; - ret = (char *) &lv_remote_domain_define_xml_ret; - memset (&lv_remote_domain_define_xml_ret, 0, sizeof lv_remote_domain_define_xml_ret); - break; + fn = (dispatch_fn) remoteDispatchDomainDefineXml; + args_filter = (xdrproc_t) xdr_remote_domain_define_xml_args; + args = (char *) &lv_remote_domain_define_xml_args; + memset (&lv_remote_domain_define_xml_args, 0, sizeof lv_remote_domain_define_xml_args); + ret_filter = (xdrproc_t) xdr_remote_domain_define_xml_ret; + ret = (char *) &lv_remote_domain_define_xml_ret; + memset (&lv_remote_domain_define_xml_ret, 0, sizeof lv_remote_domain_define_xml_ret); + break; case REMOTE_PROC_DOMAIN_DESTROY: - fn = (dispatch_fn) remoteDispatchDomainDestroy; - args_filter = (xdrproc_t) xdr_remote_domain_destroy_args; - args = (char *) &lv_remote_domain_destroy_args; - memset (&lv_remote_domain_destroy_args, 0, sizeof lv_remote_domain_destroy_args); - break; + fn = (dispatch_fn) remoteDispatchDomainDestroy; + args_filter = (xdrproc_t) xdr_remote_domain_destroy_args; + args = (char *) &lv_remote_domain_destroy_args; + memset (&lv_remote_domain_destroy_args, 0, sizeof lv_remote_domain_destroy_args); + break; case REMOTE_PROC_DOMAIN_DETACH_DEVICE: - fn = (dispatch_fn) remoteDispatchDomainDetachDevice; - args_filter = (xdrproc_t) xdr_remote_domain_detach_device_args; - args = (char *) &lv_remote_domain_detach_device_args; - memset (&lv_remote_domain_detach_device_args, 0, sizeof lv_remote_domain_detach_device_args); - break; + fn = (dispatch_fn) remoteDispatchDomainDetachDevice; + args_filter = (xdrproc_t) xdr_remote_domain_detach_device_args; + args = (char *) &lv_remote_domain_detach_device_args; + memset (&lv_remote_domain_detach_device_args, 0, sizeof lv_remote_domain_detach_device_args); + break; case REMOTE_PROC_DOMAIN_DUMP_XML: - fn = (dispatch_fn) remoteDispatchDomainDumpXml; - args_filter = (xdrproc_t) xdr_remote_domain_dump_xml_args; - args = (char *) &lv_remote_domain_dump_xml_args; - memset (&lv_remote_domain_dump_xml_args, 0, sizeof lv_remote_domain_dump_xml_args); - ret_filter = (xdrproc_t) xdr_remote_domain_dump_xml_ret; - ret = (char *) &lv_remote_domain_dump_xml_ret; - memset (&lv_remote_domain_dump_xml_ret, 0, sizeof lv_remote_domain_dump_xml_ret); - break; + fn = (dispatch_fn) remoteDispatchDomainDumpXml; + args_filter = (xdrproc_t) xdr_remote_domain_dump_xml_args; + args = (char *) &lv_remote_domain_dump_xml_args; + memset (&lv_remote_domain_dump_xml_args, 0, sizeof lv_remote_domain_dump_xml_args); + ret_filter = (xdrproc_t) xdr_remote_domain_dump_xml_ret; + ret = (char *) &lv_remote_domain_dump_xml_ret; + memset (&lv_remote_domain_dump_xml_ret, 0, sizeof lv_remote_domain_dump_xml_ret); + break; case REMOTE_PROC_DOMAIN_GET_AUTOSTART: - fn = (dispatch_fn) remoteDispatchDomainGetAutostart; - args_filter = (xdrproc_t) xdr_remote_domain_get_autostart_args; - args = (char *) &lv_remote_domain_get_autostart_args; - memset (&lv_remote_domain_get_autostart_args, 0, sizeof lv_remote_domain_get_autostart_args); - ret_filter = (xdrproc_t) xdr_remote_domain_get_autostart_ret; - ret = (char *) &lv_remote_domain_get_autostart_ret; - memset (&lv_remote_domain_get_autostart_ret, 0, sizeof lv_remote_domain_get_autostart_ret); - break; + fn = (dispatch_fn) remoteDispatchDomainGetAutostart; + args_filter = (xdrproc_t) xdr_remote_domain_get_autostart_args; + args = (char *) &lv_remote_domain_get_autostart_args; + memset (&lv_remote_domain_get_autostart_args, 0, sizeof lv_remote_domain_get_autostart_args); + ret_filter = (xdrproc_t) xdr_remote_domain_get_autostart_ret; + ret = (char *) &lv_remote_domain_get_autostart_ret; + memset (&lv_remote_domain_get_autostart_ret, 0, sizeof lv_remote_domain_get_autostart_ret); + break; case REMOTE_PROC_DOMAIN_GET_INFO: - fn = (dispatch_fn) remoteDispatchDomainGetInfo; - args_filter = (xdrproc_t) xdr_remote_domain_get_info_args; - args = (char *) &lv_remote_domain_get_info_args; - memset (&lv_remote_domain_get_info_args, 0, sizeof lv_remote_domain_get_info_args); - ret_filter = (xdrproc_t) xdr_remote_domain_get_info_ret; - ret = (char *) &lv_remote_domain_get_info_ret; - memset (&lv_remote_domain_get_info_ret, 0, sizeof lv_remote_domain_get_info_ret); - break; + fn = (dispatch_fn) remoteDispatchDomainGetInfo; + args_filter = (xdrproc_t) xdr_remote_domain_get_info_args; + args = (char *) &lv_remote_domain_get_info_args; + memset (&lv_remote_domain_get_info_args, 0, sizeof lv_remote_domain_get_info_args); + ret_filter = (xdrproc_t) xdr_remote_domain_get_info_ret; + ret = (char *) &lv_remote_domain_get_info_ret; + memset (&lv_remote_domain_get_info_ret, 0, sizeof lv_remote_domain_get_info_ret); + break; case REMOTE_PROC_DOMAIN_GET_MAX_MEMORY: - fn = (dispatch_fn) remoteDispatchDomainGetMaxMemory; - args_filter = (xdrproc_t) xdr_remote_domain_get_max_memory_args; - args = (char *) &lv_remote_domain_get_max_memory_args; - memset (&lv_remote_domain_get_max_memory_args, 0, sizeof lv_remote_domain_get_max_memory_args); - ret_filter = (xdrproc_t) xdr_remote_domain_get_max_memory_ret; - ret = (char *) &lv_remote_domain_get_max_memory_ret; - memset (&lv_remote_domain_get_max_memory_ret, 0, sizeof lv_remote_domain_get_max_memory_ret); - break; + fn = (dispatch_fn) remoteDispatchDomainGetMaxMemory; + args_filter = (xdrproc_t) xdr_remote_domain_get_max_memory_args; + args = (char *) &lv_remote_domain_get_max_memory_args; + memset (&lv_remote_domain_get_max_memory_args, 0, sizeof lv_remote_domain_get_max_memory_args); + ret_filter = (xdrproc_t) xdr_remote_domain_get_max_memory_ret; + ret = (char *) &lv_remote_domain_get_max_memory_ret; + memset (&lv_remote_domain_get_max_memory_ret, 0, sizeof lv_remote_domain_get_max_memory_ret); + break; case REMOTE_PROC_DOMAIN_GET_MAX_VCPUS: - fn = (dispatch_fn) remoteDispatchDomainGetMaxVcpus; - args_filter = (xdrproc_t) xdr_remote_domain_get_max_vcpus_args; - args = (char *) &lv_remote_domain_get_max_vcpus_args; - memset (&lv_remote_domain_get_max_vcpus_args, 0, sizeof lv_remote_domain_get_max_vcpus_args); - ret_filter = (xdrproc_t) xdr_remote_domain_get_max_vcpus_ret; - ret = (char *) &lv_remote_domain_get_max_vcpus_ret; - memset (&lv_remote_domain_get_max_vcpus_ret, 0, sizeof lv_remote_domain_get_max_vcpus_ret); - break; + fn = (dispatch_fn) remoteDispatchDomainGetMaxVcpus; + args_filter = (xdrproc_t) xdr_remote_domain_get_max_vcpus_args; + args = (char *) &lv_remote_domain_get_max_vcpus_args; + memset (&lv_remote_domain_get_max_vcpus_args, 0, sizeof lv_remote_domain_get_max_vcpus_args); + ret_filter = (xdrproc_t) xdr_remote_domain_get_max_vcpus_ret; + ret = (char *) &lv_remote_domain_get_max_vcpus_ret; + memset (&lv_remote_domain_get_max_vcpus_ret, 0, sizeof lv_remote_domain_get_max_vcpus_ret); + break; case REMOTE_PROC_DOMAIN_GET_OS_TYPE: - fn = (dispatch_fn) remoteDispatchDomainGetOsType; - args_filter = (xdrproc_t) xdr_remote_domain_get_os_type_args; - args = (char *) &lv_remote_domain_get_os_type_args; - memset (&lv_remote_domain_get_os_type_args, 0, sizeof lv_remote_domain_get_os_type_args); - ret_filter = (xdrproc_t) xdr_remote_domain_get_os_type_ret; - ret = (char *) &lv_remote_domain_get_os_type_ret; - memset (&lv_remote_domain_get_os_type_ret, 0, sizeof lv_remote_domain_get_os_type_ret); - break; + fn = (dispatch_fn) remoteDispatchDomainGetOsType; + args_filter = (xdrproc_t) xdr_remote_domain_get_os_type_args; + args = (char *) &lv_remote_domain_get_os_type_args; + memset (&lv_remote_domain_get_os_type_args, 0, sizeof lv_remote_domain_get_os_type_args); + ret_filter = (xdrproc_t) xdr_remote_domain_get_os_type_ret; + ret = (char *) &lv_remote_domain_get_os_type_ret; + memset (&lv_remote_domain_get_os_type_ret, 0, sizeof lv_remote_domain_get_os_type_ret); + break; case REMOTE_PROC_DOMAIN_GET_SCHEDULER_PARAMETERS: - fn = (dispatch_fn) remoteDispatchDomainGetSchedulerParameters; - args_filter = (xdrproc_t) xdr_remote_domain_get_scheduler_parameters_args; - args = (char *) &lv_remote_domain_get_scheduler_parameters_args; - memset (&lv_remote_domain_get_scheduler_parameters_args, 0, sizeof lv_remote_domain_get_scheduler_parameters_args); - ret_filter = (xdrproc_t) xdr_remote_domain_get_scheduler_parameters_ret; - ret = (char *) &lv_remote_domain_get_scheduler_parameters_ret; - memset (&lv_remote_domain_get_scheduler_parameters_ret, 0, sizeof lv_remote_domain_get_scheduler_parameters_ret); - break; + fn = (dispatch_fn) remoteDispatchDomainGetSchedulerParameters; + args_filter = (xdrproc_t) xdr_remote_domain_get_scheduler_parameters_args; + args = (char *) &lv_remote_domain_get_scheduler_parameters_args; + memset (&lv_remote_domain_get_scheduler_parameters_args, 0, sizeof lv_remote_domain_get_scheduler_parameters_args); + ret_filter = (xdrproc_t) xdr_remote_domain_get_scheduler_parameters_ret; + ret = (char *) &lv_remote_domain_get_scheduler_parameters_ret; + memset (&lv_remote_domain_get_scheduler_parameters_ret, 0, sizeof lv_remote_domain_get_scheduler_parameters_ret); + break; case REMOTE_PROC_DOMAIN_GET_SCHEDULER_TYPE: - fn = (dispatch_fn) remoteDispatchDomainGetSchedulerType; - args_filter = (xdrproc_t) xdr_remote_domain_get_scheduler_type_args; - args = (char *) &lv_remote_domain_get_scheduler_type_args; - memset (&lv_remote_domain_get_scheduler_type_args, 0, sizeof lv_remote_domain_get_scheduler_type_args); - ret_filter = (xdrproc_t) xdr_remote_domain_get_scheduler_type_ret; - ret = (char *) &lv_remote_domain_get_scheduler_type_ret; - memset (&lv_remote_domain_get_scheduler_type_ret, 0, sizeof lv_remote_domain_get_scheduler_type_ret); - break; + fn = (dispatch_fn) remoteDispatchDomainGetSchedulerType; + args_filter = (xdrproc_t) xdr_remote_domain_get_scheduler_type_args; + args = (char *) &lv_remote_domain_get_scheduler_type_args; + memset (&lv_remote_domain_get_scheduler_type_args, 0, sizeof lv_remote_domain_get_scheduler_type_args); + ret_filter = (xdrproc_t) xdr_remote_domain_get_scheduler_type_ret; + ret = (char *) &lv_remote_domain_get_scheduler_type_ret; + memset (&lv_remote_domain_get_scheduler_type_ret, 0, sizeof lv_remote_domain_get_scheduler_type_ret); + break; case REMOTE_PROC_DOMAIN_GET_VCPUS: - fn = (dispatch_fn) remoteDispatchDomainGetVcpus; - args_filter = (xdrproc_t) xdr_remote_domain_get_vcpus_args; - args = (char *) &lv_remote_domain_get_vcpus_args; - memset (&lv_remote_domain_get_vcpus_args, 0, sizeof lv_remote_domain_get_vcpus_args); - ret_filter = (xdrproc_t) xdr_remote_domain_get_vcpus_ret; - ret = (char *) &lv_remote_domain_get_vcpus_ret; - memset (&lv_remote_domain_get_vcpus_ret, 0, sizeof lv_remote_domain_get_vcpus_ret); - break; + fn = (dispatch_fn) remoteDispatchDomainGetVcpus; + args_filter = (xdrproc_t) xdr_remote_domain_get_vcpus_args; + args = (char *) &lv_remote_domain_get_vcpus_args; + memset (&lv_remote_domain_get_vcpus_args, 0, sizeof lv_remote_domain_get_vcpus_args); + ret_filter = (xdrproc_t) xdr_remote_domain_get_vcpus_ret; + ret = (char *) &lv_remote_domain_get_vcpus_ret; + memset (&lv_remote_domain_get_vcpus_ret, 0, sizeof lv_remote_domain_get_vcpus_ret); + break; case REMOTE_PROC_DOMAIN_INTERFACE_STATS: - fn = (dispatch_fn) remoteDispatchDomainInterfaceStats; - args_filter = (xdrproc_t) xdr_remote_domain_interface_stats_args; - args = (char *) &lv_remote_domain_interface_stats_args; - memset (&lv_remote_domain_interface_stats_args, 0, sizeof lv_remote_domain_interface_stats_args); - ret_filter = (xdrproc_t) xdr_remote_domain_interface_stats_ret; - ret = (char *) &lv_remote_domain_interface_stats_ret; - memset (&lv_remote_domain_interface_stats_ret, 0, sizeof lv_remote_domain_interface_stats_ret); - break; + fn = (dispatch_fn) remoteDispatchDomainInterfaceStats; + args_filter = (xdrproc_t) xdr_remote_domain_interface_stats_args; + args = (char *) &lv_remote_domain_interface_stats_args; + memset (&lv_remote_domain_interface_stats_args, 0, sizeof lv_remote_domain_interface_stats_args); + ret_filter = (xdrproc_t) xdr_remote_domain_interface_stats_ret; + ret = (char *) &lv_remote_domain_interface_stats_ret; + memset (&lv_remote_domain_interface_stats_ret, 0, sizeof lv_remote_domain_interface_stats_ret); + break; case REMOTE_PROC_DOMAIN_LOOKUP_BY_ID: - fn = (dispatch_fn) remoteDispatchDomainLookupById; - args_filter = (xdrproc_t) xdr_remote_domain_lookup_by_id_args; - args = (char *) &lv_remote_domain_lookup_by_id_args; - memset (&lv_remote_domain_lookup_by_id_args, 0, sizeof lv_remote_domain_lookup_by_id_args); - ret_filter = (xdrproc_t) xdr_remote_domain_lookup_by_id_ret; - ret = (char *) &lv_remote_domain_lookup_by_id_ret; - memset (&lv_remote_domain_lookup_by_id_ret, 0, sizeof lv_remote_domain_lookup_by_id_ret); - break; + fn = (dispatch_fn) remoteDispatchDomainLookupById; + args_filter = (xdrproc_t) xdr_remote_domain_lookup_by_id_args; + args = (char *) &lv_remote_domain_lookup_by_id_args; + memset (&lv_remote_domain_lookup_by_id_args, 0, sizeof lv_remote_domain_lookup_by_id_args); + ret_filter = (xdrproc_t) xdr_remote_domain_lookup_by_id_ret; + ret = (char *) &lv_remote_domain_lookup_by_id_ret; + memset (&lv_remote_domain_lookup_by_id_ret, 0, sizeof lv_remote_domain_lookup_by_id_ret); + break; case REMOTE_PROC_DOMAIN_LOOKUP_BY_NAME: - fn = (dispatch_fn) remoteDispatchDomainLookupByName; - args_filter = (xdrproc_t) xdr_remote_domain_lookup_by_name_args; - args = (char *) &lv_remote_domain_lookup_by_name_args; - memset (&lv_remote_domain_lookup_by_name_args, 0, sizeof lv_remote_domain_lookup_by_name_args); - ret_filter = (xdrproc_t) xdr_remote_domain_lookup_by_name_ret; - ret = (char *) &lv_remote_domain_lookup_by_name_ret; - memset (&lv_remote_domain_lookup_by_name_ret, 0, sizeof lv_remote_domain_lookup_by_name_ret); - break; + fn = (dispatch_fn) remoteDispatchDomainLookupByName; + args_filter = (xdrproc_t) xdr_remote_domain_lookup_by_name_args; + args = (char *) &lv_remote_domain_lookup_by_name_args; + memset (&lv_remote_domain_lookup_by_name_args, 0, sizeof lv_remote_domain_lookup_by_name_args); + ret_filter = (xdrproc_t) xdr_remote_domain_lookup_by_name_ret; + ret = (char *) &lv_remote_domain_lookup_by_name_ret; + memset (&lv_remote_domain_lookup_by_name_ret, 0, sizeof lv_remote_domain_lookup_by_name_ret); + break; case REMOTE_PROC_DOMAIN_LOOKUP_BY_UUID: - fn = (dispatch_fn) remoteDispatchDomainLookupByUuid; - args_filter = (xdrproc_t) xdr_remote_domain_lookup_by_uuid_args; - args = (char *) &lv_remote_domain_lookup_by_uuid_args; - memset (&lv_remote_domain_lookup_by_uuid_args, 0, sizeof lv_remote_domain_lookup_by_uuid_args); - ret_filter = (xdrproc_t) xdr_remote_domain_lookup_by_uuid_ret; - ret = (char *) &lv_remote_domain_lookup_by_uuid_ret; - memset (&lv_remote_domain_lookup_by_uuid_ret, 0, sizeof lv_remote_domain_lookup_by_uuid_ret); - break; + fn = (dispatch_fn) remoteDispatchDomainLookupByUuid; + args_filter = (xdrproc_t) xdr_remote_domain_lookup_by_uuid_args; + args = (char *) &lv_remote_domain_lookup_by_uuid_args; + memset (&lv_remote_domain_lookup_by_uuid_args, 0, sizeof lv_remote_domain_lookup_by_uuid_args); + ret_filter = (xdrproc_t) xdr_remote_domain_lookup_by_uuid_ret; + ret = (char *) &lv_remote_domain_lookup_by_uuid_ret; + memset (&lv_remote_domain_lookup_by_uuid_ret, 0, sizeof lv_remote_domain_lookup_by_uuid_ret); + break; case REMOTE_PROC_DOMAIN_MIGRATE_FINISH: - fn = (dispatch_fn) remoteDispatchDomainMigrateFinish; - args_filter = (xdrproc_t) xdr_remote_domain_migrate_finish_args; - args = (char *) &lv_remote_domain_migrate_finish_args; - memset (&lv_remote_domain_migrate_finish_args, 0, sizeof lv_remote_domain_migrate_finish_args); - ret_filter = (xdrproc_t) xdr_remote_domain_migrate_finish_ret; - ret = (char *) &lv_remote_domain_migrate_finish_ret; - memset (&lv_remote_domain_migrate_finish_ret, 0, sizeof lv_remote_domain_migrate_finish_ret); - break; + fn = (dispatch_fn) remoteDispatchDomainMigrateFinish; + args_filter = (xdrproc_t) xdr_remote_domain_migrate_finish_args; + args = (char *) &lv_remote_domain_migrate_finish_args; + memset (&lv_remote_domain_migrate_finish_args, 0, sizeof lv_remote_domain_migrate_finish_args); + ret_filter = (xdrproc_t) xdr_remote_domain_migrate_finish_ret; + ret = (char *) &lv_remote_domain_migrate_finish_ret; + memset (&lv_remote_domain_migrate_finish_ret, 0, sizeof lv_remote_domain_migrate_finish_ret); + break; case REMOTE_PROC_DOMAIN_MIGRATE_PERFORM: - fn = (dispatch_fn) remoteDispatchDomainMigratePerform; - args_filter = (xdrproc_t) xdr_remote_domain_migrate_perform_args; - args = (char *) &lv_remote_domain_migrate_perform_args; - memset (&lv_remote_domain_migrate_perform_args, 0, sizeof lv_remote_domain_migrate_perform_args); - break; + fn = (dispatch_fn) remoteDispatchDomainMigratePerform; + args_filter = (xdrproc_t) xdr_remote_domain_migrate_perform_args; + args = (char *) &lv_remote_domain_migrate_perform_args; + memset (&lv_remote_domain_migrate_perform_args, 0, sizeof lv_remote_domain_migrate_perform_args); + break; case REMOTE_PROC_DOMAIN_MIGRATE_PREPARE: - fn = (dispatch_fn) remoteDispatchDomainMigratePrepare; - args_filter = (xdrproc_t) xdr_remote_domain_migrate_prepare_args; - args = (char *) &lv_remote_domain_migrate_prepare_args; - memset (&lv_remote_domain_migrate_prepare_args, 0, sizeof lv_remote_domain_migrate_prepare_args); - ret_filter = (xdrproc_t) xdr_remote_domain_migrate_prepare_ret; - ret = (char *) &lv_remote_domain_migrate_prepare_ret; - memset (&lv_remote_domain_migrate_prepare_ret, 0, sizeof lv_remote_domain_migrate_prepare_ret); - break; + fn = (dispatch_fn) remoteDispatchDomainMigratePrepare; + args_filter = (xdrproc_t) xdr_remote_domain_migrate_prepare_args; + args = (char *) &lv_remote_domain_migrate_prepare_args; + memset (&lv_remote_domain_migrate_prepare_args, 0, sizeof lv_remote_domain_migrate_prepare_args); + ret_filter = (xdrproc_t) xdr_remote_domain_migrate_prepare_ret; + ret = (char *) &lv_remote_domain_migrate_prepare_ret; + memset (&lv_remote_domain_migrate_prepare_ret, 0, sizeof lv_remote_domain_migrate_prepare_ret); + break; case REMOTE_PROC_DOMAIN_PIN_VCPU: - fn = (dispatch_fn) remoteDispatchDomainPinVcpu; - args_filter = (xdrproc_t) xdr_remote_domain_pin_vcpu_args; - args = (char *) &lv_remote_domain_pin_vcpu_args; - memset (&lv_remote_domain_pin_vcpu_args, 0, sizeof lv_remote_domain_pin_vcpu_args); - break; + fn = (dispatch_fn) remoteDispatchDomainPinVcpu; + args_filter = (xdrproc_t) xdr_remote_domain_pin_vcpu_args; + args = (char *) &lv_remote_domain_pin_vcpu_args; + memset (&lv_remote_domain_pin_vcpu_args, 0, sizeof lv_remote_domain_pin_vcpu_args); + break; case REMOTE_PROC_DOMAIN_REBOOT: - fn = (dispatch_fn) remoteDispatchDomainReboot; - args_filter = (xdrproc_t) xdr_remote_domain_reboot_args; - args = (char *) &lv_remote_domain_reboot_args; - memset (&lv_remote_domain_reboot_args, 0, sizeof lv_remote_domain_reboot_args); - break; + fn = (dispatch_fn) remoteDispatchDomainReboot; + args_filter = (xdrproc_t) xdr_remote_domain_reboot_args; + args = (char *) &lv_remote_domain_reboot_args; + memset (&lv_remote_domain_reboot_args, 0, sizeof lv_remote_domain_reboot_args); + break; case REMOTE_PROC_DOMAIN_RESTORE: - fn = (dispatch_fn) remoteDispatchDomainRestore; - args_filter = (xdrproc_t) xdr_remote_domain_restore_args; - args = (char *) &lv_remote_domain_restore_args; - memset (&lv_remote_domain_restore_args, 0, sizeof lv_remote_domain_restore_args); - break; + fn = (dispatch_fn) remoteDispatchDomainRestore; + args_filter = (xdrproc_t) xdr_remote_domain_restore_args; + args = (char *) &lv_remote_domain_restore_args; + memset (&lv_remote_domain_restore_args, 0, sizeof lv_remote_domain_restore_args); + break; case REMOTE_PROC_DOMAIN_RESUME: - fn = (dispatch_fn) remoteDispatchDomainResume; - args_filter = (xdrproc_t) xdr_remote_domain_resume_args; - args = (char *) &lv_remote_domain_resume_args; - memset (&lv_remote_domain_resume_args, 0, sizeof lv_remote_domain_resume_args); - break; + fn = (dispatch_fn) remoteDispatchDomainResume; + args_filter = (xdrproc_t) xdr_remote_domain_resume_args; + args = (char *) &lv_remote_domain_resume_args; + memset (&lv_remote_domain_resume_args, 0, sizeof lv_remote_domain_resume_args); + break; case REMOTE_PROC_DOMAIN_SAVE: - fn = (dispatch_fn) remoteDispatchDomainSave; - args_filter = (xdrproc_t) xdr_remote_domain_save_args; - args = (char *) &lv_remote_domain_save_args; - memset (&lv_remote_domain_save_args, 0, sizeof lv_remote_domain_save_args); - break; + fn = (dispatch_fn) remoteDispatchDomainSave; + args_filter = (xdrproc_t) xdr_remote_domain_save_args; + args = (char *) &lv_remote_domain_save_args; + memset (&lv_remote_domain_save_args, 0, sizeof lv_remote_domain_save_args); + break; case REMOTE_PROC_DOMAIN_SET_AUTOSTART: - fn = (dispatch_fn) remoteDispatchDomainSetAutostart; - args_filter = (xdrproc_t) xdr_remote_domain_set_autostart_args; - args = (char *) &lv_remote_domain_set_autostart_args; - memset (&lv_remote_domain_set_autostart_args, 0, sizeof lv_remote_domain_set_autostart_args); - break; + fn = (dispatch_fn) remoteDispatchDomainSetAutostart; + args_filter = (xdrproc_t) xdr_remote_domain_set_autostart_args; + args = (char *) &lv_remote_domain_set_autostart_args; + memset (&lv_remote_domain_set_autostart_args, 0, sizeof lv_remote_domain_set_autostart_args); + break; case REMOTE_PROC_DOMAIN_SET_MAX_MEMORY: - fn = (dispatch_fn) remoteDispatchDomainSetMaxMemory; - args_filter = (xdrproc_t) xdr_remote_domain_set_max_memory_args; - args = (char *) &lv_remote_domain_set_max_memory_args; - memset (&lv_remote_domain_set_max_memory_args, 0, sizeof lv_remote_domain_set_max_memory_args); - break; + fn = (dispatch_fn) remoteDispatchDomainSetMaxMemory; + args_filter = (xdrproc_t) xdr_remote_domain_set_max_memory_args; + args = (char *) &lv_remote_domain_set_max_memory_args; + memset (&lv_remote_domain_set_max_memory_args, 0, sizeof lv_remote_domain_set_max_memory_args); + break; case REMOTE_PROC_DOMAIN_SET_MEMORY: - fn = (dispatch_fn) remoteDispatchDomainSetMemory; - args_filter = (xdrproc_t) xdr_remote_domain_set_memory_args; - args = (char *) &lv_remote_domain_set_memory_args; - memset (&lv_remote_domain_set_memory_args, 0, sizeof lv_remote_domain_set_memory_args); - break; + fn = (dispatch_fn) remoteDispatchDomainSetMemory; + args_filter = (xdrproc_t) xdr_remote_domain_set_memory_args; + args = (char *) &lv_remote_domain_set_memory_args; + memset (&lv_remote_domain_set_memory_args, 0, sizeof lv_remote_domain_set_memory_args); + break; case REMOTE_PROC_DOMAIN_SET_SCHEDULER_PARAMETERS: - fn = (dispatch_fn) remoteDispatchDomainSetSchedulerParameters; - args_filter = (xdrproc_t) xdr_remote_domain_set_scheduler_parameters_args; - args = (char *) &lv_remote_domain_set_scheduler_parameters_args; - memset (&lv_remote_domain_set_scheduler_parameters_args, 0, sizeof lv_remote_domain_set_scheduler_parameters_args); - break; + fn = (dispatch_fn) remoteDispatchDomainSetSchedulerParameters; + args_filter = (xdrproc_t) xdr_remote_domain_set_scheduler_parameters_args; + args = (char *) &lv_remote_domain_set_scheduler_parameters_args; + memset (&lv_remote_domain_set_scheduler_parameters_args, 0, sizeof lv_remote_domain_set_scheduler_parameters_args); + break; case REMOTE_PROC_DOMAIN_SET_VCPUS: - fn = (dispatch_fn) remoteDispatchDomainSetVcpus; - args_filter = (xdrproc_t) xdr_remote_domain_set_vcpus_args; - args = (char *) &lv_remote_domain_set_vcpus_args; - memset (&lv_remote_domain_set_vcpus_args, 0, sizeof lv_remote_domain_set_vcpus_args); - break; + fn = (dispatch_fn) remoteDispatchDomainSetVcpus; + args_filter = (xdrproc_t) xdr_remote_domain_set_vcpus_args; + args = (char *) &lv_remote_domain_set_vcpus_args; + memset (&lv_remote_domain_set_vcpus_args, 0, sizeof lv_remote_domain_set_vcpus_args); + break; case REMOTE_PROC_DOMAIN_SHUTDOWN: - fn = (dispatch_fn) remoteDispatchDomainShutdown; - args_filter = (xdrproc_t) xdr_remote_domain_shutdown_args; - args = (char *) &lv_remote_domain_shutdown_args; - memset (&lv_remote_domain_shutdown_args, 0, sizeof lv_remote_domain_shutdown_args); - break; + fn = (dispatch_fn) remoteDispatchDomainShutdown; + args_filter = (xdrproc_t) xdr_remote_domain_shutdown_args; + args = (char *) &lv_remote_domain_shutdown_args; + memset (&lv_remote_domain_shutdown_args, 0, sizeof lv_remote_domain_shutdown_args); + break; case REMOTE_PROC_DOMAIN_SUSPEND: - fn = (dispatch_fn) remoteDispatchDomainSuspend; - args_filter = (xdrproc_t) xdr_remote_domain_suspend_args; - args = (char *) &lv_remote_domain_suspend_args; - memset (&lv_remote_domain_suspend_args, 0, sizeof lv_remote_domain_suspend_args); - break; + fn = (dispatch_fn) remoteDispatchDomainSuspend; + args_filter = (xdrproc_t) xdr_remote_domain_suspend_args; + args = (char *) &lv_remote_domain_suspend_args; + memset (&lv_remote_domain_suspend_args, 0, sizeof lv_remote_domain_suspend_args); + break; case REMOTE_PROC_DOMAIN_UNDEFINE: - fn = (dispatch_fn) remoteDispatchDomainUndefine; - args_filter = (xdrproc_t) xdr_remote_domain_undefine_args; - args = (char *) &lv_remote_domain_undefine_args; - memset (&lv_remote_domain_undefine_args, 0, sizeof lv_remote_domain_undefine_args); - break; + fn = (dispatch_fn) remoteDispatchDomainUndefine; + args_filter = (xdrproc_t) xdr_remote_domain_undefine_args; + args = (char *) &lv_remote_domain_undefine_args; + memset (&lv_remote_domain_undefine_args, 0, sizeof lv_remote_domain_undefine_args); + break; case REMOTE_PROC_GET_CAPABILITIES: - fn = (dispatch_fn) remoteDispatchGetCapabilities; - ret_filter = (xdrproc_t) xdr_remote_get_capabilities_ret; - ret = (char *) &lv_remote_get_capabilities_ret; - memset (&lv_remote_get_capabilities_ret, 0, sizeof lv_remote_get_capabilities_ret); - break; + fn = (dispatch_fn) remoteDispatchGetCapabilities; + ret_filter = (xdrproc_t) xdr_remote_get_capabilities_ret; + ret = (char *) &lv_remote_get_capabilities_ret; + memset (&lv_remote_get_capabilities_ret, 0, sizeof lv_remote_get_capabilities_ret); + break; case REMOTE_PROC_GET_HOSTNAME: - fn = (dispatch_fn) remoteDispatchGetHostname; - ret_filter = (xdrproc_t) xdr_remote_get_hostname_ret; - ret = (char *) &lv_remote_get_hostname_ret; - memset (&lv_remote_get_hostname_ret, 0, sizeof lv_remote_get_hostname_ret); - break; + fn = (dispatch_fn) remoteDispatchGetHostname; + ret_filter = (xdrproc_t) xdr_remote_get_hostname_ret; + ret = (char *) &lv_remote_get_hostname_ret; + memset (&lv_remote_get_hostname_ret, 0, sizeof lv_remote_get_hostname_ret); + break; case REMOTE_PROC_GET_MAX_VCPUS: - fn = (dispatch_fn) remoteDispatchGetMaxVcpus; - args_filter = (xdrproc_t) xdr_remote_get_max_vcpus_args; - args = (char *) &lv_remote_get_max_vcpus_args; - memset (&lv_remote_get_max_vcpus_args, 0, sizeof lv_remote_get_max_vcpus_args); - ret_filter = (xdrproc_t) xdr_remote_get_max_vcpus_ret; - ret = (char *) &lv_remote_get_max_vcpus_ret; - memset (&lv_remote_get_max_vcpus_ret, 0, sizeof lv_remote_get_max_vcpus_ret); - break; + fn = (dispatch_fn) remoteDispatchGetMaxVcpus; + args_filter = (xdrproc_t) xdr_remote_get_max_vcpus_args; + args = (char *) &lv_remote_get_max_vcpus_args; + memset (&lv_remote_get_max_vcpus_args, 0, sizeof lv_remote_get_max_vcpus_args); + ret_filter = (xdrproc_t) xdr_remote_get_max_vcpus_ret; + ret = (char *) &lv_remote_get_max_vcpus_ret; + memset (&lv_remote_get_max_vcpus_ret, 0, sizeof lv_remote_get_max_vcpus_ret); + break; case REMOTE_PROC_GET_TYPE: - fn = (dispatch_fn) remoteDispatchGetType; - ret_filter = (xdrproc_t) xdr_remote_get_type_ret; - ret = (char *) &lv_remote_get_type_ret; - memset (&lv_remote_get_type_ret, 0, sizeof lv_remote_get_type_ret); - break; + fn = (dispatch_fn) remoteDispatchGetType; + ret_filter = (xdrproc_t) xdr_remote_get_type_ret; + ret = (char *) &lv_remote_get_type_ret; + memset (&lv_remote_get_type_ret, 0, sizeof lv_remote_get_type_ret); + break; case REMOTE_PROC_GET_VERSION: - fn = (dispatch_fn) remoteDispatchGetVersion; - ret_filter = (xdrproc_t) xdr_remote_get_version_ret; - ret = (char *) &lv_remote_get_version_ret; - memset (&lv_remote_get_version_ret, 0, sizeof lv_remote_get_version_ret); - break; + fn = (dispatch_fn) remoteDispatchGetVersion; + ret_filter = (xdrproc_t) xdr_remote_get_version_ret; + ret = (char *) &lv_remote_get_version_ret; + memset (&lv_remote_get_version_ret, 0, sizeof lv_remote_get_version_ret); + break; case REMOTE_PROC_LIST_DEFINED_DOMAINS: - fn = (dispatch_fn) remoteDispatchListDefinedDomains; - args_filter = (xdrproc_t) xdr_remote_list_defined_domains_args; - args = (char *) &lv_remote_list_defined_domains_args; - memset (&lv_remote_list_defined_domains_args, 0, sizeof lv_remote_list_defined_domains_args); - ret_filter = (xdrproc_t) xdr_remote_list_defined_domains_ret; - ret = (char *) &lv_remote_list_defined_domains_ret; - memset (&lv_remote_list_defined_domains_ret, 0, sizeof lv_remote_list_defined_domains_ret); - break; + fn = (dispatch_fn) remoteDispatchListDefinedDomains; + args_filter = (xdrproc_t) xdr_remote_list_defined_domains_args; + args = (char *) &lv_remote_list_defined_domains_args; + memset (&lv_remote_list_defined_domains_args, 0, sizeof lv_remote_list_defined_domains_args); + ret_filter = (xdrproc_t) xdr_remote_list_defined_domains_ret; + ret = (char *) &lv_remote_list_defined_domains_ret; + memset (&lv_remote_list_defined_domains_ret, 0, sizeof lv_remote_list_defined_domains_ret); + break; case REMOTE_PROC_LIST_DEFINED_NETWORKS: - fn = (dispatch_fn) remoteDispatchListDefinedNetworks; - args_filter = (xdrproc_t) xdr_remote_list_defined_networks_args; - args = (char *) &lv_remote_list_defined_networks_args; - memset (&lv_remote_list_defined_networks_args, 0, sizeof lv_remote_list_defined_networks_args); - ret_filter = (xdrproc_t) xdr_remote_list_defined_networks_ret; - ret = (char *) &lv_remote_list_defined_networks_ret; - memset (&lv_remote_list_defined_networks_ret, 0, sizeof lv_remote_list_defined_networks_ret); - break; + fn = (dispatch_fn) remoteDispatchListDefinedNetworks; + args_filter = (xdrproc_t) xdr_remote_list_defined_networks_args; + args = (char *) &lv_remote_list_defined_networks_args; + memset (&lv_remote_list_defined_networks_args, 0, sizeof lv_remote_list_defined_networks_args); + ret_filter = (xdrproc_t) xdr_remote_list_defined_networks_ret; + ret = (char *) &lv_remote_list_defined_networks_ret; + memset (&lv_remote_list_defined_networks_ret, 0, sizeof lv_remote_list_defined_networks_ret); + break; case REMOTE_PROC_LIST_DEFINED_STORAGE_POOLS: - fn = (dispatch_fn) remoteDispatchListDefinedStoragePools; - args_filter = (xdrproc_t) xdr_remote_list_defined_storage_pools_args; - args = (char *) &lv_remote_list_defined_storage_pools_args; - memset (&lv_remote_list_defined_storage_pools_args, 0, sizeof lv_remote_list_defined_storage_pools_args); - ret_filter = (xdrproc_t) xdr_remote_list_defined_storage_pools_ret; - ret = (char *) &lv_remote_list_defined_storage_pools_ret; - memset (&lv_remote_list_defined_storage_pools_ret, 0, sizeof lv_remote_list_defined_storage_pools_ret); - break; + fn = (dispatch_fn) remoteDispatchListDefinedStoragePools; + args_filter = (xdrproc_t) xdr_remote_list_defined_storage_pools_args; + args = (char *) &lv_remote_list_defined_storage_pools_args; + memset (&lv_remote_list_defined_storage_pools_args, 0, sizeof lv_remote_list_defined_storage_pools_args); + ret_filter = (xdrproc_t) xdr_remote_list_defined_storage_pools_ret; + ret = (char *) &lv_remote_list_defined_storage_pools_ret; + memset (&lv_remote_list_defined_storage_pools_ret, 0, sizeof lv_remote_list_defined_storage_pools_ret); + break; case REMOTE_PROC_LIST_DOMAINS: - fn = (dispatch_fn) remoteDispatchListDomains; - args_filter = (xdrproc_t) xdr_remote_list_domains_args; - args = (char *) &lv_remote_list_domains_args; - memset (&lv_remote_list_domains_args, 0, sizeof lv_remote_list_domains_args); - ret_filter = (xdrproc_t) xdr_remote_list_domains_ret; - ret = (char *) &lv_remote_list_domains_ret; - memset (&lv_remote_list_domains_ret, 0, sizeof lv_remote_list_domains_ret); - break; + fn = (dispatch_fn) remoteDispatchListDomains; + args_filter = (xdrproc_t) xdr_remote_list_domains_args; + args = (char *) &lv_remote_list_domains_args; + memset (&lv_remote_list_domains_args, 0, sizeof lv_remote_list_domains_args); + ret_filter = (xdrproc_t) xdr_remote_list_domains_ret; + ret = (char *) &lv_remote_list_domains_ret; + memset (&lv_remote_list_domains_ret, 0, sizeof lv_remote_list_domains_ret); + break; case REMOTE_PROC_LIST_NETWORKS: - fn = (dispatch_fn) remoteDispatchListNetworks; - args_filter = (xdrproc_t) xdr_remote_list_networks_args; - args = (char *) &lv_remote_list_networks_args; - memset (&lv_remote_list_networks_args, 0, sizeof lv_remote_list_networks_args); - ret_filter = (xdrproc_t) xdr_remote_list_networks_ret; - ret = (char *) &lv_remote_list_networks_ret; - memset (&lv_remote_list_networks_ret, 0, sizeof lv_remote_list_networks_ret); - break; + fn = (dispatch_fn) remoteDispatchListNetworks; + args_filter = (xdrproc_t) xdr_remote_list_networks_args; + args = (char *) &lv_remote_list_networks_args; + memset (&lv_remote_list_networks_args, 0, sizeof lv_remote_list_networks_args); + ret_filter = (xdrproc_t) xdr_remote_list_networks_ret; + ret = (char *) &lv_remote_list_networks_ret; + memset (&lv_remote_list_networks_ret, 0, sizeof lv_remote_list_networks_ret); + break; case REMOTE_PROC_LIST_STORAGE_POOLS: - fn = (dispatch_fn) remoteDispatchListStoragePools; - args_filter = (xdrproc_t) xdr_remote_list_storage_pools_args; - args = (char *) &lv_remote_list_storage_pools_args; - memset (&lv_remote_list_storage_pools_args, 0, sizeof lv_remote_list_storage_pools_args); - ret_filter = (xdrproc_t) xdr_remote_list_storage_pools_ret; - ret = (char *) &lv_remote_list_storage_pools_ret; - memset (&lv_remote_list_storage_pools_ret, 0, sizeof lv_remote_list_storage_pools_ret); - break; + fn = (dispatch_fn) remoteDispatchListStoragePools; + args_filter = (xdrproc_t) xdr_remote_list_storage_pools_args; + args = (char *) &lv_remote_list_storage_pools_args; + memset (&lv_remote_list_storage_pools_args, 0, sizeof lv_remote_list_storage_pools_args); + ret_filter = (xdrproc_t) xdr_remote_list_storage_pools_ret; + ret = (char *) &lv_remote_list_storage_pools_ret; + memset (&lv_remote_list_storage_pools_ret, 0, sizeof lv_remote_list_storage_pools_ret); + break; case REMOTE_PROC_NETWORK_CREATE: - fn = (dispatch_fn) remoteDispatchNetworkCreate; - args_filter = (xdrproc_t) xdr_remote_network_create_args; - args = (char *) &lv_remote_network_create_args; - memset (&lv_remote_network_create_args, 0, sizeof lv_remote_network_create_args); - break; + fn = (dispatch_fn) remoteDispatchNetworkCreate; + args_filter = (xdrproc_t) xdr_remote_network_create_args; + args = (char *) &lv_remote_network_create_args; + memset (&lv_remote_network_create_args, 0, sizeof lv_remote_network_create_args); + break; case REMOTE_PROC_NETWORK_CREATE_XML: - fn = (dispatch_fn) remoteDispatchNetworkCreateXml; - args_filter = (xdrproc_t) xdr_remote_network_create_xml_args; - args = (char *) &lv_remote_network_create_xml_args; - memset (&lv_remote_network_create_xml_args, 0, sizeof lv_remote_network_create_xml_args); - ret_filter = (xdrproc_t) xdr_remote_network_create_xml_ret; - ret = (char *) &lv_remote_network_create_xml_ret; - memset (&lv_remote_network_create_xml_ret, 0, sizeof lv_remote_network_create_xml_ret); - break; + fn = (dispatch_fn) remoteDispatchNetworkCreateXml; + args_filter = (xdrproc_t) xdr_remote_network_create_xml_args; + args = (char *) &lv_remote_network_create_xml_args; + memset (&lv_remote_network_create_xml_args, 0, sizeof lv_remote_network_create_xml_args); + ret_filter = (xdrproc_t) xdr_remote_network_create_xml_ret; + ret = (char *) &lv_remote_network_create_xml_ret; + memset (&lv_remote_network_create_xml_ret, 0, sizeof lv_remote_network_create_xml_ret); + break; case REMOTE_PROC_NETWORK_DEFINE_XML: - fn = (dispatch_fn) remoteDispatchNetworkDefineXml; - args_filter = (xdrproc_t) xdr_remote_network_define_xml_args; - args = (char *) &lv_remote_network_define_xml_args; - memset (&lv_remote_network_define_xml_args, 0, sizeof lv_remote_network_define_xml_args); - ret_filter = (xdrproc_t) xdr_remote_network_define_xml_ret; - ret = (char *) &lv_remote_network_define_xml_ret; - memset (&lv_remote_network_define_xml_ret, 0, sizeof lv_remote_network_define_xml_ret); - break; + fn = (dispatch_fn) remoteDispatchNetworkDefineXml; + args_filter = (xdrproc_t) xdr_remote_network_define_xml_args; + args = (char *) &lv_remote_network_define_xml_args; + memset (&lv_remote_network_define_xml_args, 0, sizeof lv_remote_network_define_xml_args); + ret_filter = (xdrproc_t) xdr_remote_network_define_xml_ret; + ret = (char *) &lv_remote_network_define_xml_ret; + memset (&lv_remote_network_define_xml_ret, 0, sizeof lv_remote_network_define_xml_ret); + break; case REMOTE_PROC_NETWORK_DESTROY: - fn = (dispatch_fn) remoteDispatchNetworkDestroy; - args_filter = (xdrproc_t) xdr_remote_network_destroy_args; - args = (char *) &lv_remote_network_destroy_args; - memset (&lv_remote_network_destroy_args, 0, sizeof lv_remote_network_destroy_args); - break; + fn = (dispatch_fn) remoteDispatchNetworkDestroy; + args_filter = (xdrproc_t) xdr_remote_network_destroy_args; + args = (char *) &lv_remote_network_destroy_args; + memset (&lv_remote_network_destroy_args, 0, sizeof lv_remote_network_destroy_args); + break; case REMOTE_PROC_NETWORK_DUMP_XML: - fn = (dispatch_fn) remoteDispatchNetworkDumpXml; - args_filter = (xdrproc_t) xdr_remote_network_dump_xml_args; - args = (char *) &lv_remote_network_dump_xml_args; - memset (&lv_remote_network_dump_xml_args, 0, sizeof lv_remote_network_dump_xml_args); - ret_filter = (xdrproc_t) xdr_remote_network_dump_xml_ret; - ret = (char *) &lv_remote_network_dump_xml_ret; - memset (&lv_remote_network_dump_xml_ret, 0, sizeof lv_remote_network_dump_xml_ret); - break; + fn = (dispatch_fn) remoteDispatchNetworkDumpXml; + args_filter = (xdrproc_t) xdr_remote_network_dump_xml_args; + args = (char *) &lv_remote_network_dump_xml_args; + memset (&lv_remote_network_dump_xml_args, 0, sizeof lv_remote_network_dump_xml_args); + ret_filter = (xdrproc_t) xdr_remote_network_dump_xml_ret; + ret = (char *) &lv_remote_network_dump_xml_ret; + memset (&lv_remote_network_dump_xml_ret, 0, sizeof lv_remote_network_dump_xml_ret); + break; case REMOTE_PROC_NETWORK_GET_AUTOSTART: - fn = (dispatch_fn) remoteDispatchNetworkGetAutostart; - args_filter = (xdrproc_t) xdr_remote_network_get_autostart_args; - args = (char *) &lv_remote_network_get_autostart_args; - memset (&lv_remote_network_get_autostart_args, 0, sizeof lv_remote_network_get_autostart_args); - ret_filter = (xdrproc_t) xdr_remote_network_get_autostart_ret; - ret = (char *) &lv_remote_network_get_autostart_ret; - memset (&lv_remote_network_get_autostart_ret, 0, sizeof lv_remote_network_get_autostart_ret); - break; + fn = (dispatch_fn) remoteDispatchNetworkGetAutostart; + args_filter = (xdrproc_t) xdr_remote_network_get_autostart_args; + args = (char *) &lv_remote_network_get_autostart_args; + memset (&lv_remote_network_get_autostart_args, 0, sizeof lv_remote_network_get_autostart_args); + ret_filter = (xdrproc_t) xdr_remote_network_get_autostart_ret; + ret = (char *) &lv_remote_network_get_autostart_ret; + memset (&lv_remote_network_get_autostart_ret, 0, sizeof lv_remote_network_get_autostart_ret); + break; case REMOTE_PROC_NETWORK_GET_BRIDGE_NAME: - fn = (dispatch_fn) remoteDispatchNetworkGetBridgeName; - args_filter = (xdrproc_t) xdr_remote_network_get_bridge_name_args; - args = (char *) &lv_remote_network_get_bridge_name_args; - memset (&lv_remote_network_get_bridge_name_args, 0, sizeof lv_remote_network_get_bridge_name_args); - ret_filter = (xdrproc_t) xdr_remote_network_get_bridge_name_ret; - ret = (char *) &lv_remote_network_get_bridge_name_ret; - memset (&lv_remote_network_get_bridge_name_ret, 0, sizeof lv_remote_network_get_bridge_name_ret); - break; + fn = (dispatch_fn) remoteDispatchNetworkGetBridgeName; + args_filter = (xdrproc_t) xdr_remote_network_get_bridge_name_args; + args = (char *) &lv_remote_network_get_bridge_name_args; + memset (&lv_remote_network_get_bridge_name_args, 0, sizeof lv_remote_network_get_bridge_name_args); + ret_filter = (xdrproc_t) xdr_remote_network_get_bridge_name_ret; + ret = (char *) &lv_remote_network_get_bridge_name_ret; + memset (&lv_remote_network_get_bridge_name_ret, 0, sizeof lv_remote_network_get_bridge_name_ret); + break; case REMOTE_PROC_NETWORK_LOOKUP_BY_NAME: - fn = (dispatch_fn) remoteDispatchNetworkLookupByName; - args_filter = (xdrproc_t) xdr_remote_network_lookup_by_name_args; - args = (char *) &lv_remote_network_lookup_by_name_args; - memset (&lv_remote_network_lookup_by_name_args, 0, sizeof lv_remote_network_lookup_by_name_args); - ret_filter = (xdrproc_t) xdr_remote_network_lookup_by_name_ret; - ret = (char *) &lv_remote_network_lookup_by_name_ret; - memset (&lv_remote_network_lookup_by_name_ret, 0, sizeof lv_remote_network_lookup_by_name_ret); - break; + fn = (dispatch_fn) remoteDispatchNetworkLookupByName; + args_filter = (xdrproc_t) xdr_remote_network_lookup_by_name_args; + args = (char *) &lv_remote_network_lookup_by_name_args; + memset (&lv_remote_network_lookup_by_name_args, 0, sizeof lv_remote_network_lookup_by_name_args); + ret_filter = (xdrproc_t) xdr_remote_network_lookup_by_name_ret; + ret = (char *) &lv_remote_network_lookup_by_name_ret; + memset (&lv_remote_network_lookup_by_name_ret, 0, sizeof lv_remote_network_lookup_by_name_ret); + break; case REMOTE_PROC_NETWORK_LOOKUP_BY_UUID: - fn = (dispatch_fn) remoteDispatchNetworkLookupByUuid; - args_filter = (xdrproc_t) xdr_remote_network_lookup_by_uuid_args; - args = (char *) &lv_remote_network_lookup_by_uuid_args; - memset (&lv_remote_network_lookup_by_uuid_args, 0, sizeof lv_remote_network_lookup_by_uuid_args); - ret_filter = (xdrproc_t) xdr_remote_network_lookup_by_uuid_ret; - ret = (char *) &lv_remote_network_lookup_by_uuid_ret; - memset (&lv_remote_network_lookup_by_uuid_ret, 0, sizeof lv_remote_network_lookup_by_uuid_ret); - break; + fn = (dispatch_fn) remoteDispatchNetworkLookupByUuid; + args_filter = (xdrproc_t) xdr_remote_network_lookup_by_uuid_args; + args = (char *) &lv_remote_network_lookup_by_uuid_args; + memset (&lv_remote_network_lookup_by_uuid_args, 0, sizeof lv_remote_network_lookup_by_uuid_args); + ret_filter = (xdrproc_t) xdr_remote_network_lookup_by_uuid_ret; + ret = (char *) &lv_remote_network_lookup_by_uuid_ret; + memset (&lv_remote_network_lookup_by_uuid_ret, 0, sizeof lv_remote_network_lookup_by_uuid_ret); + break; case REMOTE_PROC_NETWORK_SET_AUTOSTART: - fn = (dispatch_fn) remoteDispatchNetworkSetAutostart; - args_filter = (xdrproc_t) xdr_remote_network_set_autostart_args; - args = (char *) &lv_remote_network_set_autostart_args; - memset (&lv_remote_network_set_autostart_args, 0, sizeof lv_remote_network_set_autostart_args); - break; + fn = (dispatch_fn) remoteDispatchNetworkSetAutostart; + args_filter = (xdrproc_t) xdr_remote_network_set_autostart_args; + args = (char *) &lv_remote_network_set_autostart_args; + memset (&lv_remote_network_set_autostart_args, 0, sizeof lv_remote_network_set_autostart_args); + break; case REMOTE_PROC_NETWORK_UNDEFINE: - fn = (dispatch_fn) remoteDispatchNetworkUndefine; - args_filter = (xdrproc_t) xdr_remote_network_undefine_args; - args = (char *) &lv_remote_network_undefine_args; - memset (&lv_remote_network_undefine_args, 0, sizeof lv_remote_network_undefine_args); - break; + fn = (dispatch_fn) remoteDispatchNetworkUndefine; + args_filter = (xdrproc_t) xdr_remote_network_undefine_args; + args = (char *) &lv_remote_network_undefine_args; + memset (&lv_remote_network_undefine_args, 0, sizeof lv_remote_network_undefine_args); + break; case REMOTE_PROC_NODE_GET_INFO: - fn = (dispatch_fn) remoteDispatchNodeGetInfo; - ret_filter = (xdrproc_t) xdr_remote_node_get_info_ret; - ret = (char *) &lv_remote_node_get_info_ret; - memset (&lv_remote_node_get_info_ret, 0, sizeof lv_remote_node_get_info_ret); - break; + fn = (dispatch_fn) remoteDispatchNodeGetInfo; + ret_filter = (xdrproc_t) xdr_remote_node_get_info_ret; + ret = (char *) &lv_remote_node_get_info_ret; + memset (&lv_remote_node_get_info_ret, 0, sizeof lv_remote_node_get_info_ret); + break; case REMOTE_PROC_NUM_OF_DEFINED_DOMAINS: - fn = (dispatch_fn) remoteDispatchNumOfDefinedDomains; - ret_filter = (xdrproc_t) xdr_remote_num_of_defined_domains_ret; - ret = (char *) &lv_remote_num_of_defined_domains_ret; - memset (&lv_remote_num_of_defined_domains_ret, 0, sizeof lv_remote_num_of_defined_domains_ret); - break; + fn = (dispatch_fn) remoteDispatchNumOfDefinedDomains; + ret_filter = (xdrproc_t) xdr_remote_num_of_defined_domains_ret; + ret = (char *) &lv_remote_num_of_defined_domains_ret; + memset (&lv_remote_num_of_defined_domains_ret, 0, sizeof lv_remote_num_of_defined_domains_ret); + break; case REMOTE_PROC_NUM_OF_DEFINED_NETWORKS: - fn = (dispatch_fn) remoteDispatchNumOfDefinedNetworks; - ret_filter = (xdrproc_t) xdr_remote_num_of_defined_networks_ret; - ret = (char *) &lv_remote_num_of_defined_networks_ret; - memset (&lv_remote_num_of_defined_networks_ret, 0, sizeof lv_remote_num_of_defined_networks_ret); - break; + fn = (dispatch_fn) remoteDispatchNumOfDefinedNetworks; + ret_filter = (xdrproc_t) xdr_remote_num_of_defined_networks_ret; + ret = (char *) &lv_remote_num_of_defined_networks_ret; + memset (&lv_remote_num_of_defined_networks_ret, 0, sizeof lv_remote_num_of_defined_networks_ret); + break; case REMOTE_PROC_NUM_OF_DEFINED_STORAGE_POOLS: - fn = (dispatch_fn) remoteDispatchNumOfDefinedStoragePools; - ret_filter = (xdrproc_t) xdr_remote_num_of_defined_storage_pools_ret; - ret = (char *) &lv_remote_num_of_defined_storage_pools_ret; - memset (&lv_remote_num_of_defined_storage_pools_ret, 0, sizeof lv_remote_num_of_defined_storage_pools_ret); - break; + fn = (dispatch_fn) remoteDispatchNumOfDefinedStoragePools; + ret_filter = (xdrproc_t) xdr_remote_num_of_defined_storage_pools_ret; + ret = (char *) &lv_remote_num_of_defined_storage_pools_ret; + memset (&lv_remote_num_of_defined_storage_pools_ret, 0, sizeof lv_remote_num_of_defined_storage_pools_ret); + break; case REMOTE_PROC_NUM_OF_DOMAINS: - fn = (dispatch_fn) remoteDispatchNumOfDomains; - ret_filter = (xdrproc_t) xdr_remote_num_of_domains_ret; - ret = (char *) &lv_remote_num_of_domains_ret; - memset (&lv_remote_num_of_domains_ret, 0, sizeof lv_remote_num_of_domains_ret); - break; + fn = (dispatch_fn) remoteDispatchNumOfDomains; + ret_filter = (xdrproc_t) xdr_remote_num_of_domains_ret; + ret = (char *) &lv_remote_num_of_domains_ret; + memset (&lv_remote_num_of_domains_ret, 0, sizeof lv_remote_num_of_domains_ret); + break; case REMOTE_PROC_NUM_OF_NETWORKS: - fn = (dispatch_fn) remoteDispatchNumOfNetworks; - ret_filter = (xdrproc_t) xdr_remote_num_of_networks_ret; - ret = (char *) &lv_remote_num_of_networks_ret; - memset (&lv_remote_num_of_networks_ret, 0, sizeof lv_remote_num_of_networks_ret); - break; + fn = (dispatch_fn) remoteDispatchNumOfNetworks; + ret_filter = (xdrproc_t) xdr_remote_num_of_networks_ret; + ret = (char *) &lv_remote_num_of_networks_ret; + memset (&lv_remote_num_of_networks_ret, 0, sizeof lv_remote_num_of_networks_ret); + break; case REMOTE_PROC_NUM_OF_STORAGE_POOLS: - fn = (dispatch_fn) remoteDispatchNumOfStoragePools; - ret_filter = (xdrproc_t) xdr_remote_num_of_storage_pools_ret; - ret = (char *) &lv_remote_num_of_storage_pools_ret; - memset (&lv_remote_num_of_storage_pools_ret, 0, sizeof lv_remote_num_of_storage_pools_ret); - break; + fn = (dispatch_fn) remoteDispatchNumOfStoragePools; + ret_filter = (xdrproc_t) xdr_remote_num_of_storage_pools_ret; + ret = (char *) &lv_remote_num_of_storage_pools_ret; + memset (&lv_remote_num_of_storage_pools_ret, 0, sizeof lv_remote_num_of_storage_pools_ret); + break; case REMOTE_PROC_OPEN: - fn = (dispatch_fn) remoteDispatchOpen; - args_filter = (xdrproc_t) xdr_remote_open_args; - args = (char *) &lv_remote_open_args; - memset (&lv_remote_open_args, 0, sizeof lv_remote_open_args); - break; + fn = (dispatch_fn) remoteDispatchOpen; + args_filter = (xdrproc_t) xdr_remote_open_args; + args = (char *) &lv_remote_open_args; + memset (&lv_remote_open_args, 0, sizeof lv_remote_open_args); + break; case REMOTE_PROC_STORAGE_POOL_BUILD: - fn = (dispatch_fn) remoteDispatchStoragePoolBuild; - args_filter = (xdrproc_t) xdr_remote_storage_pool_build_args; - args = (char *) &lv_remote_storage_pool_build_args; - memset (&lv_remote_storage_pool_build_args, 0, sizeof lv_remote_storage_pool_build_args); - break; + fn = (dispatch_fn) remoteDispatchStoragePoolBuild; + args_filter = (xdrproc_t) xdr_remote_storage_pool_build_args; + args = (char *) &lv_remote_storage_pool_build_args; + memset (&lv_remote_storage_pool_build_args, 0, sizeof lv_remote_storage_pool_build_args); + break; case REMOTE_PROC_STORAGE_POOL_CREATE: - fn = (dispatch_fn) remoteDispatchStoragePoolCreate; - args_filter = (xdrproc_t) xdr_remote_storage_pool_create_args; - args = (char *) &lv_remote_storage_pool_create_args; - memset (&lv_remote_storage_pool_create_args, 0, sizeof lv_remote_storage_pool_create_args); - break; + fn = (dispatch_fn) remoteDispatchStoragePoolCreate; + args_filter = (xdrproc_t) xdr_remote_storage_pool_create_args; + args = (char *) &lv_remote_storage_pool_create_args; + memset (&lv_remote_storage_pool_create_args, 0, sizeof lv_remote_storage_pool_create_args); + break; case REMOTE_PROC_STORAGE_POOL_CREATE_XML: - fn = (dispatch_fn) remoteDispatchStoragePoolCreateXml; - args_filter = (xdrproc_t) xdr_remote_storage_pool_create_xml_args; - args = (char *) &lv_remote_storage_pool_create_xml_args; - memset (&lv_remote_storage_pool_create_xml_args, 0, sizeof lv_remote_storage_pool_create_xml_args); - ret_filter = (xdrproc_t) xdr_remote_storage_pool_create_xml_ret; - ret = (char *) &lv_remote_storage_pool_create_xml_ret; - memset (&lv_remote_storage_pool_create_xml_ret, 0, sizeof lv_remote_storage_pool_create_xml_ret); - break; + fn = (dispatch_fn) remoteDispatchStoragePoolCreateXml; + args_filter = (xdrproc_t) xdr_remote_storage_pool_create_xml_args; + args = (char *) &lv_remote_storage_pool_create_xml_args; + memset (&lv_remote_storage_pool_create_xml_args, 0, sizeof lv_remote_storage_pool_create_xml_args); + ret_filter = (xdrproc_t) xdr_remote_storage_pool_create_xml_ret; + ret = (char *) &lv_remote_storage_pool_create_xml_ret; + memset (&lv_remote_storage_pool_create_xml_ret, 0, sizeof lv_remote_storage_pool_create_xml_ret); + break; case REMOTE_PROC_STORAGE_POOL_DEFINE_XML: - fn = (dispatch_fn) remoteDispatchStoragePoolDefineXml; - args_filter = (xdrproc_t) xdr_remote_storage_pool_define_xml_args; - args = (char *) &lv_remote_storage_pool_define_xml_args; - memset (&lv_remote_storage_pool_define_xml_args, 0, sizeof lv_remote_storage_pool_define_xml_args); - ret_filter = (xdrproc_t) xdr_remote_storage_pool_define_xml_ret; - ret = (char *) &lv_remote_storage_pool_define_xml_ret; - memset (&lv_remote_storage_pool_define_xml_ret, 0, sizeof lv_remote_storage_pool_define_xml_ret); - break; + fn = (dispatch_fn) remoteDispatchStoragePoolDefineXml; + args_filter = (xdrproc_t) xdr_remote_storage_pool_define_xml_args; + args = (char *) &lv_remote_storage_pool_define_xml_args; + memset (&lv_remote_storage_pool_define_xml_args, 0, sizeof lv_remote_storage_pool_define_xml_args); + ret_filter = (xdrproc_t) xdr_remote_storage_pool_define_xml_ret; + ret = (char *) &lv_remote_storage_pool_define_xml_ret; + memset (&lv_remote_storage_pool_define_xml_ret, 0, sizeof lv_remote_storage_pool_define_xml_ret); + break; case REMOTE_PROC_STORAGE_POOL_DELETE: - fn = (dispatch_fn) remoteDispatchStoragePoolDelete; - args_filter = (xdrproc_t) xdr_remote_storage_pool_delete_args; - args = (char *) &lv_remote_storage_pool_delete_args; - memset (&lv_remote_storage_pool_delete_args, 0, sizeof lv_remote_storage_pool_delete_args); - break; + fn = (dispatch_fn) remoteDispatchStoragePoolDelete; + args_filter = (xdrproc_t) xdr_remote_storage_pool_delete_args; + args = (char *) &lv_remote_storage_pool_delete_args; + memset (&lv_remote_storage_pool_delete_args, 0, sizeof lv_remote_storage_pool_delete_args); + break; case REMOTE_PROC_STORAGE_POOL_DESTROY: - fn = (dispatch_fn) remoteDispatchStoragePoolDestroy; - args_filter = (xdrproc_t) xdr_remote_storage_pool_destroy_args; - args = (char *) &lv_remote_storage_pool_destroy_args; - memset (&lv_remote_storage_pool_destroy_args, 0, sizeof lv_remote_storage_pool_destroy_args); - break; + fn = (dispatch_fn) remoteDispatchStoragePoolDestroy; + args_filter = (xdrproc_t) xdr_remote_storage_pool_destroy_args; + args = (char *) &lv_remote_storage_pool_destroy_args; + memset (&lv_remote_storage_pool_destroy_args, 0, sizeof lv_remote_storage_pool_destroy_args); + break; case REMOTE_PROC_STORAGE_POOL_DUMP_XML: - fn = (dispatch_fn) remoteDispatchStoragePoolDumpXml; - args_filter = (xdrproc_t) xdr_remote_storage_pool_dump_xml_args; - args = (char *) &lv_remote_storage_pool_dump_xml_args; - memset (&lv_remote_storage_pool_dump_xml_args, 0, sizeof lv_remote_storage_pool_dump_xml_args); - ret_filter = (xdrproc_t) xdr_remote_storage_pool_dump_xml_ret; - ret = (char *) &lv_remote_storage_pool_dump_xml_ret; - memset (&lv_remote_storage_pool_dump_xml_ret, 0, sizeof lv_remote_storage_pool_dump_xml_ret); - break; + fn = (dispatch_fn) remoteDispatchStoragePoolDumpXml; + args_filter = (xdrproc_t) xdr_remote_storage_pool_dump_xml_args; + args = (char *) &lv_remote_storage_pool_dump_xml_args; + memset (&lv_remote_storage_pool_dump_xml_args, 0, sizeof lv_remote_storage_pool_dump_xml_args); + ret_filter = (xdrproc_t) xdr_remote_storage_pool_dump_xml_ret; + ret = (char *) &lv_remote_storage_pool_dump_xml_ret; + memset (&lv_remote_storage_pool_dump_xml_ret, 0, sizeof lv_remote_storage_pool_dump_xml_ret); + break; case REMOTE_PROC_STORAGE_POOL_GET_AUTOSTART: - fn = (dispatch_fn) remoteDispatchStoragePoolGetAutostart; - args_filter = (xdrproc_t) xdr_remote_storage_pool_get_autostart_args; - args = (char *) &lv_remote_storage_pool_get_autostart_args; - memset (&lv_remote_storage_pool_get_autostart_args, 0, sizeof lv_remote_storage_pool_get_autostart_args); - ret_filter = (xdrproc_t) xdr_remote_storage_pool_get_autostart_ret; - ret = (char *) &lv_remote_storage_pool_get_autostart_ret; - memset (&lv_remote_storage_pool_get_autostart_ret, 0, sizeof lv_remote_storage_pool_get_autostart_ret); - break; + fn = (dispatch_fn) remoteDispatchStoragePoolGetAutostart; + args_filter = (xdrproc_t) xdr_remote_storage_pool_get_autostart_args; + args = (char *) &lv_remote_storage_pool_get_autostart_args; + memset (&lv_remote_storage_pool_get_autostart_args, 0, sizeof lv_remote_storage_pool_get_autostart_args); + ret_filter = (xdrproc_t) xdr_remote_storage_pool_get_autostart_ret; + ret = (char *) &lv_remote_storage_pool_get_autostart_ret; + memset (&lv_remote_storage_pool_get_autostart_ret, 0, sizeof lv_remote_storage_pool_get_autostart_ret); + break; case REMOTE_PROC_STORAGE_POOL_GET_INFO: - fn = (dispatch_fn) remoteDispatchStoragePoolGetInfo; - args_filter = (xdrproc_t) xdr_remote_storage_pool_get_info_args; - args = (char *) &lv_remote_storage_pool_get_info_args; - memset (&lv_remote_storage_pool_get_info_args, 0, sizeof lv_remote_storage_pool_get_info_args); - ret_filter = (xdrproc_t) xdr_remote_storage_pool_get_info_ret; - ret = (char *) &lv_remote_storage_pool_get_info_ret; - memset (&lv_remote_storage_pool_get_info_ret, 0, sizeof lv_remote_storage_pool_get_info_ret); - break; + fn = (dispatch_fn) remoteDispatchStoragePoolGetInfo; + args_filter = (xdrproc_t) xdr_remote_storage_pool_get_info_args; + args = (char *) &lv_remote_storage_pool_get_info_args; + memset (&lv_remote_storage_pool_get_info_args, 0, sizeof lv_remote_storage_pool_get_info_args); + ret_filter = (xdrproc_t) xdr_remote_storage_pool_get_info_ret; + ret = (char *) &lv_remote_storage_pool_get_info_ret; + memset (&lv_remote_storage_pool_get_info_ret, 0, sizeof lv_remote_storage_pool_get_info_ret); + break; case REMOTE_PROC_STORAGE_POOL_LIST_VOLUMES: - fn = (dispatch_fn) remoteDispatchStoragePoolListVolumes; - args_filter = (xdrproc_t) xdr_remote_storage_pool_list_volumes_args; - args = (char *) &lv_remote_storage_pool_list_volumes_args; - memset (&lv_remote_storage_pool_list_volumes_args, 0, sizeof lv_remote_storage_pool_list_volumes_args); - ret_filter = (xdrproc_t) xdr_remote_storage_pool_list_volumes_ret; - ret = (char *) &lv_remote_storage_pool_list_volumes_ret; - memset (&lv_remote_storage_pool_list_volumes_ret, 0, sizeof lv_remote_storage_pool_list_volumes_ret); - break; + fn = (dispatch_fn) remoteDispatchStoragePoolListVolumes; + args_filter = (xdrproc_t) xdr_remote_storage_pool_list_volumes_args; + args = (char *) &lv_remote_storage_pool_list_volumes_args; + memset (&lv_remote_storage_pool_list_volumes_args, 0, sizeof lv_remote_storage_pool_list_volumes_args); + ret_filter = (xdrproc_t) xdr_remote_storage_pool_list_volumes_ret; + ret = (char *) &lv_remote_storage_pool_list_volumes_ret; + memset (&lv_remote_storage_pool_list_volumes_ret, 0, sizeof lv_remote_storage_pool_list_volumes_ret); + break; case REMOTE_PROC_STORAGE_POOL_LOOKUP_BY_NAME: - fn = (dispatch_fn) remoteDispatchStoragePoolLookupByName; - args_filter = (xdrproc_t) xdr_remote_storage_pool_lookup_by_name_args; - args = (char *) &lv_remote_storage_pool_lookup_by_name_args; - memset (&lv_remote_storage_pool_lookup_by_name_args, 0, sizeof lv_remote_storage_pool_lookup_by_name_args); - ret_filter = (xdrproc_t) xdr_remote_storage_pool_lookup_by_name_ret; - ret = (char *) &lv_remote_storage_pool_lookup_by_name_ret; - memset (&lv_remote_storage_pool_lookup_by_name_ret, 0, sizeof lv_remote_storage_pool_lookup_by_name_ret); - break; + fn = (dispatch_fn) remoteDispatchStoragePoolLookupByName; + args_filter = (xdrproc_t) xdr_remote_storage_pool_lookup_by_name_args; + args = (char *) &lv_remote_storage_pool_lookup_by_name_args; + memset (&lv_remote_storage_pool_lookup_by_name_args, 0, sizeof lv_remote_storage_pool_lookup_by_name_args); + ret_filter = (xdrproc_t) xdr_remote_storage_pool_lookup_by_name_ret; + ret = (char *) &lv_remote_storage_pool_lookup_by_name_ret; + memset (&lv_remote_storage_pool_lookup_by_name_ret, 0, sizeof lv_remote_storage_pool_lookup_by_name_ret); + break; case REMOTE_PROC_STORAGE_POOL_LOOKUP_BY_UUID: - fn = (dispatch_fn) remoteDispatchStoragePoolLookupByUuid; - args_filter = (xdrproc_t) xdr_remote_storage_pool_lookup_by_uuid_args; - args = (char *) &lv_remote_storage_pool_lookup_by_uuid_args; - memset (&lv_remote_storage_pool_lookup_by_uuid_args, 0, sizeof lv_remote_storage_pool_lookup_by_uuid_args); - ret_filter = (xdrproc_t) xdr_remote_storage_pool_lookup_by_uuid_ret; - ret = (char *) &lv_remote_storage_pool_lookup_by_uuid_ret; - memset (&lv_remote_storage_pool_lookup_by_uuid_ret, 0, sizeof lv_remote_storage_pool_lookup_by_uuid_ret); - break; + fn = (dispatch_fn) remoteDispatchStoragePoolLookupByUuid; + args_filter = (xdrproc_t) xdr_remote_storage_pool_lookup_by_uuid_args; + args = (char *) &lv_remote_storage_pool_lookup_by_uuid_args; + memset (&lv_remote_storage_pool_lookup_by_uuid_args, 0, sizeof lv_remote_storage_pool_lookup_by_uuid_args); + ret_filter = (xdrproc_t) xdr_remote_storage_pool_lookup_by_uuid_ret; + ret = (char *) &lv_remote_storage_pool_lookup_by_uuid_ret; + memset (&lv_remote_storage_pool_lookup_by_uuid_ret, 0, sizeof lv_remote_storage_pool_lookup_by_uuid_ret); + break; case REMOTE_PROC_STORAGE_POOL_LOOKUP_BY_VOLUME: - fn = (dispatch_fn) remoteDispatchStoragePoolLookupByVolume; - args_filter = (xdrproc_t) xdr_remote_storage_pool_lookup_by_volume_args; - args = (char *) &lv_remote_storage_pool_lookup_by_volume_args; - memset (&lv_remote_storage_pool_lookup_by_volume_args, 0, sizeof lv_remote_storage_pool_lookup_by_volume_args); - ret_filter = (xdrproc_t) xdr_remote_storage_pool_lookup_by_volume_ret; - ret = (char *) &lv_remote_storage_pool_lookup_by_volume_ret; - memset (&lv_remote_storage_pool_lookup_by_volume_ret, 0, sizeof lv_remote_storage_pool_lookup_by_volume_ret); - break; + fn = (dispatch_fn) remoteDispatchStoragePoolLookupByVolume; + args_filter = (xdrproc_t) xdr_remote_storage_pool_lookup_by_volume_args; + args = (char *) &lv_remote_storage_pool_lookup_by_volume_args; + memset (&lv_remote_storage_pool_lookup_by_volume_args, 0, sizeof lv_remote_storage_pool_lookup_by_volume_args); + ret_filter = (xdrproc_t) xdr_remote_storage_pool_lookup_by_volume_ret; + ret = (char *) &lv_remote_storage_pool_lookup_by_volume_ret; + memset (&lv_remote_storage_pool_lookup_by_volume_ret, 0, sizeof lv_remote_storage_pool_lookup_by_volume_ret); + break; case REMOTE_PROC_STORAGE_POOL_NUM_OF_VOLUMES: - fn = (dispatch_fn) remoteDispatchStoragePoolNumOfVolumes; - args_filter = (xdrproc_t) xdr_remote_storage_pool_num_of_volumes_args; - args = (char *) &lv_remote_storage_pool_num_of_volumes_args; - memset (&lv_remote_storage_pool_num_of_volumes_args, 0, sizeof lv_remote_storage_pool_num_of_volumes_args); - ret_filter = (xdrproc_t) xdr_remote_storage_pool_num_of_volumes_ret; - ret = (char *) &lv_remote_storage_pool_num_of_volumes_ret; - memset (&lv_remote_storage_pool_num_of_volumes_ret, 0, sizeof lv_remote_storage_pool_num_of_volumes_ret); - break; + fn = (dispatch_fn) remoteDispatchStoragePoolNumOfVolumes; + args_filter = (xdrproc_t) xdr_remote_storage_pool_num_of_volumes_args; + args = (char *) &lv_remote_storage_pool_num_of_volumes_args; + memset (&lv_remote_storage_pool_num_of_volumes_args, 0, sizeof lv_remote_storage_pool_num_of_volumes_args); + ret_filter = (xdrproc_t) xdr_remote_storage_pool_num_of_volumes_ret; + ret = (char *) &lv_remote_storage_pool_num_of_volumes_ret; + memset (&lv_remote_storage_pool_num_of_volumes_ret, 0, sizeof lv_remote_storage_pool_num_of_volumes_ret); + break; case REMOTE_PROC_STORAGE_POOL_REFRESH: - fn = (dispatch_fn) remoteDispatchStoragePoolRefresh; - args_filter = (xdrproc_t) xdr_remote_storage_pool_refresh_args; - args = (char *) &lv_remote_storage_pool_refresh_args; - memset (&lv_remote_storage_pool_refresh_args, 0, sizeof lv_remote_storage_pool_refresh_args); - break; + fn = (dispatch_fn) remoteDispatchStoragePoolRefresh; + args_filter = (xdrproc_t) xdr_remote_storage_pool_refresh_args; + args = (char *) &lv_remote_storage_pool_refresh_args; + memset (&lv_remote_storage_pool_refresh_args, 0, sizeof lv_remote_storage_pool_refresh_args); + break; case REMOTE_PROC_STORAGE_POOL_SET_AUTOSTART: - fn = (dispatch_fn) remoteDispatchStoragePoolSetAutostart; - args_filter = (xdrproc_t) xdr_remote_storage_pool_set_autostart_args; - args = (char *) &lv_remote_storage_pool_set_autostart_args; - memset (&lv_remote_storage_pool_set_autostart_args, 0, sizeof lv_remote_storage_pool_set_autostart_args); - break; + fn = (dispatch_fn) remoteDispatchStoragePoolSetAutostart; + args_filter = (xdrproc_t) xdr_remote_storage_pool_set_autostart_args; + args = (char *) &lv_remote_storage_pool_set_autostart_args; + memset (&lv_remote_storage_pool_set_autostart_args, 0, sizeof lv_remote_storage_pool_set_autostart_args); + break; case REMOTE_PROC_STORAGE_POOL_UNDEFINE: - fn = (dispatch_fn) remoteDispatchStoragePoolUndefine; - args_filter = (xdrproc_t) xdr_remote_storage_pool_undefine_args; - args = (char *) &lv_remote_storage_pool_undefine_args; - memset (&lv_remote_storage_pool_undefine_args, 0, sizeof lv_remote_storage_pool_undefine_args); - break; + fn = (dispatch_fn) remoteDispatchStoragePoolUndefine; + args_filter = (xdrproc_t) xdr_remote_storage_pool_undefine_args; + args = (char *) &lv_remote_storage_pool_undefine_args; + memset (&lv_remote_storage_pool_undefine_args, 0, sizeof lv_remote_storage_pool_undefine_args); + break; case REMOTE_PROC_STORAGE_VOL_CREATE_XML: - fn = (dispatch_fn) remoteDispatchStorageVolCreateXml; - args_filter = (xdrproc_t) xdr_remote_storage_vol_create_xml_args; - args = (char *) &lv_remote_storage_vol_create_xml_args; - memset (&lv_remote_storage_vol_create_xml_args, 0, sizeof lv_remote_storage_vol_create_xml_args); - ret_filter = (xdrproc_t) xdr_remote_storage_vol_create_xml_ret; - ret = (char *) &lv_remote_storage_vol_create_xml_ret; - memset (&lv_remote_storage_vol_create_xml_ret, 0, sizeof lv_remote_storage_vol_create_xml_ret); - break; + fn = (dispatch_fn) remoteDispatchStorageVolCreateXml; + args_filter = (xdrproc_t) xdr_remote_storage_vol_create_xml_args; + args = (char *) &lv_remote_storage_vol_create_xml_args; + memset (&lv_remote_storage_vol_create_xml_args, 0, sizeof lv_remote_storage_vol_create_xml_args); + ret_filter = (xdrproc_t) xdr_remote_storage_vol_create_xml_ret; + ret = (char *) &lv_remote_storage_vol_create_xml_ret; + memset (&lv_remote_storage_vol_create_xml_ret, 0, sizeof lv_remote_storage_vol_create_xml_ret); + break; case REMOTE_PROC_STORAGE_VOL_DELETE: - fn = (dispatch_fn) remoteDispatchStorageVolDelete; - args_filter = (xdrproc_t) xdr_remote_storage_vol_delete_args; - args = (char *) &lv_remote_storage_vol_delete_args; - memset (&lv_remote_storage_vol_delete_args, 0, sizeof lv_remote_storage_vol_delete_args); - break; + fn = (dispatch_fn) remoteDispatchStorageVolDelete; + args_filter = (xdrproc_t) xdr_remote_storage_vol_delete_args; + args = (char *) &lv_remote_storage_vol_delete_args; + memset (&lv_remote_storage_vol_delete_args, 0, sizeof lv_remote_storage_vol_delete_args); + break; case REMOTE_PROC_STORAGE_VOL_DUMP_XML: - fn = (dispatch_fn) remoteDispatchStorageVolDumpXml; - args_filter = (xdrproc_t) xdr_remote_storage_vol_dump_xml_args; - args = (char *) &lv_remote_storage_vol_dump_xml_args; - memset (&lv_remote_storage_vol_dump_xml_args, 0, sizeof lv_remote_storage_vol_dump_xml_args); - ret_filter = (xdrproc_t) xdr_remote_storage_vol_dump_xml_ret; - ret = (char *) &lv_remote_storage_vol_dump_xml_ret; - memset (&lv_remote_storage_vol_dump_xml_ret, 0, sizeof lv_remote_storage_vol_dump_xml_ret); - break; + fn = (dispatch_fn) remoteDispatchStorageVolDumpXml; + args_filter = (xdrproc_t) xdr_remote_storage_vol_dump_xml_args; + args = (char *) &lv_remote_storage_vol_dump_xml_args; + memset (&lv_remote_storage_vol_dump_xml_args, 0, sizeof lv_remote_storage_vol_dump_xml_args); + ret_filter = (xdrproc_t) xdr_remote_storage_vol_dump_xml_ret; + ret = (char *) &lv_remote_storage_vol_dump_xml_ret; + memset (&lv_remote_storage_vol_dump_xml_ret, 0, sizeof lv_remote_storage_vol_dump_xml_ret); + break; case REMOTE_PROC_STORAGE_VOL_GET_INFO: - fn = (dispatch_fn) remoteDispatchStorageVolGetInfo; - args_filter = (xdrproc_t) xdr_remote_storage_vol_get_info_args; - args = (char *) &lv_remote_storage_vol_get_info_args; - memset (&lv_remote_storage_vol_get_info_args, 0, sizeof lv_remote_storage_vol_get_info_args); - ret_filter = (xdrproc_t) xdr_remote_storage_vol_get_info_ret; - ret = (char *) &lv_remote_storage_vol_get_info_ret; - memset (&lv_remote_storage_vol_get_info_ret, 0, sizeof lv_remote_storage_vol_get_info_ret); - break; + fn = (dispatch_fn) remoteDispatchStorageVolGetInfo; + args_filter = (xdrproc_t) xdr_remote_storage_vol_get_info_args; + args = (char *) &lv_remote_storage_vol_get_info_args; + memset (&lv_remote_storage_vol_get_info_args, 0, sizeof lv_remote_storage_vol_get_info_args); + ret_filter = (xdrproc_t) xdr_remote_storage_vol_get_info_ret; + ret = (char *) &lv_remote_storage_vol_get_info_ret; + memset (&lv_remote_storage_vol_get_info_ret, 0, sizeof lv_remote_storage_vol_get_info_ret); + break; case REMOTE_PROC_STORAGE_VOL_GET_PATH: - fn = (dispatch_fn) remoteDispatchStorageVolGetPath; - args_filter = (xdrproc_t) xdr_remote_storage_vol_get_path_args; - args = (char *) &lv_remote_storage_vol_get_path_args; - memset (&lv_remote_storage_vol_get_path_args, 0, sizeof lv_remote_storage_vol_get_path_args); - ret_filter = (xdrproc_t) xdr_remote_storage_vol_get_path_ret; - ret = (char *) &lv_remote_storage_vol_get_path_ret; - memset (&lv_remote_storage_vol_get_path_ret, 0, sizeof lv_remote_storage_vol_get_path_ret); - break; + fn = (dispatch_fn) remoteDispatchStorageVolGetPath; + args_filter = (xdrproc_t) xdr_remote_storage_vol_get_path_args; + args = (char *) &lv_remote_storage_vol_get_path_args; + memset (&lv_remote_storage_vol_get_path_args, 0, sizeof lv_remote_storage_vol_get_path_args); + ret_filter = (xdrproc_t) xdr_remote_storage_vol_get_path_ret; + ret = (char *) &lv_remote_storage_vol_get_path_ret; + memset (&lv_remote_storage_vol_get_path_ret, 0, sizeof lv_remote_storage_vol_get_path_ret); + break; case REMOTE_PROC_STORAGE_VOL_LOOKUP_BY_KEY: - fn = (dispatch_fn) remoteDispatchStorageVolLookupByKey; - args_filter = (xdrproc_t) xdr_remote_storage_vol_lookup_by_key_args; - args = (char *) &lv_remote_storage_vol_lookup_by_key_args; - memset (&lv_remote_storage_vol_lookup_by_key_args, 0, sizeof lv_remote_storage_vol_lookup_by_key_args); - ret_filter = (xdrproc_t) xdr_remote_storage_vol_lookup_by_key_ret; - ret = (char *) &lv_remote_storage_vol_lookup_by_key_ret; - memset (&lv_remote_storage_vol_lookup_by_key_ret, 0, sizeof lv_remote_storage_vol_lookup_by_key_ret); - break; + fn = (dispatch_fn) remoteDispatchStorageVolLookupByKey; + args_filter = (xdrproc_t) xdr_remote_storage_vol_lookup_by_key_args; + args = (char *) &lv_remote_storage_vol_lookup_by_key_args; + memset (&lv_remote_storage_vol_lookup_by_key_args, 0, sizeof lv_remote_storage_vol_lookup_by_key_args); + ret_filter = (xdrproc_t) xdr_remote_storage_vol_lookup_by_key_ret; + ret = (char *) &lv_remote_storage_vol_lookup_by_key_ret; + memset (&lv_remote_storage_vol_lookup_by_key_ret, 0, sizeof lv_remote_storage_vol_lookup_by_key_ret); + break; case REMOTE_PROC_STORAGE_VOL_LOOKUP_BY_NAME: - fn = (dispatch_fn) remoteDispatchStorageVolLookupByName; - args_filter = (xdrproc_t) xdr_remote_storage_vol_lookup_by_name_args; - args = (char *) &lv_remote_storage_vol_lookup_by_name_args; - memset (&lv_remote_storage_vol_lookup_by_name_args, 0, sizeof lv_remote_storage_vol_lookup_by_name_args); - ret_filter = (xdrproc_t) xdr_remote_storage_vol_lookup_by_name_ret; - ret = (char *) &lv_remote_storage_vol_lookup_by_name_ret; - memset (&lv_remote_storage_vol_lookup_by_name_ret, 0, sizeof lv_remote_storage_vol_lookup_by_name_ret); - break; + fn = (dispatch_fn) remoteDispatchStorageVolLookupByName; + args_filter = (xdrproc_t) xdr_remote_storage_vol_lookup_by_name_args; + args = (char *) &lv_remote_storage_vol_lookup_by_name_args; + memset (&lv_remote_storage_vol_lookup_by_name_args, 0, sizeof lv_remote_storage_vol_lookup_by_name_args); + ret_filter = (xdrproc_t) xdr_remote_storage_vol_lookup_by_name_ret; + ret = (char *) &lv_remote_storage_vol_lookup_by_name_ret; + memset (&lv_remote_storage_vol_lookup_by_name_ret, 0, sizeof lv_remote_storage_vol_lookup_by_name_ret); + break; case REMOTE_PROC_STORAGE_VOL_LOOKUP_BY_PATH: - fn = (dispatch_fn) remoteDispatchStorageVolLookupByPath; - args_filter = (xdrproc_t) xdr_remote_storage_vol_lookup_by_path_args; - args = (char *) &lv_remote_storage_vol_lookup_by_path_args; - memset (&lv_remote_storage_vol_lookup_by_path_args, 0, sizeof lv_remote_storage_vol_lookup_by_path_args); - ret_filter = (xdrproc_t) xdr_remote_storage_vol_lookup_by_path_ret; - ret = (char *) &lv_remote_storage_vol_lookup_by_path_ret; - memset (&lv_remote_storage_vol_lookup_by_path_ret, 0, sizeof lv_remote_storage_vol_lookup_by_path_ret); - break; + fn = (dispatch_fn) remoteDispatchStorageVolLookupByPath; + args_filter = (xdrproc_t) xdr_remote_storage_vol_lookup_by_path_args; + args = (char *) &lv_remote_storage_vol_lookup_by_path_args; + memset (&lv_remote_storage_vol_lookup_by_path_args, 0, sizeof lv_remote_storage_vol_lookup_by_path_args); + ret_filter = (xdrproc_t) xdr_remote_storage_vol_lookup_by_path_ret; + ret = (char *) &lv_remote_storage_vol_lookup_by_path_ret; + memset (&lv_remote_storage_vol_lookup_by_path_ret, 0, sizeof lv_remote_storage_vol_lookup_by_path_ret); + break; case REMOTE_PROC_SUPPORTS_FEATURE: - fn = (dispatch_fn) remoteDispatchSupportsFeature; - args_filter = (xdrproc_t) xdr_remote_supports_feature_args; - args = (char *) &lv_remote_supports_feature_args; - memset (&lv_remote_supports_feature_args, 0, sizeof lv_remote_supports_feature_args); - ret_filter = (xdrproc_t) xdr_remote_supports_feature_ret; - ret = (char *) &lv_remote_supports_feature_ret; - memset (&lv_remote_supports_feature_ret, 0, sizeof lv_remote_supports_feature_ret); - break; + fn = (dispatch_fn) remoteDispatchSupportsFeature; + args_filter = (xdrproc_t) xdr_remote_supports_feature_args; + args = (char *) &lv_remote_supports_feature_args; + memset (&lv_remote_supports_feature_args, 0, sizeof lv_remote_supports_feature_args); + ret_filter = (xdrproc_t) xdr_remote_supports_feature_ret; + ret = (char *) &lv_remote_supports_feature_ret; + memset (&lv_remote_supports_feature_ret, 0, sizeof lv_remote_supports_feature_ret); + break; diff --git a/qemud/remote_protocol.c b/qemud/remote_protocol.c index dfbeb2bed3a0fdccf683b33ae17826d7059f9a45..8636dc2220879ec5fb8d9ac01f9cb59fcf8f2eab 100644 --- a/qemud/remote_protocol.c +++ b/qemud/remote_protocol.c @@ -10,1873 +10,1873 @@ bool_t xdr_remote_nonnull_string (XDR *xdrs, remote_nonnull_string *objp) { - if (!xdr_string (xdrs, objp, REMOTE_STRING_MAX)) - return FALSE; - return TRUE; + if (!xdr_string (xdrs, objp, REMOTE_STRING_MAX)) + return FALSE; + return TRUE; } bool_t xdr_remote_string (XDR *xdrs, remote_string *objp) { - if (!xdr_pointer (xdrs, (char **)objp, sizeof (remote_nonnull_string), (xdrproc_t) xdr_remote_nonnull_string)) - return FALSE; - return TRUE; + if (!xdr_pointer (xdrs, (char **)objp, sizeof (remote_nonnull_string), (xdrproc_t) xdr_remote_nonnull_string)) + return FALSE; + return TRUE; } bool_t xdr_remote_uuid (XDR *xdrs, remote_uuid objp) { - if (!xdr_opaque (xdrs, objp, VIR_UUID_BUFLEN)) - return FALSE; - return TRUE; + if (!xdr_opaque (xdrs, objp, VIR_UUID_BUFLEN)) + return FALSE; + return TRUE; } bool_t xdr_remote_nonnull_domain (XDR *xdrs, remote_nonnull_domain *objp) { - if (!xdr_remote_nonnull_string (xdrs, &objp->name)) - return FALSE; - if (!xdr_remote_uuid (xdrs, objp->uuid)) - return FALSE; - if (!xdr_int (xdrs, &objp->id)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_string (xdrs, &objp->name)) + return FALSE; + if (!xdr_remote_uuid (xdrs, objp->uuid)) + return FALSE; + if (!xdr_int (xdrs, &objp->id)) + return FALSE; + return TRUE; } bool_t xdr_remote_nonnull_network (XDR *xdrs, remote_nonnull_network *objp) { - if (!xdr_remote_nonnull_string (xdrs, &objp->name)) - return FALSE; - if (!xdr_remote_uuid (xdrs, objp->uuid)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_string (xdrs, &objp->name)) + return FALSE; + if (!xdr_remote_uuid (xdrs, objp->uuid)) + return FALSE; + return TRUE; } bool_t xdr_remote_nonnull_storage_pool (XDR *xdrs, remote_nonnull_storage_pool *objp) { - if (!xdr_remote_nonnull_string (xdrs, &objp->name)) - return FALSE; - if (!xdr_remote_uuid (xdrs, objp->uuid)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_string (xdrs, &objp->name)) + return FALSE; + if (!xdr_remote_uuid (xdrs, objp->uuid)) + return FALSE; + return TRUE; } bool_t xdr_remote_nonnull_storage_vol (XDR *xdrs, remote_nonnull_storage_vol *objp) { - if (!xdr_remote_nonnull_string (xdrs, &objp->pool)) - return FALSE; - if (!xdr_remote_nonnull_string (xdrs, &objp->name)) - return FALSE; - if (!xdr_remote_nonnull_string (xdrs, &objp->key)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_string (xdrs, &objp->pool)) + return FALSE; + if (!xdr_remote_nonnull_string (xdrs, &objp->name)) + return FALSE; + if (!xdr_remote_nonnull_string (xdrs, &objp->key)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain (XDR *xdrs, remote_domain *objp) { - if (!xdr_pointer (xdrs, (char **)objp, sizeof (remote_nonnull_domain), (xdrproc_t) xdr_remote_nonnull_domain)) - return FALSE; - return TRUE; + if (!xdr_pointer (xdrs, (char **)objp, sizeof (remote_nonnull_domain), (xdrproc_t) xdr_remote_nonnull_domain)) + return FALSE; + return TRUE; } bool_t xdr_remote_network (XDR *xdrs, remote_network *objp) { - if (!xdr_pointer (xdrs, (char **)objp, sizeof (remote_nonnull_network), (xdrproc_t) xdr_remote_nonnull_network)) - return FALSE; - return TRUE; + if (!xdr_pointer (xdrs, (char **)objp, sizeof (remote_nonnull_network), (xdrproc_t) xdr_remote_nonnull_network)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_pool (XDR *xdrs, remote_storage_pool *objp) { - if (!xdr_pointer (xdrs, (char **)objp, sizeof (remote_nonnull_storage_pool), (xdrproc_t) xdr_remote_nonnull_storage_pool)) - return FALSE; - return TRUE; + if (!xdr_pointer (xdrs, (char **)objp, sizeof (remote_nonnull_storage_pool), (xdrproc_t) xdr_remote_nonnull_storage_pool)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_vol (XDR *xdrs, remote_storage_vol *objp) { - if (!xdr_pointer (xdrs, (char **)objp, sizeof (remote_nonnull_storage_vol), (xdrproc_t) xdr_remote_nonnull_storage_vol)) - return FALSE; - return TRUE; + if (!xdr_pointer (xdrs, (char **)objp, sizeof (remote_nonnull_storage_vol), (xdrproc_t) xdr_remote_nonnull_storage_vol)) + return FALSE; + return TRUE; } bool_t xdr_remote_error (XDR *xdrs, remote_error *objp) { - if (!xdr_int (xdrs, &objp->code)) - return FALSE; - if (!xdr_int (xdrs, &objp->domain)) - return FALSE; - if (!xdr_remote_string (xdrs, &objp->message)) - return FALSE; - if (!xdr_int (xdrs, &objp->level)) - return FALSE; - if (!xdr_remote_domain (xdrs, &objp->dom)) - return FALSE; - if (!xdr_remote_string (xdrs, &objp->str1)) - return FALSE; - if (!xdr_remote_string (xdrs, &objp->str2)) - return FALSE; - if (!xdr_remote_string (xdrs, &objp->str3)) - return FALSE; - if (!xdr_int (xdrs, &objp->int1)) - return FALSE; - if (!xdr_int (xdrs, &objp->int2)) - return FALSE; - if (!xdr_remote_network (xdrs, &objp->net)) - return FALSE; - return TRUE; + if (!xdr_int (xdrs, &objp->code)) + return FALSE; + if (!xdr_int (xdrs, &objp->domain)) + return FALSE; + if (!xdr_remote_string (xdrs, &objp->message)) + return FALSE; + if (!xdr_int (xdrs, &objp->level)) + return FALSE; + if (!xdr_remote_domain (xdrs, &objp->dom)) + return FALSE; + if (!xdr_remote_string (xdrs, &objp->str1)) + return FALSE; + if (!xdr_remote_string (xdrs, &objp->str2)) + return FALSE; + if (!xdr_remote_string (xdrs, &objp->str3)) + return FALSE; + if (!xdr_int (xdrs, &objp->int1)) + return FALSE; + if (!xdr_int (xdrs, &objp->int2)) + return FALSE; + if (!xdr_remote_network (xdrs, &objp->net)) + return FALSE; + return TRUE; } bool_t xdr_remote_auth_type (XDR *xdrs, remote_auth_type *objp) { - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; + if (!xdr_enum (xdrs, (enum_t *) objp)) + return FALSE; + return TRUE; } bool_t xdr_remote_vcpu_info (XDR *xdrs, remote_vcpu_info *objp) { - if (!xdr_u_int (xdrs, &objp->number)) - return FALSE; - if (!xdr_int (xdrs, &objp->state)) - return FALSE; - if (!xdr_u_quad_t (xdrs, &objp->cpu_time)) - return FALSE; - if (!xdr_int (xdrs, &objp->cpu)) - return FALSE; - return TRUE; + if (!xdr_u_int (xdrs, &objp->number)) + return FALSE; + if (!xdr_int (xdrs, &objp->state)) + return FALSE; + if (!xdr_u_quad_t (xdrs, &objp->cpu_time)) + return FALSE; + if (!xdr_int (xdrs, &objp->cpu)) + return FALSE; + return TRUE; } bool_t xdr_remote_sched_param_value (XDR *xdrs, remote_sched_param_value *objp) { - if (!xdr_int (xdrs, &objp->type)) - return FALSE; - switch (objp->type) { - case VIR_DOMAIN_SCHED_FIELD_INT: - return FALSE; - break; - case VIR_DOMAIN_SCHED_FIELD_UINT: - if (!xdr_u_int (xdrs, &objp->remote_sched_param_value_u.ui)) - return FALSE; - break; - case VIR_DOMAIN_SCHED_FIELD_LLONG: - if (!xdr_quad_t (xdrs, &objp->remote_sched_param_value_u.l)) - return FALSE; - break; - case VIR_DOMAIN_SCHED_FIELD_ULLONG: - if (!xdr_u_quad_t (xdrs, &objp->remote_sched_param_value_u.ul)) - return FALSE; - break; - case VIR_DOMAIN_SCHED_FIELD_DOUBLE: - if (!xdr_double (xdrs, &objp->remote_sched_param_value_u.d)) - return FALSE; - break; - case VIR_DOMAIN_SCHED_FIELD_BOOLEAN: - if (!xdr_int (xdrs, &objp->remote_sched_param_value_u.b)) - return FALSE; - break; - default: - return FALSE; - } - return TRUE; + if (!xdr_int (xdrs, &objp->type)) + return FALSE; + switch (objp->type) { + case VIR_DOMAIN_SCHED_FIELD_INT: + return FALSE; + break; + case VIR_DOMAIN_SCHED_FIELD_UINT: + if (!xdr_u_int (xdrs, &objp->remote_sched_param_value_u.ui)) + return FALSE; + break; + case VIR_DOMAIN_SCHED_FIELD_LLONG: + if (!xdr_quad_t (xdrs, &objp->remote_sched_param_value_u.l)) + return FALSE; + break; + case VIR_DOMAIN_SCHED_FIELD_ULLONG: + if (!xdr_u_quad_t (xdrs, &objp->remote_sched_param_value_u.ul)) + return FALSE; + break; + case VIR_DOMAIN_SCHED_FIELD_DOUBLE: + if (!xdr_double (xdrs, &objp->remote_sched_param_value_u.d)) + return FALSE; + break; + case VIR_DOMAIN_SCHED_FIELD_BOOLEAN: + if (!xdr_int (xdrs, &objp->remote_sched_param_value_u.b)) + return FALSE; + break; + default: + return FALSE; + } + return TRUE; } bool_t xdr_remote_sched_param (XDR *xdrs, remote_sched_param *objp) { - if (!xdr_remote_nonnull_string (xdrs, &objp->field)) - return FALSE; - if (!xdr_remote_sched_param_value (xdrs, &objp->value)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_string (xdrs, &objp->field)) + return FALSE; + if (!xdr_remote_sched_param_value (xdrs, &objp->value)) + return FALSE; + return TRUE; } bool_t xdr_remote_open_args (XDR *xdrs, remote_open_args *objp) { - if (!xdr_remote_string (xdrs, &objp->name)) - return FALSE; - if (!xdr_int (xdrs, &objp->flags)) - return FALSE; - return TRUE; + if (!xdr_remote_string (xdrs, &objp->name)) + return FALSE; + if (!xdr_int (xdrs, &objp->flags)) + return FALSE; + return TRUE; } bool_t xdr_remote_supports_feature_args (XDR *xdrs, remote_supports_feature_args *objp) { - if (!xdr_int (xdrs, &objp->feature)) - return FALSE; - return TRUE; + if (!xdr_int (xdrs, &objp->feature)) + return FALSE; + return TRUE; } bool_t xdr_remote_supports_feature_ret (XDR *xdrs, remote_supports_feature_ret *objp) { - if (!xdr_int (xdrs, &objp->supported)) - return FALSE; - return TRUE; + if (!xdr_int (xdrs, &objp->supported)) + return FALSE; + return TRUE; } bool_t xdr_remote_get_type_ret (XDR *xdrs, remote_get_type_ret *objp) { - if (!xdr_remote_nonnull_string (xdrs, &objp->type)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_string (xdrs, &objp->type)) + return FALSE; + return TRUE; } bool_t xdr_remote_get_version_ret (XDR *xdrs, remote_get_version_ret *objp) { - if (!xdr_quad_t (xdrs, &objp->hv_ver)) - return FALSE; - return TRUE; + if (!xdr_quad_t (xdrs, &objp->hv_ver)) + return FALSE; + return TRUE; } bool_t xdr_remote_get_hostname_ret (XDR *xdrs, remote_get_hostname_ret *objp) { - if (!xdr_remote_nonnull_string (xdrs, &objp->hostname)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_string (xdrs, &objp->hostname)) + return FALSE; + return TRUE; } bool_t xdr_remote_get_max_vcpus_args (XDR *xdrs, remote_get_max_vcpus_args *objp) { - if (!xdr_remote_string (xdrs, &objp->type)) - return FALSE; - return TRUE; + if (!xdr_remote_string (xdrs, &objp->type)) + return FALSE; + return TRUE; } bool_t xdr_remote_get_max_vcpus_ret (XDR *xdrs, remote_get_max_vcpus_ret *objp) { - if (!xdr_int (xdrs, &objp->max_vcpus)) - return FALSE; - return TRUE; + if (!xdr_int (xdrs, &objp->max_vcpus)) + return FALSE; + return TRUE; } bool_t xdr_remote_node_get_info_ret (XDR *xdrs, remote_node_get_info_ret *objp) { - register int32_t *buf; - - - if (xdrs->x_op == XDR_ENCODE) { - if (!xdr_vector (xdrs, (char *)objp->model, 32, - sizeof (char), (xdrproc_t) xdr_char)) - return FALSE; - if (!xdr_quad_t (xdrs, &objp->memory)) - return FALSE; - buf = XDR_INLINE (xdrs, 6 * BYTES_PER_XDR_UNIT); - if (buf == NULL) { - if (!xdr_int (xdrs, &objp->cpus)) - return FALSE; - if (!xdr_int (xdrs, &objp->mhz)) - return FALSE; - if (!xdr_int (xdrs, &objp->nodes)) - return FALSE; - if (!xdr_int (xdrs, &objp->sockets)) - return FALSE; - if (!xdr_int (xdrs, &objp->cores)) - return FALSE; - if (!xdr_int (xdrs, &objp->threads)) - return FALSE; - } else { - (void)IXDR_PUT_INT32(buf, objp->cpus); - (void)IXDR_PUT_INT32(buf, objp->mhz); - (void)IXDR_PUT_INT32(buf, objp->nodes); - (void)IXDR_PUT_INT32(buf, objp->sockets); - (void)IXDR_PUT_INT32(buf, objp->cores); - (void)IXDR_PUT_INT32(buf, objp->threads); - } - return TRUE; - } else if (xdrs->x_op == XDR_DECODE) { - if (!xdr_vector (xdrs, (char *)objp->model, 32, - sizeof (char), (xdrproc_t) xdr_char)) - return FALSE; - if (!xdr_quad_t (xdrs, &objp->memory)) - return FALSE; - buf = XDR_INLINE (xdrs, 6 * BYTES_PER_XDR_UNIT); - if (buf == NULL) { - if (!xdr_int (xdrs, &objp->cpus)) - return FALSE; - if (!xdr_int (xdrs, &objp->mhz)) - return FALSE; - if (!xdr_int (xdrs, &objp->nodes)) - return FALSE; - if (!xdr_int (xdrs, &objp->sockets)) - return FALSE; - if (!xdr_int (xdrs, &objp->cores)) - return FALSE; - if (!xdr_int (xdrs, &objp->threads)) - return FALSE; - } else { - objp->cpus = IXDR_GET_LONG(buf); - objp->mhz = IXDR_GET_LONG(buf); - objp->nodes = IXDR_GET_LONG(buf); - objp->sockets = IXDR_GET_LONG(buf); - objp->cores = IXDR_GET_LONG(buf); - objp->threads = IXDR_GET_LONG(buf); - } - return TRUE; - } - - if (!xdr_vector (xdrs, (char *)objp->model, 32, - sizeof (char), (xdrproc_t) xdr_char)) - return FALSE; - if (!xdr_quad_t (xdrs, &objp->memory)) - return FALSE; - if (!xdr_int (xdrs, &objp->cpus)) - return FALSE; - if (!xdr_int (xdrs, &objp->mhz)) - return FALSE; - if (!xdr_int (xdrs, &objp->nodes)) - return FALSE; - if (!xdr_int (xdrs, &objp->sockets)) - return FALSE; - if (!xdr_int (xdrs, &objp->cores)) - return FALSE; - if (!xdr_int (xdrs, &objp->threads)) - return FALSE; - return TRUE; + register int32_t *buf; + + + if (xdrs->x_op == XDR_ENCODE) { + if (!xdr_vector (xdrs, (char *)objp->model, 32, + sizeof (char), (xdrproc_t) xdr_char)) + return FALSE; + if (!xdr_quad_t (xdrs, &objp->memory)) + return FALSE; + buf = XDR_INLINE (xdrs, 6 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_int (xdrs, &objp->cpus)) + return FALSE; + if (!xdr_int (xdrs, &objp->mhz)) + return FALSE; + if (!xdr_int (xdrs, &objp->nodes)) + return FALSE; + if (!xdr_int (xdrs, &objp->sockets)) + return FALSE; + if (!xdr_int (xdrs, &objp->cores)) + return FALSE; + if (!xdr_int (xdrs, &objp->threads)) + return FALSE; + } else { + (void)IXDR_PUT_INT32(buf, objp->cpus); + (void)IXDR_PUT_INT32(buf, objp->mhz); + (void)IXDR_PUT_INT32(buf, objp->nodes); + (void)IXDR_PUT_INT32(buf, objp->sockets); + (void)IXDR_PUT_INT32(buf, objp->cores); + (void)IXDR_PUT_INT32(buf, objp->threads); + } + return TRUE; + } else if (xdrs->x_op == XDR_DECODE) { + if (!xdr_vector (xdrs, (char *)objp->model, 32, + sizeof (char), (xdrproc_t) xdr_char)) + return FALSE; + if (!xdr_quad_t (xdrs, &objp->memory)) + return FALSE; + buf = XDR_INLINE (xdrs, 6 * BYTES_PER_XDR_UNIT); + if (buf == NULL) { + if (!xdr_int (xdrs, &objp->cpus)) + return FALSE; + if (!xdr_int (xdrs, &objp->mhz)) + return FALSE; + if (!xdr_int (xdrs, &objp->nodes)) + return FALSE; + if (!xdr_int (xdrs, &objp->sockets)) + return FALSE; + if (!xdr_int (xdrs, &objp->cores)) + return FALSE; + if (!xdr_int (xdrs, &objp->threads)) + return FALSE; + } else { + objp->cpus = IXDR_GET_LONG(buf); + objp->mhz = IXDR_GET_LONG(buf); + objp->nodes = IXDR_GET_LONG(buf); + objp->sockets = IXDR_GET_LONG(buf); + objp->cores = IXDR_GET_LONG(buf); + objp->threads = IXDR_GET_LONG(buf); + } + return TRUE; + } + + if (!xdr_vector (xdrs, (char *)objp->model, 32, + sizeof (char), (xdrproc_t) xdr_char)) + return FALSE; + if (!xdr_quad_t (xdrs, &objp->memory)) + return FALSE; + if (!xdr_int (xdrs, &objp->cpus)) + return FALSE; + if (!xdr_int (xdrs, &objp->mhz)) + return FALSE; + if (!xdr_int (xdrs, &objp->nodes)) + return FALSE; + if (!xdr_int (xdrs, &objp->sockets)) + return FALSE; + if (!xdr_int (xdrs, &objp->cores)) + return FALSE; + if (!xdr_int (xdrs, &objp->threads)) + return FALSE; + return TRUE; } bool_t xdr_remote_get_capabilities_ret (XDR *xdrs, remote_get_capabilities_ret *objp) { - if (!xdr_remote_nonnull_string (xdrs, &objp->capabilities)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_string (xdrs, &objp->capabilities)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_get_scheduler_type_args (XDR *xdrs, remote_domain_get_scheduler_type_args *objp) { - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_get_scheduler_type_ret (XDR *xdrs, remote_domain_get_scheduler_type_ret *objp) { - if (!xdr_remote_nonnull_string (xdrs, &objp->type)) - return FALSE; - if (!xdr_int (xdrs, &objp->nparams)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_string (xdrs, &objp->type)) + return FALSE; + if (!xdr_int (xdrs, &objp->nparams)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_get_scheduler_parameters_args (XDR *xdrs, remote_domain_get_scheduler_parameters_args *objp) { - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - if (!xdr_int (xdrs, &objp->nparams)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + if (!xdr_int (xdrs, &objp->nparams)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_get_scheduler_parameters_ret (XDR *xdrs, remote_domain_get_scheduler_parameters_ret *objp) { - char **objp_cpp0 = (char **) (void *) &objp->params.params_val; + char **objp_cpp0 = (char **) (void *) &objp->params.params_val; - if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->params.params_len, REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX, - sizeof (remote_sched_param), (xdrproc_t) xdr_remote_sched_param)) - return FALSE; - return TRUE; + if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->params.params_len, REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX, + sizeof (remote_sched_param), (xdrproc_t) xdr_remote_sched_param)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_set_scheduler_parameters_args (XDR *xdrs, remote_domain_set_scheduler_parameters_args *objp) { - char **objp_cpp0 = (char **) (void *) &objp->params.params_val; + char **objp_cpp0 = (char **) (void *) &objp->params.params_val; - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->params.params_len, REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX, - sizeof (remote_sched_param), (xdrproc_t) xdr_remote_sched_param)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->params.params_len, REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX, + sizeof (remote_sched_param), (xdrproc_t) xdr_remote_sched_param)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_block_stats_args (XDR *xdrs, remote_domain_block_stats_args *objp) { - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - if (!xdr_remote_nonnull_string (xdrs, &objp->path)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + if (!xdr_remote_nonnull_string (xdrs, &objp->path)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_block_stats_ret (XDR *xdrs, remote_domain_block_stats_ret *objp) { - if (!xdr_quad_t (xdrs, &objp->rd_req)) - return FALSE; - if (!xdr_quad_t (xdrs, &objp->rd_bytes)) - return FALSE; - if (!xdr_quad_t (xdrs, &objp->wr_req)) - return FALSE; - if (!xdr_quad_t (xdrs, &objp->wr_bytes)) - return FALSE; - if (!xdr_quad_t (xdrs, &objp->errs)) - return FALSE; - return TRUE; + if (!xdr_quad_t (xdrs, &objp->rd_req)) + return FALSE; + if (!xdr_quad_t (xdrs, &objp->rd_bytes)) + return FALSE; + if (!xdr_quad_t (xdrs, &objp->wr_req)) + return FALSE; + if (!xdr_quad_t (xdrs, &objp->wr_bytes)) + return FALSE; + if (!xdr_quad_t (xdrs, &objp->errs)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_interface_stats_args (XDR *xdrs, remote_domain_interface_stats_args *objp) { - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - if (!xdr_remote_nonnull_string (xdrs, &objp->path)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + if (!xdr_remote_nonnull_string (xdrs, &objp->path)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_interface_stats_ret (XDR *xdrs, remote_domain_interface_stats_ret *objp) { - if (!xdr_quad_t (xdrs, &objp->rx_bytes)) - return FALSE; - if (!xdr_quad_t (xdrs, &objp->rx_packets)) - return FALSE; - if (!xdr_quad_t (xdrs, &objp->rx_errs)) - return FALSE; - if (!xdr_quad_t (xdrs, &objp->rx_drop)) - return FALSE; - if (!xdr_quad_t (xdrs, &objp->tx_bytes)) - return FALSE; - if (!xdr_quad_t (xdrs, &objp->tx_packets)) - return FALSE; - if (!xdr_quad_t (xdrs, &objp->tx_errs)) - return FALSE; - if (!xdr_quad_t (xdrs, &objp->tx_drop)) - return FALSE; - return TRUE; + if (!xdr_quad_t (xdrs, &objp->rx_bytes)) + return FALSE; + if (!xdr_quad_t (xdrs, &objp->rx_packets)) + return FALSE; + if (!xdr_quad_t (xdrs, &objp->rx_errs)) + return FALSE; + if (!xdr_quad_t (xdrs, &objp->rx_drop)) + return FALSE; + if (!xdr_quad_t (xdrs, &objp->tx_bytes)) + return FALSE; + if (!xdr_quad_t (xdrs, &objp->tx_packets)) + return FALSE; + if (!xdr_quad_t (xdrs, &objp->tx_errs)) + return FALSE; + if (!xdr_quad_t (xdrs, &objp->tx_drop)) + return FALSE; + return TRUE; } bool_t xdr_remote_list_domains_args (XDR *xdrs, remote_list_domains_args *objp) { - if (!xdr_int (xdrs, &objp->maxids)) - return FALSE; - return TRUE; + if (!xdr_int (xdrs, &objp->maxids)) + return FALSE; + return TRUE; } bool_t xdr_remote_list_domains_ret (XDR *xdrs, remote_list_domains_ret *objp) { - char **objp_cpp0 = (char **) (void *) &objp->ids.ids_val; + char **objp_cpp0 = (char **) (void *) &objp->ids.ids_val; - if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->ids.ids_len, REMOTE_DOMAIN_ID_LIST_MAX, - sizeof (int), (xdrproc_t) xdr_int)) - return FALSE; - return TRUE; + if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->ids.ids_len, REMOTE_DOMAIN_ID_LIST_MAX, + sizeof (int), (xdrproc_t) xdr_int)) + return FALSE; + return TRUE; } bool_t xdr_remote_num_of_domains_ret (XDR *xdrs, remote_num_of_domains_ret *objp) { - if (!xdr_int (xdrs, &objp->num)) - return FALSE; - return TRUE; + if (!xdr_int (xdrs, &objp->num)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_create_linux_args (XDR *xdrs, remote_domain_create_linux_args *objp) { - if (!xdr_remote_nonnull_string (xdrs, &objp->xml_desc)) - return FALSE; - if (!xdr_int (xdrs, &objp->flags)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_string (xdrs, &objp->xml_desc)) + return FALSE; + if (!xdr_int (xdrs, &objp->flags)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_create_linux_ret (XDR *xdrs, remote_domain_create_linux_ret *objp) { - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_lookup_by_id_args (XDR *xdrs, remote_domain_lookup_by_id_args *objp) { - if (!xdr_int (xdrs, &objp->id)) - return FALSE; - return TRUE; + if (!xdr_int (xdrs, &objp->id)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_lookup_by_id_ret (XDR *xdrs, remote_domain_lookup_by_id_ret *objp) { - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_lookup_by_uuid_args (XDR *xdrs, remote_domain_lookup_by_uuid_args *objp) { - if (!xdr_remote_uuid (xdrs, objp->uuid)) - return FALSE; - return TRUE; + if (!xdr_remote_uuid (xdrs, objp->uuid)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_lookup_by_uuid_ret (XDR *xdrs, remote_domain_lookup_by_uuid_ret *objp) { - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_lookup_by_name_args (XDR *xdrs, remote_domain_lookup_by_name_args *objp) { - if (!xdr_remote_nonnull_string (xdrs, &objp->name)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_string (xdrs, &objp->name)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_lookup_by_name_ret (XDR *xdrs, remote_domain_lookup_by_name_ret *objp) { - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_suspend_args (XDR *xdrs, remote_domain_suspend_args *objp) { - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_resume_args (XDR *xdrs, remote_domain_resume_args *objp) { - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_shutdown_args (XDR *xdrs, remote_domain_shutdown_args *objp) { - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_reboot_args (XDR *xdrs, remote_domain_reboot_args *objp) { - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - if (!xdr_int (xdrs, &objp->flags)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + if (!xdr_int (xdrs, &objp->flags)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_destroy_args (XDR *xdrs, remote_domain_destroy_args *objp) { - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_get_os_type_args (XDR *xdrs, remote_domain_get_os_type_args *objp) { - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_get_os_type_ret (XDR *xdrs, remote_domain_get_os_type_ret *objp) { - if (!xdr_remote_nonnull_string (xdrs, &objp->type)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_string (xdrs, &objp->type)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_get_max_memory_args (XDR *xdrs, remote_domain_get_max_memory_args *objp) { - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_get_max_memory_ret (XDR *xdrs, remote_domain_get_max_memory_ret *objp) { - if (!xdr_u_quad_t (xdrs, &objp->memory)) - return FALSE; - return TRUE; + if (!xdr_u_quad_t (xdrs, &objp->memory)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_set_max_memory_args (XDR *xdrs, remote_domain_set_max_memory_args *objp) { - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - if (!xdr_u_quad_t (xdrs, &objp->memory)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + if (!xdr_u_quad_t (xdrs, &objp->memory)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_set_memory_args (XDR *xdrs, remote_domain_set_memory_args *objp) { - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - if (!xdr_u_quad_t (xdrs, &objp->memory)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + if (!xdr_u_quad_t (xdrs, &objp->memory)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_get_info_args (XDR *xdrs, remote_domain_get_info_args *objp) { - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_get_info_ret (XDR *xdrs, remote_domain_get_info_ret *objp) { - if (!xdr_u_char (xdrs, &objp->state)) - return FALSE; - if (!xdr_u_quad_t (xdrs, &objp->max_mem)) - return FALSE; - if (!xdr_u_quad_t (xdrs, &objp->memory)) - return FALSE; - if (!xdr_u_short (xdrs, &objp->nr_virt_cpu)) - return FALSE; - if (!xdr_u_quad_t (xdrs, &objp->cpu_time)) - return FALSE; - return TRUE; + if (!xdr_u_char (xdrs, &objp->state)) + return FALSE; + if (!xdr_u_quad_t (xdrs, &objp->max_mem)) + return FALSE; + if (!xdr_u_quad_t (xdrs, &objp->memory)) + return FALSE; + if (!xdr_u_short (xdrs, &objp->nr_virt_cpu)) + return FALSE; + if (!xdr_u_quad_t (xdrs, &objp->cpu_time)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_save_args (XDR *xdrs, remote_domain_save_args *objp) { - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - if (!xdr_remote_nonnull_string (xdrs, &objp->to)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + if (!xdr_remote_nonnull_string (xdrs, &objp->to)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_restore_args (XDR *xdrs, remote_domain_restore_args *objp) { - if (!xdr_remote_nonnull_string (xdrs, &objp->from)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_string (xdrs, &objp->from)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_core_dump_args (XDR *xdrs, remote_domain_core_dump_args *objp) { - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - if (!xdr_remote_nonnull_string (xdrs, &objp->to)) - return FALSE; - if (!xdr_int (xdrs, &objp->flags)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + if (!xdr_remote_nonnull_string (xdrs, &objp->to)) + return FALSE; + if (!xdr_int (xdrs, &objp->flags)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_dump_xml_args (XDR *xdrs, remote_domain_dump_xml_args *objp) { - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - if (!xdr_int (xdrs, &objp->flags)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + if (!xdr_int (xdrs, &objp->flags)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_dump_xml_ret (XDR *xdrs, remote_domain_dump_xml_ret *objp) { - if (!xdr_remote_nonnull_string (xdrs, &objp->xml)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_string (xdrs, &objp->xml)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_migrate_prepare_args (XDR *xdrs, remote_domain_migrate_prepare_args *objp) { - if (!xdr_remote_string (xdrs, &objp->uri_in)) - return FALSE; - if (!xdr_u_quad_t (xdrs, &objp->flags)) - return FALSE; - if (!xdr_remote_string (xdrs, &objp->dname)) - return FALSE; - if (!xdr_u_quad_t (xdrs, &objp->resource)) - return FALSE; - return TRUE; + if (!xdr_remote_string (xdrs, &objp->uri_in)) + return FALSE; + if (!xdr_u_quad_t (xdrs, &objp->flags)) + return FALSE; + if (!xdr_remote_string (xdrs, &objp->dname)) + return FALSE; + if (!xdr_u_quad_t (xdrs, &objp->resource)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_migrate_prepare_ret (XDR *xdrs, remote_domain_migrate_prepare_ret *objp) { - char **objp_cpp0 = (char **) (void *) &objp->cookie.cookie_val; + char **objp_cpp0 = (char **) (void *) &objp->cookie.cookie_val; - if (!xdr_bytes (xdrs, objp_cpp0, (u_int *) &objp->cookie.cookie_len, REMOTE_MIGRATE_COOKIE_MAX)) - return FALSE; - if (!xdr_remote_string (xdrs, &objp->uri_out)) - return FALSE; - return TRUE; + if (!xdr_bytes (xdrs, objp_cpp0, (u_int *) &objp->cookie.cookie_len, REMOTE_MIGRATE_COOKIE_MAX)) + return FALSE; + if (!xdr_remote_string (xdrs, &objp->uri_out)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_migrate_perform_args (XDR *xdrs, remote_domain_migrate_perform_args *objp) { - char **objp_cpp0 = (char **) (void *) &objp->cookie.cookie_val; + char **objp_cpp0 = (char **) (void *) &objp->cookie.cookie_val; - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - if (!xdr_bytes (xdrs, objp_cpp0, (u_int *) &objp->cookie.cookie_len, REMOTE_MIGRATE_COOKIE_MAX)) - return FALSE; - if (!xdr_remote_nonnull_string (xdrs, &objp->uri)) - return FALSE; - if (!xdr_u_quad_t (xdrs, &objp->flags)) - return FALSE; - if (!xdr_remote_string (xdrs, &objp->dname)) - return FALSE; - if (!xdr_u_quad_t (xdrs, &objp->resource)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + if (!xdr_bytes (xdrs, objp_cpp0, (u_int *) &objp->cookie.cookie_len, REMOTE_MIGRATE_COOKIE_MAX)) + return FALSE; + if (!xdr_remote_nonnull_string (xdrs, &objp->uri)) + return FALSE; + if (!xdr_u_quad_t (xdrs, &objp->flags)) + return FALSE; + if (!xdr_remote_string (xdrs, &objp->dname)) + return FALSE; + if (!xdr_u_quad_t (xdrs, &objp->resource)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_migrate_finish_args (XDR *xdrs, remote_domain_migrate_finish_args *objp) { - char **objp_cpp0 = (char **) (void *) &objp->cookie.cookie_val; + char **objp_cpp0 = (char **) (void *) &objp->cookie.cookie_val; - if (!xdr_remote_nonnull_string (xdrs, &objp->dname)) - return FALSE; - if (!xdr_bytes (xdrs, objp_cpp0, (u_int *) &objp->cookie.cookie_len, REMOTE_MIGRATE_COOKIE_MAX)) - return FALSE; - if (!xdr_remote_nonnull_string (xdrs, &objp->uri)) - return FALSE; - if (!xdr_u_quad_t (xdrs, &objp->flags)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_string (xdrs, &objp->dname)) + return FALSE; + if (!xdr_bytes (xdrs, objp_cpp0, (u_int *) &objp->cookie.cookie_len, REMOTE_MIGRATE_COOKIE_MAX)) + return FALSE; + if (!xdr_remote_nonnull_string (xdrs, &objp->uri)) + return FALSE; + if (!xdr_u_quad_t (xdrs, &objp->flags)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_migrate_finish_ret (XDR *xdrs, remote_domain_migrate_finish_ret *objp) { - if (!xdr_remote_nonnull_domain (xdrs, &objp->ddom)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->ddom)) + return FALSE; + return TRUE; } bool_t xdr_remote_list_defined_domains_args (XDR *xdrs, remote_list_defined_domains_args *objp) { - if (!xdr_int (xdrs, &objp->maxnames)) - return FALSE; - return TRUE; + if (!xdr_int (xdrs, &objp->maxnames)) + return FALSE; + return TRUE; } bool_t xdr_remote_list_defined_domains_ret (XDR *xdrs, remote_list_defined_domains_ret *objp) { - char **objp_cpp0 = (char **) (void *) &objp->names.names_val; + char **objp_cpp0 = (char **) (void *) &objp->names.names_val; - if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->names.names_len, REMOTE_DOMAIN_NAME_LIST_MAX, - sizeof (remote_nonnull_string), (xdrproc_t) xdr_remote_nonnull_string)) - return FALSE; - return TRUE; + if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->names.names_len, REMOTE_DOMAIN_NAME_LIST_MAX, + sizeof (remote_nonnull_string), (xdrproc_t) xdr_remote_nonnull_string)) + return FALSE; + return TRUE; } bool_t xdr_remote_num_of_defined_domains_ret (XDR *xdrs, remote_num_of_defined_domains_ret *objp) { - if (!xdr_int (xdrs, &objp->num)) - return FALSE; - return TRUE; + if (!xdr_int (xdrs, &objp->num)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_create_args (XDR *xdrs, remote_domain_create_args *objp) { - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_define_xml_args (XDR *xdrs, remote_domain_define_xml_args *objp) { - if (!xdr_remote_nonnull_string (xdrs, &objp->xml)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_string (xdrs, &objp->xml)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_define_xml_ret (XDR *xdrs, remote_domain_define_xml_ret *objp) { - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_undefine_args (XDR *xdrs, remote_domain_undefine_args *objp) { - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_set_vcpus_args (XDR *xdrs, remote_domain_set_vcpus_args *objp) { - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - if (!xdr_int (xdrs, &objp->nvcpus)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + if (!xdr_int (xdrs, &objp->nvcpus)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_pin_vcpu_args (XDR *xdrs, remote_domain_pin_vcpu_args *objp) { - char **objp_cpp0 = (char **) (void *) &objp->cpumap.cpumap_val; + char **objp_cpp0 = (char **) (void *) &objp->cpumap.cpumap_val; - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - if (!xdr_int (xdrs, &objp->vcpu)) - return FALSE; - if (!xdr_bytes (xdrs, objp_cpp0, (u_int *) &objp->cpumap.cpumap_len, REMOTE_CPUMAP_MAX)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + if (!xdr_int (xdrs, &objp->vcpu)) + return FALSE; + if (!xdr_bytes (xdrs, objp_cpp0, (u_int *) &objp->cpumap.cpumap_len, REMOTE_CPUMAP_MAX)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_get_vcpus_args (XDR *xdrs, remote_domain_get_vcpus_args *objp) { - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - if (!xdr_int (xdrs, &objp->maxinfo)) - return FALSE; - if (!xdr_int (xdrs, &objp->maplen)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + if (!xdr_int (xdrs, &objp->maxinfo)) + return FALSE; + if (!xdr_int (xdrs, &objp->maplen)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_get_vcpus_ret (XDR *xdrs, remote_domain_get_vcpus_ret *objp) { - char **objp_cpp0 = (char **) (void *) &objp->info.info_val; - char **objp_cpp1 = (char **) (void *) &objp->cpumaps.cpumaps_val; + char **objp_cpp0 = (char **) (void *) &objp->info.info_val; + char **objp_cpp1 = (char **) (void *) &objp->cpumaps.cpumaps_val; - if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->info.info_len, REMOTE_VCPUINFO_MAX, - sizeof (remote_vcpu_info), (xdrproc_t) xdr_remote_vcpu_info)) - return FALSE; - if (!xdr_bytes (xdrs, objp_cpp1, (u_int *) &objp->cpumaps.cpumaps_len, REMOTE_CPUMAPS_MAX)) - return FALSE; - return TRUE; + if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->info.info_len, REMOTE_VCPUINFO_MAX, + sizeof (remote_vcpu_info), (xdrproc_t) xdr_remote_vcpu_info)) + return FALSE; + if (!xdr_bytes (xdrs, objp_cpp1, (u_int *) &objp->cpumaps.cpumaps_len, REMOTE_CPUMAPS_MAX)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_get_max_vcpus_args (XDR *xdrs, remote_domain_get_max_vcpus_args *objp) { - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_get_max_vcpus_ret (XDR *xdrs, remote_domain_get_max_vcpus_ret *objp) { - if (!xdr_int (xdrs, &objp->num)) - return FALSE; - return TRUE; + if (!xdr_int (xdrs, &objp->num)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_attach_device_args (XDR *xdrs, remote_domain_attach_device_args *objp) { - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - if (!xdr_remote_nonnull_string (xdrs, &objp->xml)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + if (!xdr_remote_nonnull_string (xdrs, &objp->xml)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_detach_device_args (XDR *xdrs, remote_domain_detach_device_args *objp) { - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - if (!xdr_remote_nonnull_string (xdrs, &objp->xml)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + if (!xdr_remote_nonnull_string (xdrs, &objp->xml)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_get_autostart_args (XDR *xdrs, remote_domain_get_autostart_args *objp) { - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_get_autostart_ret (XDR *xdrs, remote_domain_get_autostart_ret *objp) { - if (!xdr_int (xdrs, &objp->autostart)) - return FALSE; - return TRUE; + if (!xdr_int (xdrs, &objp->autostart)) + return FALSE; + return TRUE; } bool_t xdr_remote_domain_set_autostart_args (XDR *xdrs, remote_domain_set_autostart_args *objp) { - if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) - return FALSE; - if (!xdr_int (xdrs, &objp->autostart)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_domain (xdrs, &objp->dom)) + return FALSE; + if (!xdr_int (xdrs, &objp->autostart)) + return FALSE; + return TRUE; } bool_t xdr_remote_num_of_networks_ret (XDR *xdrs, remote_num_of_networks_ret *objp) { - if (!xdr_int (xdrs, &objp->num)) - return FALSE; - return TRUE; + if (!xdr_int (xdrs, &objp->num)) + return FALSE; + return TRUE; } bool_t xdr_remote_list_networks_args (XDR *xdrs, remote_list_networks_args *objp) { - if (!xdr_int (xdrs, &objp->maxnames)) - return FALSE; - return TRUE; + if (!xdr_int (xdrs, &objp->maxnames)) + return FALSE; + return TRUE; } bool_t xdr_remote_list_networks_ret (XDR *xdrs, remote_list_networks_ret *objp) { - char **objp_cpp0 = (char **) (void *) &objp->names.names_val; + char **objp_cpp0 = (char **) (void *) &objp->names.names_val; - if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->names.names_len, REMOTE_NETWORK_NAME_LIST_MAX, - sizeof (remote_nonnull_string), (xdrproc_t) xdr_remote_nonnull_string)) - return FALSE; - return TRUE; + if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->names.names_len, REMOTE_NETWORK_NAME_LIST_MAX, + sizeof (remote_nonnull_string), (xdrproc_t) xdr_remote_nonnull_string)) + return FALSE; + return TRUE; } bool_t xdr_remote_num_of_defined_networks_ret (XDR *xdrs, remote_num_of_defined_networks_ret *objp) { - if (!xdr_int (xdrs, &objp->num)) - return FALSE; - return TRUE; + if (!xdr_int (xdrs, &objp->num)) + return FALSE; + return TRUE; } bool_t xdr_remote_list_defined_networks_args (XDR *xdrs, remote_list_defined_networks_args *objp) { - if (!xdr_int (xdrs, &objp->maxnames)) - return FALSE; - return TRUE; + if (!xdr_int (xdrs, &objp->maxnames)) + return FALSE; + return TRUE; } bool_t xdr_remote_list_defined_networks_ret (XDR *xdrs, remote_list_defined_networks_ret *objp) { - char **objp_cpp0 = (char **) (void *) &objp->names.names_val; + char **objp_cpp0 = (char **) (void *) &objp->names.names_val; - if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->names.names_len, REMOTE_NETWORK_NAME_LIST_MAX, - sizeof (remote_nonnull_string), (xdrproc_t) xdr_remote_nonnull_string)) - return FALSE; - return TRUE; + if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->names.names_len, REMOTE_NETWORK_NAME_LIST_MAX, + sizeof (remote_nonnull_string), (xdrproc_t) xdr_remote_nonnull_string)) + return FALSE; + return TRUE; } bool_t xdr_remote_network_lookup_by_uuid_args (XDR *xdrs, remote_network_lookup_by_uuid_args *objp) { - if (!xdr_remote_uuid (xdrs, objp->uuid)) - return FALSE; - return TRUE; + if (!xdr_remote_uuid (xdrs, objp->uuid)) + return FALSE; + return TRUE; } bool_t xdr_remote_network_lookup_by_uuid_ret (XDR *xdrs, remote_network_lookup_by_uuid_ret *objp) { - if (!xdr_remote_nonnull_network (xdrs, &objp->net)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_network (xdrs, &objp->net)) + return FALSE; + return TRUE; } bool_t xdr_remote_network_lookup_by_name_args (XDR *xdrs, remote_network_lookup_by_name_args *objp) { - if (!xdr_remote_nonnull_string (xdrs, &objp->name)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_string (xdrs, &objp->name)) + return FALSE; + return TRUE; } bool_t xdr_remote_network_lookup_by_name_ret (XDR *xdrs, remote_network_lookup_by_name_ret *objp) { - if (!xdr_remote_nonnull_network (xdrs, &objp->net)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_network (xdrs, &objp->net)) + return FALSE; + return TRUE; } bool_t xdr_remote_network_create_xml_args (XDR *xdrs, remote_network_create_xml_args *objp) { - if (!xdr_remote_nonnull_string (xdrs, &objp->xml)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_string (xdrs, &objp->xml)) + return FALSE; + return TRUE; } bool_t xdr_remote_network_create_xml_ret (XDR *xdrs, remote_network_create_xml_ret *objp) { - if (!xdr_remote_nonnull_network (xdrs, &objp->net)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_network (xdrs, &objp->net)) + return FALSE; + return TRUE; } bool_t xdr_remote_network_define_xml_args (XDR *xdrs, remote_network_define_xml_args *objp) { - if (!xdr_remote_nonnull_string (xdrs, &objp->xml)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_string (xdrs, &objp->xml)) + return FALSE; + return TRUE; } bool_t xdr_remote_network_define_xml_ret (XDR *xdrs, remote_network_define_xml_ret *objp) { - if (!xdr_remote_nonnull_network (xdrs, &objp->net)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_network (xdrs, &objp->net)) + return FALSE; + return TRUE; } bool_t xdr_remote_network_undefine_args (XDR *xdrs, remote_network_undefine_args *objp) { - if (!xdr_remote_nonnull_network (xdrs, &objp->net)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_network (xdrs, &objp->net)) + return FALSE; + return TRUE; } bool_t xdr_remote_network_create_args (XDR *xdrs, remote_network_create_args *objp) { - if (!xdr_remote_nonnull_network (xdrs, &objp->net)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_network (xdrs, &objp->net)) + return FALSE; + return TRUE; } bool_t xdr_remote_network_destroy_args (XDR *xdrs, remote_network_destroy_args *objp) { - if (!xdr_remote_nonnull_network (xdrs, &objp->net)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_network (xdrs, &objp->net)) + return FALSE; + return TRUE; } bool_t xdr_remote_network_dump_xml_args (XDR *xdrs, remote_network_dump_xml_args *objp) { - if (!xdr_remote_nonnull_network (xdrs, &objp->net)) - return FALSE; - if (!xdr_int (xdrs, &objp->flags)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_network (xdrs, &objp->net)) + return FALSE; + if (!xdr_int (xdrs, &objp->flags)) + return FALSE; + return TRUE; } bool_t xdr_remote_network_dump_xml_ret (XDR *xdrs, remote_network_dump_xml_ret *objp) { - if (!xdr_remote_nonnull_string (xdrs, &objp->xml)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_string (xdrs, &objp->xml)) + return FALSE; + return TRUE; } bool_t xdr_remote_network_get_bridge_name_args (XDR *xdrs, remote_network_get_bridge_name_args *objp) { - if (!xdr_remote_nonnull_network (xdrs, &objp->net)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_network (xdrs, &objp->net)) + return FALSE; + return TRUE; } bool_t xdr_remote_network_get_bridge_name_ret (XDR *xdrs, remote_network_get_bridge_name_ret *objp) { - if (!xdr_remote_nonnull_string (xdrs, &objp->name)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_string (xdrs, &objp->name)) + return FALSE; + return TRUE; } bool_t xdr_remote_network_get_autostart_args (XDR *xdrs, remote_network_get_autostart_args *objp) { - if (!xdr_remote_nonnull_network (xdrs, &objp->net)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_network (xdrs, &objp->net)) + return FALSE; + return TRUE; } bool_t xdr_remote_network_get_autostart_ret (XDR *xdrs, remote_network_get_autostart_ret *objp) { - if (!xdr_int (xdrs, &objp->autostart)) - return FALSE; - return TRUE; + if (!xdr_int (xdrs, &objp->autostart)) + return FALSE; + return TRUE; } bool_t xdr_remote_network_set_autostart_args (XDR *xdrs, remote_network_set_autostart_args *objp) { - if (!xdr_remote_nonnull_network (xdrs, &objp->net)) - return FALSE; - if (!xdr_int (xdrs, &objp->autostart)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_network (xdrs, &objp->net)) + return FALSE; + if (!xdr_int (xdrs, &objp->autostart)) + return FALSE; + return TRUE; } bool_t xdr_remote_auth_list_ret (XDR *xdrs, remote_auth_list_ret *objp) { - char **objp_cpp0 = (char **) (void *) &objp->types.types_val; + char **objp_cpp0 = (char **) (void *) &objp->types.types_val; - if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->types.types_len, REMOTE_AUTH_TYPE_LIST_MAX, - sizeof (remote_auth_type), (xdrproc_t) xdr_remote_auth_type)) - return FALSE; - return TRUE; + if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->types.types_len, REMOTE_AUTH_TYPE_LIST_MAX, + sizeof (remote_auth_type), (xdrproc_t) xdr_remote_auth_type)) + return FALSE; + return TRUE; } bool_t xdr_remote_auth_sasl_init_ret (XDR *xdrs, remote_auth_sasl_init_ret *objp) { - if (!xdr_remote_nonnull_string (xdrs, &objp->mechlist)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_string (xdrs, &objp->mechlist)) + return FALSE; + return TRUE; } bool_t xdr_remote_auth_sasl_start_args (XDR *xdrs, remote_auth_sasl_start_args *objp) { - char **objp_cpp0 = (char **) (void *) &objp->data.data_val; + char **objp_cpp0 = (char **) (void *) &objp->data.data_val; - if (!xdr_remote_nonnull_string (xdrs, &objp->mech)) - return FALSE; - if (!xdr_int (xdrs, &objp->nil)) - return FALSE; - if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->data.data_len, REMOTE_AUTH_SASL_DATA_MAX, - sizeof (char), (xdrproc_t) xdr_char)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_string (xdrs, &objp->mech)) + return FALSE; + if (!xdr_int (xdrs, &objp->nil)) + return FALSE; + if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->data.data_len, REMOTE_AUTH_SASL_DATA_MAX, + sizeof (char), (xdrproc_t) xdr_char)) + return FALSE; + return TRUE; } bool_t xdr_remote_auth_sasl_start_ret (XDR *xdrs, remote_auth_sasl_start_ret *objp) { - char **objp_cpp0 = (char **) (void *) &objp->data.data_val; + char **objp_cpp0 = (char **) (void *) &objp->data.data_val; - if (!xdr_int (xdrs, &objp->complete)) - return FALSE; - if (!xdr_int (xdrs, &objp->nil)) - return FALSE; - if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->data.data_len, REMOTE_AUTH_SASL_DATA_MAX, - sizeof (char), (xdrproc_t) xdr_char)) - return FALSE; - return TRUE; + if (!xdr_int (xdrs, &objp->complete)) + return FALSE; + if (!xdr_int (xdrs, &objp->nil)) + return FALSE; + if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->data.data_len, REMOTE_AUTH_SASL_DATA_MAX, + sizeof (char), (xdrproc_t) xdr_char)) + return FALSE; + return TRUE; } bool_t xdr_remote_auth_sasl_step_args (XDR *xdrs, remote_auth_sasl_step_args *objp) { - char **objp_cpp0 = (char **) (void *) &objp->data.data_val; + char **objp_cpp0 = (char **) (void *) &objp->data.data_val; - if (!xdr_int (xdrs, &objp->nil)) - return FALSE; - if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->data.data_len, REMOTE_AUTH_SASL_DATA_MAX, - sizeof (char), (xdrproc_t) xdr_char)) - return FALSE; - return TRUE; + if (!xdr_int (xdrs, &objp->nil)) + return FALSE; + if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->data.data_len, REMOTE_AUTH_SASL_DATA_MAX, + sizeof (char), (xdrproc_t) xdr_char)) + return FALSE; + return TRUE; } bool_t xdr_remote_auth_sasl_step_ret (XDR *xdrs, remote_auth_sasl_step_ret *objp) { - char **objp_cpp0 = (char **) (void *) &objp->data.data_val; + char **objp_cpp0 = (char **) (void *) &objp->data.data_val; - if (!xdr_int (xdrs, &objp->complete)) - return FALSE; - if (!xdr_int (xdrs, &objp->nil)) - return FALSE; - if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->data.data_len, REMOTE_AUTH_SASL_DATA_MAX, - sizeof (char), (xdrproc_t) xdr_char)) - return FALSE; - return TRUE; + if (!xdr_int (xdrs, &objp->complete)) + return FALSE; + if (!xdr_int (xdrs, &objp->nil)) + return FALSE; + if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->data.data_len, REMOTE_AUTH_SASL_DATA_MAX, + sizeof (char), (xdrproc_t) xdr_char)) + return FALSE; + return TRUE; } bool_t xdr_remote_auth_polkit_ret (XDR *xdrs, remote_auth_polkit_ret *objp) { - if (!xdr_int (xdrs, &objp->complete)) - return FALSE; - return TRUE; + if (!xdr_int (xdrs, &objp->complete)) + return FALSE; + return TRUE; } bool_t xdr_remote_num_of_storage_pools_ret (XDR *xdrs, remote_num_of_storage_pools_ret *objp) { - if (!xdr_int (xdrs, &objp->num)) - return FALSE; - return TRUE; + if (!xdr_int (xdrs, &objp->num)) + return FALSE; + return TRUE; } bool_t xdr_remote_list_storage_pools_args (XDR *xdrs, remote_list_storage_pools_args *objp) { - if (!xdr_int (xdrs, &objp->maxnames)) - return FALSE; - return TRUE; + if (!xdr_int (xdrs, &objp->maxnames)) + return FALSE; + return TRUE; } bool_t xdr_remote_list_storage_pools_ret (XDR *xdrs, remote_list_storage_pools_ret *objp) { - char **objp_cpp0 = (char **) (void *) &objp->names.names_val; + char **objp_cpp0 = (char **) (void *) &objp->names.names_val; - if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->names.names_len, REMOTE_STORAGE_POOL_NAME_LIST_MAX, - sizeof (remote_nonnull_string), (xdrproc_t) xdr_remote_nonnull_string)) - return FALSE; - return TRUE; + if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->names.names_len, REMOTE_STORAGE_POOL_NAME_LIST_MAX, + sizeof (remote_nonnull_string), (xdrproc_t) xdr_remote_nonnull_string)) + return FALSE; + return TRUE; } bool_t xdr_remote_num_of_defined_storage_pools_ret (XDR *xdrs, remote_num_of_defined_storage_pools_ret *objp) { - if (!xdr_int (xdrs, &objp->num)) - return FALSE; - return TRUE; + if (!xdr_int (xdrs, &objp->num)) + return FALSE; + return TRUE; } bool_t xdr_remote_list_defined_storage_pools_args (XDR *xdrs, remote_list_defined_storage_pools_args *objp) { - if (!xdr_int (xdrs, &objp->maxnames)) - return FALSE; - return TRUE; + if (!xdr_int (xdrs, &objp->maxnames)) + return FALSE; + return TRUE; } bool_t xdr_remote_list_defined_storage_pools_ret (XDR *xdrs, remote_list_defined_storage_pools_ret *objp) { - char **objp_cpp0 = (char **) (void *) &objp->names.names_val; + char **objp_cpp0 = (char **) (void *) &objp->names.names_val; - if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->names.names_len, REMOTE_STORAGE_POOL_NAME_LIST_MAX, - sizeof (remote_nonnull_string), (xdrproc_t) xdr_remote_nonnull_string)) - return FALSE; - return TRUE; + if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->names.names_len, REMOTE_STORAGE_POOL_NAME_LIST_MAX, + sizeof (remote_nonnull_string), (xdrproc_t) xdr_remote_nonnull_string)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_pool_lookup_by_uuid_args (XDR *xdrs, remote_storage_pool_lookup_by_uuid_args *objp) { - if (!xdr_remote_uuid (xdrs, objp->uuid)) - return FALSE; - return TRUE; + if (!xdr_remote_uuid (xdrs, objp->uuid)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_pool_lookup_by_uuid_ret (XDR *xdrs, remote_storage_pool_lookup_by_uuid_ret *objp) { - if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_pool_lookup_by_name_args (XDR *xdrs, remote_storage_pool_lookup_by_name_args *objp) { - if (!xdr_remote_nonnull_string (xdrs, &objp->name)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_string (xdrs, &objp->name)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_pool_lookup_by_name_ret (XDR *xdrs, remote_storage_pool_lookup_by_name_ret *objp) { - if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_pool_lookup_by_volume_args (XDR *xdrs, remote_storage_pool_lookup_by_volume_args *objp) { - if (!xdr_remote_nonnull_storage_vol (xdrs, &objp->vol)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_storage_vol (xdrs, &objp->vol)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_pool_lookup_by_volume_ret (XDR *xdrs, remote_storage_pool_lookup_by_volume_ret *objp) { - if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_pool_create_xml_args (XDR *xdrs, remote_storage_pool_create_xml_args *objp) { - if (!xdr_remote_nonnull_string (xdrs, &objp->xml)) - return FALSE; - if (!xdr_u_int (xdrs, &objp->flags)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_string (xdrs, &objp->xml)) + return FALSE; + if (!xdr_u_int (xdrs, &objp->flags)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_pool_create_xml_ret (XDR *xdrs, remote_storage_pool_create_xml_ret *objp) { - if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_pool_define_xml_args (XDR *xdrs, remote_storage_pool_define_xml_args *objp) { - if (!xdr_remote_nonnull_string (xdrs, &objp->xml)) - return FALSE; - if (!xdr_u_int (xdrs, &objp->flags)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_string (xdrs, &objp->xml)) + return FALSE; + if (!xdr_u_int (xdrs, &objp->flags)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_pool_define_xml_ret (XDR *xdrs, remote_storage_pool_define_xml_ret *objp) { - if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_pool_build_args (XDR *xdrs, remote_storage_pool_build_args *objp) { - if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) - return FALSE; - if (!xdr_u_int (xdrs, &objp->flags)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) + return FALSE; + if (!xdr_u_int (xdrs, &objp->flags)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_pool_undefine_args (XDR *xdrs, remote_storage_pool_undefine_args *objp) { - if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_pool_create_args (XDR *xdrs, remote_storage_pool_create_args *objp) { - if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) - return FALSE; - if (!xdr_u_int (xdrs, &objp->flags)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) + return FALSE; + if (!xdr_u_int (xdrs, &objp->flags)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_pool_destroy_args (XDR *xdrs, remote_storage_pool_destroy_args *objp) { - if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_pool_delete_args (XDR *xdrs, remote_storage_pool_delete_args *objp) { - if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) - return FALSE; - if (!xdr_u_int (xdrs, &objp->flags)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) + return FALSE; + if (!xdr_u_int (xdrs, &objp->flags)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_pool_refresh_args (XDR *xdrs, remote_storage_pool_refresh_args *objp) { - if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) - return FALSE; - if (!xdr_u_int (xdrs, &objp->flags)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) + return FALSE; + if (!xdr_u_int (xdrs, &objp->flags)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_pool_dump_xml_args (XDR *xdrs, remote_storage_pool_dump_xml_args *objp) { - if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) - return FALSE; - if (!xdr_u_int (xdrs, &objp->flags)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) + return FALSE; + if (!xdr_u_int (xdrs, &objp->flags)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_pool_dump_xml_ret (XDR *xdrs, remote_storage_pool_dump_xml_ret *objp) { - if (!xdr_remote_nonnull_string (xdrs, &objp->xml)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_string (xdrs, &objp->xml)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_pool_get_info_args (XDR *xdrs, remote_storage_pool_get_info_args *objp) { - if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_pool_get_info_ret (XDR *xdrs, remote_storage_pool_get_info_ret *objp) { - if (!xdr_u_char (xdrs, &objp->state)) - return FALSE; - if (!xdr_u_quad_t (xdrs, &objp->capacity)) - return FALSE; - if (!xdr_u_quad_t (xdrs, &objp->allocation)) - return FALSE; - if (!xdr_u_quad_t (xdrs, &objp->available)) - return FALSE; - return TRUE; + if (!xdr_u_char (xdrs, &objp->state)) + return FALSE; + if (!xdr_u_quad_t (xdrs, &objp->capacity)) + return FALSE; + if (!xdr_u_quad_t (xdrs, &objp->allocation)) + return FALSE; + if (!xdr_u_quad_t (xdrs, &objp->available)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_pool_get_autostart_args (XDR *xdrs, remote_storage_pool_get_autostart_args *objp) { - if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_pool_get_autostart_ret (XDR *xdrs, remote_storage_pool_get_autostart_ret *objp) { - if (!xdr_int (xdrs, &objp->autostart)) - return FALSE; - return TRUE; + if (!xdr_int (xdrs, &objp->autostart)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_pool_set_autostart_args (XDR *xdrs, remote_storage_pool_set_autostart_args *objp) { - if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) - return FALSE; - if (!xdr_int (xdrs, &objp->autostart)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) + return FALSE; + if (!xdr_int (xdrs, &objp->autostart)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_pool_num_of_volumes_args (XDR *xdrs, remote_storage_pool_num_of_volumes_args *objp) { - if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_pool_num_of_volumes_ret (XDR *xdrs, remote_storage_pool_num_of_volumes_ret *objp) { - if (!xdr_int (xdrs, &objp->num)) - return FALSE; - return TRUE; + if (!xdr_int (xdrs, &objp->num)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_pool_list_volumes_args (XDR *xdrs, remote_storage_pool_list_volumes_args *objp) { - if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) - return FALSE; - if (!xdr_int (xdrs, &objp->maxnames)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) + return FALSE; + if (!xdr_int (xdrs, &objp->maxnames)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_pool_list_volumes_ret (XDR *xdrs, remote_storage_pool_list_volumes_ret *objp) { - char **objp_cpp0 = (char **) (void *) &objp->names.names_val; + char **objp_cpp0 = (char **) (void *) &objp->names.names_val; - if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->names.names_len, REMOTE_STORAGE_VOL_NAME_LIST_MAX, - sizeof (remote_nonnull_string), (xdrproc_t) xdr_remote_nonnull_string)) - return FALSE; - return TRUE; + if (!xdr_array (xdrs, objp_cpp0, (u_int *) &objp->names.names_len, REMOTE_STORAGE_VOL_NAME_LIST_MAX, + sizeof (remote_nonnull_string), (xdrproc_t) xdr_remote_nonnull_string)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_vol_lookup_by_name_args (XDR *xdrs, remote_storage_vol_lookup_by_name_args *objp) { - if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) - return FALSE; - if (!xdr_remote_nonnull_string (xdrs, &objp->name)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) + return FALSE; + if (!xdr_remote_nonnull_string (xdrs, &objp->name)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_vol_lookup_by_name_ret (XDR *xdrs, remote_storage_vol_lookup_by_name_ret *objp) { - if (!xdr_remote_nonnull_storage_vol (xdrs, &objp->vol)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_storage_vol (xdrs, &objp->vol)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_vol_lookup_by_key_args (XDR *xdrs, remote_storage_vol_lookup_by_key_args *objp) { - if (!xdr_remote_nonnull_string (xdrs, &objp->key)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_string (xdrs, &objp->key)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_vol_lookup_by_key_ret (XDR *xdrs, remote_storage_vol_lookup_by_key_ret *objp) { - if (!xdr_remote_nonnull_storage_vol (xdrs, &objp->vol)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_storage_vol (xdrs, &objp->vol)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_vol_lookup_by_path_args (XDR *xdrs, remote_storage_vol_lookup_by_path_args *objp) { - if (!xdr_remote_nonnull_string (xdrs, &objp->path)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_string (xdrs, &objp->path)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_vol_lookup_by_path_ret (XDR *xdrs, remote_storage_vol_lookup_by_path_ret *objp) { - if (!xdr_remote_nonnull_storage_vol (xdrs, &objp->vol)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_storage_vol (xdrs, &objp->vol)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_vol_create_xml_args (XDR *xdrs, remote_storage_vol_create_xml_args *objp) { - if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) - return FALSE; - if (!xdr_remote_nonnull_string (xdrs, &objp->xml)) - return FALSE; - if (!xdr_u_int (xdrs, &objp->flags)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_storage_pool (xdrs, &objp->pool)) + return FALSE; + if (!xdr_remote_nonnull_string (xdrs, &objp->xml)) + return FALSE; + if (!xdr_u_int (xdrs, &objp->flags)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_vol_create_xml_ret (XDR *xdrs, remote_storage_vol_create_xml_ret *objp) { - if (!xdr_remote_nonnull_storage_vol (xdrs, &objp->vol)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_storage_vol (xdrs, &objp->vol)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_vol_delete_args (XDR *xdrs, remote_storage_vol_delete_args *objp) { - if (!xdr_remote_nonnull_storage_vol (xdrs, &objp->vol)) - return FALSE; - if (!xdr_u_int (xdrs, &objp->flags)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_storage_vol (xdrs, &objp->vol)) + return FALSE; + if (!xdr_u_int (xdrs, &objp->flags)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_vol_dump_xml_args (XDR *xdrs, remote_storage_vol_dump_xml_args *objp) { - if (!xdr_remote_nonnull_storage_vol (xdrs, &objp->vol)) - return FALSE; - if (!xdr_u_int (xdrs, &objp->flags)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_storage_vol (xdrs, &objp->vol)) + return FALSE; + if (!xdr_u_int (xdrs, &objp->flags)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_vol_dump_xml_ret (XDR *xdrs, remote_storage_vol_dump_xml_ret *objp) { - if (!xdr_remote_nonnull_string (xdrs, &objp->xml)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_string (xdrs, &objp->xml)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_vol_get_info_args (XDR *xdrs, remote_storage_vol_get_info_args *objp) { - if (!xdr_remote_nonnull_storage_vol (xdrs, &objp->vol)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_storage_vol (xdrs, &objp->vol)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_vol_get_info_ret (XDR *xdrs, remote_storage_vol_get_info_ret *objp) { - if (!xdr_char (xdrs, &objp->type)) - return FALSE; - if (!xdr_u_quad_t (xdrs, &objp->capacity)) - return FALSE; - if (!xdr_u_quad_t (xdrs, &objp->allocation)) - return FALSE; - return TRUE; + if (!xdr_char (xdrs, &objp->type)) + return FALSE; + if (!xdr_u_quad_t (xdrs, &objp->capacity)) + return FALSE; + if (!xdr_u_quad_t (xdrs, &objp->allocation)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_vol_get_path_args (XDR *xdrs, remote_storage_vol_get_path_args *objp) { - if (!xdr_remote_nonnull_storage_vol (xdrs, &objp->vol)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_storage_vol (xdrs, &objp->vol)) + return FALSE; + return TRUE; } bool_t xdr_remote_storage_vol_get_path_ret (XDR *xdrs, remote_storage_vol_get_path_ret *objp) { - if (!xdr_remote_nonnull_string (xdrs, &objp->name)) - return FALSE; - return TRUE; + if (!xdr_remote_nonnull_string (xdrs, &objp->name)) + return FALSE; + return TRUE; } bool_t xdr_remote_procedure (XDR *xdrs, remote_procedure *objp) { - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; + if (!xdr_enum (xdrs, (enum_t *) objp)) + return FALSE; + return TRUE; } bool_t xdr_remote_message_direction (XDR *xdrs, remote_message_direction *objp) { - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; + if (!xdr_enum (xdrs, (enum_t *) objp)) + return FALSE; + return TRUE; } bool_t xdr_remote_message_status (XDR *xdrs, remote_message_status *objp) { - if (!xdr_enum (xdrs, (enum_t *) objp)) - return FALSE; - return TRUE; + if (!xdr_enum (xdrs, (enum_t *) objp)) + return FALSE; + return TRUE; } bool_t xdr_remote_message_header (XDR *xdrs, remote_message_header *objp) { - if (!xdr_u_int (xdrs, &objp->prog)) - return FALSE; - if (!xdr_u_int (xdrs, &objp->vers)) - return FALSE; - if (!xdr_remote_procedure (xdrs, &objp->proc)) - return FALSE; - if (!xdr_remote_message_direction (xdrs, &objp->direction)) - return FALSE; - if (!xdr_u_int (xdrs, &objp->serial)) - return FALSE; - if (!xdr_remote_message_status (xdrs, &objp->status)) - return FALSE; - return TRUE; + if (!xdr_u_int (xdrs, &objp->prog)) + return FALSE; + if (!xdr_u_int (xdrs, &objp->vers)) + return FALSE; + if (!xdr_remote_procedure (xdrs, &objp->proc)) + return FALSE; + if (!xdr_remote_message_direction (xdrs, &objp->direction)) + return FALSE; + if (!xdr_u_int (xdrs, &objp->serial)) + return FALSE; + if (!xdr_remote_message_status (xdrs, &objp->status)) + return FALSE; + return TRUE; } diff --git a/qemud/remote_protocol.h b/qemud/remote_protocol.h index fdb8fb5559798e7bb7ab60636047cfc2cc445b33..d49b64af50699aea60445ce241b0b6323fb162e6 100644 --- a/qemud/remote_protocol.h +++ b/qemud/remote_protocol.h @@ -36,28 +36,28 @@ typedef remote_nonnull_string *remote_string; typedef char remote_uuid[VIR_UUID_BUFLEN]; struct remote_nonnull_domain { - remote_nonnull_string name; - remote_uuid uuid; - int id; + remote_nonnull_string name; + remote_uuid uuid; + int id; }; typedef struct remote_nonnull_domain remote_nonnull_domain; struct remote_nonnull_network { - remote_nonnull_string name; - remote_uuid uuid; + remote_nonnull_string name; + remote_uuid uuid; }; typedef struct remote_nonnull_network remote_nonnull_network; struct remote_nonnull_storage_pool { - remote_nonnull_string name; - remote_uuid uuid; + remote_nonnull_string name; + remote_uuid uuid; }; typedef struct remote_nonnull_storage_pool remote_nonnull_storage_pool; struct remote_nonnull_storage_vol { - remote_nonnull_string pool; - remote_nonnull_string name; - remote_nonnull_string key; + remote_nonnull_string pool; + remote_nonnull_string name; + remote_nonnull_string key; }; typedef struct remote_nonnull_storage_vol remote_nonnull_storage_vol; @@ -70,1076 +70,1076 @@ typedef remote_nonnull_storage_pool *remote_storage_pool; typedef remote_nonnull_storage_vol *remote_storage_vol; struct remote_error { - int code; - int domain; - remote_string message; - int level; - remote_domain dom; - remote_string str1; - remote_string str2; - remote_string str3; - int int1; - int int2; - remote_network net; + int code; + int domain; + remote_string message; + int level; + remote_domain dom; + remote_string str1; + remote_string str2; + remote_string str3; + int int1; + int int2; + remote_network net; }; typedef struct remote_error remote_error; enum remote_auth_type { - REMOTE_AUTH_NONE = 0, - REMOTE_AUTH_SASL = 1, - REMOTE_AUTH_POLKIT = 2, + REMOTE_AUTH_NONE = 0, + REMOTE_AUTH_SASL = 1, + REMOTE_AUTH_POLKIT = 2, }; typedef enum remote_auth_type remote_auth_type; struct remote_vcpu_info { - u_int number; - int state; - u_quad_t cpu_time; - int cpu; + u_int number; + int state; + u_quad_t cpu_time; + int cpu; }; typedef struct remote_vcpu_info remote_vcpu_info; struct remote_sched_param_value { - int type; - union { - int i; - u_int ui; - quad_t l; - u_quad_t ul; - double d; - int b; - } remote_sched_param_value_u; + int type; + union { + int i; + u_int ui; + quad_t l; + u_quad_t ul; + double d; + int b; + } remote_sched_param_value_u; }; typedef struct remote_sched_param_value remote_sched_param_value; struct remote_sched_param { - remote_nonnull_string field; - remote_sched_param_value value; + remote_nonnull_string field; + remote_sched_param_value value; }; typedef struct remote_sched_param remote_sched_param; struct remote_open_args { - remote_string name; - int flags; + remote_string name; + int flags; }; typedef struct remote_open_args remote_open_args; struct remote_supports_feature_args { - int feature; + int feature; }; typedef struct remote_supports_feature_args remote_supports_feature_args; struct remote_supports_feature_ret { - int supported; + int supported; }; typedef struct remote_supports_feature_ret remote_supports_feature_ret; struct remote_get_type_ret { - remote_nonnull_string type; + remote_nonnull_string type; }; typedef struct remote_get_type_ret remote_get_type_ret; struct remote_get_version_ret { - quad_t hv_ver; + quad_t hv_ver; }; typedef struct remote_get_version_ret remote_get_version_ret; struct remote_get_hostname_ret { - remote_nonnull_string hostname; + remote_nonnull_string hostname; }; typedef struct remote_get_hostname_ret remote_get_hostname_ret; struct remote_get_max_vcpus_args { - remote_string type; + remote_string type; }; typedef struct remote_get_max_vcpus_args remote_get_max_vcpus_args; struct remote_get_max_vcpus_ret { - int max_vcpus; + int max_vcpus; }; typedef struct remote_get_max_vcpus_ret remote_get_max_vcpus_ret; struct remote_node_get_info_ret { - char model[32]; - quad_t memory; - int cpus; - int mhz; - int nodes; - int sockets; - int cores; - int threads; + char model[32]; + quad_t memory; + int cpus; + int mhz; + int nodes; + int sockets; + int cores; + int threads; }; typedef struct remote_node_get_info_ret remote_node_get_info_ret; struct remote_get_capabilities_ret { - remote_nonnull_string capabilities; + remote_nonnull_string capabilities; }; typedef struct remote_get_capabilities_ret remote_get_capabilities_ret; struct remote_domain_get_scheduler_type_args { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; typedef struct remote_domain_get_scheduler_type_args remote_domain_get_scheduler_type_args; struct remote_domain_get_scheduler_type_ret { - remote_nonnull_string type; - int nparams; + remote_nonnull_string type; + int nparams; }; typedef struct remote_domain_get_scheduler_type_ret remote_domain_get_scheduler_type_ret; struct remote_domain_get_scheduler_parameters_args { - remote_nonnull_domain dom; - int nparams; + remote_nonnull_domain dom; + int nparams; }; typedef struct remote_domain_get_scheduler_parameters_args remote_domain_get_scheduler_parameters_args; struct remote_domain_get_scheduler_parameters_ret { - struct { - u_int params_len; - remote_sched_param *params_val; - } params; + struct { + u_int params_len; + remote_sched_param *params_val; + } params; }; typedef struct remote_domain_get_scheduler_parameters_ret remote_domain_get_scheduler_parameters_ret; struct remote_domain_set_scheduler_parameters_args { - remote_nonnull_domain dom; - struct { - u_int params_len; - remote_sched_param *params_val; - } params; + remote_nonnull_domain dom; + struct { + u_int params_len; + remote_sched_param *params_val; + } params; }; typedef struct remote_domain_set_scheduler_parameters_args remote_domain_set_scheduler_parameters_args; struct remote_domain_block_stats_args { - remote_nonnull_domain dom; - remote_nonnull_string path; + remote_nonnull_domain dom; + remote_nonnull_string path; }; typedef struct remote_domain_block_stats_args remote_domain_block_stats_args; struct remote_domain_block_stats_ret { - quad_t rd_req; - quad_t rd_bytes; - quad_t wr_req; - quad_t wr_bytes; - quad_t errs; + quad_t rd_req; + quad_t rd_bytes; + quad_t wr_req; + quad_t wr_bytes; + quad_t errs; }; typedef struct remote_domain_block_stats_ret remote_domain_block_stats_ret; struct remote_domain_interface_stats_args { - remote_nonnull_domain dom; - remote_nonnull_string path; + remote_nonnull_domain dom; + remote_nonnull_string path; }; typedef struct remote_domain_interface_stats_args remote_domain_interface_stats_args; struct remote_domain_interface_stats_ret { - quad_t rx_bytes; - quad_t rx_packets; - quad_t rx_errs; - quad_t rx_drop; - quad_t tx_bytes; - quad_t tx_packets; - quad_t tx_errs; - quad_t tx_drop; + quad_t rx_bytes; + quad_t rx_packets; + quad_t rx_errs; + quad_t rx_drop; + quad_t tx_bytes; + quad_t tx_packets; + quad_t tx_errs; + quad_t tx_drop; }; typedef struct remote_domain_interface_stats_ret remote_domain_interface_stats_ret; struct remote_list_domains_args { - int maxids; + int maxids; }; typedef struct remote_list_domains_args remote_list_domains_args; struct remote_list_domains_ret { - struct { - u_int ids_len; - int *ids_val; - } ids; + struct { + u_int ids_len; + int *ids_val; + } ids; }; typedef struct remote_list_domains_ret remote_list_domains_ret; struct remote_num_of_domains_ret { - int num; + int num; }; typedef struct remote_num_of_domains_ret remote_num_of_domains_ret; struct remote_domain_create_linux_args { - remote_nonnull_string xml_desc; - int flags; + remote_nonnull_string xml_desc; + int flags; }; typedef struct remote_domain_create_linux_args remote_domain_create_linux_args; struct remote_domain_create_linux_ret { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; typedef struct remote_domain_create_linux_ret remote_domain_create_linux_ret; struct remote_domain_lookup_by_id_args { - int id; + int id; }; typedef struct remote_domain_lookup_by_id_args remote_domain_lookup_by_id_args; struct remote_domain_lookup_by_id_ret { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; typedef struct remote_domain_lookup_by_id_ret remote_domain_lookup_by_id_ret; struct remote_domain_lookup_by_uuid_args { - remote_uuid uuid; + remote_uuid uuid; }; typedef struct remote_domain_lookup_by_uuid_args remote_domain_lookup_by_uuid_args; struct remote_domain_lookup_by_uuid_ret { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; typedef struct remote_domain_lookup_by_uuid_ret remote_domain_lookup_by_uuid_ret; struct remote_domain_lookup_by_name_args { - remote_nonnull_string name; + remote_nonnull_string name; }; typedef struct remote_domain_lookup_by_name_args remote_domain_lookup_by_name_args; struct remote_domain_lookup_by_name_ret { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; typedef struct remote_domain_lookup_by_name_ret remote_domain_lookup_by_name_ret; struct remote_domain_suspend_args { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; typedef struct remote_domain_suspend_args remote_domain_suspend_args; struct remote_domain_resume_args { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; typedef struct remote_domain_resume_args remote_domain_resume_args; struct remote_domain_shutdown_args { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; typedef struct remote_domain_shutdown_args remote_domain_shutdown_args; struct remote_domain_reboot_args { - remote_nonnull_domain dom; - int flags; + remote_nonnull_domain dom; + int flags; }; typedef struct remote_domain_reboot_args remote_domain_reboot_args; struct remote_domain_destroy_args { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; typedef struct remote_domain_destroy_args remote_domain_destroy_args; struct remote_domain_get_os_type_args { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; typedef struct remote_domain_get_os_type_args remote_domain_get_os_type_args; struct remote_domain_get_os_type_ret { - remote_nonnull_string type; + remote_nonnull_string type; }; typedef struct remote_domain_get_os_type_ret remote_domain_get_os_type_ret; struct remote_domain_get_max_memory_args { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; typedef struct remote_domain_get_max_memory_args remote_domain_get_max_memory_args; struct remote_domain_get_max_memory_ret { - u_quad_t memory; + u_quad_t memory; }; typedef struct remote_domain_get_max_memory_ret remote_domain_get_max_memory_ret; struct remote_domain_set_max_memory_args { - remote_nonnull_domain dom; - u_quad_t memory; + remote_nonnull_domain dom; + u_quad_t memory; }; typedef struct remote_domain_set_max_memory_args remote_domain_set_max_memory_args; struct remote_domain_set_memory_args { - remote_nonnull_domain dom; - u_quad_t memory; + remote_nonnull_domain dom; + u_quad_t memory; }; typedef struct remote_domain_set_memory_args remote_domain_set_memory_args; struct remote_domain_get_info_args { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; typedef struct remote_domain_get_info_args remote_domain_get_info_args; struct remote_domain_get_info_ret { - u_char state; - u_quad_t max_mem; - u_quad_t memory; - u_short nr_virt_cpu; - u_quad_t cpu_time; + u_char state; + u_quad_t max_mem; + u_quad_t memory; + u_short nr_virt_cpu; + u_quad_t cpu_time; }; typedef struct remote_domain_get_info_ret remote_domain_get_info_ret; struct remote_domain_save_args { - remote_nonnull_domain dom; - remote_nonnull_string to; + remote_nonnull_domain dom; + remote_nonnull_string to; }; typedef struct remote_domain_save_args remote_domain_save_args; struct remote_domain_restore_args { - remote_nonnull_string from; + remote_nonnull_string from; }; typedef struct remote_domain_restore_args remote_domain_restore_args; struct remote_domain_core_dump_args { - remote_nonnull_domain dom; - remote_nonnull_string to; - int flags; + remote_nonnull_domain dom; + remote_nonnull_string to; + int flags; }; typedef struct remote_domain_core_dump_args remote_domain_core_dump_args; struct remote_domain_dump_xml_args { - remote_nonnull_domain dom; - int flags; + remote_nonnull_domain dom; + int flags; }; typedef struct remote_domain_dump_xml_args remote_domain_dump_xml_args; struct remote_domain_dump_xml_ret { - remote_nonnull_string xml; + remote_nonnull_string xml; }; typedef struct remote_domain_dump_xml_ret remote_domain_dump_xml_ret; struct remote_domain_migrate_prepare_args { - remote_string uri_in; - u_quad_t flags; - remote_string dname; - u_quad_t resource; + remote_string uri_in; + u_quad_t flags; + remote_string dname; + u_quad_t resource; }; typedef struct remote_domain_migrate_prepare_args remote_domain_migrate_prepare_args; struct remote_domain_migrate_prepare_ret { - struct { - u_int cookie_len; - char *cookie_val; - } cookie; - remote_string uri_out; + struct { + u_int cookie_len; + char *cookie_val; + } cookie; + remote_string uri_out; }; typedef struct remote_domain_migrate_prepare_ret remote_domain_migrate_prepare_ret; struct remote_domain_migrate_perform_args { - remote_nonnull_domain dom; - struct { - u_int cookie_len; - char *cookie_val; - } cookie; - remote_nonnull_string uri; - u_quad_t flags; - remote_string dname; - u_quad_t resource; + remote_nonnull_domain dom; + struct { + u_int cookie_len; + char *cookie_val; + } cookie; + remote_nonnull_string uri; + u_quad_t flags; + remote_string dname; + u_quad_t resource; }; typedef struct remote_domain_migrate_perform_args remote_domain_migrate_perform_args; struct remote_domain_migrate_finish_args { - remote_nonnull_string dname; - struct { - u_int cookie_len; - char *cookie_val; - } cookie; - remote_nonnull_string uri; - u_quad_t flags; + remote_nonnull_string dname; + struct { + u_int cookie_len; + char *cookie_val; + } cookie; + remote_nonnull_string uri; + u_quad_t flags; }; typedef struct remote_domain_migrate_finish_args remote_domain_migrate_finish_args; struct remote_domain_migrate_finish_ret { - remote_nonnull_domain ddom; + remote_nonnull_domain ddom; }; typedef struct remote_domain_migrate_finish_ret remote_domain_migrate_finish_ret; struct remote_list_defined_domains_args { - int maxnames; + int maxnames; }; typedef struct remote_list_defined_domains_args remote_list_defined_domains_args; struct remote_list_defined_domains_ret { - struct { - u_int names_len; - remote_nonnull_string *names_val; - } names; + struct { + u_int names_len; + remote_nonnull_string *names_val; + } names; }; typedef struct remote_list_defined_domains_ret remote_list_defined_domains_ret; struct remote_num_of_defined_domains_ret { - int num; + int num; }; typedef struct remote_num_of_defined_domains_ret remote_num_of_defined_domains_ret; struct remote_domain_create_args { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; typedef struct remote_domain_create_args remote_domain_create_args; struct remote_domain_define_xml_args { - remote_nonnull_string xml; + remote_nonnull_string xml; }; typedef struct remote_domain_define_xml_args remote_domain_define_xml_args; struct remote_domain_define_xml_ret { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; typedef struct remote_domain_define_xml_ret remote_domain_define_xml_ret; struct remote_domain_undefine_args { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; typedef struct remote_domain_undefine_args remote_domain_undefine_args; struct remote_domain_set_vcpus_args { - remote_nonnull_domain dom; - int nvcpus; + remote_nonnull_domain dom; + int nvcpus; }; typedef struct remote_domain_set_vcpus_args remote_domain_set_vcpus_args; struct remote_domain_pin_vcpu_args { - remote_nonnull_domain dom; - int vcpu; - struct { - u_int cpumap_len; - char *cpumap_val; - } cpumap; + remote_nonnull_domain dom; + int vcpu; + struct { + u_int cpumap_len; + char *cpumap_val; + } cpumap; }; typedef struct remote_domain_pin_vcpu_args remote_domain_pin_vcpu_args; struct remote_domain_get_vcpus_args { - remote_nonnull_domain dom; - int maxinfo; - int maplen; + remote_nonnull_domain dom; + int maxinfo; + int maplen; }; typedef struct remote_domain_get_vcpus_args remote_domain_get_vcpus_args; struct remote_domain_get_vcpus_ret { - struct { - u_int info_len; - remote_vcpu_info *info_val; - } info; - struct { - u_int cpumaps_len; - char *cpumaps_val; - } cpumaps; + struct { + u_int info_len; + remote_vcpu_info *info_val; + } info; + struct { + u_int cpumaps_len; + char *cpumaps_val; + } cpumaps; }; typedef struct remote_domain_get_vcpus_ret remote_domain_get_vcpus_ret; struct remote_domain_get_max_vcpus_args { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; typedef struct remote_domain_get_max_vcpus_args remote_domain_get_max_vcpus_args; struct remote_domain_get_max_vcpus_ret { - int num; + int num; }; typedef struct remote_domain_get_max_vcpus_ret remote_domain_get_max_vcpus_ret; struct remote_domain_attach_device_args { - remote_nonnull_domain dom; - remote_nonnull_string xml; + remote_nonnull_domain dom; + remote_nonnull_string xml; }; typedef struct remote_domain_attach_device_args remote_domain_attach_device_args; struct remote_domain_detach_device_args { - remote_nonnull_domain dom; - remote_nonnull_string xml; + remote_nonnull_domain dom; + remote_nonnull_string xml; }; typedef struct remote_domain_detach_device_args remote_domain_detach_device_args; struct remote_domain_get_autostart_args { - remote_nonnull_domain dom; + remote_nonnull_domain dom; }; typedef struct remote_domain_get_autostart_args remote_domain_get_autostart_args; struct remote_domain_get_autostart_ret { - int autostart; + int autostart; }; typedef struct remote_domain_get_autostart_ret remote_domain_get_autostart_ret; struct remote_domain_set_autostart_args { - remote_nonnull_domain dom; - int autostart; + remote_nonnull_domain dom; + int autostart; }; typedef struct remote_domain_set_autostart_args remote_domain_set_autostart_args; struct remote_num_of_networks_ret { - int num; + int num; }; typedef struct remote_num_of_networks_ret remote_num_of_networks_ret; struct remote_list_networks_args { - int maxnames; + int maxnames; }; typedef struct remote_list_networks_args remote_list_networks_args; struct remote_list_networks_ret { - struct { - u_int names_len; - remote_nonnull_string *names_val; - } names; + struct { + u_int names_len; + remote_nonnull_string *names_val; + } names; }; typedef struct remote_list_networks_ret remote_list_networks_ret; struct remote_num_of_defined_networks_ret { - int num; + int num; }; typedef struct remote_num_of_defined_networks_ret remote_num_of_defined_networks_ret; struct remote_list_defined_networks_args { - int maxnames; + int maxnames; }; typedef struct remote_list_defined_networks_args remote_list_defined_networks_args; struct remote_list_defined_networks_ret { - struct { - u_int names_len; - remote_nonnull_string *names_val; - } names; + struct { + u_int names_len; + remote_nonnull_string *names_val; + } names; }; typedef struct remote_list_defined_networks_ret remote_list_defined_networks_ret; struct remote_network_lookup_by_uuid_args { - remote_uuid uuid; + remote_uuid uuid; }; typedef struct remote_network_lookup_by_uuid_args remote_network_lookup_by_uuid_args; struct remote_network_lookup_by_uuid_ret { - remote_nonnull_network net; + remote_nonnull_network net; }; typedef struct remote_network_lookup_by_uuid_ret remote_network_lookup_by_uuid_ret; struct remote_network_lookup_by_name_args { - remote_nonnull_string name; + remote_nonnull_string name; }; typedef struct remote_network_lookup_by_name_args remote_network_lookup_by_name_args; struct remote_network_lookup_by_name_ret { - remote_nonnull_network net; + remote_nonnull_network net; }; typedef struct remote_network_lookup_by_name_ret remote_network_lookup_by_name_ret; struct remote_network_create_xml_args { - remote_nonnull_string xml; + remote_nonnull_string xml; }; typedef struct remote_network_create_xml_args remote_network_create_xml_args; struct remote_network_create_xml_ret { - remote_nonnull_network net; + remote_nonnull_network net; }; typedef struct remote_network_create_xml_ret remote_network_create_xml_ret; struct remote_network_define_xml_args { - remote_nonnull_string xml; + remote_nonnull_string xml; }; typedef struct remote_network_define_xml_args remote_network_define_xml_args; struct remote_network_define_xml_ret { - remote_nonnull_network net; + remote_nonnull_network net; }; typedef struct remote_network_define_xml_ret remote_network_define_xml_ret; struct remote_network_undefine_args { - remote_nonnull_network net; + remote_nonnull_network net; }; typedef struct remote_network_undefine_args remote_network_undefine_args; struct remote_network_create_args { - remote_nonnull_network net; + remote_nonnull_network net; }; typedef struct remote_network_create_args remote_network_create_args; struct remote_network_destroy_args { - remote_nonnull_network net; + remote_nonnull_network net; }; typedef struct remote_network_destroy_args remote_network_destroy_args; struct remote_network_dump_xml_args { - remote_nonnull_network net; - int flags; + remote_nonnull_network net; + int flags; }; typedef struct remote_network_dump_xml_args remote_network_dump_xml_args; struct remote_network_dump_xml_ret { - remote_nonnull_string xml; + remote_nonnull_string xml; }; typedef struct remote_network_dump_xml_ret remote_network_dump_xml_ret; struct remote_network_get_bridge_name_args { - remote_nonnull_network net; + remote_nonnull_network net; }; typedef struct remote_network_get_bridge_name_args remote_network_get_bridge_name_args; struct remote_network_get_bridge_name_ret { - remote_nonnull_string name; + remote_nonnull_string name; }; typedef struct remote_network_get_bridge_name_ret remote_network_get_bridge_name_ret; struct remote_network_get_autostart_args { - remote_nonnull_network net; + remote_nonnull_network net; }; typedef struct remote_network_get_autostart_args remote_network_get_autostart_args; struct remote_network_get_autostart_ret { - int autostart; + int autostart; }; typedef struct remote_network_get_autostart_ret remote_network_get_autostart_ret; struct remote_network_set_autostart_args { - remote_nonnull_network net; - int autostart; + remote_nonnull_network net; + int autostart; }; typedef struct remote_network_set_autostart_args remote_network_set_autostart_args; struct remote_auth_list_ret { - struct { - u_int types_len; - remote_auth_type *types_val; - } types; + struct { + u_int types_len; + remote_auth_type *types_val; + } types; }; typedef struct remote_auth_list_ret remote_auth_list_ret; struct remote_auth_sasl_init_ret { - remote_nonnull_string mechlist; + remote_nonnull_string mechlist; }; typedef struct remote_auth_sasl_init_ret remote_auth_sasl_init_ret; struct remote_auth_sasl_start_args { - remote_nonnull_string mech; - int nil; - struct { - u_int data_len; - char *data_val; - } data; + remote_nonnull_string mech; + int nil; + struct { + u_int data_len; + char *data_val; + } data; }; typedef struct remote_auth_sasl_start_args remote_auth_sasl_start_args; struct remote_auth_sasl_start_ret { - int complete; - int nil; - struct { - u_int data_len; - char *data_val; - } data; + int complete; + int nil; + struct { + u_int data_len; + char *data_val; + } data; }; typedef struct remote_auth_sasl_start_ret remote_auth_sasl_start_ret; struct remote_auth_sasl_step_args { - int nil; - struct { - u_int data_len; - char *data_val; - } data; + int nil; + struct { + u_int data_len; + char *data_val; + } data; }; typedef struct remote_auth_sasl_step_args remote_auth_sasl_step_args; struct remote_auth_sasl_step_ret { - int complete; - int nil; - struct { - u_int data_len; - char *data_val; - } data; + int complete; + int nil; + struct { + u_int data_len; + char *data_val; + } data; }; typedef struct remote_auth_sasl_step_ret remote_auth_sasl_step_ret; struct remote_auth_polkit_ret { - int complete; + int complete; }; typedef struct remote_auth_polkit_ret remote_auth_polkit_ret; struct remote_num_of_storage_pools_ret { - int num; + int num; }; typedef struct remote_num_of_storage_pools_ret remote_num_of_storage_pools_ret; struct remote_list_storage_pools_args { - int maxnames; + int maxnames; }; typedef struct remote_list_storage_pools_args remote_list_storage_pools_args; struct remote_list_storage_pools_ret { - struct { - u_int names_len; - remote_nonnull_string *names_val; - } names; + struct { + u_int names_len; + remote_nonnull_string *names_val; + } names; }; typedef struct remote_list_storage_pools_ret remote_list_storage_pools_ret; struct remote_num_of_defined_storage_pools_ret { - int num; + int num; }; typedef struct remote_num_of_defined_storage_pools_ret remote_num_of_defined_storage_pools_ret; struct remote_list_defined_storage_pools_args { - int maxnames; + int maxnames; }; typedef struct remote_list_defined_storage_pools_args remote_list_defined_storage_pools_args; struct remote_list_defined_storage_pools_ret { - struct { - u_int names_len; - remote_nonnull_string *names_val; - } names; + struct { + u_int names_len; + remote_nonnull_string *names_val; + } names; }; typedef struct remote_list_defined_storage_pools_ret remote_list_defined_storage_pools_ret; struct remote_storage_pool_lookup_by_uuid_args { - remote_uuid uuid; + remote_uuid uuid; }; typedef struct remote_storage_pool_lookup_by_uuid_args remote_storage_pool_lookup_by_uuid_args; struct remote_storage_pool_lookup_by_uuid_ret { - remote_nonnull_storage_pool pool; + remote_nonnull_storage_pool pool; }; typedef struct remote_storage_pool_lookup_by_uuid_ret remote_storage_pool_lookup_by_uuid_ret; struct remote_storage_pool_lookup_by_name_args { - remote_nonnull_string name; + remote_nonnull_string name; }; typedef struct remote_storage_pool_lookup_by_name_args remote_storage_pool_lookup_by_name_args; struct remote_storage_pool_lookup_by_name_ret { - remote_nonnull_storage_pool pool; + remote_nonnull_storage_pool pool; }; typedef struct remote_storage_pool_lookup_by_name_ret remote_storage_pool_lookup_by_name_ret; struct remote_storage_pool_lookup_by_volume_args { - remote_nonnull_storage_vol vol; + remote_nonnull_storage_vol vol; }; typedef struct remote_storage_pool_lookup_by_volume_args remote_storage_pool_lookup_by_volume_args; struct remote_storage_pool_lookup_by_volume_ret { - remote_nonnull_storage_pool pool; + remote_nonnull_storage_pool pool; }; typedef struct remote_storage_pool_lookup_by_volume_ret remote_storage_pool_lookup_by_volume_ret; struct remote_storage_pool_create_xml_args { - remote_nonnull_string xml; - u_int flags; + remote_nonnull_string xml; + u_int flags; }; typedef struct remote_storage_pool_create_xml_args remote_storage_pool_create_xml_args; struct remote_storage_pool_create_xml_ret { - remote_nonnull_storage_pool pool; + remote_nonnull_storage_pool pool; }; typedef struct remote_storage_pool_create_xml_ret remote_storage_pool_create_xml_ret; struct remote_storage_pool_define_xml_args { - remote_nonnull_string xml; - u_int flags; + remote_nonnull_string xml; + u_int flags; }; typedef struct remote_storage_pool_define_xml_args remote_storage_pool_define_xml_args; struct remote_storage_pool_define_xml_ret { - remote_nonnull_storage_pool pool; + remote_nonnull_storage_pool pool; }; typedef struct remote_storage_pool_define_xml_ret remote_storage_pool_define_xml_ret; struct remote_storage_pool_build_args { - remote_nonnull_storage_pool pool; - u_int flags; + remote_nonnull_storage_pool pool; + u_int flags; }; typedef struct remote_storage_pool_build_args remote_storage_pool_build_args; struct remote_storage_pool_undefine_args { - remote_nonnull_storage_pool pool; + remote_nonnull_storage_pool pool; }; typedef struct remote_storage_pool_undefine_args remote_storage_pool_undefine_args; struct remote_storage_pool_create_args { - remote_nonnull_storage_pool pool; - u_int flags; + remote_nonnull_storage_pool pool; + u_int flags; }; typedef struct remote_storage_pool_create_args remote_storage_pool_create_args; struct remote_storage_pool_destroy_args { - remote_nonnull_storage_pool pool; + remote_nonnull_storage_pool pool; }; typedef struct remote_storage_pool_destroy_args remote_storage_pool_destroy_args; struct remote_storage_pool_delete_args { - remote_nonnull_storage_pool pool; - u_int flags; + remote_nonnull_storage_pool pool; + u_int flags; }; typedef struct remote_storage_pool_delete_args remote_storage_pool_delete_args; struct remote_storage_pool_refresh_args { - remote_nonnull_storage_pool pool; - u_int flags; + remote_nonnull_storage_pool pool; + u_int flags; }; typedef struct remote_storage_pool_refresh_args remote_storage_pool_refresh_args; struct remote_storage_pool_dump_xml_args { - remote_nonnull_storage_pool pool; - u_int flags; + remote_nonnull_storage_pool pool; + u_int flags; }; typedef struct remote_storage_pool_dump_xml_args remote_storage_pool_dump_xml_args; struct remote_storage_pool_dump_xml_ret { - remote_nonnull_string xml; + remote_nonnull_string xml; }; typedef struct remote_storage_pool_dump_xml_ret remote_storage_pool_dump_xml_ret; struct remote_storage_pool_get_info_args { - remote_nonnull_storage_pool pool; + remote_nonnull_storage_pool pool; }; typedef struct remote_storage_pool_get_info_args remote_storage_pool_get_info_args; struct remote_storage_pool_get_info_ret { - u_char state; - u_quad_t capacity; - u_quad_t allocation; - u_quad_t available; + u_char state; + u_quad_t capacity; + u_quad_t allocation; + u_quad_t available; }; typedef struct remote_storage_pool_get_info_ret remote_storage_pool_get_info_ret; struct remote_storage_pool_get_autostart_args { - remote_nonnull_storage_pool pool; + remote_nonnull_storage_pool pool; }; typedef struct remote_storage_pool_get_autostart_args remote_storage_pool_get_autostart_args; struct remote_storage_pool_get_autostart_ret { - int autostart; + int autostart; }; typedef struct remote_storage_pool_get_autostart_ret remote_storage_pool_get_autostart_ret; struct remote_storage_pool_set_autostart_args { - remote_nonnull_storage_pool pool; - int autostart; + remote_nonnull_storage_pool pool; + int autostart; }; typedef struct remote_storage_pool_set_autostart_args remote_storage_pool_set_autostart_args; struct remote_storage_pool_num_of_volumes_args { - remote_nonnull_storage_pool pool; + remote_nonnull_storage_pool pool; }; typedef struct remote_storage_pool_num_of_volumes_args remote_storage_pool_num_of_volumes_args; struct remote_storage_pool_num_of_volumes_ret { - int num; + int num; }; typedef struct remote_storage_pool_num_of_volumes_ret remote_storage_pool_num_of_volumes_ret; struct remote_storage_pool_list_volumes_args { - remote_nonnull_storage_pool pool; - int maxnames; + remote_nonnull_storage_pool pool; + int maxnames; }; typedef struct remote_storage_pool_list_volumes_args remote_storage_pool_list_volumes_args; struct remote_storage_pool_list_volumes_ret { - struct { - u_int names_len; - remote_nonnull_string *names_val; - } names; + struct { + u_int names_len; + remote_nonnull_string *names_val; + } names; }; typedef struct remote_storage_pool_list_volumes_ret remote_storage_pool_list_volumes_ret; struct remote_storage_vol_lookup_by_name_args { - remote_nonnull_storage_pool pool; - remote_nonnull_string name; + remote_nonnull_storage_pool pool; + remote_nonnull_string name; }; typedef struct remote_storage_vol_lookup_by_name_args remote_storage_vol_lookup_by_name_args; struct remote_storage_vol_lookup_by_name_ret { - remote_nonnull_storage_vol vol; + remote_nonnull_storage_vol vol; }; typedef struct remote_storage_vol_lookup_by_name_ret remote_storage_vol_lookup_by_name_ret; struct remote_storage_vol_lookup_by_key_args { - remote_nonnull_string key; + remote_nonnull_string key; }; typedef struct remote_storage_vol_lookup_by_key_args remote_storage_vol_lookup_by_key_args; struct remote_storage_vol_lookup_by_key_ret { - remote_nonnull_storage_vol vol; + remote_nonnull_storage_vol vol; }; typedef struct remote_storage_vol_lookup_by_key_ret remote_storage_vol_lookup_by_key_ret; struct remote_storage_vol_lookup_by_path_args { - remote_nonnull_string path; + remote_nonnull_string path; }; typedef struct remote_storage_vol_lookup_by_path_args remote_storage_vol_lookup_by_path_args; struct remote_storage_vol_lookup_by_path_ret { - remote_nonnull_storage_vol vol; + remote_nonnull_storage_vol vol; }; typedef struct remote_storage_vol_lookup_by_path_ret remote_storage_vol_lookup_by_path_ret; struct remote_storage_vol_create_xml_args { - remote_nonnull_storage_pool pool; - remote_nonnull_string xml; - u_int flags; + remote_nonnull_storage_pool pool; + remote_nonnull_string xml; + u_int flags; }; typedef struct remote_storage_vol_create_xml_args remote_storage_vol_create_xml_args; struct remote_storage_vol_create_xml_ret { - remote_nonnull_storage_vol vol; + remote_nonnull_storage_vol vol; }; typedef struct remote_storage_vol_create_xml_ret remote_storage_vol_create_xml_ret; struct remote_storage_vol_delete_args { - remote_nonnull_storage_vol vol; - u_int flags; + remote_nonnull_storage_vol vol; + u_int flags; }; typedef struct remote_storage_vol_delete_args remote_storage_vol_delete_args; struct remote_storage_vol_dump_xml_args { - remote_nonnull_storage_vol vol; - u_int flags; + remote_nonnull_storage_vol vol; + u_int flags; }; typedef struct remote_storage_vol_dump_xml_args remote_storage_vol_dump_xml_args; struct remote_storage_vol_dump_xml_ret { - remote_nonnull_string xml; + remote_nonnull_string xml; }; typedef struct remote_storage_vol_dump_xml_ret remote_storage_vol_dump_xml_ret; struct remote_storage_vol_get_info_args { - remote_nonnull_storage_vol vol; + remote_nonnull_storage_vol vol; }; typedef struct remote_storage_vol_get_info_args remote_storage_vol_get_info_args; struct remote_storage_vol_get_info_ret { - char type; - u_quad_t capacity; - u_quad_t allocation; + char type; + u_quad_t capacity; + u_quad_t allocation; }; typedef struct remote_storage_vol_get_info_ret remote_storage_vol_get_info_ret; struct remote_storage_vol_get_path_args { - remote_nonnull_storage_vol vol; + remote_nonnull_storage_vol vol; }; typedef struct remote_storage_vol_get_path_args remote_storage_vol_get_path_args; struct remote_storage_vol_get_path_ret { - remote_nonnull_string name; + remote_nonnull_string name; }; typedef struct remote_storage_vol_get_path_ret remote_storage_vol_get_path_ret; #define REMOTE_PROGRAM 0x20008086 #define REMOTE_PROTOCOL_VERSION 1 enum remote_procedure { - REMOTE_PROC_OPEN = 1, - REMOTE_PROC_CLOSE = 2, - REMOTE_PROC_GET_TYPE = 3, - REMOTE_PROC_GET_VERSION = 4, - REMOTE_PROC_GET_MAX_VCPUS = 5, - REMOTE_PROC_NODE_GET_INFO = 6, - REMOTE_PROC_GET_CAPABILITIES = 7, - REMOTE_PROC_DOMAIN_ATTACH_DEVICE = 8, - REMOTE_PROC_DOMAIN_CREATE = 9, - REMOTE_PROC_DOMAIN_CREATE_LINUX = 10, - REMOTE_PROC_DOMAIN_DEFINE_XML = 11, - REMOTE_PROC_DOMAIN_DESTROY = 12, - REMOTE_PROC_DOMAIN_DETACH_DEVICE = 13, - REMOTE_PROC_DOMAIN_DUMP_XML = 14, - REMOTE_PROC_DOMAIN_GET_AUTOSTART = 15, - REMOTE_PROC_DOMAIN_GET_INFO = 16, - REMOTE_PROC_DOMAIN_GET_MAX_MEMORY = 17, - REMOTE_PROC_DOMAIN_GET_MAX_VCPUS = 18, - REMOTE_PROC_DOMAIN_GET_OS_TYPE = 19, - REMOTE_PROC_DOMAIN_GET_VCPUS = 20, - REMOTE_PROC_LIST_DEFINED_DOMAINS = 21, - REMOTE_PROC_DOMAIN_LOOKUP_BY_ID = 22, - REMOTE_PROC_DOMAIN_LOOKUP_BY_NAME = 23, - REMOTE_PROC_DOMAIN_LOOKUP_BY_UUID = 24, - REMOTE_PROC_NUM_OF_DEFINED_DOMAINS = 25, - REMOTE_PROC_DOMAIN_PIN_VCPU = 26, - REMOTE_PROC_DOMAIN_REBOOT = 27, - REMOTE_PROC_DOMAIN_RESUME = 28, - REMOTE_PROC_DOMAIN_SET_AUTOSTART = 29, - REMOTE_PROC_DOMAIN_SET_MAX_MEMORY = 30, - REMOTE_PROC_DOMAIN_SET_MEMORY = 31, - REMOTE_PROC_DOMAIN_SET_VCPUS = 32, - REMOTE_PROC_DOMAIN_SHUTDOWN = 33, - REMOTE_PROC_DOMAIN_SUSPEND = 34, - REMOTE_PROC_DOMAIN_UNDEFINE = 35, - REMOTE_PROC_LIST_DEFINED_NETWORKS = 36, - REMOTE_PROC_LIST_DOMAINS = 37, - REMOTE_PROC_LIST_NETWORKS = 38, - REMOTE_PROC_NETWORK_CREATE = 39, - REMOTE_PROC_NETWORK_CREATE_XML = 40, - REMOTE_PROC_NETWORK_DEFINE_XML = 41, - REMOTE_PROC_NETWORK_DESTROY = 42, - REMOTE_PROC_NETWORK_DUMP_XML = 43, - REMOTE_PROC_NETWORK_GET_AUTOSTART = 44, - REMOTE_PROC_NETWORK_GET_BRIDGE_NAME = 45, - REMOTE_PROC_NETWORK_LOOKUP_BY_NAME = 46, - REMOTE_PROC_NETWORK_LOOKUP_BY_UUID = 47, - REMOTE_PROC_NETWORK_SET_AUTOSTART = 48, - REMOTE_PROC_NETWORK_UNDEFINE = 49, - REMOTE_PROC_NUM_OF_DEFINED_NETWORKS = 50, - REMOTE_PROC_NUM_OF_DOMAINS = 51, - REMOTE_PROC_NUM_OF_NETWORKS = 52, - REMOTE_PROC_DOMAIN_CORE_DUMP = 53, - REMOTE_PROC_DOMAIN_RESTORE = 54, - REMOTE_PROC_DOMAIN_SAVE = 55, - REMOTE_PROC_DOMAIN_GET_SCHEDULER_TYPE = 56, - REMOTE_PROC_DOMAIN_GET_SCHEDULER_PARAMETERS = 57, - REMOTE_PROC_DOMAIN_SET_SCHEDULER_PARAMETERS = 58, - REMOTE_PROC_GET_HOSTNAME = 59, - REMOTE_PROC_SUPPORTS_FEATURE = 60, - REMOTE_PROC_DOMAIN_MIGRATE_PREPARE = 61, - REMOTE_PROC_DOMAIN_MIGRATE_PERFORM = 62, - REMOTE_PROC_DOMAIN_MIGRATE_FINISH = 63, - REMOTE_PROC_DOMAIN_BLOCK_STATS = 64, - REMOTE_PROC_DOMAIN_INTERFACE_STATS = 65, - REMOTE_PROC_AUTH_LIST = 66, - REMOTE_PROC_AUTH_SASL_INIT = 67, - REMOTE_PROC_AUTH_SASL_START = 68, - REMOTE_PROC_AUTH_SASL_STEP = 69, - REMOTE_PROC_AUTH_POLKIT = 70, - REMOTE_PROC_NUM_OF_STORAGE_POOLS = 71, - REMOTE_PROC_LIST_STORAGE_POOLS = 72, - REMOTE_PROC_NUM_OF_DEFINED_STORAGE_POOLS = 73, - REMOTE_PROC_LIST_DEFINED_STORAGE_POOLS = 74, - REMOTE_PROC_DISCOVER_STORAGE_POOLS = 75, - REMOTE_PROC_STORAGE_POOL_CREATE_XML = 76, - REMOTE_PROC_STORAGE_POOL_DEFINE_XML = 77, - REMOTE_PROC_STORAGE_POOL_CREATE = 78, - REMOTE_PROC_STORAGE_POOL_BUILD = 79, - REMOTE_PROC_STORAGE_POOL_DESTROY = 80, - REMOTE_PROC_STORAGE_POOL_DELETE = 81, - REMOTE_PROC_STORAGE_POOL_UNDEFINE = 82, - REMOTE_PROC_STORAGE_POOL_REFRESH = 83, - REMOTE_PROC_STORAGE_POOL_LOOKUP_BY_NAME = 84, - REMOTE_PROC_STORAGE_POOL_LOOKUP_BY_UUID = 85, - REMOTE_PROC_STORAGE_POOL_LOOKUP_BY_VOLUME = 86, - REMOTE_PROC_STORAGE_POOL_GET_INFO = 87, - REMOTE_PROC_STORAGE_POOL_DUMP_XML = 88, - REMOTE_PROC_STORAGE_POOL_GET_AUTOSTART = 89, - REMOTE_PROC_STORAGE_POOL_SET_AUTOSTART = 90, - REMOTE_PROC_STORAGE_POOL_NUM_OF_VOLUMES = 91, - REMOTE_PROC_STORAGE_POOL_LIST_VOLUMES = 92, - REMOTE_PROC_STORAGE_VOL_CREATE_XML = 93, - REMOTE_PROC_STORAGE_VOL_DELETE = 94, - REMOTE_PROC_STORAGE_VOL_LOOKUP_BY_NAME = 95, - REMOTE_PROC_STORAGE_VOL_LOOKUP_BY_KEY = 96, - REMOTE_PROC_STORAGE_VOL_LOOKUP_BY_PATH = 97, - REMOTE_PROC_STORAGE_VOL_GET_INFO = 98, - REMOTE_PROC_STORAGE_VOL_DUMP_XML = 99, - REMOTE_PROC_STORAGE_VOL_GET_PATH = 100, + REMOTE_PROC_OPEN = 1, + REMOTE_PROC_CLOSE = 2, + REMOTE_PROC_GET_TYPE = 3, + REMOTE_PROC_GET_VERSION = 4, + REMOTE_PROC_GET_MAX_VCPUS = 5, + REMOTE_PROC_NODE_GET_INFO = 6, + REMOTE_PROC_GET_CAPABILITIES = 7, + REMOTE_PROC_DOMAIN_ATTACH_DEVICE = 8, + REMOTE_PROC_DOMAIN_CREATE = 9, + REMOTE_PROC_DOMAIN_CREATE_LINUX = 10, + REMOTE_PROC_DOMAIN_DEFINE_XML = 11, + REMOTE_PROC_DOMAIN_DESTROY = 12, + REMOTE_PROC_DOMAIN_DETACH_DEVICE = 13, + REMOTE_PROC_DOMAIN_DUMP_XML = 14, + REMOTE_PROC_DOMAIN_GET_AUTOSTART = 15, + REMOTE_PROC_DOMAIN_GET_INFO = 16, + REMOTE_PROC_DOMAIN_GET_MAX_MEMORY = 17, + REMOTE_PROC_DOMAIN_GET_MAX_VCPUS = 18, + REMOTE_PROC_DOMAIN_GET_OS_TYPE = 19, + REMOTE_PROC_DOMAIN_GET_VCPUS = 20, + REMOTE_PROC_LIST_DEFINED_DOMAINS = 21, + REMOTE_PROC_DOMAIN_LOOKUP_BY_ID = 22, + REMOTE_PROC_DOMAIN_LOOKUP_BY_NAME = 23, + REMOTE_PROC_DOMAIN_LOOKUP_BY_UUID = 24, + REMOTE_PROC_NUM_OF_DEFINED_DOMAINS = 25, + REMOTE_PROC_DOMAIN_PIN_VCPU = 26, + REMOTE_PROC_DOMAIN_REBOOT = 27, + REMOTE_PROC_DOMAIN_RESUME = 28, + REMOTE_PROC_DOMAIN_SET_AUTOSTART = 29, + REMOTE_PROC_DOMAIN_SET_MAX_MEMORY = 30, + REMOTE_PROC_DOMAIN_SET_MEMORY = 31, + REMOTE_PROC_DOMAIN_SET_VCPUS = 32, + REMOTE_PROC_DOMAIN_SHUTDOWN = 33, + REMOTE_PROC_DOMAIN_SUSPEND = 34, + REMOTE_PROC_DOMAIN_UNDEFINE = 35, + REMOTE_PROC_LIST_DEFINED_NETWORKS = 36, + REMOTE_PROC_LIST_DOMAINS = 37, + REMOTE_PROC_LIST_NETWORKS = 38, + REMOTE_PROC_NETWORK_CREATE = 39, + REMOTE_PROC_NETWORK_CREATE_XML = 40, + REMOTE_PROC_NETWORK_DEFINE_XML = 41, + REMOTE_PROC_NETWORK_DESTROY = 42, + REMOTE_PROC_NETWORK_DUMP_XML = 43, + REMOTE_PROC_NETWORK_GET_AUTOSTART = 44, + REMOTE_PROC_NETWORK_GET_BRIDGE_NAME = 45, + REMOTE_PROC_NETWORK_LOOKUP_BY_NAME = 46, + REMOTE_PROC_NETWORK_LOOKUP_BY_UUID = 47, + REMOTE_PROC_NETWORK_SET_AUTOSTART = 48, + REMOTE_PROC_NETWORK_UNDEFINE = 49, + REMOTE_PROC_NUM_OF_DEFINED_NETWORKS = 50, + REMOTE_PROC_NUM_OF_DOMAINS = 51, + REMOTE_PROC_NUM_OF_NETWORKS = 52, + REMOTE_PROC_DOMAIN_CORE_DUMP = 53, + REMOTE_PROC_DOMAIN_RESTORE = 54, + REMOTE_PROC_DOMAIN_SAVE = 55, + REMOTE_PROC_DOMAIN_GET_SCHEDULER_TYPE = 56, + REMOTE_PROC_DOMAIN_GET_SCHEDULER_PARAMETERS = 57, + REMOTE_PROC_DOMAIN_SET_SCHEDULER_PARAMETERS = 58, + REMOTE_PROC_GET_HOSTNAME = 59, + REMOTE_PROC_SUPPORTS_FEATURE = 60, + REMOTE_PROC_DOMAIN_MIGRATE_PREPARE = 61, + REMOTE_PROC_DOMAIN_MIGRATE_PERFORM = 62, + REMOTE_PROC_DOMAIN_MIGRATE_FINISH = 63, + REMOTE_PROC_DOMAIN_BLOCK_STATS = 64, + REMOTE_PROC_DOMAIN_INTERFACE_STATS = 65, + REMOTE_PROC_AUTH_LIST = 66, + REMOTE_PROC_AUTH_SASL_INIT = 67, + REMOTE_PROC_AUTH_SASL_START = 68, + REMOTE_PROC_AUTH_SASL_STEP = 69, + REMOTE_PROC_AUTH_POLKIT = 70, + REMOTE_PROC_NUM_OF_STORAGE_POOLS = 71, + REMOTE_PROC_LIST_STORAGE_POOLS = 72, + REMOTE_PROC_NUM_OF_DEFINED_STORAGE_POOLS = 73, + REMOTE_PROC_LIST_DEFINED_STORAGE_POOLS = 74, + REMOTE_PROC_DISCOVER_STORAGE_POOLS = 75, + REMOTE_PROC_STORAGE_POOL_CREATE_XML = 76, + REMOTE_PROC_STORAGE_POOL_DEFINE_XML = 77, + REMOTE_PROC_STORAGE_POOL_CREATE = 78, + REMOTE_PROC_STORAGE_POOL_BUILD = 79, + REMOTE_PROC_STORAGE_POOL_DESTROY = 80, + REMOTE_PROC_STORAGE_POOL_DELETE = 81, + REMOTE_PROC_STORAGE_POOL_UNDEFINE = 82, + REMOTE_PROC_STORAGE_POOL_REFRESH = 83, + REMOTE_PROC_STORAGE_POOL_LOOKUP_BY_NAME = 84, + REMOTE_PROC_STORAGE_POOL_LOOKUP_BY_UUID = 85, + REMOTE_PROC_STORAGE_POOL_LOOKUP_BY_VOLUME = 86, + REMOTE_PROC_STORAGE_POOL_GET_INFO = 87, + REMOTE_PROC_STORAGE_POOL_DUMP_XML = 88, + REMOTE_PROC_STORAGE_POOL_GET_AUTOSTART = 89, + REMOTE_PROC_STORAGE_POOL_SET_AUTOSTART = 90, + REMOTE_PROC_STORAGE_POOL_NUM_OF_VOLUMES = 91, + REMOTE_PROC_STORAGE_POOL_LIST_VOLUMES = 92, + REMOTE_PROC_STORAGE_VOL_CREATE_XML = 93, + REMOTE_PROC_STORAGE_VOL_DELETE = 94, + REMOTE_PROC_STORAGE_VOL_LOOKUP_BY_NAME = 95, + REMOTE_PROC_STORAGE_VOL_LOOKUP_BY_KEY = 96, + REMOTE_PROC_STORAGE_VOL_LOOKUP_BY_PATH = 97, + REMOTE_PROC_STORAGE_VOL_GET_INFO = 98, + REMOTE_PROC_STORAGE_VOL_DUMP_XML = 99, + REMOTE_PROC_STORAGE_VOL_GET_PATH = 100, }; typedef enum remote_procedure remote_procedure; enum remote_message_direction { - REMOTE_CALL = 0, - REMOTE_REPLY = 1, - REMOTE_MESSAGE = 2, + REMOTE_CALL = 0, + REMOTE_REPLY = 1, + REMOTE_MESSAGE = 2, }; typedef enum remote_message_direction remote_message_direction; enum remote_message_status { - REMOTE_OK = 0, - REMOTE_ERROR = 1, + REMOTE_OK = 0, + REMOTE_ERROR = 1, }; typedef enum remote_message_status remote_message_status; #define REMOTE_MESSAGE_HEADER_XDR_LEN 4 struct remote_message_header { - u_int prog; - u_int vers; - remote_procedure proc; - remote_message_direction direction; - u_int serial; - remote_message_status status; + u_int prog; + u_int vers; + remote_procedure proc; + remote_message_direction direction; + u_int serial; + remote_message_status status; }; typedef struct remote_message_header remote_message_header; diff --git a/src/buf.c b/src/buf.c index 236219ddb221823a4e66ca499d78fcc0a0afa5b7..a542fda437298ab02521d1e102d4d78808af18e1 100644 --- a/src/buf.c +++ b/src/buf.c @@ -254,32 +254,32 @@ virBufferEscapeString(virBufferPtr buf, const char *format, const char *str) out = escaped; while (*cur != 0) { if (*cur == '<') { - *out++ = '&'; - *out++ = 'l'; - *out++ = 't'; - *out++ = ';'; - } else if (*cur == '>') { - *out++ = '&'; - *out++ = 'g'; - *out++ = 't'; - *out++ = ';'; - } else if (*cur == '&') { - *out++ = '&'; - *out++ = 'a'; - *out++ = 'm'; - *out++ = 'p'; - *out++ = ';'; - } else if ((*cur >= 0x20) || (*cur == '\n') || (*cur == '\t') || - (*cur == '\r')) { - /* - * default case, just copy ! - * Note that character over 0x80 are likely to give problem - * with UTF-8 XML, but since our string don't have an encoding - * it's hard to handle properly we have to assume it's UTF-8 too - */ - *out++ = *cur; - } - cur++; + *out++ = '&'; + *out++ = 'l'; + *out++ = 't'; + *out++ = ';'; + } else if (*cur == '>') { + *out++ = '&'; + *out++ = 'g'; + *out++ = 't'; + *out++ = ';'; + } else if (*cur == '&') { + *out++ = '&'; + *out++ = 'a'; + *out++ = 'm'; + *out++ = 'p'; + *out++ = ';'; + } else if ((*cur >= 0x20) || (*cur == '\n') || (*cur == '\t') || + (*cur == '\r')) { + /* + * default case, just copy ! + * Note that character over 0x80 are likely to give problem + * with UTF-8 XML, but since our string don't have an encoding + * it's hard to handle properly we have to assume it's UTF-8 too + */ + *out++ = *cur; + } + cur++; } *out = 0; @@ -289,7 +289,7 @@ virBufferEscapeString(virBufferPtr buf, const char *format, const char *str) buf->content[buf->use] = 0; grow_size = (count > 1000) ? count : 1000; if (virBufferGrow(buf, grow_size) < 0) { - free(escaped); + free(escaped); return (-1); } size = buf->size - buf->use - 1; diff --git a/src/conf.c b/src/conf.c index 064c0fe2a6a1a36bce7bbe482d740052bc416561..6cbcde538a769a015fa0f132e4b2de6297cc834c 100644 --- a/src/conf.c +++ b/src/conf.c @@ -48,11 +48,11 @@ struct _virConfParserCtxt { #define IS_BLANK(c) (((c) == ' ') || ((c) == '\n') || ((c) == '\r') || \ ((c) == '\t')) #define SKIP_BLANKS {while ((ctxt->cur < ctxt->end) && (IS_BLANK(CUR))){\ - if (CUR == '\n') ctxt->line++; \ - ctxt->cur++;}} + if (CUR == '\n') ctxt->line++; \ + ctxt->cur++;}} #define IS_SPACE(c) (((c) == ' ') || ((c) == '\t')) #define SKIP_SPACES {while ((ctxt->cur < ctxt->end) && (IS_SPACE(CUR))) \ - ctxt->cur++;} + ctxt->cur++;} #define IS_CHAR(c) ((((c) >= 'a') && ((c) <= 'z')) || \ (((c) >= 'A') && ((c) <= 'Z'))) #define IS_DIGIT(c) (((c) >= '0') && ((c) <= '9')) @@ -216,9 +216,9 @@ virConfAddEntry(virConfPtr conf, char *name, virConfValuePtr value, char *comm) conf->entries = ret; } else { prev = conf->entries; - while (prev->next != NULL) - prev = prev->next; - prev->next = ret; + while (prev->next != NULL) + prev = prev->next; + prev->next = ret; } return(ret); } @@ -245,40 +245,40 @@ virConfSaveValue(virBufferPtr buf, virConfValuePtr val) return(-1); switch (val->type) { case VIR_CONF_NONE: - return(-1); - case VIR_CONF_LONG: - virBufferVSprintf(buf, "%ld", val->l); - break; - case VIR_CONF_STRING: - if (strchr(val->str, '\n') != NULL) { - virBufferVSprintf(buf, "\"\"\"%s\"\"\"", val->str); - } else if (strchr(val->str, '"') == NULL) { - virBufferVSprintf(buf, "\"%s\"", val->str); - } else if (strchr(val->str, '\'') == NULL) { - virBufferVSprintf(buf, "'%s'", val->str); - } else { - virBufferVSprintf(buf, "\"\"\"%s\"\"\"", val->str); - } - break; - case VIR_CONF_LIST: { - virConfValuePtr cur; - - cur = val->list; - virBufferAddLit(buf, "[ "); - if (cur != NULL) { - virConfSaveValue(buf, cur); - cur = cur->next; - while (cur != NULL) { - virBufferAddLit(buf, ", "); - virConfSaveValue(buf, cur); - cur = cur->next; - } - } - virBufferAddLit(buf, " ]"); - break; - } - default: - return(-1); + return(-1); + case VIR_CONF_LONG: + virBufferVSprintf(buf, "%ld", val->l); + break; + case VIR_CONF_STRING: + if (strchr(val->str, '\n') != NULL) { + virBufferVSprintf(buf, "\"\"\"%s\"\"\"", val->str); + } else if (strchr(val->str, '"') == NULL) { + virBufferVSprintf(buf, "\"%s\"", val->str); + } else if (strchr(val->str, '\'') == NULL) { + virBufferVSprintf(buf, "'%s'", val->str); + } else { + virBufferVSprintf(buf, "\"\"\"%s\"\"\"", val->str); + } + break; + case VIR_CONF_LIST: { + virConfValuePtr cur; + + cur = val->list; + virBufferAddLit(buf, "[ "); + if (cur != NULL) { + virConfSaveValue(buf, cur); + cur = cur->next; + while (cur != NULL) { + virBufferAddLit(buf, ", "); + virConfSaveValue(buf, cur); + cur = cur->next; + } + } + virBufferAddLit(buf, " ]"); + break; + } + default: + return(-1); } return(0); } @@ -297,15 +297,15 @@ virConfSaveEntry(virBufferPtr buf, virConfEntryPtr cur) { if (cur->name != NULL) { virBufferAdd(buf, cur->name, -1); - virBufferAddLit(buf, " = "); - virConfSaveValue(buf, cur->value); - if (cur->comment != NULL) { - virBufferAddLit(buf, " #"); - virBufferAdd(buf, cur->comment, -1); - } + virBufferAddLit(buf, " = "); + virConfSaveValue(buf, cur->value); + if (cur->comment != NULL) { + virBufferAddLit(buf, " #"); + virBufferAdd(buf, cur->comment, -1); + } } else if (cur->comment != NULL) { - virBufferAddLit(buf, "#"); - virBufferAdd(buf, cur->comment, -1); + virBufferAddLit(buf, "#"); + virBufferAdd(buf, cur->comment, -1); } virBufferAddLit(buf, "\n"); return(0); @@ -334,18 +334,18 @@ virConfParseLong(virConfParserCtxtPtr ctxt, long *val) if (CUR == '-') { neg = 1; - NEXT; + NEXT; } else if (CUR == '+') { NEXT; } if ((ctxt->cur >= ctxt->end) || (!IS_DIGIT(CUR))) { virConfError(NULL, VIR_ERR_CONF_SYNTAX, _("unterminated number"), - ctxt->line); - return(-1); + ctxt->line); + return(-1); } while ((ctxt->cur < ctxt->end) && (IS_DIGIT(CUR))) { l = l * 10 + (CUR - '0'); - NEXT; + NEXT; } if (neg) l = -l; @@ -369,45 +369,45 @@ virConfParseString(virConfParserCtxtPtr ctxt) if (CUR == '\'') { NEXT; - base = ctxt->cur; - while ((ctxt->cur < ctxt->end) && (CUR != '\'') && (!IS_EOL(CUR))) - NEXT; - if (CUR != '\'') { - virConfError(NULL, VIR_ERR_CONF_SYNTAX, _("unterminated string"), - ctxt->line); - return(NULL); - } - ret = strndup(base, ctxt->cur - base); - NEXT; + base = ctxt->cur; + while ((ctxt->cur < ctxt->end) && (CUR != '\'') && (!IS_EOL(CUR))) + NEXT; + if (CUR != '\'') { + virConfError(NULL, VIR_ERR_CONF_SYNTAX, _("unterminated string"), + ctxt->line); + return(NULL); + } + ret = strndup(base, ctxt->cur - base); + NEXT; } else if ((ctxt->cur + 6 < ctxt->end) && (ctxt->cur[0] == '"') && (ctxt->cur[1] == '"') && (ctxt->cur[2] == '"')) { - ctxt->cur += 3; - base = ctxt->cur; - while ((ctxt->cur + 2 < ctxt->end) && (ctxt->cur[0] == '"') && - (ctxt->cur[1] == '"') && (ctxt->cur[2] == '"')) { - if (CUR == '\n') ctxt->line++; - NEXT; - } - if ((ctxt->cur[0] != '"') || (ctxt->cur[1] != '"') || - (ctxt->cur[2] != '"')) { - virConfError(NULL, VIR_ERR_CONF_SYNTAX, _("unterminated string"), - ctxt->line); - return(NULL); - } - ret = strndup(base, ctxt->cur - base); - ctxt->cur += 3; + ctxt->cur += 3; + base = ctxt->cur; + while ((ctxt->cur + 2 < ctxt->end) && (ctxt->cur[0] == '"') && + (ctxt->cur[1] == '"') && (ctxt->cur[2] == '"')) { + if (CUR == '\n') ctxt->line++; + NEXT; + } + if ((ctxt->cur[0] != '"') || (ctxt->cur[1] != '"') || + (ctxt->cur[2] != '"')) { + virConfError(NULL, VIR_ERR_CONF_SYNTAX, _("unterminated string"), + ctxt->line); + return(NULL); + } + ret = strndup(base, ctxt->cur - base); + ctxt->cur += 3; } else if (CUR == '"') { NEXT; - base = ctxt->cur; - while ((ctxt->cur < ctxt->end) && (CUR != '"') && (!IS_EOL(CUR))) - NEXT; - if (CUR != '"') { - virConfError(NULL, VIR_ERR_CONF_SYNTAX, _("unterminated string"), - ctxt->line); - return(NULL); - } - ret = strndup(base, ctxt->cur - base); - NEXT; + base = ctxt->cur; + while ((ctxt->cur < ctxt->end) && (CUR != '"') && (!IS_EOL(CUR))) + NEXT; + if (CUR != '"') { + virConfError(NULL, VIR_ERR_CONF_SYNTAX, _("unterminated string"), + ctxt->line); + return(NULL); + } + ret = strndup(base, ctxt->cur - base); + NEXT; } return(ret); } @@ -431,66 +431,66 @@ virConfParseValue(virConfParserCtxtPtr ctxt) SKIP_SPACES; if (ctxt->cur >= ctxt->end) { virConfError(NULL, VIR_ERR_CONF_SYNTAX, _("expecting a value"), - ctxt->line); - return(NULL); + ctxt->line); + return(NULL); } if ((CUR == '"') || (CUR == '\'')) { type = VIR_CONF_STRING; str = virConfParseString(ctxt); - if (str == NULL) - return(NULL); + if (str == NULL) + return(NULL); } else if (CUR == '[') { type = VIR_CONF_LIST; NEXT; - SKIP_BLANKS; - if ((ctxt->cur < ctxt->end) && (CUR != ']')) { - lst = virConfParseValue(ctxt); - SKIP_BLANKS; - } - while ((ctxt->cur < ctxt->end) && (CUR != ']')) { - if (CUR != ',') { - virConfError(NULL, VIR_ERR_CONF_SYNTAX, - _("expecting a separator in list"), ctxt->line); - virConfFreeList(lst); - return(NULL); - } - NEXT; - SKIP_BLANKS; - if (CUR == ']') { - break; - } - tmp = virConfParseValue(ctxt); - if (tmp == NULL) { - virConfFreeList(lst); - return(NULL); - } - prev = lst; - while (prev->next != NULL) prev = prev->next; - prev->next = tmp; - SKIP_BLANKS; - } - if (CUR == ']') { - NEXT; - } else { - virConfError(NULL, VIR_ERR_CONF_SYNTAX, - _("list is not closed with ]"), ctxt->line); - virConfFreeList(lst); - return(NULL); - } + SKIP_BLANKS; + if ((ctxt->cur < ctxt->end) && (CUR != ']')) { + lst = virConfParseValue(ctxt); + SKIP_BLANKS; + } + while ((ctxt->cur < ctxt->end) && (CUR != ']')) { + if (CUR != ',') { + virConfError(NULL, VIR_ERR_CONF_SYNTAX, + _("expecting a separator in list"), ctxt->line); + virConfFreeList(lst); + return(NULL); + } + NEXT; + SKIP_BLANKS; + if (CUR == ']') { + break; + } + tmp = virConfParseValue(ctxt); + if (tmp == NULL) { + virConfFreeList(lst); + return(NULL); + } + prev = lst; + while (prev->next != NULL) prev = prev->next; + prev->next = tmp; + SKIP_BLANKS; + } + if (CUR == ']') { + NEXT; + } else { + virConfError(NULL, VIR_ERR_CONF_SYNTAX, + _("list is not closed with ]"), ctxt->line); + virConfFreeList(lst); + return(NULL); + } } else if (IS_DIGIT(CUR) || (CUR == '-') || (CUR == '+')) { if (virConfParseLong(ctxt, &l) < 0) { - return(NULL); - } + return(NULL); + } type = VIR_CONF_LONG; } else { virConfError(NULL, VIR_ERR_CONF_SYNTAX, _("expecting a value"), - ctxt->line); - return(NULL); + ctxt->line); + return(NULL); } ret = calloc(1, sizeof(*ret)); if (ret == NULL) { virConfError(NULL, VIR_ERR_NO_MEMORY, _("allocating configuration"), 0); - free(str); + free(str); return(NULL); } ret->type = type; @@ -519,14 +519,14 @@ virConfParseName(virConfParserCtxtPtr ctxt) /* TODO: probably need encoding support and UTF-8 parsing ! */ if (!IS_CHAR(CUR)) { virConfError(NULL, VIR_ERR_CONF_SYNTAX, _("expecting a name"), ctxt->line); - return(NULL); + return(NULL); } while ((ctxt->cur < ctxt->end) && ((IS_CHAR(CUR)) || (IS_DIGIT(CUR)) || (CUR == '_'))) NEXT; ret = strndup(base, ctxt->cur - base); if (ret == NULL) { virConfError(NULL, VIR_ERR_NO_MEMORY, _("allocating configuration"), - ctxt->line); + ctxt->line); return(NULL); } return(ret); @@ -554,7 +554,7 @@ virConfParseComment(virConfParserCtxtPtr ctxt) comm = strndup(base, ctxt->cur - base); if (comm == NULL) { virConfError(NULL, VIR_ERR_NO_MEMORY, _("allocating configuration"), - ctxt->line); + ctxt->line); return(-1); } virConfAddEntry(ctxt->conf, NULL, NULL, comm); @@ -574,16 +574,16 @@ virConfParseSeparator(virConfParserCtxtPtr ctxt) { SKIP_SPACES; if (ctxt->cur >= ctxt->end) - return(0); + return(0); if (IS_EOL(CUR)) { - SKIP_BLANKS + SKIP_BLANKS } else if (CUR == ';') { - NEXT; - SKIP_BLANKS; + NEXT; + SKIP_BLANKS; } else { virConfError(NULL, VIR_ERR_CONF_SYNTAX, _("expecting a separator"), - ctxt->line); - return(-1); + ctxt->line); + return(-1); } return(0); } @@ -614,7 +614,7 @@ virConfParseStatement(virConfParserCtxtPtr ctxt) SKIP_SPACES; if (CUR != '=') { virConfError(NULL, VIR_ERR_CONF_SYNTAX, _("expecting an assignment"), - ctxt->line); + ctxt->line); return(-1); } NEXT; @@ -622,27 +622,27 @@ virConfParseStatement(virConfParserCtxtPtr ctxt) value = virConfParseValue(ctxt); if (value == NULL) { free(name); - return(-1); + return(-1); } SKIP_SPACES; if (CUR == '#') { - NEXT; - base = ctxt->cur; - while ((ctxt->cur < ctxt->end) && (!IS_EOL(CUR))) NEXT; - comm = strndup(base, ctxt->cur - base); - if (comm == NULL) { - virConfError(NULL, VIR_ERR_NO_MEMORY, _("allocating configuration"), - ctxt->line); - free(name); - virConfFreeValue(value); - return(-1); - } + NEXT; + base = ctxt->cur; + while ((ctxt->cur < ctxt->end) && (!IS_EOL(CUR))) NEXT; + comm = strndup(base, ctxt->cur - base); + if (comm == NULL) { + virConfError(NULL, VIR_ERR_NO_MEMORY, _("allocating configuration"), + ctxt->line); + free(name); + virConfFreeValue(value); + return(-1); + } } if (virConfAddEntry(ctxt->conf, name, value, comm) == NULL) { free(name); - virConfFreeValue(value); + virConfFreeValue(value); free(comm); - return(-1); + return(-1); } return(0); } @@ -674,9 +674,9 @@ virConfParse(const char *filename, const char *content, int len) { while (ctxt.cur < ctxt.end) { if (virConfParseStatement(&ctxt) < 0) - goto error; - if (virConfParseSeparator(&ctxt) < 0) - goto error; + goto error; + if (virConfParseSeparator(&ctxt) < 0) + goto error; } return(ctxt.conf); @@ -801,7 +801,7 @@ __virConfGetValue(virConfPtr conf, const char *setting) cur = conf->entries; while (cur != NULL) { if ((cur->name != NULL) && (!strcmp(cur->name, setting))) - return(cur->value); + return(cur->value); cur = cur->next; } return(NULL); @@ -894,14 +894,14 @@ __virConfWriteFile(const char *filename, virConfPtr conf) cur = conf->entries; while (cur != NULL) { virConfSaveEntry(buf, cur); - cur = cur->next; + cur = cur->next; } fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR ); if (fd < 0) { virConfError(NULL, VIR_ERR_WRITE_FAILED, _("failed to open file"), 0); ret = -1; - goto error; + goto error; } ret = safewrite(fd, buf->content, buf->use); @@ -909,7 +909,7 @@ __virConfWriteFile(const char *filename, virConfPtr conf) if (ret != (int) buf->use) { virConfError(NULL, VIR_ERR_WRITE_FAILED, _("failed to save content"), 0); ret = -1; - goto error; + goto error; } error: virBufferFree(buf); diff --git a/src/conf.h b/src/conf.h index a5758240c6a69dc29312a0a85eac10d9da9e08f3..29ce96ac2b36947c1ca038d5e5702cd572933c63 100644 --- a/src/conf.h +++ b/src/conf.h @@ -68,19 +68,19 @@ typedef virConf *virConfPtr; virConfPtr __virConfNew (void); virConfPtr __virConfReadFile (const char *filename); virConfPtr __virConfReadMem (const char *memory, - int len); + int len); int __virConfFree (virConfPtr conf); virConfValuePtr __virConfGetValue (virConfPtr conf, - const char *setting); + const char *setting); int __virConfSetValue (virConfPtr conf, - const char *setting, - virConfValuePtr value); + const char *setting, + virConfValuePtr value); int __virConfWriteFile (const char *filename, - virConfPtr conf); + virConfPtr conf); int __virConfWriteMem (char *memory, - int *len, - virConfPtr conf); + int *len, + virConfPtr conf); #define virConfNew() (__virConfNew()) #define virConfReadFile(f) (__virConfReadFile((f))) diff --git a/src/driver.h b/src/driver.h index 472456006b7ad99a7d28529dad55ec08ee8c71e4..61f8f38b1e2fc93c8806a0bd8b874c110e6b6197 100644 --- a/src/driver.h +++ b/src/driver.h @@ -71,146 +71,146 @@ typedef enum { ((drv)->supports_feature ? (drv)->supports_feature((conn),(feature)) : 0) typedef const char * - (*virDrvProbe) (void); + (*virDrvProbe) (void); typedef virDrvOpenStatus - (*virDrvOpen) (virConnectPtr conn, + (*virDrvOpen) (virConnectPtr conn, xmlURIPtr uri, virConnectAuthPtr auth, int flags); typedef int - (*virDrvClose) (virConnectPtr conn); + (*virDrvClose) (virConnectPtr conn); typedef int (*virDrvSupportsFeature) (virConnectPtr conn, int feature); typedef const char * - (*virDrvGetType) (virConnectPtr conn); + (*virDrvGetType) (virConnectPtr conn); typedef int - (*virDrvGetVersion) (virConnectPtr conn, - unsigned long *hvVer); + (*virDrvGetVersion) (virConnectPtr conn, + unsigned long *hvVer); typedef char * (*virDrvGetHostname) (virConnectPtr conn); typedef char * (*virDrvGetURI) (virConnectPtr conn); typedef int - (*virDrvGetMaxVcpus) (virConnectPtr conn, - const char *type); + (*virDrvGetMaxVcpus) (virConnectPtr conn, + const char *type); typedef int - (*virDrvNodeGetInfo) (virConnectPtr conn, - virNodeInfoPtr info); + (*virDrvNodeGetInfo) (virConnectPtr conn, + virNodeInfoPtr info); typedef char * - (*virDrvGetCapabilities) (virConnectPtr conn); + (*virDrvGetCapabilities) (virConnectPtr conn); typedef int - (*virDrvListDomains) (virConnectPtr conn, - int *ids, - int maxids); + (*virDrvListDomains) (virConnectPtr conn, + int *ids, + int maxids); typedef int - (*virDrvNumOfDomains) (virConnectPtr conn); + (*virDrvNumOfDomains) (virConnectPtr conn); typedef virDomainPtr - (*virDrvDomainCreateLinux) (virConnectPtr conn, - const char *xmlDesc, - unsigned int flags); + (*virDrvDomainCreateLinux) (virConnectPtr conn, + const char *xmlDesc, + unsigned int flags); typedef virDomainPtr - (*virDrvDomainLookupByID) (virConnectPtr conn, - int id); + (*virDrvDomainLookupByID) (virConnectPtr conn, + int id); typedef virDomainPtr - (*virDrvDomainLookupByUUID) (virConnectPtr conn, - const unsigned char *uuid); + (*virDrvDomainLookupByUUID) (virConnectPtr conn, + const unsigned char *uuid); typedef virDomainPtr - (*virDrvDomainLookupByName) (virConnectPtr conn, - const char *name); + (*virDrvDomainLookupByName) (virConnectPtr conn, + const char *name); typedef int - (*virDrvDomainSuspend) (virDomainPtr domain); + (*virDrvDomainSuspend) (virDomainPtr domain); typedef int - (*virDrvDomainResume) (virDomainPtr domain); + (*virDrvDomainResume) (virDomainPtr domain); typedef int - (*virDrvDomainShutdown) (virDomainPtr domain); + (*virDrvDomainShutdown) (virDomainPtr domain); typedef int - (*virDrvDomainReboot) (virDomainPtr domain, - unsigned int flags); + (*virDrvDomainReboot) (virDomainPtr domain, + unsigned int flags); typedef int - (*virDrvDomainDestroy) (virDomainPtr domain); + (*virDrvDomainDestroy) (virDomainPtr domain); typedef char * - (*virDrvDomainGetOSType) (virDomainPtr domain); + (*virDrvDomainGetOSType) (virDomainPtr domain); typedef unsigned long - (*virDrvDomainGetMaxMemory) (virDomainPtr domain); + (*virDrvDomainGetMaxMemory) (virDomainPtr domain); typedef int - (*virDrvDomainSetMaxMemory) (virDomainPtr domain, - unsigned long memory); + (*virDrvDomainSetMaxMemory) (virDomainPtr domain, + unsigned long memory); typedef int - (*virDrvDomainSetMemory) (virDomainPtr domain, - unsigned long memory); + (*virDrvDomainSetMemory) (virDomainPtr domain, + unsigned long memory); typedef int - (*virDrvDomainGetInfo) (virDomainPtr domain, - virDomainInfoPtr info); + (*virDrvDomainGetInfo) (virDomainPtr domain, + virDomainInfoPtr info); typedef int - (*virDrvDomainSave) (virDomainPtr domain, - const char *to); + (*virDrvDomainSave) (virDomainPtr domain, + const char *to); typedef int - (*virDrvDomainRestore) (virConnectPtr conn, - const char *from); + (*virDrvDomainRestore) (virConnectPtr conn, + const char *from); typedef int - (*virDrvDomainCoreDump) (virDomainPtr domain, - const char *to, - int flags); + (*virDrvDomainCoreDump) (virDomainPtr domain, + const char *to, + int flags); typedef char * - (*virDrvDomainDumpXML) (virDomainPtr dom, - int flags); + (*virDrvDomainDumpXML) (virDomainPtr dom, + int flags); typedef int - (*virDrvListDefinedDomains) (virConnectPtr conn, - char **const names, - int maxnames); + (*virDrvListDefinedDomains) (virConnectPtr conn, + char **const names, + int maxnames); typedef int - (*virDrvNumOfDefinedDomains) (virConnectPtr conn); + (*virDrvNumOfDefinedDomains) (virConnectPtr conn); typedef int - (*virDrvDomainCreate) (virDomainPtr dom); + (*virDrvDomainCreate) (virDomainPtr dom); typedef virDomainPtr - (*virDrvDomainDefineXML) (virConnectPtr conn, - const char *xml); + (*virDrvDomainDefineXML) (virConnectPtr conn, + const char *xml); typedef int - (*virDrvDomainUndefine) (virDomainPtr dom); + (*virDrvDomainUndefine) (virDomainPtr dom); typedef int - (*virDrvDomainSetVcpus) (virDomainPtr domain, - unsigned int nvcpus); + (*virDrvDomainSetVcpus) (virDomainPtr domain, + unsigned int nvcpus); typedef int - (*virDrvDomainPinVcpu) (virDomainPtr domain, - unsigned int vcpu, - unsigned char *cpumap, - int maplen); + (*virDrvDomainPinVcpu) (virDomainPtr domain, + unsigned int vcpu, + unsigned char *cpumap, + int maplen); typedef int - (*virDrvDomainGetVcpus) (virDomainPtr domain, - virVcpuInfoPtr info, - int maxinfo, - unsigned char *cpumaps, - int maplen); + (*virDrvDomainGetVcpus) (virDomainPtr domain, + virVcpuInfoPtr info, + int maxinfo, + unsigned char *cpumaps, + int maplen); typedef int - (*virDrvDomainGetMaxVcpus) (virDomainPtr domain); + (*virDrvDomainGetMaxVcpus) (virDomainPtr domain); typedef int - (*virDrvDomainAttachDevice) (virDomainPtr domain, - const char *xml); + (*virDrvDomainAttachDevice) (virDomainPtr domain, + const char *xml); typedef int - (*virDrvDomainDetachDevice) (virDomainPtr domain, - const char *xml); + (*virDrvDomainDetachDevice) (virDomainPtr domain, + const char *xml); typedef int - (*virDrvDomainGetAutostart) (virDomainPtr domain, - int *autostart); + (*virDrvDomainGetAutostart) (virDomainPtr domain, + int *autostart); typedef int - (*virDrvDomainSetAutostart) (virDomainPtr domain, - int autostart); + (*virDrvDomainSetAutostart) (virDomainPtr domain, + int autostart); typedef char * - (*virDrvDomainGetSchedulerType) (virDomainPtr domain, - int *nparams); + (*virDrvDomainGetSchedulerType) (virDomainPtr domain, + int *nparams); typedef int - (*virDrvDomainGetSchedulerParameters) - (virDomainPtr domain, - virSchedParameterPtr params, - int *nparams); + (*virDrvDomainGetSchedulerParameters) + (virDomainPtr domain, + virSchedParameterPtr params, + int *nparams); typedef int - (*virDrvDomainSetSchedulerParameters) - (virDomainPtr domain, - virSchedParameterPtr params, - int nparams); + (*virDrvDomainSetSchedulerParameters) + (virDomainPtr domain, + virSchedParameterPtr params, + int nparams); typedef int (*virDrvDomainBlockStats) @@ -265,7 +265,7 @@ typedef int typedef unsigned long long (*virDrvNodeGetFreeMemory) - (virConnectPtr conn); + (virConnectPtr conn); /** * _virDriver: @@ -340,46 +340,46 @@ struct _virDriver { }; typedef int - (*virDrvNumOfNetworks) (virConnectPtr conn); + (*virDrvNumOfNetworks) (virConnectPtr conn); typedef int - (*virDrvListNetworks) (virConnectPtr conn, - char **const names, - int maxnames); + (*virDrvListNetworks) (virConnectPtr conn, + char **const names, + int maxnames); typedef int - (*virDrvNumOfDefinedNetworks) (virConnectPtr conn); + (*virDrvNumOfDefinedNetworks) (virConnectPtr conn); typedef int - (*virDrvListDefinedNetworks) (virConnectPtr conn, - char **const names, - int maxnames); + (*virDrvListDefinedNetworks) (virConnectPtr conn, + char **const names, + int maxnames); typedef virNetworkPtr - (*virDrvNetworkLookupByUUID) (virConnectPtr conn, - const unsigned char *uuid); + (*virDrvNetworkLookupByUUID) (virConnectPtr conn, + const unsigned char *uuid); typedef virNetworkPtr - (*virDrvNetworkLookupByName) (virConnectPtr conn, - const char *name); + (*virDrvNetworkLookupByName) (virConnectPtr conn, + const char *name); typedef virNetworkPtr - (*virDrvNetworkCreateXML) (virConnectPtr conn, - const char *xmlDesc); + (*virDrvNetworkCreateXML) (virConnectPtr conn, + const char *xmlDesc); typedef virNetworkPtr - (*virDrvNetworkDefineXML) (virConnectPtr conn, - const char *xml); + (*virDrvNetworkDefineXML) (virConnectPtr conn, + const char *xml); typedef int - (*virDrvNetworkUndefine) (virNetworkPtr network); + (*virDrvNetworkUndefine) (virNetworkPtr network); typedef int - (*virDrvNetworkCreate) (virNetworkPtr network); + (*virDrvNetworkCreate) (virNetworkPtr network); typedef int - (*virDrvNetworkDestroy) (virNetworkPtr network); + (*virDrvNetworkDestroy) (virNetworkPtr network); typedef char * - (*virDrvNetworkDumpXML) (virNetworkPtr network, - int flags); + (*virDrvNetworkDumpXML) (virNetworkPtr network, + int flags); typedef char * - (*virDrvNetworkGetBridgeName) (virNetworkPtr network); + (*virDrvNetworkGetBridgeName) (virNetworkPtr network); typedef int - (*virDrvNetworkGetAutostart) (virNetworkPtr network, - int *autostart); + (*virDrvNetworkGetAutostart) (virNetworkPtr network, + int *autostart); typedef int - (*virDrvNetworkSetAutostart) (virNetworkPtr network, - int autostart); + (*virDrvNetworkSetAutostart) (virNetworkPtr network, + int autostart); typedef struct _virNetworkDriver virNetworkDriver; @@ -396,24 +396,24 @@ typedef virNetworkDriver *virNetworkDriverPtr; * - close */ struct _virNetworkDriver { - const char * name; /* the name of the driver */ - virDrvOpen open; - virDrvClose close; - virDrvNumOfNetworks numOfNetworks; - virDrvListNetworks listNetworks; - virDrvNumOfDefinedNetworks numOfDefinedNetworks; - virDrvListDefinedNetworks listDefinedNetworks; - virDrvNetworkLookupByUUID networkLookupByUUID; - virDrvNetworkLookupByName networkLookupByName; - virDrvNetworkCreateXML networkCreateXML; - virDrvNetworkDefineXML networkDefineXML; - virDrvNetworkUndefine networkUndefine; - virDrvNetworkCreate networkCreate; - virDrvNetworkDestroy networkDestroy; - virDrvNetworkDumpXML networkDumpXML; - virDrvNetworkGetBridgeName networkGetBridgeName; - virDrvNetworkGetAutostart networkGetAutostart; - virDrvNetworkSetAutostart networkSetAutostart; + const char * name; /* the name of the driver */ + virDrvOpen open; + virDrvClose close; + virDrvNumOfNetworks numOfNetworks; + virDrvListNetworks listNetworks; + virDrvNumOfDefinedNetworks numOfDefinedNetworks; + virDrvListDefinedNetworks listDefinedNetworks; + virDrvNetworkLookupByUUID networkLookupByUUID; + virDrvNetworkLookupByName networkLookupByName; + virDrvNetworkCreateXML networkCreateXML; + virDrvNetworkDefineXML networkDefineXML; + virDrvNetworkUndefine networkUndefine; + virDrvNetworkCreate networkCreate; + virDrvNetworkDestroy networkDestroy; + virDrvNetworkDumpXML networkDumpXML; + virDrvNetworkGetBridgeName networkGetBridgeName; + virDrvNetworkGetAutostart networkGetAutostart; + virDrvNetworkSetAutostart networkSetAutostart; }; diff --git a/src/event.h b/src/event.h index 7ba1db789977b2121e6dd5331208625f6be406cc..758573c145ca72baac224f89c2b87175bb04bb7d 100644 --- a/src/event.h +++ b/src/event.h @@ -119,11 +119,11 @@ typedef void (*virEventUpdateTimeoutFunc)(int, int); typedef int (*virEventRemoveTimeoutFunc)(int); void __virEventRegisterImpl(virEventAddHandleFunc addHandle, - virEventUpdateHandleFunc updateHandle, - virEventRemoveHandleFunc removeHandle, - virEventAddTimeoutFunc addTimeout, - virEventUpdateTimeoutFunc updateTimeout, - virEventRemoveTimeoutFunc removeTimeout); + virEventUpdateHandleFunc updateHandle, + virEventRemoveHandleFunc removeHandle, + virEventAddTimeoutFunc addTimeout, + virEventUpdateTimeoutFunc updateTimeout, + virEventRemoveTimeoutFunc removeTimeout); #define virEventRegisterImpl(ah,rh,at,rt) __virEventRegisterImpl(ah,rh,at,rt) diff --git a/src/hash.h b/src/hash.h index 6fc963c410a6d7453ea1daf3201bd0697cbd626a..5b7bf3e566136c61fb3aeb5ab3a12e3afd3e1da8 100644 --- a/src/hash.h +++ b/src/hash.h @@ -66,16 +66,16 @@ int virHashSize(virHashTablePtr table); * Add a new entry to the hash table. */ int virHashAddEntry(virHashTablePtr table, - const char *name, void *userdata); + const char *name, void *userdata); int virHashUpdateEntry(virHashTablePtr table, - const char *name, - void *userdata, virHashDeallocator f); + const char *name, + void *userdata, virHashDeallocator f); /* * Remove an entry from the hash table. */ int virHashRemoveEntry(virHashTablePtr table, - const char *name, virHashDeallocator f); + const char *name, virHashDeallocator f); /* * Retrieve the userdata. diff --git a/src/internal.h b/src/internal.h index 605bd825f11c10f85a6b223081972a930dfa1a0c..07a109ebe2bb8efe96f493461472ee2cfe17df51 100644 --- a/src/internal.h +++ b/src/internal.h @@ -266,15 +266,15 @@ struct _virStorageVol { ************************************************************************/ extern virError __lastErr; void __virRaiseError(virConnectPtr conn, - virDomainPtr dom, - virNetworkPtr net, - int domain, - int code, - virErrorLevel level, - const char *str1, - const char *str2, - const char *str3, - int int1, int int2, const char *msg, ...) + virDomainPtr dom, + virNetworkPtr net, + int domain, + int code, + virErrorLevel level, + const char *str1, + const char *str2, + const char *str3, + int int1, int int2, const char *msg, ...) ATTRIBUTE_FORMAT(printf, 12, 13); const char *__virErrorMsg(virErrorNumber error, const char *info); diff --git a/src/libvirt.c b/src/libvirt.c index 39fe8bc27671fc85d44ce2b368a5b06ae9eaf70f..d4933043b414b26d48c367fc407666d9ad9ee8a5 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -454,12 +454,12 @@ virRegisterNetworkDriver(virNetworkDriverPtr driver) if (driver == NULL) { virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__); - return(-1); + return(-1); } if (virNetworkDriverTabCount >= MAX_DRIVERS) { - virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__); - return(-1); + virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__); + return(-1); } virNetworkDriverTab[virNetworkDriverTabCount] = driver; @@ -486,7 +486,7 @@ virRegisterStorageDriver(virStorageDriverPtr driver) } if (virStorageDriverTabCount >= MAX_DRIVERS) { - virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__); + virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__); return(-1); } @@ -510,16 +510,16 @@ virRegisterDriver(virDriverPtr driver) if (driver == NULL) { virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__); - return(-1); + return(-1); } if (virDriverTabCount >= MAX_DRIVERS) { - virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__); - return(-1); + virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__); + return(-1); } if (driver->no < 0) { - virLibConnError + virLibConnError (NULL, VIR_ERR_INVALID_ARG, "virRegisterDriver: tried to register an internal Xen driver"); return -1; @@ -549,7 +549,7 @@ virRegisterStateDriver(virStateDriverPtr driver) } if (virStateDriverTabCount >= MAX_DRIVERS) { - virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__); + virLibConnError(NULL, VIR_ERR_INVALID_ARG, __FUNCTION__); return(-1); } @@ -633,7 +633,7 @@ virGetVersion(unsigned long *libVer, const char *type, if (!initialized) if (virInitialize() < 0) - return -1; + return -1; if (libVer == NULL) return (-1); @@ -641,14 +641,14 @@ virGetVersion(unsigned long *libVer, const char *type, if (typeVer != NULL) { if (type == NULL) - type = "Xen"; - for (i = 0;i < virDriverTabCount;i++) { - if ((virDriverTab[i] != NULL) && - (!strcasecmp(virDriverTab[i]->name, type))) { - *typeVer = virDriverTab[i]->ver; - break; - } - } + type = "Xen"; + for (i = 0;i < virDriverTabCount;i++) { + if ((virDriverTab[i] != NULL) && + (!strcasecmp(virDriverTab[i]->name, type))) { + *typeVer = virDriverTab[i]->ver; + break; + } + } if (i >= virDriverTabCount) { *typeVer = 0; virLibConnError(NULL, VIR_ERR_NO_SUPPORT, type); @@ -675,38 +675,38 @@ do_open (const char *name, if (!name || name[0] == '\0') { char *defname = getenv("LIBVIRT_DEFAULT_URI"); if (defname && *defname) { - DEBUG("Using LIBVIRT_DEFAULT_URI %s", defname); + DEBUG("Using LIBVIRT_DEFAULT_URI %s", defname); name = defname; } else { - const char *use = NULL; - const char *latest; - int probes = 0; - for (i = 0; i < virNetworkDriverTabCount; i++) { - if ((virDriverTab[i]->probe != NULL) && - ((latest = virDriverTab[i]->probe()) != NULL)) { - probes++; - - DEBUG("Probed %s", latest); - /* - * if running a xen kernel, give it priority over - * QEmu emulation - */ - if (STREQ(latest, "xen:///")) - use = latest; - else if (use == NULL) - use = latest; - } - } - if (use == NULL) { - name = "xen:///"; - DEBUG("Could not probe any hypervisor defaulting to %s", - name); - } else { - name = use; - DEBUG("Using %s as default URI, %d hypervisor found", - use, probes); - } - } + const char *use = NULL; + const char *latest; + int probes = 0; + for (i = 0; i < virNetworkDriverTabCount; i++) { + if ((virDriverTab[i]->probe != NULL) && + ((latest = virDriverTab[i]->probe()) != NULL)) { + probes++; + + DEBUG("Probed %s", latest); + /* + * if running a xen kernel, give it priority over + * QEmu emulation + */ + if (STREQ(latest, "xen:///")) + use = latest; + else if (use == NULL) + use = latest; + } + } + if (use == NULL) { + name = "xen:///"; + DEBUG("Could not probe any hypervisor defaulting to %s", + name); + } else { + name = use; + DEBUG("Using %s as default URI, %d hypervisor found", + use, probes); + } + } } /* Convert xen -> xen:/// for back compat */ @@ -824,7 +824,7 @@ do_open (const char *name, failed: if (ret->driver) ret->driver->close (ret); if (uri) xmlFreeURI(uri); - virUnrefConnect(ret); + virUnrefConnect(ret); return NULL; } @@ -1218,7 +1218,7 @@ virDomainCreateLinux(virConnectPtr conn, const char *xmlDesc, } if (conn->flags & VIR_CONNECT_RO) { virLibConnError(conn, VIR_ERR_OPERATION_DENIED, __FUNCTION__); - return (NULL); + return (NULL); } if (conn->driver->domainCreateLinux) @@ -1334,8 +1334,8 @@ virDomainLookupByUUIDString(virConnectPtr conn, const char *uuidstr) raw + 12, raw + 13, raw + 14, raw + 15); if (ret!=VIR_UUID_BUFLEN) { - virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__); - return (NULL); + virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__); + return (NULL); } for (i = 0; i < VIR_UUID_BUFLEN; i++) uuid[i] = raw[i] & 0xFF; @@ -1401,7 +1401,7 @@ virDomainDestroy(virDomainPtr domain) conn = domain->conn; if (conn->flags & VIR_CONNECT_RO) { virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__); - return (-1); + return (-1); } if (conn->driver->domainDestroy) @@ -1458,7 +1458,7 @@ virDomainSuspend(virDomainPtr domain) } if (domain->conn->flags & VIR_CONNECT_RO) { virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__); - return (-1); + return (-1); } conn = domain->conn; @@ -1492,7 +1492,7 @@ virDomainResume(virDomainPtr domain) } if (domain->conn->flags & VIR_CONNECT_RO) { virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__); - return (-1); + return (-1); } conn = domain->conn; @@ -1529,7 +1529,7 @@ virDomainSave(virDomainPtr domain, const char *to) } if (domain->conn->flags & VIR_CONNECT_RO) { virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__); - return (-1); + return (-1); } conn = domain->conn; if (to == NULL) { @@ -1585,7 +1585,7 @@ virDomainRestore(virConnectPtr conn, const char *from) } if (conn->flags & VIR_CONNECT_RO) { virLibConnError(conn, VIR_ERR_OPERATION_DENIED, __FUNCTION__); - return (-1); + return (-1); } if (from == NULL) { virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__); @@ -1643,7 +1643,7 @@ virDomainCoreDump(virDomainPtr domain, const char *to, int flags) } if (domain->conn->flags & VIR_CONNECT_RO) { virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__); - return (-1); + return (-1); } conn = domain->conn; if (to == NULL) { @@ -1703,7 +1703,7 @@ virDomainShutdown(virDomainPtr domain) } if (domain->conn->flags & VIR_CONNECT_RO) { virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__); - return (-1); + return (-1); } conn = domain->conn; @@ -1738,7 +1738,7 @@ virDomainReboot(virDomainPtr domain, unsigned int flags) } if (domain->conn->flags & VIR_CONNECT_RO) { virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__); - return (-1); + return (-1); } conn = domain->conn; @@ -1930,7 +1930,7 @@ virDomainSetMaxMemory(virDomainPtr domain, unsigned long memory) if (domain == NULL) { TODO - return (-1); + return (-1); } if (!VIR_IS_CONNECTED_DOMAIN(domain)) { virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__); @@ -1938,7 +1938,7 @@ virDomainSetMaxMemory(virDomainPtr domain, unsigned long memory) } if (domain->conn->flags & VIR_CONNECT_RO) { virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__); - return (-1); + return (-1); } if (memory < 4096) { virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__); @@ -1973,7 +1973,7 @@ virDomainSetMemory(virDomainPtr domain, unsigned long memory) if (domain == NULL) { TODO - return (-1); + return (-1); } if (!VIR_IS_CONNECTED_DOMAIN(domain)) { virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__); @@ -1981,7 +1981,7 @@ virDomainSetMemory(virDomainPtr domain, unsigned long memory) } if (domain->conn->flags & VIR_CONNECT_RO) { virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__); - return (-1); + return (-1); } if (memory < 4096) { virLibDomainError(domain, VIR_ERR_INVALID_ARG, __FUNCTION__); @@ -2413,7 +2413,7 @@ virDomainGetSchedulerType(virDomainPtr domain, int *nparams) */ int virDomainGetSchedulerParameters(virDomainPtr domain, - virSchedParameterPtr params, int *nparams) + virSchedParameterPtr params, int *nparams) { virConnectPtr conn; DEBUG("domain=%p, params=%p, nparams=%p", domain, params, nparams); @@ -2445,7 +2445,7 @@ virDomainGetSchedulerParameters(virDomainPtr domain, */ int virDomainSetSchedulerParameters(virDomainPtr domain, - virSchedParameterPtr params, int nparams) + virSchedParameterPtr params, int nparams) { virConnectPtr conn; DEBUG("domain=%p, params=%p, nparams=%d", domain, params, nparams); @@ -2601,7 +2601,7 @@ virDomainDefineXML(virConnectPtr conn, const char *xml) { } if (conn->flags & VIR_CONNECT_RO) { virLibConnError(conn, VIR_ERR_OPERATION_DENIED, __FUNCTION__); - return (NULL); + return (NULL); } if (xml == NULL) { virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__); @@ -2635,7 +2635,7 @@ virDomainUndefine(virDomainPtr domain) { conn = domain->conn; if (conn->flags & VIR_CONNECT_RO) { virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__); - return (-1); + return (-1); } if (conn->driver->domainUndefine) @@ -2719,7 +2719,7 @@ virDomainCreate(virDomainPtr domain) { if (domain == NULL) { TODO - return (-1); + return (-1); } if (!VIR_IS_CONNECTED_DOMAIN(domain)) { virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__); @@ -2728,7 +2728,7 @@ virDomainCreate(virDomainPtr domain) { conn = domain->conn; if (conn->flags & VIR_CONNECT_RO) { virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__); - return (-1); + return (-1); } if (conn->driver->domainCreate) @@ -2826,7 +2826,7 @@ virDomainSetVcpus(virDomainPtr domain, unsigned int nvcpus) if (domain == NULL) { TODO - return (-1); + return (-1); } if (!VIR_IS_CONNECTED_DOMAIN(domain)) { virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__); @@ -2834,7 +2834,7 @@ virDomainSetVcpus(virDomainPtr domain, unsigned int nvcpus) } if (domain->conn->flags & VIR_CONNECT_RO) { virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__); - return (-1); + return (-1); } if (nvcpus < 1) { @@ -2877,7 +2877,7 @@ virDomainPinVcpu(virDomainPtr domain, unsigned int vcpu, if (domain == NULL) { TODO - return (-1); + return (-1); } if (!VIR_IS_CONNECTED_DOMAIN(domain)) { virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__); @@ -2885,7 +2885,7 @@ virDomainPinVcpu(virDomainPtr domain, unsigned int vcpu, } if (domain->conn->flags & VIR_CONNECT_RO) { virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__); - return (-1); + return (-1); } if ((vcpu > 32000) || (cpumap == NULL) || (maplen < 1)) { @@ -2925,14 +2925,14 @@ virDomainPinVcpu(virDomainPtr domain, unsigned int vcpu, */ int virDomainGetVcpus(virDomainPtr domain, virVcpuInfoPtr info, int maxinfo, - unsigned char *cpumaps, int maplen) + unsigned char *cpumaps, int maplen) { virConnectPtr conn; DEBUG("domain=%p, info=%p, maxinfo=%d, cpumaps=%p, maplen=%d", domain, info, maxinfo, cpumaps, maplen); if (domain == NULL) { TODO - return (-1); + return (-1); } if (!VIR_IS_CONNECTED_DOMAIN(domain)) { virLibDomainError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__); @@ -3011,7 +3011,7 @@ virDomainAttachDevice(virDomainPtr domain, const char *xml) } if (domain->conn->flags & VIR_CONNECT_RO) { virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__); - return (-1); + return (-1); } conn = domain->conn; @@ -3043,7 +3043,7 @@ virDomainDetachDevice(virDomainPtr domain, const char *xml) } if (domain->conn->flags & VIR_CONNECT_RO) { virLibDomainError(domain, VIR_ERR_OPERATION_DENIED, __FUNCTION__); - return (-1); + return (-1); } conn = domain->conn; @@ -3342,8 +3342,8 @@ virNetworkLookupByUUIDString(virConnectPtr conn, const char *uuidstr) raw + 12, raw + 13, raw + 14, raw + 15); if (ret!=VIR_UUID_BUFLEN) { - virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__); - return (NULL); + virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__); + return (NULL); } for (i = 0; i < VIR_UUID_BUFLEN; i++) uuid[i] = raw[i] & 0xFF; @@ -3376,7 +3376,7 @@ virNetworkCreateXML(virConnectPtr conn, const char *xmlDesc) } if (conn->flags & VIR_CONNECT_RO) { virLibConnError(conn, VIR_ERR_OPERATION_DENIED, __FUNCTION__); - return (NULL); + return (NULL); } if (conn->networkDriver && conn->networkDriver->networkCreateXML) @@ -3406,7 +3406,7 @@ virNetworkDefineXML(virConnectPtr conn, const char *xml) } if (conn->flags & VIR_CONNECT_RO) { virLibConnError(conn, VIR_ERR_OPERATION_DENIED, __FUNCTION__); - return (NULL); + return (NULL); } if (xml == NULL) { virLibConnError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__); @@ -3440,7 +3440,7 @@ virNetworkUndefine(virNetworkPtr network) { conn = network->conn; if (conn->flags & VIR_CONNECT_RO) { virLibNetworkError(network, VIR_ERR_OPERATION_DENIED, __FUNCTION__); - return (-1); + return (-1); } if (conn->networkDriver && conn->networkDriver->networkUndefine) @@ -3467,7 +3467,7 @@ virNetworkCreate(virNetworkPtr network) if (network == NULL) { TODO - return (-1); + return (-1); } if (!VIR_IS_CONNECTED_NETWORK(network)) { virLibNetworkError(NULL, VIR_ERR_INVALID_NETWORK, __FUNCTION__); @@ -3476,7 +3476,7 @@ virNetworkCreate(virNetworkPtr network) conn = network->conn; if (conn->flags & VIR_CONNECT_RO) { virLibNetworkError(network, VIR_ERR_OPERATION_DENIED, __FUNCTION__); - return (-1); + return (-1); } if (conn->networkDriver && conn->networkDriver->networkCreate) @@ -3512,7 +3512,7 @@ virNetworkDestroy(virNetworkPtr network) conn = network->conn; if (conn->flags & VIR_CONNECT_RO) { virLibNetworkError(network, VIR_ERR_OPERATION_DENIED, __FUNCTION__); - return (-1); + return (-1); } if (conn->networkDriver && conn->networkDriver->networkDestroy) @@ -3987,7 +3987,7 @@ virStoragePoolLookupByUUID(virConnectPtr conn, */ virStoragePoolPtr virStoragePoolLookupByUUIDString(virConnectPtr conn, - const char *uuidstr) + const char *uuidstr) { unsigned char uuid[VIR_UUID_BUFLEN]; DEBUG("conn=%p, uuidstr=%s", conn, uuidstr); diff --git a/src/lxc_conf.c b/src/lxc_conf.c index fd45709074321140409d08862845c810200da1f4..8f01844180dd9b9a24ce27b5e9a8f342191f5664 100644 --- a/src/lxc_conf.c +++ b/src/lxc_conf.c @@ -183,10 +183,10 @@ static int lxcParseDomainUUID(virConnectPtr conn, unsigned char *uuid, if (virUUIDParse(res, uuid) < 0) { lxcError(conn, NULL, VIR_ERR_INTERNAL_ERROR, _("invalid uuid element")); - free(res); + free(res); return(-1); } - free(res); + free(res); } return(0); } @@ -228,7 +228,7 @@ static int lxcParseDomainMounts(virConnectPtr conn, } prevObj = mountObj; } - free(list); + free(list); } rc = nmounts; @@ -253,7 +253,7 @@ static int lxcParseDomainInit(virConnectPtr conn, char** init, lxcError(conn, NULL, VIR_ERR_INTERNAL_ERROR, _("init string too long")); free(res); - return(-1); + return(-1); } *init = res; @@ -270,10 +270,10 @@ static int lxcParseDomainTty(virConnectPtr conn, char **tty, xmlXPathContextPtr if (res == NULL) { /* make sure the tty string is empty */ *tty = strdup(""); - if (*tty == NULL) { - lxcError(conn, NULL, VIR_ERR_NO_MEMORY, NULL); - return(-1); - } + if (*tty == NULL) { + lxcError(conn, NULL, VIR_ERR_NO_MEMORY, NULL); + return(-1); + } } else { *tty = res; } @@ -288,14 +288,14 @@ static int lxcParseDomainMemory(virConnectPtr conn, int* memory, xmlXPathContext rc = virXPathLong("string(/domain/memory[1])", contextPtr, &res); if ((rc == -2) || ((rc == 0) && (res <= 0))) { - *memory = -1; - lxcError(conn, NULL, VIR_ERR_INTERNAL_ERROR, - _("invalid memory value")); + *memory = -1; + lxcError(conn, NULL, VIR_ERR_INTERNAL_ERROR, + _("invalid memory value")); } else if (rc < 0) { /* not an error, default to an invalid value so it's not used */ - *memory = -1; + *memory = -1; } else { - *memory = (int) res; + *memory = (int) res; } return(0); } @@ -656,7 +656,7 @@ int lxcLoadContainerInfo(lxc_driver_t *driver) } else { lxcError(NULL, NULL, VIR_ERR_INTERNAL_ERROR, _("failed to open config directory %s: %s"), - driver->configDir, strerror(errno)); + driver->configDir, strerror(errno)); } goto load_complete; @@ -700,12 +700,12 @@ char *lxcGenerateXML(virConnectPtr conn, if (lxcIsActiveVM(vm)) { if (virBufferVSprintf(buf, "\n", - LXC_DOMAIN_TYPE, vm->def->id) < 0) { + LXC_DOMAIN_TYPE, vm->def->id) < 0) { goto no_memory; } } else { - if (virBufferVSprintf(buf, "\n", - LXC_DOMAIN_TYPE) < 0) { + if (virBufferVSprintf(buf, "\n", + LXC_DOMAIN_TYPE) < 0) { goto no_memory; } } diff --git a/src/openvz_conf.c b/src/openvz_conf.c index 2d3ca5a587b6eeaeecdd311ec7f4599c04e27b50..132041599487457ff59dce4a02ef86d8926dd01d 100644 --- a/src/openvz_conf.c +++ b/src/openvz_conf.c @@ -238,8 +238,8 @@ openvzAssignVMDef(virConnectPtr conn, else { openvzLog(OPENVZ_ERR, - _("Error already an active OPENVZ VM having id '%s'"), - def->name); + _("Error already an active OPENVZ VM having id '%s'"), + def->name); openvzFreeVMDef(def); return NULL; /* can't redefine an active domain */ } @@ -342,7 +342,7 @@ static struct openvz_vm_def /* rejecting VPS ID <= OPENVZ_RSRV_VM_LIMIT for they are reserved */ if (strtoI((const char *) obj->stringval) <= OPENVZ_RSRV_VM_LIMIT) { error(conn, VIR_ERR_INTERNAL_ERROR, - _("VPS ID Error (must be an integer greater than 100")); + _("VPS ID Error (must be an integer greater than 100")); goto bail_out; } strncpy(def->name, (const char *) obj->stringval, OPENVZ_NAME_MAX); @@ -385,20 +385,20 @@ static struct openvz_vm_def if ((obj == NULL) || (obj->type != XPATH_STRING) || (obj->stringval == NULL) || (obj->stringval[0] == 0)) { openvzLog(OPENVZ_WARN, - _("No IP address in the given xml config file '%s'"), - xml->name); + _("No IP address in the given xml config file '%s'"), + xml->name); } if (xmlStrlen(obj->stringval) >= (OPENVZ_IP_MAX)) { char errorMessage[OPENVZ_MAX_ERROR_LEN]; snprintf(errorMessage, OPENVZ_MAX_ERROR_LEN - 1, "%s", - _("ipaddress length too long")); + _("ipaddress length too long")); error(conn, VIR_ERR_INTERNAL_ERROR, errorMessage); goto bail_out; } if (!(ovzIp = calloc(1, sizeof(*ovzIp)))) { openvzLog(OPENVZ_ERR, - _("Failed to Create Memory for 'ovz_ip' structure")); + _("Failed to Create Memory for 'ovz_ip' structure")); goto bail_out; } strncpy(ovzIp->ip, (const char *) obj->stringval, OPENVZ_IP_MAX); @@ -410,14 +410,14 @@ static struct openvz_vm_def if ((obj == NULL) || (obj->type != XPATH_STRING) || (obj->stringval == NULL) || (obj->stringval[0] == 0)) openvzLog(OPENVZ_WARN, - _("No Netmask address in the given xml config file '%s'"), - xml->name); + _("No Netmask address in the given xml config file '%s'"), + xml->name); if (strlen((const char *) obj->stringval) >= (OPENVZ_IP_MAX)) { char errorMessage[OPENVZ_MAX_ERROR_LEN]; snprintf(errorMessage, OPENVZ_MAX_ERROR_LEN - 1, "%s", - _("netmask length too long")); + _("netmask length too long")); error(conn, VIR_ERR_INTERNAL_ERROR, errorMessage); goto bail_out; } @@ -429,14 +429,14 @@ static struct openvz_vm_def if ((obj == NULL) || (obj->type != XPATH_STRING) || (obj->stringval == NULL) || (obj->stringval[0] == 0)) openvzLog(OPENVZ_WARN, - _("No hostname in the given xml config file '%s'"), - xml->name); + _("No hostname in the given xml config file '%s'"), + xml->name); if (strlen((const char *) obj->stringval) >= (OPENVZ_HOSTNAME_MAX - 1)) { char errorMessage[OPENVZ_MAX_ERROR_LEN]; snprintf(errorMessage, OPENVZ_MAX_ERROR_LEN - 1, - "%s", _("hostname length too long")); + "%s", _("hostname length too long")); error(conn, VIR_ERR_INTERNAL_ERROR, errorMessage); goto bail_out; } @@ -448,8 +448,8 @@ static struct openvz_vm_def if ((obj == NULL) || (obj->type != XPATH_STRING) || (obj->stringval == NULL) || (obj->stringval[0] == 0)) openvzLog(OPENVZ_WARN, - _("No Gateway address in the given xml config file '%s'"), - xml->name); + _("No Gateway address in the given xml config file '%s'"), + xml->name); if (strlen((const char *) obj->stringval) >= (OPENVZ_IP_MAX)) { char errorMessage[OPENVZ_MAX_ERROR_LEN]; @@ -467,8 +467,8 @@ static struct openvz_vm_def if ((obj == NULL) || (obj->type != XPATH_STRING) || (obj->stringval == NULL) || (obj->stringval[0] == 0)) openvzLog(OPENVZ_WARN, - _("No Nameserver address inthe given xml config file '%s'"), - xml->name); + _("No Nameserver address inthe given xml config file '%s'"), + xml->name); if (strlen((const char *) obj->stringval) >= (OPENVZ_IP_MAX)) { char errorMessage[OPENVZ_MAX_ERROR_LEN]; @@ -549,10 +549,10 @@ openvzGetVPSInfo(virConnectPtr conn) { vm = *pnext; if (fscanf(fp, "%d %s\n", &veid, status) != 2) { - error(conn, VIR_ERR_INTERNAL_ERROR, - _("Failed to parse vzlist output")); - goto error; - } + error(conn, VIR_ERR_INTERNAL_ERROR, + _("Failed to parse vzlist output")); + goto error; + } if(strcmp(status, "stopped")) { (*pnext)->status = VIR_DOMAIN_RUNNING; driver->num_active ++; @@ -561,17 +561,17 @@ openvzGetVPSInfo(virConnectPtr conn) { else { (*pnext)->status = VIR_DOMAIN_SHUTOFF; driver->num_inactive ++; - /* - * inactive domains don't have their ID set in libvirt, - * thought this doesn't make sense for OpenVZ - */ + /* + * inactive domains don't have their ID set in libvirt, + * thought this doesn't make sense for OpenVZ + */ (*pnext)->vpsid = -1; } vmdef = calloc(1, sizeof(*vmdef)); if(!vmdef) { error(conn, VIR_ERR_INTERNAL_ERROR, _("calloc failed")); - goto error; + goto error; } snprintf(vmdef->name, OPENVZ_NAME_MAX, "%i", veid); @@ -580,8 +580,8 @@ openvzGetVPSInfo(virConnectPtr conn) { if(ret == -1) { error(conn, VIR_ERR_INTERNAL_ERROR, - _("UUID in config file malformed")); - free(vmdef); + _("UUID in config file malformed")); + free(vmdef); goto error; } @@ -593,10 +593,10 @@ error: while (vm != NULL) { struct openvz_vm *next; - next = vm->next; - free(vm->vmdef); - free(vm); - vm = next; + next = vm->next; + free(vm->vmdef); + free(vm); + vm = next; } return NULL; } @@ -609,7 +609,7 @@ static char while(conf_dir_list[i]) { if(!access(conf_dir_list[i], F_OK)) - return strdup(conf_dir_list[i]); + return strdup(conf_dir_list[i]); i ++; } @@ -703,18 +703,18 @@ openvzSetUUID(int vpsid) return -1; if (uuidstr[0] == 0) { - FILE *fp = fopen(conf_file, "a"); /* append */ - if (fp == NULL) - return -1; + FILE *fp = fopen(conf_file, "a"); /* append */ + if (fp == NULL) + return -1; virUUIDGenerate(uuid); virUUIDFormat(uuid, uuidstr); - /* Record failure if fprintf or fclose fails, - and be careful always to close the stream. */ - if ((fprintf(fp, "\n#UUID: %s\n", uuidstr) < 0) - + (fclose(fp) == EOF)) - return -1; + /* Record failure if fprintf or fclose fails, + and be careful always to close the stream. */ + if ((fprintf(fp, "\n#UUID: %s\n", uuidstr) < 0) + + (fclose(fp) == EOF)) + return -1; } return 0; diff --git a/src/openvz_driver.h b/src/openvz_driver.h index 0c1716cc842013871d4049358887530ab3d90722..8b0a49fa5dd23b27c26bf92d2b589d64630e9c95 100644 --- a/src/openvz_driver.h +++ b/src/openvz_driver.h @@ -44,11 +44,11 @@ struct openvz_driver { int openvzRegister(void); #define openvzLog(level, msg...) { if(level == OPENVZ_WARN) \ - fprintf(stderr, "\nWARNING: ");\ - else \ - fprintf(stderr, "\nERROR: ");\ - fprintf(stderr, "\n\t");\ - fprintf(stderr, msg);\ - fprintf(stderr, "\n"); } + fprintf(stderr, "\nWARNING: ");\ + else \ + fprintf(stderr, "\nERROR: ");\ + fprintf(stderr, "\n\t");\ + fprintf(stderr, msg);\ + fprintf(stderr, "\n"); } #endif diff --git a/src/proxy_internal.c b/src/proxy_internal.c index 2a9fb550e59b666fe4dd637e033c12b51b2f7ea4..195717bc0da2ccb50a11524c2f7b58215703b015 100644 --- a/src/proxy_internal.c +++ b/src/proxy_internal.c @@ -174,7 +174,7 @@ virProxyForkServer(void) if (!proxyPath) { fprintf(stderr, "failed to find libvirt_proxy\n"); - return(-1); + return(-1); } if (debug) @@ -184,12 +184,12 @@ virProxyForkServer(void) pid = fork(); if (pid == 0) { long open_max; - long i; + long i; /* don't hold open fd opened from the client of the library */ - open_max = sysconf (_SC_OPEN_MAX); - for (i = 0; i < open_max; i++) - fcntl (i, F_SETFD, FD_CLOEXEC); + open_max = sysconf (_SC_OPEN_MAX); + for (i = 0; i < open_max; i++) + fcntl (i, F_SETFD, FD_CLOEXEC); setsid(); if (fork() == 0) { @@ -238,7 +238,7 @@ virProxyOpenClientSocket(const char *path) { retry: fd = socket(PF_UNIX, SOCK_STREAM, 0); if (fd < 0) { - return(-1); + return(-1); } /* @@ -254,15 +254,15 @@ retry: * now bind the socket to that address and listen on it */ if (connect(fd, (struct sockaddr *) &addr, sizeof(addr)) < 0) { - close(fd); - if (trials < 3) { - if (virProxyForkServer() < 0) - return(-1); - trials++; - usleep(5000 * trials * trials); - goto retry; - } - return (-1); + close(fd); + if (trials < 3) { + if (virProxyForkServer() < 0) + return(-1); + trials++; + usleep(5000 * trials * trials); + goto retry; + } + return (-1); } if (debug > 0) @@ -290,7 +290,7 @@ virProxyCloseClientSocket(int fd) { if (ret != 0) fprintf(stderr, _("Failed to close socket %d\n"), fd); else if (debug > 0) - fprintf(stderr, "Closed socket %d\n", fd); + fprintf(stderr, "Closed socket %d\n", fd); return(ret); } @@ -316,18 +316,18 @@ retry: ret = read(fd, buffer, len); if (ret < 0) { if (errno == EINTR) { - if (debug > 0) - fprintf(stderr, "read socket %d interrupted\n", fd); - goto retry; - } - if (!quiet) + if (debug > 0) + fprintf(stderr, "read socket %d interrupted\n", fd); + goto retry; + } + if (!quiet) fprintf(stderr, _("Failed to read socket %d\n"), fd); - return(-1); + return(-1); } if (debug) - fprintf(stderr, "read %d bytes from socket %d\n", - ret, fd); + fprintf(stderr, "read %d bytes from socket %d\n", + ret, fd); return(ret); } @@ -352,8 +352,8 @@ virProxyWriteClientSocket(int fd, const char *data, int len) { return(-1); } if (debug) - fprintf(stderr, "wrote %d bytes to socket %d\n", - len, fd); + fprintf(stderr, "wrote %d bytes to socket %d\n", + len, fd); return(0); } @@ -434,59 +434,59 @@ xenProxyCommand(virConnectPtr conn, virProxyPacketPtr request, retry: if (answer == NULL) { /* read in situ */ - ret = virProxyReadClientSocket(priv->proxy, (char *) request, - sizeof(virProxyPacket), quiet); - if (ret < 0) - return(-1); - if (ret != sizeof(virProxyPacket)) { - fprintf(stderr, - _("Communication error with proxy: got %d bytes of %d\n"), - ret, (int) sizeof(virProxyPacket)); - xenProxyClose(conn); - return(-1); - } - res = request; - if (res->len != sizeof(virProxyPacket)) { - fprintf(stderr, - _("Communication error with proxy: expected %d bytes got %d\n"), - (int) sizeof(virProxyPacket), res->len); - xenProxyClose(conn); - return(-1); - } + ret = virProxyReadClientSocket(priv->proxy, (char *) request, + sizeof(virProxyPacket), quiet); + if (ret < 0) + return(-1); + if (ret != sizeof(virProxyPacket)) { + fprintf(stderr, + _("Communication error with proxy: got %d bytes of %d\n"), + ret, (int) sizeof(virProxyPacket)); + xenProxyClose(conn); + return(-1); + } + res = request; + if (res->len != sizeof(virProxyPacket)) { + fprintf(stderr, + _("Communication error with proxy: expected %d bytes got %d\n"), + (int) sizeof(virProxyPacket), res->len); + xenProxyClose(conn); + return(-1); + } } else { /* read in packet provided */ ret = virProxyReadClientSocket(priv->proxy, (char *) answer, - sizeof(virProxyPacket), quiet); - if (ret < 0) - return(-1); - if (ret != sizeof(virProxyPacket)) { - fprintf(stderr, - _("Communication error with proxy: got %d bytes of %d\n"), - ret, (int) sizeof(virProxyPacket)); - xenProxyClose(conn); - return(-1); - } - res = (virProxyPacketPtr) answer; - if ((res->len < sizeof(virProxyPacket)) || - (res->len > sizeof(virProxyFullPacket))) { - fprintf(stderr, - _("Communication error with proxy: got %d bytes packet\n"), - res->len); - xenProxyClose(conn); - return(-1); - } - if (res->len > sizeof(virProxyPacket)) { - ret = virProxyReadClientSocket(priv->proxy, - (char *) &(answer->extra.arg[0]), - res->len - ret, quiet); - if (ret != (int) (res->len - sizeof(virProxyPacket))) { - fprintf(stderr, - _("Communication error with proxy: got %d bytes of %d\n"), - ret, (int) sizeof(virProxyPacket)); - xenProxyClose(conn); - return(-1); - } - } + sizeof(virProxyPacket), quiet); + if (ret < 0) + return(-1); + if (ret != sizeof(virProxyPacket)) { + fprintf(stderr, + _("Communication error with proxy: got %d bytes of %d\n"), + ret, (int) sizeof(virProxyPacket)); + xenProxyClose(conn); + return(-1); + } + res = (virProxyPacketPtr) answer; + if ((res->len < sizeof(virProxyPacket)) || + (res->len > sizeof(virProxyFullPacket))) { + fprintf(stderr, + _("Communication error with proxy: got %d bytes packet\n"), + res->len); + xenProxyClose(conn); + return(-1); + } + if (res->len > sizeof(virProxyPacket)) { + ret = virProxyReadClientSocket(priv->proxy, + (char *) &(answer->extra.arg[0]), + res->len - ret, quiet); + if (ret != (int) (res->len - sizeof(virProxyPacket))) { + fprintf(stderr, + _("Communication error with proxy: got %d bytes of %d\n"), + ret, (int) sizeof(virProxyPacket)); + xenProxyClose(conn); + return(-1); + } + } } /* * do more checks on the incoming packet. @@ -500,7 +500,7 @@ retry: } if (res->serial != serial) { TODO /* Asynchronous communication */ - fprintf(stderr, _("got asynchronous packet number %d\n"), res->serial); + fprintf(stderr, _("got asynchronous packet number %d\n"), res->serial); goto retry; } return(0); @@ -536,7 +536,7 @@ xenProxyOpen(virConnectPtr conn, fd = virProxyOpenClientSocket(PROXY_SOCKET_PATH); if (fd < 0) { - virProxyError(NULL, VIR_ERR_NO_XEN, PROXY_SOCKET_PATH); + virProxyError(NULL, VIR_ERR_NO_XEN, PROXY_SOCKET_PATH); return(-1); } priv->proxy = fd; @@ -546,9 +546,9 @@ xenProxyOpen(virConnectPtr conn, req.len = sizeof(req); ret = xenProxyCommand(conn, &req, NULL, 1); if ((ret < 0) || (req.command != VIR_PROXY_NONE)) { - virProxyError(NULL, VIR_ERR_OPERATION_FAILED, __FUNCTION__); + virProxyError(NULL, VIR_ERR_OPERATION_FAILED, __FUNCTION__); xenProxyClose(conn); - return(-1); + return(-1); } return(0); } @@ -582,7 +582,7 @@ xenProxyGetVersion(virConnectPtr conn, unsigned long *hvVer) } if (hvVer == NULL) { virProxyError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__); - return (-1); + return (-1); } memset(&req, 0, sizeof(req)); req.command = VIR_PROXY_VERSION; @@ -590,7 +590,7 @@ xenProxyGetVersion(virConnectPtr conn, unsigned long *hvVer) ret = xenProxyCommand(conn, &req, NULL, 0); if (ret < 0) { xenProxyClose(conn); - return(-1); + return(-1); } *hvVer = req.data.larg; return(0); @@ -620,7 +620,7 @@ xenProxyListDomains(virConnectPtr conn, int *ids, int maxids) } if ((ids == NULL) || (maxids <= 0)) { virProxyError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__); - return (-1); + return (-1); } memset(&req, 0, sizeof(req)); req.command = VIR_PROXY_LIST; @@ -628,12 +628,12 @@ xenProxyListDomains(virConnectPtr conn, int *ids, int maxids) ret = xenProxyCommand(conn, &req, &ans, 0); if (ret < 0) { xenProxyClose(conn); - return(-1); + return(-1); } nb = ans.data.arg; if ((nb > 1020) || (nb <= 0) || (ans.len <= sizeof(virProxyPacket)) || - (ans.len > sizeof(virProxyFullPacket))) { + (ans.len > sizeof(virProxyFullPacket))) { virProxyError(conn, VIR_ERR_OPERATION_FAILED, __FUNCTION__); return(-1); } @@ -668,7 +668,7 @@ xenProxyNumOfDomains(virConnectPtr conn) ret = xenProxyCommand(conn, &req, NULL, 0); if (ret < 0) { xenProxyClose(conn); - return(-1); + return(-1); } return(req.data.arg); } @@ -717,10 +717,10 @@ static unsigned long xenProxyDomainGetMaxMemory(virDomainPtr domain) { if (!VIR_IS_CONNECTED_DOMAIN(domain)) { - if (domain == NULL) - virProxyError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__); - else - virProxyError(domain->conn, VIR_ERR_INVALID_DOMAIN, __FUNCTION__); + if (domain == NULL) + virProxyError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__); + else + virProxyError(domain->conn, VIR_ERR_INVALID_DOMAIN, __FUNCTION__); return (0); } if (domain->id < 0) @@ -801,7 +801,7 @@ xenProxyLookupByID(virConnectPtr conn, int id) } if (id < 0) { virProxyError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__); - return (NULL); + return (NULL); } memset(&req, 0, sizeof(req)); req.command = VIR_PROXY_LOOKUP_ID; @@ -810,15 +810,15 @@ xenProxyLookupByID(virConnectPtr conn, int id) ret = xenProxyCommand(conn, &req, &ans, 0); if (ret < 0) { xenProxyClose(conn); - return(NULL); + return(NULL); } if (ans.data.arg == -1) { - return(NULL); + return(NULL); } memcpy(uuid, &ans.extra.str[0], VIR_UUID_BUFLEN); name = &ans.extra.str[VIR_UUID_BUFLEN]; res = virGetDomain(conn, name, uuid); - if (res) res->id = id; + if (res) res->id = id; return(res); } @@ -845,7 +845,7 @@ xenProxyLookupByUUID(virConnectPtr conn, const unsigned char *uuid) } if (uuid == NULL) { virProxyError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__); - return (NULL); + return (NULL); } memset(&req, 0, sizeof(virProxyPacket)); req.command = VIR_PROXY_LOOKUP_UUID; @@ -855,14 +855,14 @@ xenProxyLookupByUUID(virConnectPtr conn, const unsigned char *uuid) ret = xenProxyCommand(conn, (virProxyPacketPtr) &req, &req, 0); if (ret < 0) { xenProxyClose(conn); - return(NULL); + return(NULL); } if (req.data.arg == -1) { - return(NULL); + return(NULL); } name = &req.extra.str[0]; res = virGetDomain(conn, name, uuid); - if (res) res->id = req.data.arg; + if (res) res->id = req.data.arg; return(res); } @@ -888,12 +888,12 @@ xenProxyLookupByName(virConnectPtr conn, const char *name) } if (name == NULL) { virProxyError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__); - return (NULL); + return (NULL); } len = strlen(name); if (len > 1000) { virProxyError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__); - return (NULL); + return (NULL); } memset(&req, 0, sizeof(virProxyPacket)); req.command = VIR_PROXY_LOOKUP_NAME; @@ -902,13 +902,13 @@ xenProxyLookupByName(virConnectPtr conn, const char *name) ret = xenProxyCommand(conn, (virProxyPacketPtr) &req, &req, 0); if (ret < 0) { xenProxyClose(conn); - return(NULL); + return(NULL); } if (req.data.arg == -1) { - return(NULL); + return(NULL); } res = virGetDomain(conn, name, (const unsigned char *)&req.extra.str[0]); - if (res) res->id = req.data.arg; + if (res) res->id = req.data.arg; return(res); } @@ -933,7 +933,7 @@ xenProxyNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info) { } if (info == NULL) { virProxyError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__); - return (-1); + return (-1); } memset(&req, 0, sizeof(req)); req.command = VIR_PROXY_NODE_INFO; @@ -942,13 +942,13 @@ xenProxyNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info) { ret = xenProxyCommand(conn, &req, &ans, 0); if (ret < 0) { xenProxyClose(conn); - return(-1); + return(-1); } if (ans.data.arg == -1) { - return(-1); + return(-1); } if (ans.len != sizeof(virProxyPacket) + sizeof(virNodeInfo)) { - return(-1); + return(-1); } memcpy(info, &ans.extra.ninfo, sizeof(virNodeInfo)); return(0); @@ -1022,10 +1022,10 @@ xenProxyDomainDumpXML(virDomainPtr domain, int flags ATTRIBUTE_UNUSED) char *xml; if (!VIR_IS_CONNECTED_DOMAIN(domain)) { - if (domain == NULL) - virProxyError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__); - else - virProxyError(domain->conn, VIR_ERR_INVALID_DOMAIN, __FUNCTION__); + if (domain == NULL) + virProxyError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__); + else + virProxyError(domain->conn, VIR_ERR_INVALID_DOMAIN, __FUNCTION__); return (NULL); } if (domain->id < 0) @@ -1037,15 +1037,15 @@ xenProxyDomainDumpXML(virDomainPtr domain, int flags ATTRIBUTE_UNUSED) ret = xenProxyCommand(domain->conn, &req, &ans, 0); if (ret < 0) { xenProxyClose(domain->conn); - return(NULL); + return(NULL); } if (ans.len <= sizeof(virProxyPacket)) { virProxyError(domain->conn, VIR_ERR_OPERATION_FAILED, __FUNCTION__); - return (NULL); + return (NULL); } xmllen = ans.len - sizeof(virProxyPacket); if (!(xml = malloc(xmllen+1))) { - virProxyError(domain->conn, VIR_ERR_NO_MEMORY, __FUNCTION__); + virProxyError(domain->conn, VIR_ERR_NO_MEMORY, __FUNCTION__); return NULL; } memmove(xml, &ans.extra.dinfo, xmllen); @@ -1073,10 +1073,10 @@ xenProxyDomainGetOSType(virDomainPtr domain) char *ostype; if (!VIR_IS_CONNECTED_DOMAIN(domain)) { - if (domain == NULL) - virProxyError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__); - else - virProxyError(domain->conn, VIR_ERR_INVALID_DOMAIN, __FUNCTION__); + if (domain == NULL) + virProxyError(NULL, VIR_ERR_INVALID_DOMAIN, __FUNCTION__); + else + virProxyError(domain->conn, VIR_ERR_INVALID_DOMAIN, __FUNCTION__); return (NULL); } memset(&req, 0, sizeof(req)); @@ -1086,19 +1086,19 @@ xenProxyDomainGetOSType(virDomainPtr domain) ret = xenProxyCommand(domain->conn, &req, &ans, 0); if (ret < 0) { xenProxyClose(domain->conn); - return(NULL); + return(NULL); } if ((ans.len == sizeof(virProxyPacket)) && (ans.data.arg < 0)) { - return(NULL); + return(NULL); } if (ans.len <= sizeof(virProxyPacket)) { virProxyError(domain->conn, VIR_ERR_OPERATION_FAILED, __FUNCTION__); - return (NULL); + return (NULL); } oslen = ans.len - sizeof(virProxyPacket); if (!(ostype = malloc(oslen+1))) { - virProxyError(domain->conn, VIR_ERR_NO_MEMORY, __FUNCTION__); + virProxyError(domain->conn, VIR_ERR_NO_MEMORY, __FUNCTION__); return NULL; } memmove(ostype, &ans.extra.dinfo, oslen); diff --git a/src/proxy_internal.h b/src/proxy_internal.h index 0d8e5a8c2f7dc9793d81b1dbec11e9e60aecb094..f0e7cc82dffa18f9ae070b9cb490c117fa37b0d4 100644 --- a/src/proxy_internal.h +++ b/src/proxy_internal.h @@ -25,18 +25,18 @@ extern "C" { * the command allowed though the proxy */ typedef enum { - VIR_PROXY_NONE = 0, - VIR_PROXY_VERSION = 1, - VIR_PROXY_NODE_INFO = 2, - VIR_PROXY_LIST = 3, - VIR_PROXY_NUM_DOMAIN = 4, - VIR_PROXY_LOOKUP_ID = 5, - VIR_PROXY_LOOKUP_UUID = 6, - VIR_PROXY_LOOKUP_NAME = 7, - VIR_PROXY_MAX_MEMORY = 8, - VIR_PROXY_DOMAIN_INFO = 9, - VIR_PROXY_DOMAIN_XML = 10, - VIR_PROXY_DOMAIN_OSTYPE = 11, + VIR_PROXY_NONE = 0, + VIR_PROXY_VERSION = 1, + VIR_PROXY_NODE_INFO = 2, + VIR_PROXY_LIST = 3, + VIR_PROXY_NUM_DOMAIN = 4, + VIR_PROXY_LOOKUP_ID = 5, + VIR_PROXY_LOOKUP_UUID = 6, + VIR_PROXY_LOOKUP_NAME = 7, + VIR_PROXY_MAX_MEMORY = 8, + VIR_PROXY_DOMAIN_INFO = 9, + VIR_PROXY_DOMAIN_XML = 10, + VIR_PROXY_DOMAIN_OSTYPE = 11, VIR_PROXY_GET_CAPABILITIES = 12 } virProxyCommand; @@ -97,7 +97,7 @@ extern virDomainPtr xenProxyLookupByName(virConnectPtr conn, const char *domname); extern char * xenProxyDomainDumpXML(virDomainPtr domain, - int flags); + int flags); #ifdef __cplusplus } #endif /* __cplusplus */ diff --git a/src/qemu_conf.c b/src/qemu_conf.c index 774183bcad5e532c3a5f2a0c3b2ee0c23169d79f..d9b82b205baacfbecc36c986f7cfed8a1b19c597 100644 --- a/src/qemu_conf.c +++ b/src/qemu_conf.c @@ -1319,7 +1319,7 @@ static struct qemud_vm_def *qemudParseXML(virConnectPtr conn, } else if (!strcmp((char *)prop, "network")) { def->os.bootDevs[def->os.nBootDevs++] = QEMUD_BOOT_NET; } else { - qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, + qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR, _("unknown boot device \'%s\'"), (char*)prop); goto error; } diff --git a/src/qemu_driver.c b/src/qemu_driver.c index 0ed426265bc3012505c92591d9409efe8f0f6d84..b65ae6625a2787b343befefd3b4687e89d28d4b3 100644 --- a/src/qemu_driver.c +++ b/src/qemu_driver.c @@ -1470,12 +1470,12 @@ static const char *qemudProbe(void) { if ((virFileExists("/usr/bin/qemu")) || (virFileExists("/usr/bin/qemu-kvm")) || - (virFileExists("/usr/bin/xenner"))) { + (virFileExists("/usr/bin/xenner"))) { if (getuid() == 0) { - return("qemu:///system"); - } else { - return("qemu:///session"); - } + return("qemu:///system"); + } else { + return("qemu:///session"); + } } return(NULL); } diff --git a/src/qparams.h b/src/qparams.h index 8cdaeae2d3c70effe9b50472d02148bc39e657b2..1a92048196d112b46d160453d824260f01d4b57f 100644 --- a/src/qparams.h +++ b/src/qparams.h @@ -43,7 +43,7 @@ extern struct qparam_set *new_qparam_set (int init_alloc, ...); /* Appending parameters. */ extern int append_qparams (struct qparam_set *ps, ...); extern int append_qparam (struct qparam_set *ps, - const char *name, const char *value); + const char *name, const char *value); /* Get a query string ("name=value&name=value&...") */ extern char *qparam_get_query (const struct qparam_set *ps); diff --git a/src/remote_internal.c b/src/remote_internal.c index 065ee970a196c7e70b75d30b50bb1601e828b2cb..ef34a3a09d4bbf8eb4f7b623f3b0234a47936bbf 100644 --- a/src/remote_internal.c +++ b/src/remote_internal.c @@ -4682,11 +4682,11 @@ static virDriver driver = { .open = remoteOpen, .close = remoteClose, .supports_feature = remoteSupportsFeature, - .type = remoteType, - .version = remoteVersion, + .type = remoteType, + .version = remoteVersion, .getHostname = remoteGetHostname, - .getMaxVcpus = remoteGetMaxVcpus, - .nodeGetInfo = remoteNodeGetInfo, + .getMaxVcpus = remoteGetMaxVcpus, + .nodeGetInfo = remoteNodeGetInfo, .getCapabilities = remoteGetCapabilities, .listDomains = remoteListDomains, .numOfDomains = remoteNumOfDomains, diff --git a/src/sexpr.c b/src/sexpr.c index d0401ddd5cb64a6a942953b6da07f78f9510c567..9f6ed0d6588cc8024ef76f769061b315ca16be01 100644 --- a/src/sexpr.c +++ b/src/sexpr.c @@ -483,7 +483,7 @@ sexpr_lookup(const struct sexpr *sexpr, const char *node) struct sexpr *s = sexpr_lookup_key(sexpr, node); if (s == NULL) - return NULL; + return NULL; if (s->kind != SEXPR_CONS || s->u.s.cdr->kind != SEXPR_CONS) return NULL; @@ -509,7 +509,7 @@ sexpr_has(struct sexpr *sexpr, const char *node) struct sexpr *s = sexpr_lookup_key(sexpr, node); if (s == NULL) - return 0; + return 0; if (s->kind != SEXPR_CONS) return 0; diff --git a/src/stats_linux.h b/src/stats_linux.h index 8fd9b00eb8ea3522cdda8422d9ec5f7afdd2e187..076ccd7c8a649e3eb5475e90d4f2aa9398a94d68 100644 --- a/src/stats_linux.h +++ b/src/stats_linux.h @@ -16,10 +16,10 @@ #include "xen_unified.h" extern int xenLinuxDomainBlockStats (xenUnifiedPrivatePtr priv, - virDomainPtr dom, const char *path, - struct _virDomainBlockStats *stats); + virDomainPtr dom, const char *path, + struct _virDomainBlockStats *stats); extern int linuxDomainInterfaceStats (virConnectPtr conn, const char *path, - struct _virDomainInterfaceStats *stats); + struct _virDomainInterfaceStats *stats); extern int xenLinuxDomainDeviceID(virConnectPtr conn, int domid, const char *dev); diff --git a/src/util-lib.c b/src/util-lib.c index 92496cd76b83b03b0897c5a6c121c4c92f3d8520..2d79c918b0aa18d381669cd91f2ce770e5f44457 100644 --- a/src/util-lib.c +++ b/src/util-lib.c @@ -15,38 +15,38 @@ /* Like read(), but restarts after EINTR */ int saferead(int fd, void *buf, size_t count) { - size_t nread = 0; - while (count > 0) { - ssize_t r = read(fd, buf, count); - if (r < 0 && errno == EINTR) - continue; - if (r < 0) - return r; - if (r == 0) - return nread; - buf = (char *)buf + r; - count -= r; - nread += r; - } - return nread; + size_t nread = 0; + while (count > 0) { + ssize_t r = read(fd, buf, count); + if (r < 0 && errno == EINTR) + continue; + if (r < 0) + return r; + if (r == 0) + return nread; + buf = (char *)buf + r; + count -= r; + nread += r; + } + return nread; } /* Like write(), but restarts after EINTR */ ssize_t safewrite(int fd, const void *buf, size_t count) { - size_t nwritten = 0; - while (count > 0) { - ssize_t r = write(fd, buf, count); + size_t nwritten = 0; + while (count > 0) { + ssize_t r = write(fd, buf, count); - if (r < 0 && errno == EINTR) - continue; - if (r < 0) - return r; - if (r == 0) - return nwritten; - buf = (const char *)buf + r; - count -= r; - nwritten += r; - } - return nwritten; + if (r < 0 && errno == EINTR) + continue; + if (r < 0) + return r; + if (r == 0) + return nwritten; + buf = (const char *)buf + r; + count -= r; + nwritten += r; + } + return nwritten; } diff --git a/src/util.c b/src/util.c index 595e7213ecc3f5c96cbe03f26c648f54ce8277ba..bd7bb92af178e9c6c6591afb3aa17ca0e234c2f9 100644 --- a/src/util.c +++ b/src/util.c @@ -759,10 +759,10 @@ virParseMacAddr(const char* str, unsigned char *addr) addr[i] = (unsigned char) result; - if ((i == 5) && (*end_ptr == '\0')) - return 0; - if (*end_ptr != ':') - break; + if ((i == 5) && (*end_ptr == '\0')) + return 0; + if (*end_ptr != ':') + break; str = end_ptr + 1; } diff --git a/src/util.h b/src/util.h index 62cef51218072df0fda2341d51044c47d51de6bc..25165046821efdebcb854862a5ed7256c5a66a3f 100644 --- a/src/util.h +++ b/src/util.h @@ -28,14 +28,14 @@ #include "util-lib.h" int virExec(virConnectPtr conn, char **argv, int *retpid, - int infd, int *outfd, int *errfd); + int infd, int *outfd, int *errfd); int virExecNonBlock(virConnectPtr conn, char **argv, int *retpid, - int infd, int *outfd, int *errfd); + int infd, int *outfd, int *errfd); int virRun(virConnectPtr conn, char **argv, int *status); int __virFileReadAll(const char *path, - int maxlen, - char **buf); + int maxlen, + char **buf); #define virFileReadAll(p,m,b) __virFileReadAll((p),(m),(b)) int virFileMatchesNameSuffix(const char *file, @@ -74,9 +74,9 @@ int virStrToLong_ll(char const *s, int base, long long *result); int __virStrToLong_ull(char const *s, - char **end_ptr, - int base, - unsigned long long *result); + char **end_ptr, + int base, + unsigned long long *result); #define virStrToLong_ull(s,e,b,r) __virStrToLong_ull((s),(e),(b),(r)) int __virMacAddrCompare (const char *mac1, const char *mac2); diff --git a/src/uuid.h b/src/uuid.h index f1d7d028c65290eff60e93bd378a35d09d57c7b7..c5230a80634dd2bf0753512f24297f94f35e0394 100644 --- a/src/uuid.h +++ b/src/uuid.h @@ -25,9 +25,9 @@ int virUUIDGenerate(unsigned char *uuid); int virUUIDParse(const char *uuidstr, - unsigned char *uuid); + unsigned char *uuid); void virUUIDFormat(const unsigned char *uuid, - char *uuidstr); + char *uuidstr); #endif /* __VIR_UUID_H__ */ diff --git a/src/virsh.c b/src/virsh.c index 817cb985db98c73bb75b033ea55806a0f8627449..de7546c1bb8192b4c14bb301dd2b0ec83f8c9a6c 100644 --- a/src/virsh.c +++ b/src/virsh.c @@ -401,19 +401,19 @@ cmdAutostart(vshControl * ctl, vshCmd * cmd) if (virDomainSetAutostart(dom, autostart) < 0) { if (autostart) - vshError(ctl, FALSE, _("Failed to mark domain %s as autostarted"), + vshError(ctl, FALSE, _("Failed to mark domain %s as autostarted"), name); - else - vshError(ctl, FALSE, _("Failed to unmark domain %s as autostarted"), + else + vshError(ctl, FALSE, _("Failed to unmark domain %s as autostarted"), name); virDomainFree(dom); return FALSE; } if (autostart) - vshPrint(ctl, _("Domain %s marked as autostarted\n"), name); + vshPrint(ctl, _("Domain %s marked as autostarted\n"), name); else - vshPrint(ctl, _("Domain %s unmarked as autostarted\n"), name); + vshPrint(ctl, _("Domain %s unmarked as autostarted\n"), name); virDomainFree(dom); return TRUE; @@ -902,7 +902,7 @@ cmdCreate(vshControl * ctl, vshCmd * cmd) if (dom != NULL) { vshPrint(ctl, _("Domain %s created from %s\n"), virDomainGetName(dom), from); - virDomainFree(dom); + virDomainFree(dom); } else { vshError(ctl, FALSE, _("Failed to create domain from %s"), from); ret = FALSE; @@ -1027,7 +1027,7 @@ cmdStart(vshControl * ctl, vshCmd * cmd) if (virDomainGetID(dom) != (unsigned int)-1) { vshError(ctl, FALSE, "%s", _("Domain is already active")); - virDomainFree(dom); + virDomainFree(dom); return FALSE; } @@ -1176,7 +1176,7 @@ cmdSchedinfo(vshControl * ctl, vshCmd * cmd) ret = virDomainSetSchedulerParameters(dom, params, inputparams); if (ret == -1) { goto cleanup; - } + } } free(params); params = NULL; @@ -1583,15 +1583,15 @@ cmdFreecell(vshControl * ctl, vshCmd * cmd) if (!cell_given) { memory = virNodeGetFreeMemory(ctl->conn); } else { - ret = virNodeGetCellsFreeMemory(ctl->conn, &memory, cell, 1); - if (ret != 1) - return FALSE; + ret = virNodeGetCellsFreeMemory(ctl->conn, &memory, cell, 1); + if (ret != 1) + return FALSE; } if (cell == -1) - vshPrint(ctl, "%s: %llu kB\n", _("Total"), memory); + vshPrint(ctl, "%s: %llu kB\n", _("Total"), memory); else - vshPrint(ctl, "%d: %llu kB\n", cell, memory); + vshPrint(ctl, "%d: %llu kB\n", cell, memory); return TRUE; } @@ -1742,7 +1742,7 @@ cmdVcpupin(vshControl * ctl, vshCmd * cmd) if (virDomainGetInfo(dom, &info) != 0) { vshError(ctl, FALSE, "%s", - _("vcpupin: failed to get domain informations.")); + _("vcpupin: failed to get domain informations.")); virDomainFree(dom); return FALSE; } @@ -2290,19 +2290,19 @@ cmdNetworkAutostart(vshControl * ctl, vshCmd * cmd) if (virNetworkSetAutostart(network, autostart) < 0) { if (autostart) - vshError(ctl, FALSE, _("failed to mark network %s as autostarted"), + vshError(ctl, FALSE, _("failed to mark network %s as autostarted"), name); - else - vshError(ctl, FALSE,_("failed to unmark network %s as autostarted"), + else + vshError(ctl, FALSE,_("failed to unmark network %s as autostarted"), name); virNetworkFree(network); return FALSE; } if (autostart) - vshPrint(ctl, _("Network %s marked as autostarted\n"), name); + vshPrint(ctl, _("Network %s marked as autostarted\n"), name); else - vshPrint(ctl, _("Network %s unmarked as autostarted\n"), name); + vshPrint(ctl, _("Network %s unmarked as autostarted\n"), name); return TRUE; } @@ -2523,7 +2523,7 @@ cmdNetworkList(vshControl * ctl, vshCmd * cmd ATTRIBUTE_UNUSED) activeNames = vshMalloc(ctl, sizeof(char *) * maxactive); if ((maxactive = virConnectListNetworks(ctl->conn, activeNames, - maxactive)) < 0) { + maxactive)) < 0) { vshError(ctl, FALSE, "%s", _("Failed to list active networks")); free(activeNames); return FALSE; @@ -2630,7 +2630,7 @@ cmdNetworkName(vshControl * ctl, vshCmd * cmd) if (!vshConnectionUsability(ctl, ctl->conn, TRUE)) return FALSE; if (!(network = vshCommandOptNetworkBy(ctl, cmd, "network", NULL, - VSH_BYUUID))) + VSH_BYUUID))) return FALSE; vshPrint(ctl, "%s\n", virNetworkGetName(network)); @@ -2741,7 +2741,7 @@ cmdNetworkUuid(vshControl * ctl, vshCmd * cmd) return FALSE; if (!(network = vshCommandOptNetworkBy(ctl, cmd, "network", NULL, - VSH_BYNAME))) + VSH_BYNAME))) return FALSE; if (virNetworkGetUUIDString(network, uuid) != -1) @@ -2798,19 +2798,19 @@ cmdPoolAutostart(vshControl * ctl, vshCmd * cmd) if (virStoragePoolSetAutostart(pool, autostart) < 0) { if (autostart) - vshError(ctl, FALSE, _("failed to mark pool %s as autostarted"), + vshError(ctl, FALSE, _("failed to mark pool %s as autostarted"), name); - else - vshError(ctl, FALSE,_("failed to unmark pool %s as autostarted"), + else + vshError(ctl, FALSE,_("failed to unmark pool %s as autostarted"), name); virStoragePoolFree(pool); return FALSE; } if (autostart) - vshPrint(ctl, _("Pool %s marked as autostarted\n"), name); + vshPrint(ctl, _("Pool %s marked as autostarted\n"), name); else - vshPrint(ctl, _("Pool %s unmarked as autostarted\n"), name); + vshPrint(ctl, _("Pool %s unmarked as autostarted\n"), name); return TRUE; } @@ -3543,7 +3543,7 @@ cmdPoolName(vshControl * ctl, vshCmd * cmd) if (!vshConnectionUsability(ctl, ctl->conn, TRUE)) return FALSE; if (!(pool = vshCommandOptPoolBy(ctl, cmd, "pool", NULL, - VSH_BYUUID))) + VSH_BYUUID))) return FALSE; vshPrint(ctl, "%s\n", virStoragePoolGetName(pool)); @@ -3779,7 +3779,7 @@ cmdPoolUuid(vshControl * ctl, vshCmd * cmd) return FALSE; if (!(pool = vshCommandOptPoolBy(ctl, cmd, "pool", NULL, - VSH_BYNAME))) + VSH_BYNAME))) return FALSE; if (virStoragePoolGetUUIDString(pool, uuid) != -1) @@ -3823,7 +3823,7 @@ cmdVolCreate(vshControl * ctl, vshCmd * cmd) return FALSE; if (!(pool = vshCommandOptPoolBy(ctl, cmd, "pool", NULL, - VSH_BYNAME))) + VSH_BYNAME))) return FALSE; from = vshCommandOptString(cmd, "file", &found); @@ -5485,7 +5485,7 @@ vshCommandOptDomainBy(vshControl * ctl, vshCmd * cmd, const char *optname, static virNetworkPtr vshCommandOptNetworkBy(vshControl * ctl, vshCmd * cmd, const char *optname, - char **name, int flag) + char **name, int flag) { virNetworkPtr network = NULL; char *n; @@ -5504,7 +5504,7 @@ vshCommandOptNetworkBy(vshControl * ctl, vshCmd * cmd, const char *optname, /* try it by UUID */ if (network==NULL && (flag & VSH_BYUUID) && strlen(n)==VIR_UUID_STRING_BUFLEN-1) { vshDebug(ctl, 5, "%s: <%s> trying as network UUID\n", - cmd->def->name, optname); + cmd->def->name, optname); network = virNetworkLookupByUUIDString(ctl->conn, n); } /* try it by NAME */ @@ -5541,7 +5541,7 @@ vshCommandOptPoolBy(vshControl * ctl, vshCmd * cmd, const char *optname, /* try it by UUID */ if (pool==NULL && (flag & VSH_BYUUID) && strlen(n)==VIR_UUID_STRING_BUFLEN-1) { vshDebug(ctl, 5, "%s: <%s> trying as pool UUID\n", - cmd->def->name, optname); + cmd->def->name, optname); pool = virStoragePoolLookupByUUIDString(ctl->conn, n); } /* try it by NAME */ diff --git a/src/virterror.c b/src/virterror.c index 35328b040bfa91eab3b9ab87ee9d9bc82fca1abb..9f18463e3daff62ba67f31ee131cb7b430451789 100644 --- a/src/virterror.c +++ b/src/virterror.c @@ -34,31 +34,31 @@ static void *virUserData = NULL; /* associated data */ int chars; \ char *larger; \ va_list ap; \ - \ + \ str = (char *) malloc(150); \ if (str != NULL) { \ - \ + \ size = 150; \ - \ + \ while (1) { \ - va_start(ap, msg); \ - chars = vsnprintf(str, size, msg, ap); \ - va_end(ap); \ - if ((chars > -1) && (chars < size)) { \ - if (prev_size == chars) { \ - break; \ - } else { \ - prev_size = chars; \ - } \ - } \ - if (chars > -1) \ - size += chars + 1; \ - else \ - size += 100; \ - if ((larger = (char *) realloc(str, size)) == NULL) { \ - break; \ - } \ - str = larger; \ + va_start(ap, msg); \ + chars = vsnprintf(str, size, msg, ap); \ + va_end(ap); \ + if ((chars > -1) && (chars < size)) { \ + if (prev_size == chars) { \ + break; \ + } else { \ + prev_size = chars; \ + } \ + } \ + if (chars > -1) \ + size += chars + 1; \ + else \ + size += 100; \ + if ((larger = (char *) realloc(str, size)) == NULL) { \ + break; \ + } \ + str = larger; \ }} \ } @@ -427,18 +427,18 @@ __virErrorMsg(virErrorNumber error, const char *info) return (NULL); case VIR_ERR_INTERNAL_ERROR: if (info != NULL) - errmsg = _("internal error %s"); + errmsg = _("internal error %s"); else - errmsg = _("internal error"); + errmsg = _("internal error"); break; case VIR_ERR_NO_MEMORY: errmsg = _("out of memory"); break; case VIR_ERR_NO_SUPPORT: if (info == NULL) - errmsg = _("this function is not supported by the hypervisor"); - else - errmsg = _("this function is not supported by the hypervisor: %s"); + errmsg = _("this function is not supported by the hypervisor"); + else + errmsg = _("this function is not supported by the hypervisor: %s"); break; case VIR_ERR_NO_CONNECT: if (info == NULL) @@ -448,21 +448,21 @@ __virErrorMsg(virErrorNumber error, const char *info) break; case VIR_ERR_INVALID_CONN: if (info == NULL) - errmsg = _("invalid connection pointer in"); - else - errmsg = _("invalid connection pointer in %s"); + errmsg = _("invalid connection pointer in"); + else + errmsg = _("invalid connection pointer in %s"); break; case VIR_ERR_INVALID_DOMAIN: if (info == NULL) - errmsg = _("invalid domain pointer in"); - else - errmsg = _("invalid domain pointer in %s"); + errmsg = _("invalid domain pointer in"); + else + errmsg = _("invalid domain pointer in %s"); break; case VIR_ERR_INVALID_ARG: if (info == NULL) - errmsg = _("invalid argument in"); - else - errmsg = _("invalid argument in %s"); + errmsg = _("invalid argument in"); + else + errmsg = _("invalid argument in %s"); break; case VIR_ERR_OPERATION_FAILED: if (info != NULL) @@ -487,9 +487,9 @@ __virErrorMsg(virErrorNumber error, const char *info) break; case VIR_ERR_UNKNOWN_HOST: if (info != NULL) - errmsg = _("unknown host %s"); - else - errmsg = _("unknown host"); + errmsg = _("unknown host %s"); + else + errmsg = _("unknown host"); break; case VIR_ERR_SEXPR_SERIAL: if (info != NULL) @@ -503,7 +503,7 @@ __virErrorMsg(virErrorNumber error, const char *info) else errmsg = _("could not use Xen hypervisor entry %s"); break; - case VIR_ERR_NO_XENSTORE: + case VIR_ERR_NO_XENSTORE: if (info == NULL) errmsg = _("could not connect to Xen Store"); else @@ -569,150 +569,150 @@ __virErrorMsg(virErrorNumber error, const char *info) else errmsg = _("library call %s failed, possibly not supported"); break; - case VIR_ERR_XML_ERROR: - if (info == NULL) - errmsg = _("XML description not well formed or invalid"); - else - errmsg = _("XML description for %s is not well formed or invalid"); - break; - case VIR_ERR_DOM_EXIST: - if (info == NULL) - errmsg = _("this domain exists already"); - else - errmsg = _("domain %s exists already"); - break; - case VIR_ERR_OPERATION_DENIED: - if (info == NULL) - errmsg = _("operation forbidden for read only access"); - else - errmsg = _("operation %s forbidden for read only access"); - break; - case VIR_ERR_OPEN_FAILED: - if (info == NULL) - errmsg = _("failed to open configuration file for reading"); - else - errmsg = _("failed to open %s for reading"); - break; - case VIR_ERR_READ_FAILED: - if (info == NULL) - errmsg = _("failed to read configuration file"); - else - errmsg = _("failed to read configuration file %s"); - break; - case VIR_ERR_PARSE_FAILED: - if (info == NULL) - errmsg = _("failed to parse configuration file"); - else - errmsg = _("failed to parse configuration file %s"); - break; - case VIR_ERR_CONF_SYNTAX: - if (info == NULL) - errmsg = _("configuration file syntax error"); - else - errmsg = _("configuration file syntax error: %s"); - break; - case VIR_ERR_WRITE_FAILED: - if (info == NULL) - errmsg = _("failed to write configuration file"); - else - errmsg = _("failed to write configuration file: %s"); - break; - case VIR_ERR_XML_DETAIL: - if (info == NULL) - errmsg = _("parser error"); - else - errmsg = "%s"; + case VIR_ERR_XML_ERROR: + if (info == NULL) + errmsg = _("XML description not well formed or invalid"); + else + errmsg = _("XML description for %s is not well formed or invalid"); + break; + case VIR_ERR_DOM_EXIST: + if (info == NULL) + errmsg = _("this domain exists already"); + else + errmsg = _("domain %s exists already"); + break; + case VIR_ERR_OPERATION_DENIED: + if (info == NULL) + errmsg = _("operation forbidden for read only access"); + else + errmsg = _("operation %s forbidden for read only access"); + break; + case VIR_ERR_OPEN_FAILED: + if (info == NULL) + errmsg = _("failed to open configuration file for reading"); + else + errmsg = _("failed to open %s for reading"); + break; + case VIR_ERR_READ_FAILED: + if (info == NULL) + errmsg = _("failed to read configuration file"); + else + errmsg = _("failed to read configuration file %s"); + break; + case VIR_ERR_PARSE_FAILED: + if (info == NULL) + errmsg = _("failed to parse configuration file"); + else + errmsg = _("failed to parse configuration file %s"); + break; + case VIR_ERR_CONF_SYNTAX: + if (info == NULL) + errmsg = _("configuration file syntax error"); + else + errmsg = _("configuration file syntax error: %s"); + break; + case VIR_ERR_WRITE_FAILED: + if (info == NULL) + errmsg = _("failed to write configuration file"); + else + errmsg = _("failed to write configuration file: %s"); + break; + case VIR_ERR_XML_DETAIL: + if (info == NULL) + errmsg = _("parser error"); + else + errmsg = "%s"; break; case VIR_ERR_INVALID_NETWORK: if (info == NULL) - errmsg = _("invalid network pointer in"); - else - errmsg = _("invalid network pointer in %s"); - break; - case VIR_ERR_NETWORK_EXIST: - if (info == NULL) - errmsg = _("this network exists already"); - else - errmsg = _("network %s exists already"); - break; - case VIR_ERR_SYSTEM_ERROR: - if (info == NULL) - errmsg = _("system call error"); - else - errmsg = "%s"; - break; - case VIR_ERR_RPC: - if (info == NULL) - errmsg = _("RPC error"); - else - errmsg = "%s"; - break; - case VIR_ERR_GNUTLS_ERROR: - if (info == NULL) - errmsg = _("GNUTLS call error"); - else - errmsg = "%s"; - break; - case VIR_WAR_NO_NETWORK: - if (info == NULL) - errmsg = _("Failed to find the network"); - else - errmsg = _("Failed to find the network: %s"); - break; - case VIR_ERR_NO_DOMAIN: - if (info == NULL) - errmsg = _("Domain not found"); - else - errmsg = _("Domain not found: %s"); - break; - case VIR_ERR_NO_NETWORK: - if (info == NULL) - errmsg = _("Network not found"); - else - errmsg = _("Network not found: %s"); - break; + errmsg = _("invalid network pointer in"); + else + errmsg = _("invalid network pointer in %s"); + break; + case VIR_ERR_NETWORK_EXIST: + if (info == NULL) + errmsg = _("this network exists already"); + else + errmsg = _("network %s exists already"); + break; + case VIR_ERR_SYSTEM_ERROR: + if (info == NULL) + errmsg = _("system call error"); + else + errmsg = "%s"; + break; + case VIR_ERR_RPC: + if (info == NULL) + errmsg = _("RPC error"); + else + errmsg = "%s"; + break; + case VIR_ERR_GNUTLS_ERROR: + if (info == NULL) + errmsg = _("GNUTLS call error"); + else + errmsg = "%s"; + break; + case VIR_WAR_NO_NETWORK: + if (info == NULL) + errmsg = _("Failed to find the network"); + else + errmsg = _("Failed to find the network: %s"); + break; + case VIR_ERR_NO_DOMAIN: + if (info == NULL) + errmsg = _("Domain not found"); + else + errmsg = _("Domain not found: %s"); + break; + case VIR_ERR_NO_NETWORK: + if (info == NULL) + errmsg = _("Network not found"); + else + errmsg = _("Network not found: %s"); + break; case VIR_ERR_INVALID_MAC: - if (info == NULL) - errmsg = _("invalid MAC address"); - else - errmsg = _("invalid MAC address: %s"); - break; + if (info == NULL) + errmsg = _("invalid MAC address"); + else + errmsg = _("invalid MAC address: %s"); + break; case VIR_ERR_AUTH_FAILED: - if (info == NULL) - errmsg = _("authentication failed"); - else - errmsg = _("authentication failed: %s"); - break; - case VIR_ERR_NO_STORAGE_POOL: - if (info == NULL) - errmsg = _("Storage pool not found"); - else - errmsg = _("Storage pool not found: %s"); - break; - case VIR_ERR_NO_STORAGE_VOL: - if (info == NULL) - errmsg = _("Storage volume not found"); - else - errmsg = _("Storage volume not found: %s"); - break; - case VIR_ERR_INVALID_STORAGE_POOL: - if (info == NULL) - errmsg = _("invalid storage pool pointer in"); - else - errmsg = _("invalid storage pool pointer in %s"); - break; - case VIR_ERR_INVALID_STORAGE_VOL: - if (info == NULL) - errmsg = _("invalid storage volume pointer in"); - else - errmsg = _("invalid storage volume pointer in %s"); - break; - case VIR_WAR_NO_STORAGE: - if (info == NULL) - errmsg = _("Failed to find a storage driver"); - else - errmsg = _("Failed to find a storage driver: %s"); - break; + if (info == NULL) + errmsg = _("authentication failed"); + else + errmsg = _("authentication failed: %s"); + break; + case VIR_ERR_NO_STORAGE_POOL: + if (info == NULL) + errmsg = _("Storage pool not found"); + else + errmsg = _("Storage pool not found: %s"); + break; + case VIR_ERR_NO_STORAGE_VOL: + if (info == NULL) + errmsg = _("Storage volume not found"); + else + errmsg = _("Storage volume not found: %s"); + break; + case VIR_ERR_INVALID_STORAGE_POOL: + if (info == NULL) + errmsg = _("invalid storage pool pointer in"); + else + errmsg = _("invalid storage pool pointer in %s"); + break; + case VIR_ERR_INVALID_STORAGE_VOL: + if (info == NULL) + errmsg = _("invalid storage volume pointer in"); + else + errmsg = _("invalid storage volume pointer in %s"); + break; + case VIR_WAR_NO_STORAGE: + if (info == NULL) + errmsg = _("Failed to find a storage driver"); + else + errmsg = _("Failed to find a storage driver: %s"); + break; } return (errmsg); } diff --git a/src/xen_internal.c b/src/xen_internal.c index 7ad08038fb284de0c8b60a651c170ee46d94b63d..6664053b334d65d8ec47912bf873870da747043e 100644 --- a/src/xen_internal.c +++ b/src/xen_internal.c @@ -338,9 +338,9 @@ static int lock_pages(void *addr, size_t len) { #ifdef __linux__ - return (mlock(addr, len)); + return (mlock(addr, len)); #elif define(__sun) - return (0); + return (0); #endif } @@ -348,9 +348,9 @@ static int unlock_pages(void *addr, size_t len) { #ifdef __linux__ - return (munlock(addr, len)); + return (munlock(addr, len)); #elif define(__sun) - return (0); + return (0); #endif } @@ -771,14 +771,14 @@ virXenErrorFunc(virConnectPtr conn, errmsg = __virErrorMsg(error, info); if (func != NULL) { snprintf(fullinfo, 999, "%s: %s", func, info); - fullinfo[999] = 0; - __virRaiseError(conn, NULL, NULL, VIR_FROM_XEN, error, VIR_ERR_ERROR, - errmsg, fullinfo, NULL, value, 0, errmsg, fullinfo, - value); + fullinfo[999] = 0; + __virRaiseError(conn, NULL, NULL, VIR_FROM_XEN, error, VIR_ERR_ERROR, + errmsg, fullinfo, NULL, value, 0, errmsg, fullinfo, + value); } else { - __virRaiseError(conn, NULL, NULL, VIR_FROM_XEN, error, VIR_ERR_ERROR, - errmsg, info, NULL, value, 0, errmsg, info, - value); + __virRaiseError(conn, NULL, NULL, VIR_FROM_XEN, error, VIR_ERR_ERROR, + errmsg, info, NULL, value, 0, errmsg, info, + value); } } @@ -1090,14 +1090,14 @@ xenHypervisorGetSchedulerType(virDomainPtr domain, int *nparams) if ((domain == NULL) || (domain->conn == NULL)) { virXenErrorFunc(NULL, VIR_ERR_INTERNAL_ERROR, __FUNCTION__, - "domain or conn is NULL", 0); + "domain or conn is NULL", 0); return NULL; } priv = (xenUnifiedPrivatePtr) domain->conn->privateData; if (priv->handle < 0 || domain->id < 0) { virXenErrorFunc(domain->conn, VIR_ERR_INTERNAL_ERROR, __FUNCTION__, - "priv->handle or domain->id invalid", 0); + "priv->handle or domain->id invalid", 0); return NULL; } @@ -1108,7 +1108,7 @@ xenHypervisorGetSchedulerType(virDomainPtr domain, int *nparams) */ if (dom_interface_version < 5) { virXenErrorFunc(domain->conn, VIR_ERR_NO_XEN, __FUNCTION__, - "unsupported in dom interface < 5", 0); + "unsupported in dom interface < 5", 0); return NULL; } @@ -1120,21 +1120,21 @@ xenHypervisorGetSchedulerType(virDomainPtr domain, int *nparams) op.cmd = XEN_V2_OP_GETSCHEDULERID; ret = xenHypervisorDoV2Sys(priv->handle, &op); if (ret < 0) - return(NULL); + return(NULL); switch (op.u.getschedulerid.sched_id){ - case XEN_SCHEDULER_SEDF: - schedulertype = strdup("sedf"); - if (nparams) - *nparams = 6; - break; - case XEN_SCHEDULER_CREDIT: - schedulertype = strdup("credit"); - if (nparams) - *nparams = 2; - break; - default: - break; + case XEN_SCHEDULER_SEDF: + schedulertype = strdup("sedf"); + if (nparams) + *nparams = 6; + break; + case XEN_SCHEDULER_CREDIT: + schedulertype = strdup("credit"); + if (nparams) + *nparams = 2; + break; + default: + break; } } @@ -1159,20 +1159,20 @@ static const char *str_cap = "cap"; */ int xenHypervisorGetSchedulerParameters(virDomainPtr domain, - virSchedParameterPtr params, int *nparams) + virSchedParameterPtr params, int *nparams) { xenUnifiedPrivatePtr priv; if ((domain == NULL) || (domain->conn == NULL)) { virXenErrorFunc(NULL, VIR_ERR_INTERNAL_ERROR, __FUNCTION__, - "domain or conn is NULL", 0); + "domain or conn is NULL", 0); return -1; } priv = (xenUnifiedPrivatePtr) domain->conn->privateData; if (priv->handle < 0 || domain->id < 0) { virXenErrorFunc(domain->conn, VIR_ERR_INTERNAL_ERROR, __FUNCTION__, - "priv->handle or domain->id invalid", 0); + "priv->handle or domain->id invalid", 0); return -1; } @@ -1183,7 +1183,7 @@ xenHypervisorGetSchedulerParameters(virDomainPtr domain, */ if (dom_interface_version < 5) { virXenErrorFunc(domain->conn, VIR_ERR_NO_XEN, __FUNCTION__, - "unsupported in dom interface < 5", 0); + "unsupported in dom interface < 5", 0); return -1; } @@ -1196,41 +1196,41 @@ xenHypervisorGetSchedulerParameters(virDomainPtr domain, op_sys.cmd = XEN_V2_OP_GETSCHEDULERID; ret = xenHypervisorDoV2Sys(priv->handle, &op_sys); if (ret < 0) - return -1; + return -1; switch (op_sys.u.getschedulerid.sched_id){ - case XEN_SCHEDULER_SEDF: - /* TODO: Implement for Xen/SEDF */ - TODO - return(-1); - case XEN_SCHEDULER_CREDIT: - if (*nparams < 2) - return(-1); - memset(&op_dom, 0, sizeof(op_dom)); - op_dom.cmd = XEN_V2_OP_SCHEDULER; - op_dom.domain = (domid_t) domain->id; - op_dom.u.getschedinfo.sched_id = XEN_SCHEDULER_CREDIT; - op_dom.u.getschedinfo.cmd = XEN_DOMCTL_SCHEDOP_getinfo; - ret = xenHypervisorDoV2Dom(priv->handle, &op_dom); - if (ret < 0) - return(-1); - - strncpy (params[0].field, str_weight, VIR_DOMAIN_SCHED_FIELD_LENGTH); + case XEN_SCHEDULER_SEDF: + /* TODO: Implement for Xen/SEDF */ + TODO + return(-1); + case XEN_SCHEDULER_CREDIT: + if (*nparams < 2) + return(-1); + memset(&op_dom, 0, sizeof(op_dom)); + op_dom.cmd = XEN_V2_OP_SCHEDULER; + op_dom.domain = (domid_t) domain->id; + op_dom.u.getschedinfo.sched_id = XEN_SCHEDULER_CREDIT; + op_dom.u.getschedinfo.cmd = XEN_DOMCTL_SCHEDOP_getinfo; + ret = xenHypervisorDoV2Dom(priv->handle, &op_dom); + if (ret < 0) + return(-1); + + strncpy (params[0].field, str_weight, VIR_DOMAIN_SCHED_FIELD_LENGTH); params[0].field[VIR_DOMAIN_SCHED_FIELD_LENGTH-1] = '\0'; - params[0].type = VIR_DOMAIN_SCHED_FIELD_UINT; - params[0].value.ui = op_dom.u.getschedinfo.u.credit.weight; + params[0].type = VIR_DOMAIN_SCHED_FIELD_UINT; + params[0].value.ui = op_dom.u.getschedinfo.u.credit.weight; - strncpy (params[1].field, str_cap, VIR_DOMAIN_SCHED_FIELD_LENGTH); + strncpy (params[1].field, str_cap, VIR_DOMAIN_SCHED_FIELD_LENGTH); params[1].field[VIR_DOMAIN_SCHED_FIELD_LENGTH-1] = '\0'; - params[1].type = VIR_DOMAIN_SCHED_FIELD_UINT; - params[1].value.ui = op_dom.u.getschedinfo.u.credit.cap; + params[1].type = VIR_DOMAIN_SCHED_FIELD_UINT; + params[1].value.ui = op_dom.u.getschedinfo.u.credit.cap; - *nparams = 2; - break; - default: + *nparams = 2; + break; + default: virXenErrorFunc(domain->conn, VIR_ERR_INVALID_ARG, __FUNCTION__, - "Unknown scheduler", op_sys.u.getschedulerid.sched_id); - return -1; + "Unknown scheduler", op_sys.u.getschedulerid.sched_id); + return -1; } } @@ -1248,7 +1248,7 @@ xenHypervisorGetSchedulerParameters(virDomainPtr domain, */ int xenHypervisorSetSchedulerParameters(virDomainPtr domain, - virSchedParameterPtr params, int nparams) + virSchedParameterPtr params, int nparams) { int i; unsigned int val; @@ -1257,20 +1257,20 @@ xenHypervisorSetSchedulerParameters(virDomainPtr domain, if ((domain == NULL) || (domain->conn == NULL)) { virXenErrorFunc (NULL, VIR_ERR_INTERNAL_ERROR, __FUNCTION__, - "domain or conn is NULL", 0); + "domain or conn is NULL", 0); return -1; } if ((nparams == 0) || (params == NULL)) { virXenErrorFunc (domain->conn, VIR_ERR_INVALID_ARG, __FUNCTION__, - "Noparameters given", 0); - return(-1); + "Noparameters given", 0); + return(-1); } priv = (xenUnifiedPrivatePtr) domain->conn->privateData; if (priv->handle < 0 || domain->id < 0) { virXenErrorFunc (domain->conn, VIR_ERR_INTERNAL_ERROR, __FUNCTION__, - "priv->handle or domain->id invalid", 0); + "priv->handle or domain->id invalid", 0); return -1; } @@ -1281,7 +1281,7 @@ xenHypervisorSetSchedulerParameters(virDomainPtr domain, */ if (dom_interface_version < 5) { virXenErrorFunc(domain->conn, VIR_ERR_NO_XEN, __FUNCTION__, - "unsupported in dom interface < 5", 0); + "unsupported in dom interface < 5", 0); return -1; } @@ -1299,7 +1299,7 @@ xenHypervisorSetSchedulerParameters(virDomainPtr domain, case XEN_SCHEDULER_SEDF: /* TODO: Implement for Xen/SEDF */ TODO - return(-1); + return(-1); case XEN_SCHEDULER_CREDIT: { int weight_set = 0; int cap_set = 0; @@ -1321,37 +1321,37 @@ xenHypervisorSetSchedulerParameters(virDomainPtr domain, memset(&buf, 0, sizeof(buf)); if (STREQ (params[i].field, str_weight) && params[i].type == VIR_DOMAIN_SCHED_FIELD_UINT) { - val = params[i].value.ui; - if ((val < 1) || (val > USHRT_MAX)) { + val = params[i].value.ui; + if ((val < 1) || (val > USHRT_MAX)) { snprintf(buf, sizeof(buf), _("Credit scheduler weight parameter (%d) is out of range (1-65535)"), val); virXenErrorFunc (domain->conn, VIR_ERR_INVALID_ARG, __FUNCTION__, buf, val); - return(-1); - } + return(-1); + } op_dom.u.getschedinfo.u.credit.weight = val; - weight_set = 1; - } else if (STREQ (params[i].field, str_cap) && + weight_set = 1; + } else if (STREQ (params[i].field, str_cap) && params[i].type == VIR_DOMAIN_SCHED_FIELD_UINT) { - val = params[i].value.ui; - if (val > USHRT_MAX) { + val = params[i].value.ui; + if (val > USHRT_MAX) { snprintf(buf, sizeof(buf), _("Credit scheduler cap parameter (%d) is out of range (0-65535)"), val); virXenErrorFunc (domain->conn, VIR_ERR_INVALID_ARG, __FUNCTION__, buf, val); - return(-1); - } + return(-1); + } op_dom.u.getschedinfo.u.credit.cap = val; - cap_set = 1; - } else { + cap_set = 1; + } else { virXenErrorFunc (domain->conn, VIR_ERR_INVALID_ARG, __FUNCTION__, "Credit scheduler accepts 'cap' and 'weight' integer parameters", - 0); - return(-1); - } + 0); + return(-1); + } } ret = xenHypervisorDoV2Dom(priv->handle, &op_dom); if (ret < 0) - return -1; + return -1; break; - } + } default: virXenErrorFunc(domain->conn, VIR_ERR_INVALID_ARG, __FUNCTION__, "Unknown scheduler", op_sys.u.getschedulerid.sched_id); @@ -1987,7 +1987,7 @@ xenHypervisorInit(void) ipt = malloc(sizeof(*ipt)); if (ipt == NULL){ - virXenError(NULL, VIR_ERR_NO_MEMORY, __FUNCTION__, 0); + virXenError(NULL, VIR_ERR_NO_MEMORY, __FUNCTION__, 0); return(-1); } /* Currently consider RHEL5.0 Fedora7, xen-3.1, and xen-unstable */ @@ -2762,8 +2762,8 @@ xenHypervisorGetDomMaxMemory(virConnectPtr conn, int id) if (kb_per_pages == 0) { kb_per_pages = sysconf(_SC_PAGESIZE) / 1024; - if (kb_per_pages <= 0) - kb_per_pages = 4; + if (kb_per_pages <= 0) + kb_per_pages = 4; } XEN_GETDOMAININFO_CLEAR(dominfo); @@ -2823,8 +2823,8 @@ xenHypervisorGetDomInfo(virConnectPtr conn, int id, virDomainInfoPtr info) if (kb_per_pages == 0) { kb_per_pages = sysconf(_SC_PAGESIZE) / 1024; - if (kb_per_pages <= 0) - kb_per_pages = 4; + if (kb_per_pages <= 0) + kb_per_pages = 4; } if (conn == NULL) @@ -2846,10 +2846,10 @@ xenHypervisorGetDomInfo(virConnectPtr conn, int id, virDomainInfoPtr info) domain_flags &= ~DOMFLAGS_HVM; /* Mask out HVM flags */ domain_state = domain_flags & 0xFF; /* Mask out high bits */ switch (domain_state) { - case DOMFLAGS_DYING: - info->state = VIR_DOMAIN_SHUTDOWN; - break; - case DOMFLAGS_SHUTDOWN: + case DOMFLAGS_DYING: + info->state = VIR_DOMAIN_SHUTDOWN; + break; + case DOMFLAGS_SHUTDOWN: /* The domain is shutdown. Determine the cause. */ domain_shutdown_cause = domain_flags >> DOMFLAGS_SHUTDOWNSHIFT; switch (domain_shutdown_cause) { @@ -2859,18 +2859,18 @@ xenHypervisorGetDomInfo(virConnectPtr conn, int id, virDomainInfoPtr info) default: info->state = VIR_DOMAIN_SHUTOFF; } - break; - case DOMFLAGS_PAUSED: - info->state = VIR_DOMAIN_PAUSED; - break; - case DOMFLAGS_BLOCKED: - info->state = VIR_DOMAIN_BLOCKED; - break; - case DOMFLAGS_RUNNING: - info->state = VIR_DOMAIN_RUNNING; - break; - default: - info->state = VIR_DOMAIN_NOSTATE; + break; + case DOMFLAGS_PAUSED: + info->state = VIR_DOMAIN_PAUSED; + break; + case DOMFLAGS_BLOCKED: + info->state = VIR_DOMAIN_BLOCKED; + break; + case DOMFLAGS_RUNNING: + info->state = VIR_DOMAIN_RUNNING; + break; + default: + info->state = VIR_DOMAIN_NOSTATE; } /* @@ -2949,8 +2949,8 @@ xenHypervisorNodeGetCellsFreeMemory(virConnectPtr conn, unsigned long long *free nbNodeCells = xenNbCells(conn); if (nbNodeCells < 0) { virXenErrorFunc (conn, VIR_ERR_XEN_CALL, __FUNCTION__, - "cannot determine actual number of cells",0); - return(-1); + "cannot determine actual number of cells",0); + return(-1); } if ((maxCells < 1) || (startCell >= nbNodeCells)) { diff --git a/src/xen_internal.h b/src/xen_internal.h index b2fd24f73d0ea5b7eaf86b23b83210d74071c277..5cd4eeaaec4e97eb91b3262736a8cf66cc470cda 100644 --- a/src/xen_internal.h +++ b/src/xen_internal.h @@ -22,7 +22,7 @@ int xenHypervisorInit (void); virDomainPtr xenHypervisorLookupDomainByID (virConnectPtr conn, - int id); + int id); virDomainPtr xenHypervisorLookupDomainByUUID(virConnectPtr conn, const unsigned char *uuid); @@ -30,74 +30,74 @@ char * xenHypervisorDomainGetOSType (virDomainPtr dom); int xenHypervisorOpen (virConnectPtr conn, - xmlURIPtr uri, - virConnectAuthPtr auth, - int flags); + xmlURIPtr uri, + virConnectAuthPtr auth, + int flags); int xenHypervisorClose (virConnectPtr conn); int xenHypervisorGetVersion (virConnectPtr conn, - unsigned long *hvVer); + unsigned long *hvVer); char * xenHypervisorMakeCapabilitiesXML (virConnectPtr conn, - const char *hostmachine, - FILE *cpuinfo, - FILE *capabilities); + const char *hostmachine, + FILE *cpuinfo, + FILE *capabilities); char * xenHypervisorGetCapabilities (virConnectPtr conn); unsigned long xenHypervisorGetDomMaxMemory (virConnectPtr conn, - int id); + int id); int xenHypervisorNumOfDomains (virConnectPtr conn); int xenHypervisorListDomains (virConnectPtr conn, - int *ids, - int maxids); + int *ids, + int maxids); int xenHypervisorGetMaxVcpus (virConnectPtr conn, const char *type); int xenHypervisorDestroyDomain (virDomainPtr domain); int xenHypervisorResumeDomain (virDomainPtr domain); int xenHypervisorPauseDomain (virDomainPtr domain); int xenHypervisorGetDomainInfo (virDomainPtr domain, - virDomainInfoPtr info); + virDomainInfoPtr info); int xenHypervisorGetDomInfo (virConnectPtr conn, - int id, - virDomainInfoPtr info); + int id, + virDomainInfoPtr info); int xenHypervisorSetMaxMemory (virDomainPtr domain, - unsigned long memory); + unsigned long memory); int xenHypervisorCheckID (virConnectPtr conn, - int id); + int id); int xenHypervisorSetVcpus (virDomainPtr domain, - unsigned int nvcpus); + unsigned int nvcpus); int xenHypervisorPinVcpu (virDomainPtr domain, - unsigned int vcpu, - unsigned char *cpumap, - int maplen); + unsigned int vcpu, + unsigned char *cpumap, + int maplen); int xenHypervisorGetVcpus (virDomainPtr domain, - virVcpuInfoPtr info, - int maxinfo, - unsigned char *cpumaps, - int maplen); + virVcpuInfoPtr info, + int maxinfo, + unsigned char *cpumaps, + int maplen); int xenHypervisorGetVcpuMax (virDomainPtr domain); char * xenHypervisorGetSchedulerType (virDomainPtr domain, - int *nparams); + int *nparams); int xenHypervisorGetSchedulerParameters (virDomainPtr domain, - virSchedParameterPtr params, - int *nparams); + virSchedParameterPtr params, + int *nparams); int xenHypervisorSetSchedulerParameters (virDomainPtr domain, - virSchedParameterPtr params, - int nparams); + virSchedParameterPtr params, + int nparams); int xenHypervisorDomainBlockStats (virDomainPtr domain, - const char *path, - struct _virDomainBlockStats *stats); + const char *path, + struct _virDomainBlockStats *stats); int xenHypervisorDomainInterfaceStats (virDomainPtr domain, - const char *path, - struct _virDomainInterfaceStats *stats); + const char *path, + struct _virDomainInterfaceStats *stats); int xenHypervisorNodeGetCellsFreeMemory(virConnectPtr conn, - unsigned long long *freeMems, - int startCell, - int maxCells); + unsigned long long *freeMems, + int startCell, + int maxCells); #ifdef __cplusplus } #endif diff --git a/src/xen_unified.c b/src/xen_unified.c index d9117d93c458d8bfdf7a331f02e7b2fc1b6cd8e3..91502dc1f9c3dfda805cd1f827d7f6ab82de4d22 100644 --- a/src/xen_unified.c +++ b/src/xen_unified.c @@ -185,19 +185,19 @@ xenDomainUsedCpus(virDomainPtr dom) if ((ncpus = xenUnifiedDomainGetVcpus(dom, cpuinfo, nb_vcpu, cpumap, cpumaplen)) >= 0) { - for (n = 0 ; n < ncpus ; n++) { - for (m = 0 ; m < nb_cpu; m++) { - if ((cpulist[m] == 0) && - (VIR_CPU_USABLE(cpumap, cpumaplen, n, m))) { - cpulist[m] = 1; - nb++; - /* if all CPU are used just return NULL */ - if (nb == nb_cpu) - goto done; - - } - } - } + for (n = 0 ; n < ncpus ; n++) { + for (m = 0 ; m < nb_cpu; m++) { + if ((cpulist[m] == 0) && + (VIR_CPU_USABLE(cpumap, cpumaplen, n, m))) { + cpulist[m] = 1; + nb++; + /* if all CPU are used just return NULL */ + if (nb == nb_cpu) + goto done; + + } + } + } res = virSaveCpuSet(dom->conn, cpulist, nb_cpu); } @@ -230,7 +230,7 @@ xenUnifiedProbe (void) FILE *fh; if (fh = fopen("/dev/xen/domcaps", "r")) { - fclose(fh); + fclose(fh); return("xen:///"); } #endif @@ -961,7 +961,7 @@ xenUnifiedDomainDumpXML (virDomainPtr dom, int flags) char *cpus, *res; cpus = xenDomainUsedCpus(dom); res = xenDaemonDomainDumpXML(dom, flags, cpus); - free(cpus); + free(cpus); return(res); } if (priv->opened[XEN_UNIFIED_PROXY_OFFSET]) @@ -1138,8 +1138,8 @@ xenUnifiedDomainGetSchedulerType (virDomainPtr dom, int *nparams) for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; i++) { if (priv->opened[i] && drivers[i]->domainGetSchedulerType) { schedulertype = drivers[i]->domainGetSchedulerType (dom, nparams); - if (schedulertype != NULL) - return(schedulertype); + if (schedulertype != NULL) + return(schedulertype); } } return(NULL); @@ -1155,9 +1155,9 @@ xenUnifiedDomainGetSchedulerParameters (virDomainPtr dom, for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i) { if (priv->opened[i] && drivers[i]->domainGetSchedulerParameters) { ret = drivers[i]->domainGetSchedulerParameters(dom, params, nparams); - if (ret == 0) - return(0); - } + if (ret == 0) + return(0); + } } return(-1); } @@ -1172,9 +1172,9 @@ xenUnifiedDomainSetSchedulerParameters (virDomainPtr dom, for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i) { if (priv->opened[i] && drivers[i]->domainSetSchedulerParameters) { ret = drivers[i]->domainSetSchedulerParameters(dom, params, nparams); - if (ret == 0) - return 0; - } + if (ret == 0) + return 0; + } } return(-1); @@ -1230,9 +1230,9 @@ xenUnifiedNodeGetFreeMemory (virConnectPtr conn) if (priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET]) { ret = xenHypervisorNodeGetCellsFreeMemory (conn, &freeMem, -1, 1); - if (ret != 1) - return (0); - return(freeMem); + if (ret != 1) + return (0); + return(freeMem); } xenUnifiedError (conn, VIR_ERR_NO_SUPPORT, __FUNCTION__); diff --git a/src/xen_unified.h b/src/xen_unified.h index c53050889ffee38ee5d7d9df592b2bf8ab5b6321..cd32d5da9bb7798313fc5e79b9ad2aa68e6fa33b 100644 --- a/src/xen_unified.h +++ b/src/xen_unified.h @@ -44,45 +44,45 @@ extern int xenUnifiedRegister (void); * structure with direct calls in xen_unified.c. */ struct xenUnifiedDriver { - virDrvOpen open; - virDrvClose close; - virDrvGetVersion version; + virDrvOpen open; + virDrvClose close; + 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; - virDrvListDefinedDomains listDefinedDomains; - virDrvNumOfDefinedDomains numOfDefinedDomains; - virDrvDomainCreate domainCreate; - virDrvDomainDefineXML domainDefineXML; - virDrvDomainUndefine domainUndefine; - virDrvDomainAttachDevice domainAttachDevice; - virDrvDomainDetachDevice domainDetachDevice; - virDrvDomainGetAutostart domainGetAutostart; - virDrvDomainSetAutostart domainSetAutostart; - virDrvDomainGetSchedulerType domainGetSchedulerType; - virDrvDomainGetSchedulerParameters domainGetSchedulerParameters; - virDrvDomainSetSchedulerParameters domainSetSchedulerParameters; + 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; + 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: diff --git a/src/xend_internal.c b/src/xend_internal.c index bd40d3f07d4822ba05afa6fd5032abdee62ef9f3..6ba4571db6f0443fd4a887f50b17c90ac485caca 100644 --- a/src/xend_internal.c +++ b/src/xend_internal.c @@ -59,7 +59,7 @@ static int xenDaemonListDefinedDomains(virConnectPtr conn, char **const names, i static int xenDaemonNumOfDefinedDomains(virConnectPtr conn); static virDomainPtr xenDaemonCreateLinux(virConnectPtr conn, const char *xmlDesc, - unsigned int flags); + unsigned int flags); static char *xenDaemonDomainGetOSType(virDomainPtr domain); static int xenDaemonAttachDevice(virDomainPtr domain, const char *xml); static int xenDaemonDetachDevice(virDomainPtr domain, const char *xml); @@ -203,7 +203,7 @@ virXendErrorInt(virConnectPtr conn, virErrorNumber error, int val) #define foreach(iterator, start) \ - for (_for_i = (start), *iterator = (start)->u.s.car; \ + for (_for_i = (start), *iterator = (start)->u.s.car; \ _for_i->kind == SEXPR_CONS; \ _for_i = _for_i->u.s.cdr, iterator = _for_i->u.s.car) @@ -613,7 +613,7 @@ xend_op_ext2(virConnectPtr xend, const char *path, char *error, buf.content = malloc(1000); if (buf.content == NULL) { - virXendError(xend, VIR_ERR_NO_MEMORY, _("allocate new buffer")); + virXendError(xend, VIR_ERR_NO_MEMORY, _("allocate new buffer")); return -1; } buf.size = 1000; @@ -832,7 +832,7 @@ urlencode(const char *string) size_t i; if (buffer == NULL) { - virXendError(NULL, VIR_ERR_NO_MEMORY, _("allocate new buffer")); + virXendError(NULL, VIR_ERR_NO_MEMORY, _("allocate new buffer")); return (NULL); } for (i = 0; i < len; i++) { @@ -1065,7 +1065,7 @@ xenDaemonDomainCreateLinux(virConnectPtr xend, const char *sexpr) */ int xenDaemonDomainLookupByName_ids(virConnectPtr xend, const char *domname, - unsigned char *uuid) + unsigned char *uuid) { struct sexpr *root; const char *value; @@ -1114,9 +1114,9 @@ xenDaemonDomainLookupByName_ids(virConnectPtr xend, const char *domname, */ int xenDaemonDomainLookupByID(virConnectPtr xend, - int id, - char **domname, - unsigned char *uuid) + int id, + char **domname, + unsigned char *uuid) { const char *name = NULL; struct sexpr *root; @@ -1667,7 +1667,7 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root, xend has already done this ? */ if ((mode != NULL) && (!strcmp(mode, "r"))) virBufferAddLit(&buf, " \n"); - else if ((mode != NULL) && (!strcmp(mode, "w!"))) + else if ((mode != NULL) && (!strcmp(mode, "w!"))) virBufferAddLit(&buf, " \n"); virBufferAddLit(&buf, " \n"); @@ -1727,11 +1727,11 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root, virBufferVSprintf(&buf, " \n"); @@ -1806,11 +1806,11 @@ xend_parse_sexp_desc(virConnectPtr conn, struct sexpr *root, virBufferVSprintf(&buf, " \n"); @@ -2237,7 +2237,7 @@ xenDaemonDomainSuspend(virDomainPtr domain) { if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) { virXendError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG, - __FUNCTION__); + __FUNCTION__); return(-1); } if (domain->id < 0) @@ -2259,7 +2259,7 @@ xenDaemonDomainResume(virDomainPtr domain) { if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) { virXendError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG, - __FUNCTION__); + __FUNCTION__); return(-1); } if (domain->id < 0) @@ -2282,7 +2282,7 @@ xenDaemonDomainShutdown(virDomainPtr domain) { if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) { virXendError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG, - __FUNCTION__); + __FUNCTION__); return(-1); } if (domain->id < 0) @@ -2306,7 +2306,7 @@ xenDaemonDomainReboot(virDomainPtr domain, unsigned int flags ATTRIBUTE_UNUSED) { if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) { virXendError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG, - __FUNCTION__); + __FUNCTION__); return(-1); } if (domain->id < 0) @@ -2332,7 +2332,7 @@ xenDaemonDomainDestroy(virDomainPtr domain) { if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) { virXendError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG, - __FUNCTION__); + __FUNCTION__); return(-1); } if (domain->id < 0) @@ -2358,7 +2358,7 @@ xenDaemonDomainGetOSType(virDomainPtr domain) if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) { virXendError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG, - __FUNCTION__); + __FUNCTION__); return(NULL); } @@ -2402,7 +2402,7 @@ xenDaemonDomainSave(virDomainPtr domain, const char *filename) if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL) || (filename == NULL) || (domain->id < 0)) { virXendError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG, - __FUNCTION__); + __FUNCTION__); return(-1); } @@ -2434,7 +2434,7 @@ xenDaemonDomainCoreDump(virDomainPtr domain, const char *filename, if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL) || (filename == NULL)) { virXendError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG, - __FUNCTION__); + __FUNCTION__); return(-1); } if (domain->id < 0) @@ -2483,7 +2483,7 @@ xenDaemonDomainGetMaxMemory(virDomainPtr domain) if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) { virXendError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG, - __FUNCTION__); + __FUNCTION__); return(-1); } @@ -2523,7 +2523,7 @@ xenDaemonDomainSetMaxMemory(virDomainPtr domain, unsigned long memory) if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) { virXendError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG, - __FUNCTION__); + __FUNCTION__); return(-1); } @@ -2561,7 +2561,7 @@ xenDaemonDomainSetMemory(virDomainPtr domain, unsigned long memory) if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) { virXendError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG, - __FUNCTION__); + __FUNCTION__); return(-1); } @@ -2650,22 +2650,22 @@ xenDaemonDomainDumpXML(virDomainPtr domain, int flags, const char *cpus) if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) { virXendError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG, - __FUNCTION__); + __FUNCTION__); return(NULL); } priv = (xenUnifiedPrivatePtr) domain->conn->privateData; if (domain->id < 0 && priv->xendConfigVersion < 3) { - // fall-through to the next driver to handle + // fall-through to the next driver to handle return(NULL); } if (domain->id < 0) return xenDaemonDomainDumpXMLByName(domain->conn, domain->name, flags, - cpus); + cpus); else return xenDaemonDomainDumpXMLByID(domain->conn, domain->id, flags, - cpus); + cpus); } #endif /* !PROXY */ @@ -2689,7 +2689,7 @@ xenDaemonDomainGetInfo(virDomainPtr domain, virDomainInfoPtr info) if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL) || (info == NULL)) { virXendError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG, - __FUNCTION__); + __FUNCTION__); return(-1); } @@ -2837,7 +2837,7 @@ xenDaemonGetVersion(virConnectPtr conn, unsigned long *hvVer) } root = sexpr_get(conn, "/xend/node/"); if (root == NULL) - return(-1); + return(-1); major = sexpr_int(root, "node/xen_major"); minor = sexpr_int(root, "node/xen_minor"); @@ -2888,7 +2888,7 @@ xenDaemonListDomains(virConnectPtr conn, int *ids, int maxids) } error: - sexpr_free(root); + sexpr_free(root); return(ret); } @@ -2917,11 +2917,11 @@ xenDaemonNumOfDomains(virConnectPtr conn) _for_i = _for_i->u.s.cdr, node = _for_i->u.s.car) { if (node->kind != SEXPR_VALUE) continue; - ret++; + ret++; } error: - sexpr_free(root); + sexpr_free(root); return(ret); } #endif /* ! PROXY */ @@ -2976,7 +2976,7 @@ xenDaemonDomainSetVcpus(virDomainPtr domain, unsigned int vcpus) if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL) || (vcpus < 1)) { virXendError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG, - __FUNCTION__); + __FUNCTION__); return (-1); } @@ -3011,7 +3011,7 @@ xenDaemonDomainPinVcpu(virDomainPtr domain, unsigned int vcpu, if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL) || (cpumap == NULL) || (maplen < 1) || (maplen > (int)sizeof(cpumap_t))) { virXendError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG, - __FUNCTION__); + __FUNCTION__); return (-1); } if (domain->id < 0) @@ -3286,7 +3286,7 @@ xenDaemonAttachDevice(virDomainPtr domain, const char *xml) if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) { virXendError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG, - __FUNCTION__); + __FUNCTION__); return (-1); } @@ -3341,7 +3341,7 @@ xenDaemonDetachDevice(virDomainPtr domain, const char *xml) if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) { virXendError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG, - __FUNCTION__); + __FUNCTION__); return (-1); } if (virDomainXMLDevID(domain, xml, class, ref, sizeof(ref))) @@ -3567,7 +3567,7 @@ int xenDaemonDomainCreate(virDomainPtr domain) if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) { virXendError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG, - __FUNCTION__); + __FUNCTION__); return(-1); } @@ -3585,7 +3585,7 @@ int xenDaemonDomainUndefine(virDomainPtr domain) if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL)) { virXendError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG, - __FUNCTION__); + __FUNCTION__); return(-1); } diff --git a/src/xend_internal.h b/src/xend_internal.h index fb0306bd6663554d7a3325a0a260662041eb4886..e157e88b5e20329f663963fe37070b198f195bca 100644 --- a/src/xend_internal.h +++ b/src/xend_internal.h @@ -104,19 +104,19 @@ int xenDaemonDomainLookupByName_ids(virConnectPtr xend, * This method looks up the name/uuid of a domain */ int xenDaemonDomainLookupByID(virConnectPtr xend, - int id, - char **name, unsigned char *uuid); + int id, + char **name, unsigned char *uuid); char *xenDaemonDomainDumpXMLByID(virConnectPtr xend, - int domid, - int flags, - const char *cpus); + int domid, + int flags, + const char *cpus); char *xenDaemonDomainDumpXMLByName(virConnectPtr xend, - const char *name, - int flags, - const char *cpus); + const char *name, + int flags, + const char *cpus); /** * \brief Lookup information about the host machine @@ -207,16 +207,16 @@ int xenDaemonDomainCreate(virDomainPtr domain); int xenDaemonDomainUndefine(virDomainPtr domain); int xenDaemonDomainSetVcpus (virDomainPtr domain, - unsigned int vcpus); + unsigned int vcpus); int xenDaemonDomainPinVcpu (virDomainPtr domain, - unsigned int vcpu, - unsigned char *cpumap, - int maplen); + unsigned int vcpu, + unsigned char *cpumap, + int maplen); int xenDaemonDomainGetVcpus (virDomainPtr domain, - virVcpuInfoPtr info, - int maxinfo, - unsigned char *cpumaps, - int maplen); + virVcpuInfoPtr info, + int maxinfo, + unsigned char *cpumaps, + int maplen); /* xen_unified calls through here. */ extern struct xenUnifiedDriver xenDaemonDriver; diff --git a/src/xm_internal.c b/src/xm_internal.c index e759345582d5ceaf969ecddef2b1dd9c4836fa81..3d845dcd57c9ca9343e9a1fb43db0bbf40d69da9 100644 --- a/src/xm_internal.c +++ b/src/xm_internal.c @@ -674,12 +674,12 @@ char *xenXMDomainFormatXML(virConnectPtr conn, virConfPtr conf) { if (xenXMConfigGetString(conf, "cpus", &str) == 0) { char *ranges; - ranges = virConvertCpuSet(conn, str, 0); - if (ranges != NULL) { - virBufferVSprintf(buf, " cpuset='%s'", ranges); - free(ranges); - } else - virBufferVSprintf(buf, " cpuset='%s'", str); + ranges = virConvertCpuSet(conn, str, 0); + if (ranges != NULL) { + virBufferVSprintf(buf, " cpuset='%s'", ranges); + free(ranges); + } else + virBufferVSprintf(buf, " cpuset='%s'", str); } if (xenXMConfigGetInt(conf, "vcpus", &val) < 0) val = 1; @@ -771,7 +771,7 @@ char *xenXMDomainFormatXML(virConnectPtr conn, virConfPtr conf) { /* Extract source driver type */ if (!src[0]) { strcpy(drvName, "phy"); - tmp = &src[0]; + tmp = &src[0]; } else if (!(tmp = strchr(src, ':')) || !tmp[0]) { goto skipdisk; } else { @@ -821,9 +821,9 @@ char *xenXMDomainFormatXML(virConnectPtr conn, virConfPtr conf) { if (!strcmp(head, "r") || !strcmp(head, "ro")) virBufferAddLit(buf, " \n"); - else if ((!strcmp(head, "w!")) || - (!strcmp(head, "!"))) - virBufferAddLit(buf, " \n"); + else if ((!strcmp(head, "w!")) || + (!strcmp(head, "!"))) + virBufferAddLit(buf, " \n"); virBufferAddLit(buf, " \n"); skipdisk: @@ -1965,21 +1965,21 @@ virConfPtr xenXMParseXMLToConfig(virConnectPtr conn, const char *xml) { if (cpus != NULL) { char *ranges; - ranges = virConvertCpuSet(conn, cpus, 0); - if (ranges != NULL) { - free(cpus); - if (xenXMConfigSetString(conf, "cpus", ranges) < 0) { - free(ranges); - goto error; - } - free(ranges); - } else { - if (xenXMConfigSetString(conf, "cpus", cpus) < 0) { - free(cpus); - goto error; - } - free(cpus); - } + ranges = virConvertCpuSet(conn, cpus, 0); + if (ranges != NULL) { + free(cpus); + if (xenXMConfigSetString(conf, "cpus", ranges) < 0) { + free(ranges); + goto error; + } + free(ranges); + } else { + if (xenXMConfigSetString(conf, "cpus", cpus) < 0) { + free(cpus); + goto error; + } + free(cpus); + } } obj = xmlXPathEval(BAD_CAST "string(/domain/os/type)", ctxt); diff --git a/src/xm_internal.h b/src/xm_internal.h index bdb5bb768e09ca510d733add03829986df87554d..6445b7465f234b01c161aac79625fe0501299f71 100644 --- a/src/xm_internal.h +++ b/src/xm_internal.h @@ -49,7 +49,7 @@ int xenXMDomainPinVcpu(virDomainPtr domain, unsigned int vcpu, unsigned char *cpumap, int maplen); virDomainPtr xenXMDomainLookupByName(virConnectPtr conn, const char *domname); virDomainPtr xenXMDomainLookupByUUID(virConnectPtr conn, - const unsigned char *uuid); + const unsigned char *uuid); int xenXMListDefinedDomains(virConnectPtr conn, char ** const names, int maxnames); int xenXMNumOfDefinedDomains(virConnectPtr conn); diff --git a/src/xml.c b/src/xml.c index 429c1d78fcc5311551d5c15d6453675f72211730..8e95103b196edce7880a9dbd7a9b3656237be0b0 100644 --- a/src/xml.c +++ b/src/xml.c @@ -276,14 +276,14 @@ virConvertCpuSet(virConnectPtr conn, const char *str, int maxcpu) { cpuset = calloc(maxcpu, sizeof(*cpuset)); if (cpuset == NULL) { - virXMLError(conn, VIR_ERR_NO_MEMORY, _("allocate buffer"), 0); - return(NULL); + virXMLError(conn, VIR_ERR_NO_MEMORY, _("allocate buffer"), 0); + return(NULL); } ret = virParseCpuSet(conn, &cur, 0, cpuset, maxcpu); if (ret < 0) { free(cpuset); - return(NULL); + return(NULL); } res = virSaveCpuSet(conn, cpuset, maxcpu); free(cpuset); @@ -803,7 +803,7 @@ virDomainParseXMLOSDescHVM(virConnectPtr conn, xmlNodePtr node, /* Only XenD <= 3.0.2 wants cdrom config here */ if (xendConfigVersion == 1) { cur = virXPathNode( - "/domain/devices/disk[@device='cdrom' and target/@dev='hdc']/source", + "/domain/devices/disk[@device='cdrom' and target/@dev='hdc']/source", ctxt); if (cur != NULL) { xmlChar *cdfile; @@ -1653,14 +1653,14 @@ virParseXMLDevice(virConnectPtr conn, const char *xmldesc, int hvm, goto error; if (xmlStrEqual(node->name, BAD_CAST "disk")) { if (virDomainParseXMLDiskDesc(conn, node, &buf, hvm, - xendConfigVersion) != 0) + xendConfigVersion) != 0) goto error; /* SXP is not created when device is "floppy". */ else if (buf.use == 0) goto error; } else if (xmlStrEqual(node->name, BAD_CAST "interface")) { if (virDomainParseXMLIfDesc(conn, node, &buf, hvm, - xendConfigVersion) != 0) + xendConfigVersion) != 0) goto error; } else { virXMLError(conn, VIR_ERR_XML_ERROR, (const char *) node->name, 0); diff --git a/src/xml.h b/src/xml.h index f196b27252c2df660b5a24ddb426a6779b8e15a7..2d30b6576f71e4cb1026c3f7002408201e3f73a5 100644 --- a/src/xml.h +++ b/src/xml.h @@ -17,46 +17,46 @@ extern "C" { #endif int virXPathBoolean (const char *xpath, - xmlXPathContextPtr ctxt); + xmlXPathContextPtr ctxt); char * virXPathString (const char *xpath, - xmlXPathContextPtr ctxt); + xmlXPathContextPtr ctxt); int virXPathNumber (const char *xpath, - xmlXPathContextPtr ctxt, - double *value); + xmlXPathContextPtr ctxt, + double *value); int virXPathLong (const char *xpath, - xmlXPathContextPtr ctxt, - long *value); + xmlXPathContextPtr ctxt, + long *value); xmlNodePtr virXPathNode (const char *xpath, - xmlXPathContextPtr ctxt); + xmlXPathContextPtr ctxt); int virXPathNodeSet (const char *xpath, - xmlXPathContextPtr ctxt, - xmlNodePtr **list); + xmlXPathContextPtr ctxt, + xmlNodePtr **list); #if WITH_XEN int virParseCpuSet (virConnectPtr conn, - const char **str, - char sep, - char *cpuset, - int maxcpu); + const char **str, + char sep, + char *cpuset, + int maxcpu); char * virSaveCpuSet (virConnectPtr conn, - char *cpuset, - int maxcpu); + char *cpuset, + int maxcpu); char * virConvertCpuSet(virConnectPtr conn, - const char *str, - int maxcpu); + const char *str, + int maxcpu); char * virDomainParseXMLDesc(virConnectPtr conn, - const char *xmldesc, - char **name, - int xendConfigVersion); + const char *xmldesc, + char **name, + int xendConfigVersion); char * virParseXMLDevice(virConnectPtr conn, - const char *xmldesc, - int hvm, - int xendConfigVersion); + const char *xmldesc, + int hvm, + int xendConfigVersion); int virDomainXMLDevID(virDomainPtr domain, - const char *xmldesc, - char *class, - char *ref, - int ref_len); + const char *xmldesc, + char *class, + char *ref, + int ref_len); #endif #ifdef __cplusplus diff --git a/src/xmlrpc.c b/src/xmlrpc.c index ba0cecfde24591f3a27da0032443ba4e8b248ab7..45715bc3bbd78001b135da3bd4cec7f7c3fee08b 100644 --- a/src/xmlrpc.c +++ b/src/xmlrpc.c @@ -50,38 +50,38 @@ static xmlRpcValuePtr xmlRpcValueNew(xmlRpcValueType type) xmlRpcValuePtr ret = malloc(sizeof(*ret)); if (!ret) - xmlRpcError(VIR_ERR_NO_MEMORY, _("allocate value"), sizeof(*ret)); + xmlRpcError(VIR_ERR_NO_MEMORY, _("allocate value"), sizeof(*ret)); else - ret->kind = type; + ret->kind = type; return ret; } static char *xmlGetText(xmlNodePtr node) { for (node = node->children; node; node = node->next) - if (node->type == XML_TEXT_NODE) { - char *x = strdup((const char *)node->content); - if (!x) + if (node->type == XML_TEXT_NODE) { + char *x = strdup((const char *)node->content); + if (!x) xmlRpcError(VIR_ERR_NO_MEMORY, _("copying node content"), strlen((const char *)node->content)); - return x; - } + return x; + } return NULL; } static xmlNodePtr xmlFirstElement(xmlNodePtr node) { for (node = node->children; node; node = node->next) - if (node->type == XML_ELEMENT_NODE) - break; + if (node->type == XML_ELEMENT_NODE) + break; return node; } static xmlNodePtr xmlNextElement(xmlNodePtr node) { for (node = node->next; node; node = node->next) - if (node->type == XML_ELEMENT_NODE) - break; + if (node->type == XML_ELEMENT_NODE) + break; return node; } @@ -127,9 +127,9 @@ static xmlRpcValuePtr xmlRpcValueUnmarshalBoolean(xmlNodePtr node) if (!ret) return NULL; if (value && atoi(value)) - ret->value.boolean = true; + ret->value.boolean = true; else - ret->value.boolean = false; + ret->value.boolean = false; free(value); return ret; } @@ -156,19 +156,19 @@ static xmlRpcValuePtr xmlRpcValueUnmarshalArray(xmlNodePtr node) return NULL; for (cur = xmlFirstElement(node); cur; cur = xmlNextElement(cur)) - n_elements += 1; + n_elements += 1; elems = malloc(n_elements * sizeof(*elems)); if (!elems) { xmlRpcError(VIR_ERR_NO_MEMORY, _("allocate value array"), n_elements * sizeof(*elems)); - free(ret); - return NULL; + free(ret); + return NULL; } n_elements = 0; for (cur = xmlFirstElement(node); cur; cur = xmlNextElement(cur)) { - elems[n_elements] = xmlRpcValueUnmarshal(cur); - n_elements += 1; + elems[n_elements] = xmlRpcValueUnmarshal(cur); + n_elements += 1; } ret->value.array.elements = elems; @@ -183,24 +183,24 @@ static xmlRpcValueDictElementPtr xmlRpcValueUnmarshalDictElement(xmlNodePtr node xmlNodePtr cur; if (!ret) { - xmlRpcError(VIR_ERR_NO_MEMORY, _("allocate dict"), sizeof(*ret)); - return NULL; + xmlRpcError(VIR_ERR_NO_MEMORY, _("allocate dict"), sizeof(*ret)); + return NULL; } memset(ret, 0, sizeof(*ret)); for (cur = xmlFirstElement(node); cur; cur = xmlNextElement(cur)) { - if (xmlStrEqual(cur->name, BAD_CAST "name")) { - ret->name = xmlGetText(cur); - } else if (xmlStrEqual(cur->name, BAD_CAST "value")) { - ret->value = xmlRpcValueUnmarshal(cur); - } else { + if (xmlStrEqual(cur->name, BAD_CAST "name")) { + ret->name = xmlGetText(cur); + } else if (xmlStrEqual(cur->name, BAD_CAST "value")) { + ret->value = xmlRpcValueUnmarshal(cur); + } else { xmlRpcError(VIR_ERR_XML_ERROR, _("unexpected dict node"), 0); - free(ret->name); - if (ret->value) - xmlRpcValueFree(ret->value); - free(ret); - return NULL; - } + free(ret->name); + if (ret->value) + xmlRpcValueFree(ret->value); + free(ret); + return NULL; + } } ret->next = NULL; @@ -215,17 +215,17 @@ static xmlRpcValuePtr xmlRpcValueUnmarshalDict(xmlNodePtr node) xmlNodePtr cur; if (!ret) - return NULL; + return NULL; ret->value.dict.root = root; for (cur = xmlFirstElement(node); cur; cur = xmlNextElement(cur)) { - *elem = xmlRpcValueUnmarshalDictElement(cur); - if (*elem==NULL) { - xmlRpcValueFree(ret); - return NULL; - } - elem = &(*elem)->next; + *elem = xmlRpcValueUnmarshalDictElement(cur); + if (*elem==NULL) { + xmlRpcValueFree(ret); + return NULL; + } + elem = &(*elem)->next; } return ret; @@ -237,33 +237,33 @@ xmlRpcValuePtr xmlRpcValueUnmarshal(xmlNodePtr node) xmlRpcValuePtr ret = NULL; if (xmlStrEqual(node->name, BAD_CAST "value")) { - n = xmlFirstElement(node); - if (n == NULL) { - ret = xmlRpcValueUnmarshalString(node); - } else { - ret = xmlRpcValueUnmarshal(n); - } + n = xmlFirstElement(node); + if (n == NULL) { + ret = xmlRpcValueUnmarshalString(node); + } else { + ret = xmlRpcValueUnmarshal(n); + } } else if (xmlStrEqual(node->name, BAD_CAST "dateTime.iso8601")) { - ret = xmlRpcValueUnmarshalDateTime(node); + ret = xmlRpcValueUnmarshalDateTime(node); } else if (xmlStrEqual(node->name, BAD_CAST "string")) { - ret = xmlRpcValueUnmarshalString(node); + ret = xmlRpcValueUnmarshalString(node); } else if (xmlStrEqual(node->name, BAD_CAST "base64")) { - ret = xmlRpcValueUnmarshalBase64(node); + ret = xmlRpcValueUnmarshalBase64(node); } else if (xmlStrEqual(node->name, BAD_CAST "i4") || - xmlStrEqual(node->name, BAD_CAST "int")) { - ret = xmlRpcValueUnmarshalInteger(node); + xmlStrEqual(node->name, BAD_CAST "int")) { + ret = xmlRpcValueUnmarshalInteger(node); } else if (xmlStrEqual(node->name, BAD_CAST "boolean")) { - ret = xmlRpcValueUnmarshalBoolean(node); + ret = xmlRpcValueUnmarshalBoolean(node); } else if (xmlStrEqual(node->name, BAD_CAST "double")) { - ret = xmlRpcValueUnmarshalDouble(node); + ret = xmlRpcValueUnmarshalDouble(node); } else if (xmlStrEqual(node->name, BAD_CAST "array")) { - ret = xmlRpcValueUnmarshal(xmlFirstElement(node)); + ret = xmlRpcValueUnmarshal(xmlFirstElement(node)); } else if (xmlStrEqual(node->name, BAD_CAST "data")) { - ret = xmlRpcValueUnmarshalArray(node); + ret = xmlRpcValueUnmarshalArray(node); } else if (xmlStrEqual(node->name, BAD_CAST "struct")) { - ret = xmlRpcValueUnmarshalDict(node); + ret = xmlRpcValueUnmarshalDict(node); } else if (xmlStrEqual(node->name, BAD_CAST "nil")) { - ret = xmlRpcValueNew(XML_RPC_NIL); + ret = xmlRpcValueNew(XML_RPC_NIL); } else { xmlRpcError(VIR_ERR_XML_ERROR, _("unexpected value node"), 0); } @@ -277,29 +277,29 @@ void xmlRpcValueFree(xmlRpcValuePtr value) xmlRpcValueDictElementPtr cur, next; if (value == NULL) - return; + return; switch (value->kind) { case XML_RPC_ARRAY: - for (i = 0; i < value->value.array.n_elements; i++) - xmlRpcValueFree(value->value.array.elements[i]); - free(value->value.array.elements); - break; + for (i = 0; i < value->value.array.n_elements; i++) + xmlRpcValueFree(value->value.array.elements[i]); + free(value->value.array.elements); + break; case XML_RPC_STRUCT: - next = value->value.dict.root; - while (next) { - cur = next; - next = next->next; - free(cur->name); - xmlRpcValueFree(cur->value); - free(cur); - } - break; + next = value->value.dict.root; + while (next) { + cur = next; + next = next->next; + free(cur->name); + xmlRpcValueFree(cur->value); + free(cur); + } + break; case XML_RPC_STRING: - free(value->value.string); - break; + free(value->value.string); + break; default: - break; + break; } free(value); @@ -313,58 +313,58 @@ void xmlRpcValueMarshal(xmlRpcValuePtr value, virBufferPtr buf, int indent) virBufferVSprintf(buf, "%*s", indent, ""); switch (value->kind) { case XML_RPC_ARRAY: - virBufferStrcat(buf, "\n", NULL); - for (i = 0; i < value->value.array.n_elements; i++) - xmlRpcValueMarshal(value->value.array.elements[i], buf, indent+2); - virBufferVSprintf(buf, "%*s", indent, ""); - break; + virBufferStrcat(buf, "\n", NULL); + for (i = 0; i < value->value.array.n_elements; i++) + xmlRpcValueMarshal(value->value.array.elements[i], buf, indent+2); + virBufferVSprintf(buf, "%*s", indent, ""); + break; case XML_RPC_STRUCT: - virBufferStrcat(buf, "\n", NULL); - indent += 2; - for (elem = value->value.dict.root; elem; elem = elem->next) { - virBufferVSprintf(buf, "%*s\n", indent, ""); - virBufferVSprintf(buf, "%*s%s\n", - indent + 2, "", elem->name); - xmlRpcValueMarshal(elem->value, buf, indent + 2); - virBufferVSprintf(buf, "%*s\n", indent, ""); - } - indent -= 2; - virBufferVSprintf(buf, "%*s", indent, ""); - break; + virBufferStrcat(buf, "\n", NULL); + indent += 2; + for (elem = value->value.dict.root; elem; elem = elem->next) { + virBufferVSprintf(buf, "%*s\n", indent, ""); + virBufferVSprintf(buf, "%*s%s\n", + indent + 2, "", elem->name); + xmlRpcValueMarshal(elem->value, buf, indent + 2); + virBufferVSprintf(buf, "%*s\n", indent, ""); + } + indent -= 2; + virBufferVSprintf(buf, "%*s", indent, ""); + break; case XML_RPC_INTEGER: - virBufferVSprintf(buf, "%d", value->value.integer); - break; + virBufferVSprintf(buf, "%d", value->value.integer); + break; case XML_RPC_DOUBLE: - virBufferVSprintf(buf, "%f", value->value.real); - break; + virBufferVSprintf(buf, "%f", value->value.real); + break; case XML_RPC_BOOLEAN: - if (value->value.boolean) - i = 1; - else - i = 0; - virBufferVSprintf(buf, "%d", i); - break; + if (value->value.boolean) + i = 1; + else + i = 0; + virBufferVSprintf(buf, "%d", i); + break; case XML_RPC_DATE_TIME: - /* FIXME */ - TODO - break; + /* FIXME */ + TODO + break; case XML_RPC_BASE64: - /* FIXME */ - TODO - break; + /* FIXME */ + TODO + break; case XML_RPC_STRING: - virBufferStrcat(buf, - "", value->value.string, "", NULL); - break; + virBufferStrcat(buf, + "", value->value.string, "", NULL); + break; case XML_RPC_NIL: - virBufferStrcat(buf, " ", NULL); - break; + virBufferStrcat(buf, " ", NULL); + break; } virBufferStrcat(buf, "\n", NULL); } virBufferPtr xmlRpcMarshalRequest(const char *request, - int argc, xmlRpcValuePtr *argv) + int argc, xmlRpcValuePtr *argv) { virBufferPtr buf; int i; @@ -372,97 +372,97 @@ virBufferPtr xmlRpcMarshalRequest(const char *request, buf = virBufferNew(1024); virBufferStrcat(buf, - "\n" - "\n" - " ", request, "\n" - " \n", NULL); + "\n" + "\n" + " ", request, "\n" + " \n", NULL); for (i = 0; i < argc; i++) { - virBufferStrcat(buf, + virBufferStrcat(buf, " \n", NULL); - xmlRpcValueMarshal(argv[i], buf, 6); - virBufferStrcat(buf, + xmlRpcValueMarshal(argv[i], buf, 6); + virBufferStrcat(buf, " \n", NULL); } virBufferStrcat(buf, " \n" - "\n", NULL); + "\n", NULL); return buf; } xmlRpcValuePtr xmlRpcUnmarshalResponse(xmlNodePtr node, bool *is_fault) { if (!node) - return NULL; + return NULL; if (!xmlStrEqual(node->name, BAD_CAST "methodResponse")) - return NULL; + return NULL; node = xmlFirstElement(node); if (xmlStrEqual(node->name, BAD_CAST "params")) { - node = xmlFirstElement(node); + node = xmlFirstElement(node); - if (!xmlStrEqual(node->name, BAD_CAST "param")) - return NULL; + if (!xmlStrEqual(node->name, BAD_CAST "param")) + return NULL; - *is_fault = false; - return xmlRpcValueUnmarshal(xmlFirstElement(node)); + *is_fault = false; + return xmlRpcValueUnmarshal(xmlFirstElement(node)); } else if (xmlStrEqual(node->name, BAD_CAST "fault")) { - *is_fault = true; - return xmlRpcValueUnmarshal(xmlFirstElement(node)); + *is_fault = true; + return xmlRpcValueUnmarshal(xmlFirstElement(node)); } else - return NULL; + return NULL; } static char *xmlRpcCallRaw(const char *url, const char *request) { - void *cxt; - char *contentType = (char *) "text/xml"; - int len, ret, serrno; - char *response = NULL; - - cxt = xmlNanoHTTPMethod(url, - "POST", - request, - &contentType, - NULL, - strlen(request)); - - if (cxt == NULL) { + void *cxt; + char *contentType = (char *) "text/xml"; + int len, ret, serrno; + char *response = NULL; + + cxt = xmlNanoHTTPMethod(url, + "POST", + request, + &contentType, + NULL, + strlen(request)); + + if (cxt == NULL) { xmlRpcError(VIR_ERR_POST_FAILED, _("send request"), 0); - goto error; - } - - if (contentType && strcmp(contentType, "text/xml") != 0) { - errno = EINVAL; - xmlRpcError(VIR_ERR_POST_FAILED, _("unexpected mime type"), 0); - goto error; - } - - len = xmlNanoHTTPContentLength(cxt); - response = malloc(len + 1); - if (response == NULL) { - xmlRpcError(VIR_ERR_NO_MEMORY, _("allocate response"), len); - goto error; - } - ret = xmlNanoHTTPRead(cxt, response, len); - if (ret != len) { - errno = EINVAL; - free(response); - response = NULL; - xmlRpcError(VIR_ERR_POST_FAILED, _("read response"), 0); - } - - response[len] = 0; + goto error; + } + + if (contentType && strcmp(contentType, "text/xml") != 0) { + errno = EINVAL; + xmlRpcError(VIR_ERR_POST_FAILED, _("unexpected mime type"), 0); + goto error; + } + + len = xmlNanoHTTPContentLength(cxt); + response = malloc(len + 1); + if (response == NULL) { + xmlRpcError(VIR_ERR_NO_MEMORY, _("allocate response"), len); + goto error; + } + ret = xmlNanoHTTPRead(cxt, response, len); + if (ret != len) { + errno = EINVAL; + free(response); + response = NULL; + xmlRpcError(VIR_ERR_POST_FAILED, _("read response"), 0); + } + + response[len] = 0; error: - serrno = errno; - if (cxt) { - xmlNanoHTTPClose(cxt); - free(contentType); - } - errno = serrno; - - return response; + serrno = errno; + if (cxt) { + xmlNanoHTTPClose(cxt); + free(contentType); + } + errno = serrno; + + return response; } static char **xmlRpcStringArray(xmlRpcValuePtr value) @@ -472,29 +472,29 @@ static char **xmlRpcStringArray(xmlRpcValuePtr value) size_t size = 0; if (value->kind != XML_RPC_ARRAY) - return NULL; + return NULL; size = sizeof(char *) * (value->value.array.n_elements + 1); for (i = 0; i < value->value.array.n_elements; i++) - if (value->value.array.elements[i]->kind == XML_RPC_STRING) - size += strlen(value->value.array.elements[i]->value.string) + 1; + if (value->value.array.elements[i]->kind == XML_RPC_STRING) + size += strlen(value->value.array.elements[i]->value.string) + 1; if (!(ptr = malloc(size))) { - xmlRpcError(VIR_ERR_NO_MEMORY, _("allocate string array"), size); - return NULL; + xmlRpcError(VIR_ERR_NO_MEMORY, _("allocate string array"), size); + return NULL; } ret = (char **)ptr; ptr += sizeof(char *) * (value->value.array.n_elements + 1); for (i = 0; i < value->value.array.n_elements; i++) { - if (value->value.array.elements[i]->kind == XML_RPC_STRING) { - char *s = value->value.array.elements[i]->value.string; - strcpy(ptr, s); - ret[i] = ptr; - ptr += strlen(s) + 1; - } else - ret[i] = (char *) ""; + if (value->value.array.elements[i]->kind == XML_RPC_STRING) { + char *s = value->value.array.elements[i]->value.string; + strcpy(ptr, s); + ret[i] = ptr; + ptr += strlen(s) + 1; + } else + ret[i] = (char *) ""; } ret[i] = NULL; @@ -516,32 +516,32 @@ xmlRpcArgvNew(const char *fmt, va_list ap, int *argc) } i = 0; for (ptr = fmt; *ptr; ptr++) { - switch (*ptr) { - case 'i': - if ((argv[i] = xmlRpcValueNew(XML_RPC_INTEGER))) - argv[i]->value.integer = va_arg(ap, int32_t); - break; - case 'f': - if ((argv[i] = xmlRpcValueNew(XML_RPC_DOUBLE))) - argv[i]->value.real = va_arg(ap, double); - break; - case 'b': - if ((argv[i] = xmlRpcValueNew(XML_RPC_BOOLEAN))) - argv[i]->value.boolean = va_arg(ap, int); - break; - case 's': - if ((argv[i] = xmlRpcValueNew(XML_RPC_STRING))) - argv[i]->value.string = strdup(va_arg(ap, const char *)); - break; - default: - argv[i] = NULL; - break; - } - if (argv[i]==NULL) { - xmlRpcArgvFree(i, argv); - return NULL; - } - i++; + switch (*ptr) { + case 'i': + if ((argv[i] = xmlRpcValueNew(XML_RPC_INTEGER))) + argv[i]->value.integer = va_arg(ap, int32_t); + break; + case 'f': + if ((argv[i] = xmlRpcValueNew(XML_RPC_DOUBLE))) + argv[i]->value.real = va_arg(ap, double); + break; + case 'b': + if ((argv[i] = xmlRpcValueNew(XML_RPC_BOOLEAN))) + argv[i]->value.boolean = va_arg(ap, int); + break; + case 's': + if ((argv[i] = xmlRpcValueNew(XML_RPC_STRING))) + argv[i]->value.string = strdup(va_arg(ap, const char *)); + break; + default: + argv[i] = NULL; + break; + } + if (argv[i]==NULL) { + xmlRpcArgvFree(i, argv); + return NULL; + } + i++; } return argv; } @@ -551,15 +551,15 @@ xmlRpcArgvFree(int argc, xmlRpcValuePtr *argv) { int i; if (!argv) - return; + return; for (i = 0; i < argc; i++) - xmlRpcValueFree(argv[i]); + xmlRpcValueFree(argv[i]); free(argv); } int xmlRpcCall(xmlRpcContextPtr context, const char *method, - const char *retfmt, const char *fmt, ...) + const char *retfmt, const char *fmt, ...) { va_list ap; int argc; @@ -575,10 +575,10 @@ int xmlRpcCall(xmlRpcContextPtr context, const char *method, va_start(ap, fmt); if (retfmt && *retfmt) - retval = va_arg(ap, void *); + retval = va_arg(ap, void *); if (!(argv = xmlRpcArgvNew(fmt, ap, &argc))) - return -1; + return -1; va_end(ap); @@ -587,24 +587,24 @@ int xmlRpcCall(xmlRpcContextPtr context, const char *method, xmlRpcArgvFree(argc, argv); if (!buf) - return -1; + return -1; ret = xmlRpcCallRaw(context->uri, buf->content); virBufferFree(buf); if (!ret) - return -1; + return -1; xml = xmlReadDoc((const xmlChar *)ret, "response.xml", NULL, - XML_PARSE_NOENT | XML_PARSE_NONET | - XML_PARSE_NOERROR | XML_PARSE_NOWARNING); + XML_PARSE_NOENT | XML_PARSE_NONET | + XML_PARSE_NOERROR | XML_PARSE_NOWARNING); free(ret); if (xml == NULL) { - errno = EINVAL; - xmlRpcError(VIR_ERR_XML_ERROR, _("parse server response failed"), 0); - return -1; + errno = EINVAL; + xmlRpcError(VIR_ERR_XML_ERROR, _("parse server response failed"), 0); + return -1; } node = xmlDocGetRootElement(xml); @@ -612,46 +612,46 @@ int xmlRpcCall(xmlRpcContextPtr context, const char *method, value = xmlRpcUnmarshalResponse(node, &fault); if (!fault) { - switch (*retfmt) { - case 'i': - if (value->kind == XML_RPC_INTEGER) - *(int32_t *)retval = value->value.integer; - break; - case 'b': - if (value->kind == XML_RPC_BOOLEAN) - *(bool *)retval = value->value.boolean; - break; - case 'f': - if (value->kind == XML_RPC_DOUBLE) - *(double *)retval = value->value.real; - break; - case 's': - if (value->kind == XML_RPC_STRING) - *(char **)retval = strdup(value->value.string); - break; - case 'S': - *(char ***)retval = xmlRpcStringArray(value); - break; - case 'V': - *(xmlRpcValuePtr *)retval = value; - value = NULL; - break; - default: - printf("not supported yet\n"); - break; - } + switch (*retfmt) { + case 'i': + if (value->kind == XML_RPC_INTEGER) + *(int32_t *)retval = value->value.integer; + break; + case 'b': + if (value->kind == XML_RPC_BOOLEAN) + *(bool *)retval = value->value.boolean; + break; + case 'f': + if (value->kind == XML_RPC_DOUBLE) + *(double *)retval = value->value.real; + break; + case 's': + if (value->kind == XML_RPC_STRING) + *(char **)retval = strdup(value->value.string); + break; + case 'S': + *(char ***)retval = xmlRpcStringArray(value); + break; + case 'V': + *(xmlRpcValuePtr *)retval = value; + value = NULL; + break; + default: + printf("not supported yet\n"); + break; + } } xmlFreeDoc(xml); if (fault) { - /* FIXME we need generic dict routines */ - /* FIXME we need faultMessage propagate to libvirt error API */ - context->faultCode = value->value.dict.root->value->value.integer; - context->faultMessage = strdup(value->value.dict.root->next->value->value.string); - xmlRpcValueFree(value); - errno = EFAULT; - return -1; + /* FIXME we need generic dict routines */ + /* FIXME we need faultMessage propagate to libvirt error API */ + context->faultCode = value->value.dict.root->value->value.integer; + context->faultMessage = strdup(value->value.dict.root->next->value->value.string); + xmlRpcValueFree(value); + errno = EFAULT; + return -1; } xmlRpcValueFree(value); @@ -664,8 +664,8 @@ xmlRpcContextPtr xmlRpcContextNew(const char *uri) xmlRpcContextPtr ret = malloc(sizeof(*ret)); if (ret) { - ret->uri = strdup(uri); - ret->faultMessage = NULL; + ret->uri = strdup(uri); + ret->faultMessage = NULL; } else xmlRpcError(VIR_ERR_NO_MEMORY, _("allocate new context"), sizeof(*ret)); @@ -675,9 +675,9 @@ xmlRpcContextPtr xmlRpcContextNew(const char *uri) void xmlRpcContextFree(xmlRpcContextPtr context) { if (context) { - free(context->uri); - free(context->faultMessage); - free(context); + free(context->uri); + free(context->faultMessage); + free(context); } } diff --git a/src/xmlrpc.h b/src/xmlrpc.h index 7ecace105d13b1cbf055e1230298a7a90b02194f..5a36f507b8e2ee21a5a340f548487a641039a3a3 100644 --- a/src/xmlrpc.h +++ b/src/xmlrpc.h @@ -73,14 +73,14 @@ struct _xmlRpcValue { xmlRpcValueType kind; union { - char *string; - xmlRpcValueArray array; - xmlRpcValueDict dict; - int32_t integer; - double real; - bool boolean; - time_t dateTime; - xmlRpcValueBase64 base64; + char *string; + xmlRpcValueArray array; + xmlRpcValueDict dict; + int32_t integer; + double real; + bool boolean; + time_t dateTime; + xmlRpcValueBase64 base64; } value; }; @@ -90,7 +90,7 @@ xmlRpcValuePtr *xmlRpcArgvNew(const char *fmt, va_list ap, int *argc); void xmlRpcArgvFree(int argc, xmlRpcValuePtr *argv); virBufferPtr xmlRpcMarshalRequest(const char *request, - int argc, xmlRpcValuePtr *argv); + int argc, xmlRpcValuePtr *argv); xmlRpcValuePtr xmlRpcUnmarshalResponse(xmlNodePtr node, bool *is_fault); @@ -101,7 +101,7 @@ xmlRpcValuePtr xmlRpcValueUnmarshal(xmlNodePtr node); void xmlRpcValueFree(xmlRpcValuePtr value); int xmlRpcCall(xmlRpcContextPtr context, const char *method, - const char *retval, const char *fmt, ...); + const char *retval, const char *fmt, ...); xmlRpcContextPtr xmlRpcContextNew(const char *uri); diff --git a/src/xs_internal.c b/src/xs_internal.c index c944cd2e11a359c93fdb927135169726189b33b9..b110586929c4eaf888e12a353aa339466f6940b2 100644 --- a/src/xs_internal.c +++ b/src/xs_internal.c @@ -313,21 +313,21 @@ xenStoreOpen(virConnectPtr conn, priv->xshandle = xs_daemon_open_readonly(); #else if (flags & VIR_CONNECT_RO) - priv->xshandle = xs_daemon_open_readonly(); + priv->xshandle = xs_daemon_open_readonly(); else - priv->xshandle = xs_daemon_open(); + priv->xshandle = xs_daemon_open(); #endif /* ! PROXY */ if (priv->xshandle == NULL) { - /* + /* * not being able to connect via the socket as a normal user * is rather normal, this should fallback to the proxy (or * remote) mechanism. - */ + */ if (getuid() == 0) { - virXenStoreError(NULL, VIR_ERR_NO_XEN, - _("failed to connect to Xen Store")); - } + virXenStoreError(NULL, VIR_ERR_NO_XEN, + _("failed to connect to Xen Store")); + } return (-1); } return (0); @@ -382,8 +382,8 @@ xenStoreGetDomainInfo(virDomainPtr domain, virDomainInfoPtr info) if ((domain == NULL) || (domain->conn == NULL) || (info == NULL)) { virXenStoreError(domain ? domain->conn : NULL, VIR_ERR_INVALID_ARG, - __FUNCTION__); - return(-1); + __FUNCTION__); + return(-1); } priv = (xenUnifiedPrivatePtr) domain->conn->privateData; @@ -448,13 +448,13 @@ xenStoreDomainSetMemory(virDomainPtr domain, unsigned long memory) if ((domain == NULL) || (domain->conn == NULL) || (memory < 1024 * MIN_XEN_GUEST_SIZE)) { virXenStoreError(domain ? domain->conn : NULL, VIR_ERR_INVALID_ARG, - __FUNCTION__); - return(-1); + __FUNCTION__); + return(-1); } if (domain->id == -1) return(-1); if ((domain->id == 0) && (memory < (2 * MIN_XEN_GUEST_SIZE * 1024))) - return(-1); + return(-1); snprintf(value, 19, "%lu", memory); value[19] = 0; ret = virDomainDoStoreWrite(domain, "memory/target", &value[0]); @@ -484,8 +484,8 @@ xenStoreDomainGetMaxMemory(virDomainPtr domain) tmp = virDomainDoStoreQuery(domain->conn, domain->id, "memory/target"); if (tmp != NULL) { - ret = (unsigned long) atol(tmp); - free(tmp); + ret = (unsigned long) atol(tmp); + free(tmp); } return(ret); } @@ -519,7 +519,7 @@ xenStoreNumOfDomains(virConnectPtr conn) idlist = xs_directory(priv->xshandle, 0, "/local/domain", &num); if (idlist) { free(idlist); - ret = num; + ret = num; } return(ret); } @@ -545,7 +545,7 @@ xenStoreListDomains(virConnectPtr conn, int *ids, int maxids) if ((conn == NULL) || (ids == NULL)) { virXenStoreError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__); - return(-1); + return(-1); } priv = (xenUnifiedPrivatePtr) conn->privateData; @@ -554,19 +554,19 @@ xenStoreListDomains(virConnectPtr conn, int *ids, int maxids) idlist = xs_directory (priv->xshandle, 0, "/local/domain", &num); if (idlist == NULL) - return(-1); + return(-1); for (ret = 0, i = 0; (i < num) && (ret < maxids); i++) { - id = strtol(idlist[i], &endptr, 10); - if ((endptr == idlist[i]) || (*endptr != 0)) { - ret = -1; - break; - } + id = strtol(idlist[i], &endptr, 10); + if ((endptr == idlist[i]) || (*endptr != 0)) { + ret = -1; + break; + } #if 0 - if (virConnectCheckStoreID(conn, (int) id) < 0) - continue; + if (virConnectCheckStoreID(conn, (int) id) < 0) + continue; #endif - ids[ret++] = (int) id; + ids[ret++] = (int) id; } free(idlist); return(ret); @@ -595,7 +595,7 @@ xenStoreLookupByName(virConnectPtr conn, const char *name) if ((conn == NULL) || (name == NULL)) { virXenStoreError(conn, VIR_ERR_INVALID_ARG, __FUNCTION__); - return(NULL); + return(NULL); } priv = (xenUnifiedPrivatePtr) conn->privateData; @@ -604,7 +604,7 @@ xenStoreLookupByName(virConnectPtr conn, const char *name) idlist = xs_directory(priv->xshandle, 0, "/local/domain", &num); if (idlist == NULL) - goto done; + goto done; for (i = 0; i < num; i++) { id = strtol(idlist[i], &endptr, 10); @@ -635,8 +635,8 @@ xenStoreLookupByName(virConnectPtr conn, const char *name) ret->id = id; done: - free(xenddomain); - free(idlist); + free(xenddomain); + free(idlist); return(ret); } @@ -656,7 +656,7 @@ xenStoreDomainShutdown(virDomainPtr domain) { if ((domain == NULL) || (domain->conn == NULL)) { virXenStoreError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG, - __FUNCTION__); + __FUNCTION__); return(-1); } if (domain->id == -1 || domain->id == 0) @@ -684,7 +684,7 @@ xenStoreDomainReboot(virDomainPtr domain, unsigned int flags ATTRIBUTE_UNUSED) { if ((domain == NULL) || (domain->conn == NULL)) { virXenStoreError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG, - __FUNCTION__); + __FUNCTION__); return(-1); } if (domain->id == -1 || domain->id == 0) @@ -711,7 +711,7 @@ xenStoreDomainGetOSType(virDomainPtr domain) { if ((domain == NULL) || (domain->conn == NULL)) { virXenStoreError((domain ? domain->conn : NULL), VIR_ERR_INVALID_ARG, - __FUNCTION__); + __FUNCTION__); return(NULL); } @@ -798,7 +798,7 @@ xenStoreDomainGetOSTypeID(virConnectPtr conn, int id) { if (vm) { snprintf(query, 199, "%s/image/ostype", vm); - str = xs_read(priv->xshandle, 0, &query[0], &len); + str = xs_read(priv->xshandle, 0, &query[0], &len); free(vm); } if (str == NULL) @@ -843,19 +843,19 @@ xenStoreDomainGetNetworkID(virConnectPtr conn, int id, const char *mac) { snprintf(dir, sizeof(dir), "/local/domain/0/backend/vif/%d", id); list = xs_directory(priv->xshandle, 0, dir, &num); if (list == NULL) - return(NULL); + return(NULL); for (i = 0; i < num; i++) { - snprintf(path, sizeof(path), "%s/%s/%s", dir, list[i], "mac"); - val = xs_read(priv->xshandle, 0, path, &len); - if (val == NULL) - break; - if ((maclen != len) || memcmp(val, mac, len)) { - free(val); - } else { - ret = strdup(list[i]); - free(val); - break; - } + snprintf(path, sizeof(path), "%s/%s/%s", dir, list[i], "mac"); + val = xs_read(priv->xshandle, 0, path, &len); + if (val == NULL) + break; + if ((maclen != len) || memcmp(val, mac, len)) { + free(val); + } else { + ret = strdup(list[i]); + free(val); + break; + } } free(list); return(ret); diff --git a/src/xs_internal.h b/src/xs_internal.h index b0e7dacfd4b65983e7370308589fc256762727b5..8b403f4a4e0e09475424a3eb23da55219fb9729e 100644 --- a/src/xs_internal.h +++ b/src/xs_internal.h @@ -21,41 +21,41 @@ extern struct xenUnifiedDriver xenStoreDriver; int xenStoreInit (void); int xenStoreOpen (virConnectPtr conn, - xmlURIPtr uri, - virConnectAuthPtr auth, - int flags); + xmlURIPtr uri, + virConnectAuthPtr auth, + int flags); int xenStoreClose (virConnectPtr conn); int xenStoreGetDomainInfo (virDomainPtr domain, - virDomainInfoPtr info); + virDomainInfoPtr info); int xenStoreNumOfDomains (virConnectPtr conn); int xenStoreListDomains (virConnectPtr conn, - int *ids, - int maxids); + int *ids, + int maxids); virDomainPtr xenStoreLookupByName(virConnectPtr conn, - const char *name); + const char *name); unsigned long xenStoreGetMaxMemory (virDomainPtr domain); int xenStoreDomainSetMemory (virDomainPtr domain, - unsigned long memory); + unsigned long memory); unsigned long xenStoreDomainGetMaxMemory(virDomainPtr domain); int xenStoreDomainShutdown (virDomainPtr domain); int xenStoreDomainReboot (virDomainPtr domain, - unsigned int flags); + unsigned int flags); /* those are entry point for the proxy */ int xenStoreDomainGetVNCPort(virConnectPtr conn, - int domid); + int domid); char * xenStoreDomainGetConsolePath(virConnectPtr conn, - int domid); + int domid); char * xenStoreDomainGetOSTypeID(virConnectPtr conn, - int id); + int id); char * xenStoreDomainGetNetworkID(virConnectPtr conn, - int id, - const char *mac); + int id, + const char *mac); char * xenStoreDomainGetDiskID(virConnectPtr conn, - int id, - const char *dev); + int id, + const char *dev); char * xenStoreDomainGetName(virConnectPtr conn, - int id); + int id); #ifdef __cplusplus } diff --git a/tests/conftest.c b/tests/conftest.c index 637b737c7734f2936dc725f60f13045575c497d2..14232bdab63f39a73f9e804db9704a341305a4a4 100644 --- a/tests/conftest.c +++ b/tests/conftest.c @@ -15,23 +15,23 @@ int main(int argc, char **argv) { if (argc != 2) { fprintf(stderr, "Usage: %s conf_file\n", argv[0]); - exit(1); + exit(1); } conf = virConfReadFile(argv[1]); if (conf == NULL) { fprintf(stderr, "Failed to process %s\n", argv[1]); - exit(2); + exit(2); } ret = virConfWriteMem(&buffer[0], &len, conf); if (ret < 0) { fprintf(stderr, "Failed to serialize %s back\n", argv[1]); - exit(3); + exit(3); } virConfFree(conf); if (fwrite(buffer, 1, len, stdout) != len) { - fprintf(stderr, "Write failed: %s\n", strerror (errno)); - exit(1); + fprintf(stderr, "Write failed: %s\n", strerror (errno)); + exit(1); } exit(0); } diff --git a/tests/nodeinfotest.c b/tests/nodeinfotest.c index 8cde403337378a5fce1d9cad2684f677d895c718..d53b21246a544ee524df1d89f0574c5afa85b67f 100644 --- a/tests/nodeinfotest.c +++ b/tests/nodeinfotest.c @@ -95,7 +95,7 @@ main(int argc, char **argv) for (i = 0 ; i < (sizeof(nodeData)/sizeof(nodeData[0])) ; i++) if (virtTestRun(nodeData[i], 1, linuxTestNodeInfo, nodeData[i]) != 0) - ret = -1; + ret = -1; #endif exit(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE); diff --git a/tests/reconnect.c b/tests/reconnect.c index 8fcb00ca7878363386a023fae99bd25bc314d2c4..d81f530fe49c6cb15facb0799a98c56bb0d6b523 100644 --- a/tests/reconnect.c +++ b/tests/reconnect.c @@ -8,7 +8,7 @@ #include "internal.h" static void errorHandler(void *userData ATTRIBUTE_UNUSED, - virErrorPtr error ATTRIBUTE_UNUSED) { + virErrorPtr error ATTRIBUTE_UNUSED) { } int main(void) { @@ -22,31 +22,31 @@ int main(void) { conn = virConnectOpen(NULL); if (conn == NULL) { ro = 1; - conn = virConnectOpenReadOnly(NULL); + conn = virConnectOpenReadOnly(NULL); } if (conn == NULL) { fprintf(stderr, "First virConnectOpen() failed\n"); - exit(1); + exit(1); } dom = virDomainLookupByID(conn, id); if (dom == NULL) { fprintf(stderr, "First lookup for domain %d failed\n", id); - exit(1); + exit(1); } virDomainFree(dom); virConnectClose(conn); if (ro == 1) - conn = virConnectOpenReadOnly(NULL); + conn = virConnectOpenReadOnly(NULL); else - conn = virConnectOpen(NULL); + conn = virConnectOpen(NULL); if (conn == NULL) { fprintf(stderr, "Second virConnectOpen() failed\n"); - exit(1); + exit(1); } dom = virDomainLookupByID(conn, id); if (dom == NULL) { fprintf(stderr, "Second lookup for domain %d failed\n", id); - exit(1); + exit(1); } virDomainFree(dom); virConnectClose(conn); diff --git a/tests/sexpr2xmltest.c b/tests/sexpr2xmltest.c index 06c2b01e8123a7be2f20dcb512983f0011a148ce..576ea98800556b5c6e301995f8c421a20906ffac 100644 --- a/tests/sexpr2xmltest.c +++ b/tests/sexpr2xmltest.c @@ -57,20 +57,20 @@ static int testCompareFiles(const char *xml_rel, const char *sexpr_rel, static int testComparePVversion1(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("sexpr2xmldata/sexpr2xml-pv.xml", - "sexpr2xmldata/sexpr2xml-pv.sexpr", - 1); + "sexpr2xmldata/sexpr2xml-pv.sexpr", + 1); } static int testCompareFVversion1(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("sexpr2xmldata/sexpr2xml-fv.xml", - "sexpr2xmldata/sexpr2xml-fv.sexpr", - 1); + "sexpr2xmldata/sexpr2xml-fv.sexpr", + 1); } static int testComparePVversion2(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("sexpr2xmldata/sexpr2xml-pv.xml", - "sexpr2xmldata/sexpr2xml-pv.sexpr", - 2); + "sexpr2xmldata/sexpr2xml-pv.sexpr", + 2); } static int testComparePVOrigVFB(const void *data ATTRIBUTE_UNUSED) { @@ -89,105 +89,105 @@ static int testComparePVNewVFB(const void *data ATTRIBUTE_UNUSED) { static int testCompareFVversion2(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("sexpr2xmldata/sexpr2xml-fv-v2.xml", - "sexpr2xmldata/sexpr2xml-fv-v2.sexpr", - 2); + "sexpr2xmldata/sexpr2xml-fv-v2.sexpr", + 2); } static int testComparePVBootloader(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("sexpr2xmldata/sexpr2xml-pv-bootloader.xml", - "sexpr2xmldata/sexpr2xml-pv-bootloader.sexpr", - 2); + "sexpr2xmldata/sexpr2xml-pv-bootloader.sexpr", + 2); } static int testCompareDiskFile(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("sexpr2xmldata/sexpr2xml-disk-file.xml", - "sexpr2xmldata/sexpr2xml-disk-file.sexpr", - 1); + "sexpr2xmldata/sexpr2xml-disk-file.sexpr", + 1); } static int testCompareDiskBlock(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("sexpr2xmldata/sexpr2xml-disk-block.xml", - "sexpr2xmldata/sexpr2xml-disk-block.sexpr", - 1); + "sexpr2xmldata/sexpr2xml-disk-block.sexpr", + 1); } static int testCompareDiskShareable(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("sexpr2xmldata/sexpr2xml-disk-block-shareable.xml", - "sexpr2xmldata/sexpr2xml-disk-block-shareable.sexpr", - 1); + "sexpr2xmldata/sexpr2xml-disk-block-shareable.sexpr", + 1); } static int testCompareDiskDrvBlktapQcow(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("sexpr2xmldata/sexpr2xml-disk-drv-blktap-qcow.xml", - "sexpr2xmldata/sexpr2xml-disk-drv-blktap-qcow.sexpr", - 1); + "sexpr2xmldata/sexpr2xml-disk-drv-blktap-qcow.sexpr", + 1); } static int testCompareDiskDrvBlktapRaw(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("sexpr2xmldata/sexpr2xml-disk-drv-blktap-raw.xml", - "sexpr2xmldata/sexpr2xml-disk-drv-blktap-raw.sexpr", - 1); + "sexpr2xmldata/sexpr2xml-disk-drv-blktap-raw.sexpr", + 1); } static int testCompareResizedMemory(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("sexpr2xmldata/sexpr2xml-curmem.xml", - "sexpr2xmldata/sexpr2xml-curmem.sexpr", - 1); + "sexpr2xmldata/sexpr2xml-curmem.sexpr", + 1); } static int testCompareNetRouted(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("sexpr2xmldata/sexpr2xml-net-routed.xml", - "sexpr2xmldata/sexpr2xml-net-routed.sexpr", - 1); + "sexpr2xmldata/sexpr2xml-net-routed.sexpr", + 1); } static int testCompareNetBridged(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("sexpr2xmldata/sexpr2xml-net-bridged.xml", - "sexpr2xmldata/sexpr2xml-net-bridged.sexpr", - 1); + "sexpr2xmldata/sexpr2xml-net-bridged.sexpr", + 1); } static int testCompareNoSourceCDRom(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("sexpr2xmldata/sexpr2xml-no-source-cdrom.xml", - "sexpr2xmldata/sexpr2xml-no-source-cdrom.sexpr", - 1); + "sexpr2xmldata/sexpr2xml-no-source-cdrom.sexpr", + 1); } static int testCompareFVInputUSBMouse(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("sexpr2xmldata/sexpr2xml-fv-usbmouse.xml", - "sexpr2xmldata/sexpr2xml-fv-usbmouse.sexpr", - 1); + "sexpr2xmldata/sexpr2xml-fv-usbmouse.sexpr", + 1); } static int testCompareFVInputUSBTablet(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("sexpr2xmldata/sexpr2xml-fv-usbtablet.xml", - "sexpr2xmldata/sexpr2xml-fv-usbtablet.sexpr", - 1); + "sexpr2xmldata/sexpr2xml-fv-usbtablet.sexpr", + 1); } static int testCompareFVclockUTC(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("sexpr2xmldata/sexpr2xml-fv-utc.xml", - "sexpr2xmldata/sexpr2xml-fv-utc.sexpr", - 1); + "sexpr2xmldata/sexpr2xml-fv-utc.sexpr", + 1); } static int testCompareFVclockLocaltime(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("sexpr2xmldata/sexpr2xml-fv-localtime.xml", - "sexpr2xmldata/sexpr2xml-fv-localtime.sexpr", - 1); + "sexpr2xmldata/sexpr2xml-fv-localtime.sexpr", + 1); } static int testCompareFVKernel(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("sexpr2xmldata/sexpr2xml-fv-kernel.xml", - "sexpr2xmldata/sexpr2xml-fv-kernel.sexpr", - 1); + "sexpr2xmldata/sexpr2xml-fv-kernel.sexpr", + 1); } static int testCompareFVLegacyVFB(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("sexpr2xmldata/sexpr2xml-fv-legacy-vfb.xml", - "sexpr2xmldata/sexpr2xml-fv-legacy-vfb.sexpr", - 4); + "sexpr2xmldata/sexpr2xml-fv-legacy-vfb.sexpr", + 4); } @@ -199,27 +199,27 @@ main(int argc, char **argv) progname = argv[0]; if (argc > 1) { - fprintf(stderr, "Usage: %s\n", progname); - exit(EXIT_FAILURE); + fprintf(stderr, "Usage: %s\n", progname); + exit(EXIT_FAILURE); } abs_top_srcdir = getenv("abs_top_srcdir"); if (!abs_top_srcdir) { fprintf(stderr, "missing enviroment variable abs_top_srcdir\n"); - exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } if (virtTestRun("SEXPR-2-XML PV config (version 1)", - 1, testComparePVversion1, NULL) != 0) - ret = -1; + 1, testComparePVversion1, NULL) != 0) + ret = -1; if (virtTestRun("SEXPR-2-XML FV config (version 1)", - 1, testCompareFVversion1, NULL) != 0) - ret = -1; + 1, testCompareFVversion1, NULL) != 0) + ret = -1; if (virtTestRun("SEXPR-2-XML PV config (version 2)", - 1, testComparePVversion2, NULL) != 0) - ret = -1; + 1, testComparePVversion2, NULL) != 0) + ret = -1; if (virtTestRun("SEXPR-2-XML PV config (Orig VFB)", 1, testComparePVOrigVFB, NULL) != 0) @@ -230,71 +230,71 @@ main(int argc, char **argv) ret = -1; if (virtTestRun("SEXPR-2-XML FV config (version 2)", - 1, testCompareFVversion2, NULL) != 0) - ret = -1; + 1, testCompareFVversion2, NULL) != 0) + ret = -1; if (virtTestRun("SEXPR-2-XML PV config bootloader", - 1, testComparePVBootloader, NULL) != 0) - ret = -1; + 1, testComparePVBootloader, NULL) != 0) + ret = -1; if (virtTestRun("SEXPR-2-XML Disk File config", - 1, testCompareDiskFile, NULL) != 0) - ret = -1; + 1, testCompareDiskFile, NULL) != 0) + ret = -1; if (virtTestRun("SEXPR-2-XML Disk Block config", - 1, testCompareDiskBlock, NULL) != 0) - ret = -1; + 1, testCompareDiskBlock, NULL) != 0) + ret = -1; if (virtTestRun("SEXPR-2-XML Disk Block shareable", - 1, testCompareDiskShareable, NULL) != 0) - ret = -1; + 1, testCompareDiskShareable, NULL) != 0) + ret = -1; if (virtTestRun("SEXPR-2-XML Disk Driver blktap qcow config", - 1, testCompareDiskDrvBlktapQcow, NULL) != 0) - ret = -1; + 1, testCompareDiskDrvBlktapQcow, NULL) != 0) + ret = -1; if (virtTestRun("SEXPR-2-XML Disk Driver blktap raw config", - 1, testCompareDiskDrvBlktapRaw, NULL) != 0) - ret = -1; + 1, testCompareDiskDrvBlktapRaw, NULL) != 0) + ret = -1; if (virtTestRun("SEXPR-2-XML Resized memory config", - 1, testCompareResizedMemory, NULL) != 0) - ret = -1; + 1, testCompareResizedMemory, NULL) != 0) + ret = -1; if (virtTestRun("SEXPR-2-XML net routed", - 1, testCompareNetRouted, NULL) != 0) - ret = -1; + 1, testCompareNetRouted, NULL) != 0) + ret = -1; if (virtTestRun("SEXPR-2-XML net bridged", - 1, testCompareNetBridged, NULL) != 0) - ret = -1; + 1, testCompareNetBridged, NULL) != 0) + ret = -1; if (virtTestRun("SEXPR-2-XML no source CDRom", - 1, testCompareNoSourceCDRom, NULL) != 0) - ret = -1; + 1, testCompareNoSourceCDRom, NULL) != 0) + ret = -1; if (virtTestRun("SEXPR-2-XML USB Mouse", - 1, testCompareFVInputUSBMouse, NULL) != 0) - ret = -1; + 1, testCompareFVInputUSBMouse, NULL) != 0) + ret = -1; if (virtTestRun("SEXPR-2-XML USB Tablet", - 1, testCompareFVInputUSBTablet, NULL) != 0) - ret = -1; + 1, testCompareFVInputUSBTablet, NULL) != 0) + ret = -1; if (virtTestRun("SEXPR-2-XML clock UTC", - 1, testCompareFVclockUTC, NULL) != 0) - ret = -1; + 1, testCompareFVclockUTC, NULL) != 0) + ret = -1; if (virtTestRun("SEXPR-2-XML clock Localtime", - 1, testCompareFVclockLocaltime, NULL) != 0) - ret = -1; + 1, testCompareFVclockLocaltime, NULL) != 0) + ret = -1; if (virtTestRun("SEXPR-2-XML FV kernel", - 1, testCompareFVKernel, NULL) != 0) - ret = -1; + 1, testCompareFVKernel, NULL) != 0) + ret = -1; if (virtTestRun("SEXPR-2-XML FV legacy VFB", - 1, testCompareFVLegacyVFB, NULL) != 0) - ret = -1; + 1, testCompareFVLegacyVFB, NULL) != 0) + ret = -1; exit(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE); } diff --git a/tests/virshtest.c b/tests/virshtest.c index 070383bd0057c4f8d7fb9db86ce25a69b534461c..7dbe7c5d6baad278f82f86f8fba71077ff28213f 100644 --- a/tests/virshtest.c +++ b/tests/virshtest.c @@ -13,7 +13,7 @@ static char *abs_top_srcdir; #define MAX_FILE 4096 static int testFilterLine(char *buffer, - const char *toRemove) { + const char *toRemove) { char *start; char *end; @@ -78,8 +78,8 @@ static int testCompareListDefault(const void *data ATTRIBUTE_UNUSED) { NULL }; return testCompareOutput("virshdata/list-default.txt", - NULL, - argv); + NULL, + argv); } static int testCompareListCustom(const void *data ATTRIBUTE_UNUSED) { @@ -89,8 +89,8 @@ static int testCompareListCustom(const void *data ATTRIBUTE_UNUSED) { NULL }; return testCompareOutput("virshdata/list-custom.txt", - NULL, - argv); + NULL, + argv); } @@ -101,8 +101,8 @@ static int testCompareNodeinfoDefault(const void *data ATTRIBUTE_UNUSED) { NULL }; return testCompareOutput("virshdata/nodeinfo-default.txt", - NULL, - argv); + NULL, + argv); } static int testCompareNodeinfoCustom(const void *data ATTRIBUTE_UNUSED) { @@ -112,8 +112,8 @@ static int testCompareNodeinfoCustom(const void *data ATTRIBUTE_UNUSED) { NULL }; return testCompareOutput("virshdata/nodeinfo-custom.txt", - NULL, - argv); + NULL, + argv); } static int testCompareDominfoByID(const void *data ATTRIBUTE_UNUSED) { @@ -124,8 +124,8 @@ static int testCompareDominfoByID(const void *data ATTRIBUTE_UNUSED) { NULL }; return testCompareOutput("virshdata/dominfo-fc4.txt", - "\nCPU time:", - argv); + "\nCPU time:", + argv); } @@ -137,8 +137,8 @@ static int testCompareDominfoByUUID(const void *data ATTRIBUTE_UNUSED) { NULL }; return testCompareOutput("virshdata/dominfo-fc4.txt", - "\nCPU time:", - argv); + "\nCPU time:", + argv); } @@ -150,8 +150,8 @@ static int testCompareDominfoByName(const void *data ATTRIBUTE_UNUSED) { NULL }; return testCompareOutput("virshdata/dominfo-fc4.txt", - "\nCPU time:", - argv); + "\nCPU time:", + argv); } @@ -163,8 +163,8 @@ static int testCompareDomuuidByID(const void *data ATTRIBUTE_UNUSED) { NULL }; return testCompareOutput("virshdata/domuuid-fc4.txt", - NULL, - argv); + NULL, + argv); } static int testCompareDomuuidByName(const void *data ATTRIBUTE_UNUSED) { @@ -175,8 +175,8 @@ static int testCompareDomuuidByName(const void *data ATTRIBUTE_UNUSED) { NULL }; return testCompareOutput("virshdata/domuuid-fc4.txt", - NULL, - argv); + NULL, + argv); } static int testCompareDomidByName(const void *data ATTRIBUTE_UNUSED) { @@ -187,8 +187,8 @@ static int testCompareDomidByName(const void *data ATTRIBUTE_UNUSED) { NULL }; return testCompareOutput("virshdata/domid-fc4.txt", - NULL, - argv); + NULL, + argv); } @@ -200,8 +200,8 @@ static int testCompareDomidByUUID(const void *data ATTRIBUTE_UNUSED) { NULL }; return testCompareOutput("virshdata/domid-fc4.txt", - NULL, - argv); + NULL, + argv); } @@ -213,8 +213,8 @@ static int testCompareDomnameByID(const void *data ATTRIBUTE_UNUSED) { NULL }; return testCompareOutput("virshdata/domname-fc4.txt", - NULL, - argv); + NULL, + argv); } @@ -226,8 +226,8 @@ static int testCompareDomnameByUUID(const void *data ATTRIBUTE_UNUSED) { NULL }; return testCompareOutput("virshdata/domname-fc4.txt", - NULL, - argv); + NULL, + argv); } static int testCompareDomstateByID(const void *data ATTRIBUTE_UNUSED) { @@ -238,8 +238,8 @@ static int testCompareDomstateByID(const void *data ATTRIBUTE_UNUSED) { NULL }; return testCompareOutput("virshdata/domstate-fc4.txt", - NULL, - argv); + NULL, + argv); } @@ -251,8 +251,8 @@ static int testCompareDomstateByUUID(const void *data ATTRIBUTE_UNUSED) { NULL }; return testCompareOutput("virshdata/domstate-fc4.txt", - NULL, - argv); + NULL, + argv); } static int testCompareDomstateByName(const void *data ATTRIBUTE_UNUSED) { @@ -263,8 +263,8 @@ static int testCompareDomstateByName(const void *data ATTRIBUTE_UNUSED) { NULL }; return testCompareOutput("virshdata/domstate-fc4.txt", - NULL, - argv); + NULL, + argv); } @@ -290,67 +290,67 @@ main(int argc, char **argv) } if (virtTestRun("virsh list (default)", - 1, testCompareListDefault, NULL) != 0) + 1, testCompareListDefault, NULL) != 0) ret = -1; if (virtTestRun("virsh list (custom)", - 1, testCompareListCustom, NULL) != 0) + 1, testCompareListCustom, NULL) != 0) ret = -1; if (virtTestRun("virsh nodeinfo (default)", - 1, testCompareNodeinfoDefault, NULL) != 0) + 1, testCompareNodeinfoDefault, NULL) != 0) ret = -1; if (virtTestRun("virsh nodeinfo (custom)", - 1, testCompareNodeinfoCustom, NULL) != 0) + 1, testCompareNodeinfoCustom, NULL) != 0) ret = -1; if (virtTestRun("virsh dominfo (by id)", - 1, testCompareDominfoByID, NULL) != 0) + 1, testCompareDominfoByID, NULL) != 0) ret = -1; if (virtTestRun("virsh dominfo (by uuid)", - 1, testCompareDominfoByUUID, NULL) != 0) + 1, testCompareDominfoByUUID, NULL) != 0) ret = -1; if (virtTestRun("virsh dominfo (by name)", - 1, testCompareDominfoByName, NULL) != 0) + 1, testCompareDominfoByName, NULL) != 0) ret = -1; if (virtTestRun("virsh domid (by name)", - 1, testCompareDomidByName, NULL) != 0) + 1, testCompareDomidByName, NULL) != 0) ret = -1; if (virtTestRun("virsh domid (by uuid)", - 1, testCompareDomidByUUID, NULL) != 0) + 1, testCompareDomidByUUID, NULL) != 0) ret = -1; if (virtTestRun("virsh domuuid (by id)", - 1, testCompareDomuuidByID, NULL) != 0) + 1, testCompareDomuuidByID, NULL) != 0) ret = -1; if (virtTestRun("virsh domuuid (by name)", - 1, testCompareDomuuidByName, NULL) != 0) + 1, testCompareDomuuidByName, NULL) != 0) ret = -1; if (virtTestRun("virsh domname (by id)", - 1, testCompareDomnameByID, NULL) != 0) + 1, testCompareDomnameByID, NULL) != 0) ret = -1; if (virtTestRun("virsh domname (by uuid)", - 1, testCompareDomnameByUUID, NULL) != 0) + 1, testCompareDomnameByUUID, NULL) != 0) ret = -1; if (virtTestRun("virsh domstate (by id)", - 1, testCompareDomstateByID, NULL) != 0) + 1, testCompareDomstateByID, NULL) != 0) ret = -1; if (virtTestRun("virsh domstate (by uuid)", - 1, testCompareDomstateByUUID, NULL) != 0) + 1, testCompareDomstateByUUID, NULL) != 0) ret = -1; if (virtTestRun("virsh domstate (by name)", - 1, testCompareDomstateByName, NULL) != 0) + 1, testCompareDomstateByName, NULL) != 0) ret = -1; exit(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE); diff --git a/tests/xencapstest.c b/tests/xencapstest.c index ff9ed33362a02a466dc78c3c08e3310a8df39b5b..43daaf018a1724d4f375af19d810ed510a159f35 100644 --- a/tests/xencapstest.c +++ b/tests/xencapstest.c @@ -74,23 +74,23 @@ static int testCompareFiles(const char *hostmachine, static int testXeni686(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("i686", - "xencapsdata/xen-i686.xml", - "xencapsdata/xen-i686.cpuinfo", - "xencapsdata/xen-i686.caps"); + "xencapsdata/xen-i686.xml", + "xencapsdata/xen-i686.cpuinfo", + "xencapsdata/xen-i686.caps"); } static int testXeni686PAE(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("i686", - "xencapsdata/xen-i686-pae.xml", - "xencapsdata/xen-i686-pae.cpuinfo", - "xencapsdata/xen-i686-pae.caps"); + "xencapsdata/xen-i686-pae.xml", + "xencapsdata/xen-i686-pae.cpuinfo", + "xencapsdata/xen-i686-pae.caps"); } static int testXeni686PAEHVM(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("i686", - "xencapsdata/xen-i686-pae-hvm.xml", - "xencapsdata/xen-i686-pae-hvm.cpuinfo", - "xencapsdata/xen-i686-pae-hvm.caps"); + "xencapsdata/xen-i686-pae-hvm.xml", + "xencapsdata/xen-i686-pae-hvm.cpuinfo", + "xencapsdata/xen-i686-pae-hvm.caps"); } /* No PAE + HVM is non-sensical - all VMX capable @@ -98,56 +98,56 @@ static int testXeni686PAEHVM(const void *data ATTRIBUTE_UNUSED) { /* static int testXeni686HVM(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("i686", - "xencapsdata/xen-i686-hvm.xml", - "xencapsdata/xen-i686.cpuinfo", - "xencapsdata/xen-i686-hvm.caps"); + "xencapsdata/xen-i686-hvm.xml", + "xencapsdata/xen-i686.cpuinfo", + "xencapsdata/xen-i686-hvm.caps"); } */ static int testXenx86_64(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("x86_64", - "xencapsdata/xen-x86_64.xml", - "xencapsdata/xen-x86_64.cpuinfo", - "xencapsdata/xen-x86_64.caps"); + "xencapsdata/xen-x86_64.xml", + "xencapsdata/xen-x86_64.cpuinfo", + "xencapsdata/xen-x86_64.caps"); } static int testXenx86_64HVM(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("x86_64", - "xencapsdata/xen-x86_64-hvm.xml", - "xencapsdata/xen-x86_64-hvm.cpuinfo", - "xencapsdata/xen-x86_64-hvm.caps"); + "xencapsdata/xen-x86_64-hvm.xml", + "xencapsdata/xen-x86_64-hvm.cpuinfo", + "xencapsdata/xen-x86_64-hvm.caps"); } static int testXenia64(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("ia64", - "xencapsdata/xen-ia64.xml", - "xencapsdata/xen-ia64.cpuinfo", - "xencapsdata/xen-ia64.caps"); + "xencapsdata/xen-ia64.xml", + "xencapsdata/xen-ia64.cpuinfo", + "xencapsdata/xen-ia64.caps"); } static int testXenia64BE(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("ia64", - "xencapsdata/xen-ia64-be.xml", - "xencapsdata/xen-ia64-be.cpuinfo", - "xencapsdata/xen-ia64-be.caps"); + "xencapsdata/xen-ia64-be.xml", + "xencapsdata/xen-ia64-be.cpuinfo", + "xencapsdata/xen-ia64-be.caps"); } static int testXenia64HVM(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("ia64", - "xencapsdata/xen-ia64-hvm.xml", - "xencapsdata/xen-ia64-hvm.cpuinfo", - "xencapsdata/xen-ia64-hvm.caps"); + "xencapsdata/xen-ia64-hvm.xml", + "xencapsdata/xen-ia64-hvm.cpuinfo", + "xencapsdata/xen-ia64-hvm.caps"); } static int testXenia64BEHVM(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("ia64", - "xencapsdata/xen-ia64-be-hvm.xml", - "xencapsdata/xen-ia64-be-hvm.cpuinfo", - "xencapsdata/xen-ia64-be-hvm.caps"); + "xencapsdata/xen-ia64-be-hvm.xml", + "xencapsdata/xen-ia64-be-hvm.cpuinfo", + "xencapsdata/xen-ia64-be-hvm.caps"); } static int testXenppc64(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("ppc64", - "xencapsdata/xen-ppc64.xml", - "xencapsdata/xen-ppc64.cpuinfo", - "xencapsdata/xen-ppc64.caps"); + "xencapsdata/xen-ppc64.xml", + "xencapsdata/xen-ppc64.cpuinfo", + "xencapsdata/xen-ppc64.caps"); } @@ -159,8 +159,8 @@ main(int argc, char **argv) progname = argv[0]; if (argc > 1) { - fprintf(stderr, "Usage: %s\n", progname); - exit(EXIT_FAILURE); + fprintf(stderr, "Usage: %s\n", progname); + exit(EXIT_FAILURE); } abs_top_srcdir = getenv("abs_top_srcdir"); @@ -170,51 +170,51 @@ main(int argc, char **argv) virInitialize(); if (virtTestRun("Capabilities for i686, no PAE, no HVM", - 1, testXeni686, NULL) != 0) - ret = -1; + 1, testXeni686, NULL) != 0) + ret = -1; if (virtTestRun("Capabilities for i686, PAE, no HVM", - 1, testXeni686PAE, NULL) != 0) - ret = -1; + 1, testXeni686PAE, NULL) != 0) + ret = -1; /* No PAE + HVM is non-sensical - all VMX capable CPUs have PAE */ /*if (virtTestRun("Capabilities for i686, no PAE, HVM", - 1, testXeni686HVM, NULL) != 0) - ret = -1; + 1, testXeni686HVM, NULL) != 0) + ret = -1; */ if (virtTestRun("Capabilities for i686, PAE, HVM", - 1, testXeni686PAEHVM, NULL) != 0) - ret = -1; + 1, testXeni686PAEHVM, NULL) != 0) + ret = -1; if (virtTestRun("Capabilities for x86_64, no HVM", - 1, testXenx86_64, NULL) != 0) - ret = -1; + 1, testXenx86_64, NULL) != 0) + ret = -1; if (virtTestRun("Capabilities for x86_64, HVM", - 1, testXenx86_64HVM, NULL) != 0) - ret = -1; + 1, testXenx86_64HVM, NULL) != 0) + ret = -1; if (virtTestRun("Capabilities for ia64, no HVM, LE", - 1, testXenia64, NULL) != 0) - ret = -1; + 1, testXenia64, NULL) != 0) + ret = -1; if (virtTestRun("Capabilities for ia64, HVM, LE", - 1, testXenia64HVM, NULL) != 0) - ret = -1; + 1, testXenia64HVM, NULL) != 0) + ret = -1; if (virtTestRun("Capabilities for ia64, no HVM, BE", - 1, testXenia64BE, NULL) != 0) - ret = -1; + 1, testXenia64BE, NULL) != 0) + ret = -1; if (virtTestRun("Capabilities for ia64, HVM, BE", - 1, testXenia64BEHVM, NULL) != 0) - ret = -1; + 1, testXenia64BEHVM, NULL) != 0) + ret = -1; if (virtTestRun("Capabilities for ppc64", - 1, testXenppc64, NULL) != 0) - ret = -1; + 1, testXenppc64, NULL) != 0) + ret = -1; exit(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE); diff --git a/tests/xml2sexprtest.c b/tests/xml2sexprtest.c index 2ebd4092cfabb547a03a07578c4c55a8ecb523e3..d87a852a9d66c6f9fa65a9915ea7928971ecde69 100644 --- a/tests/xml2sexprtest.c +++ b/tests/xml2sexprtest.c @@ -44,8 +44,8 @@ static int testCompareFiles(const char *xml_rel, const char *sexpr_rel, if (strcmp(sexprData, gotsexpr)) { if (getenv("DEBUG_TESTS")) { - printf("Expect %d '%s'\n", (int)strlen(sexprData), sexprData); - printf("Actual %d '%s'\n", (int)strlen(gotsexpr), gotsexpr); + printf("Expect %d '%s'\n", (int)strlen(sexprData), sexprData); + printf("Actual %d '%s'\n", (int)strlen(gotsexpr), gotsexpr); } goto fail; } @@ -67,43 +67,43 @@ static int testCompareFiles(const char *xml_rel, const char *sexpr_rel, static int testComparePVversion1(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("xml2sexprdata/xml2sexpr-pv.xml", - "xml2sexprdata/xml2sexpr-pv.sexpr", - "pvtest", - 1); + "xml2sexprdata/xml2sexpr-pv.sexpr", + "pvtest", + 1); } static int testCompareFVversion1(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("xml2sexprdata/xml2sexpr-fv.xml", - "xml2sexprdata/xml2sexpr-fv.sexpr", - "fvtest", - 1); + "xml2sexprdata/xml2sexpr-fv.sexpr", + "fvtest", + 1); } static int testComparePVversion2(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("xml2sexprdata/xml2sexpr-pv.xml", - "xml2sexprdata/xml2sexpr-pv.sexpr", - "pvtest", - 2); + "xml2sexprdata/xml2sexpr-pv.sexpr", + "pvtest", + 2); } static int testCompareFVversion2(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("xml2sexprdata/xml2sexpr-fv.xml", - "xml2sexprdata/xml2sexpr-fv-v2.sexpr", - "fvtest", - 2); + "xml2sexprdata/xml2sexpr-fv-v2.sexpr", + "fvtest", + 2); } static int testCompareFVversion2VNC(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("xml2sexprdata/xml2sexpr-fv-vncunused.xml", - "xml2sexprdata/xml2sexpr-fv-vncunused.sexpr", - "fvtest", - 2); + "xml2sexprdata/xml2sexpr-fv-vncunused.sexpr", + "fvtest", + 2); } static int testComparePVOrigVFB(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("xml2sexprdata/xml2sexpr-pv-vfb-orig.xml", "xml2sexprdata/xml2sexpr-pv-vfb-orig.sexpr", - "pvtest", + "pvtest", 2); } @@ -111,135 +111,135 @@ static int testComparePVOrigVFB(const void *data ATTRIBUTE_UNUSED) { static int testComparePVNewVFB(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("xml2sexprdata/xml2sexpr-pv-vfb-new.xml", "xml2sexprdata/xml2sexpr-pv-vfb-new.sexpr", - "pvtest", + "pvtest", 3); } static int testComparePVBootloader(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("xml2sexprdata/xml2sexpr-pv-bootloader.xml", - "xml2sexprdata/xml2sexpr-pv-bootloader.sexpr", - "pvtest", - 1); + "xml2sexprdata/xml2sexpr-pv-bootloader.sexpr", + "pvtest", + 1); } static int testCompareDiskFile(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("xml2sexprdata/xml2sexpr-disk-file.xml", - "xml2sexprdata/xml2sexpr-disk-file.sexpr", - "pvtest", - 2); + "xml2sexprdata/xml2sexpr-disk-file.sexpr", + "pvtest", + 2); } static int testCompareDiskBlock(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("xml2sexprdata/xml2sexpr-disk-block.xml", - "xml2sexprdata/xml2sexpr-disk-block.sexpr", - "pvtest", - 2); + "xml2sexprdata/xml2sexpr-disk-block.sexpr", + "pvtest", + 2); } static int testCompareDiskShareable(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("xml2sexprdata/xml2sexpr-disk-block-shareable.xml", - "xml2sexprdata/xml2sexpr-disk-block-shareable.sexpr", - "pvtest", - 2); + "xml2sexprdata/xml2sexpr-disk-block-shareable.sexpr", + "pvtest", + 2); } static int testCompareDiskDrvLoop(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("xml2sexprdata/xml2sexpr-disk-drv-loop.xml", - "xml2sexprdata/xml2sexpr-disk-drv-loop.sexpr", - "pvtest", - 2); + "xml2sexprdata/xml2sexpr-disk-drv-loop.sexpr", + "pvtest", + 2); } static int testCompareDiskDrvBlkback(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("xml2sexprdata/xml2sexpr-disk-drv-blkback.xml", - "xml2sexprdata/xml2sexpr-disk-drv-blkback.sexpr", - "pvtest", - 2); + "xml2sexprdata/xml2sexpr-disk-drv-blkback.sexpr", + "pvtest", + 2); } static int testCompareDiskDrvBlktap(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("xml2sexprdata/xml2sexpr-disk-drv-blktap.xml", - "xml2sexprdata/xml2sexpr-disk-drv-blktap.sexpr", - "pvtest", - 2); + "xml2sexprdata/xml2sexpr-disk-drv-blktap.sexpr", + "pvtest", + 2); } static int testCompareDiskDrvBlktapQcow(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("xml2sexprdata/xml2sexpr-disk-drv-blktap-qcow.xml", - "xml2sexprdata/xml2sexpr-disk-drv-blktap-qcow.sexpr", - "pvtest", - 2); + "xml2sexprdata/xml2sexpr-disk-drv-blktap-qcow.sexpr", + "pvtest", + 2); } static int testCompareDiskDrvBlktapRaw(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("xml2sexprdata/xml2sexpr-disk-drv-blktap-raw.xml", - "xml2sexprdata/xml2sexpr-disk-drv-blktap-raw.sexpr", - "pvtest", - 2); + "xml2sexprdata/xml2sexpr-disk-drv-blktap-raw.sexpr", + "pvtest", + 2); } static int testCompareMemoryResize(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("xml2sexprdata/xml2sexpr-curmem.xml", - "xml2sexprdata/xml2sexpr-curmem.sexpr", - "rhel5", - 2); + "xml2sexprdata/xml2sexpr-curmem.sexpr", + "rhel5", + 2); } static int testCompareNetRouted(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("xml2sexprdata/xml2sexpr-net-routed.xml", - "xml2sexprdata/xml2sexpr-net-routed.sexpr", - "pvtest", - 2); + "xml2sexprdata/xml2sexpr-net-routed.sexpr", + "pvtest", + 2); } static int testCompareNetBridged(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("xml2sexprdata/xml2sexpr-net-bridged.xml", - "xml2sexprdata/xml2sexpr-net-bridged.sexpr", - "pvtest", - 2); + "xml2sexprdata/xml2sexpr-net-bridged.sexpr", + "pvtest", + 2); } static int testCompareNoSourceCDRom(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("xml2sexprdata/xml2sexpr-no-source-cdrom.xml", - "xml2sexprdata/xml2sexpr-no-source-cdrom.sexpr", - "test", - 2); + "xml2sexprdata/xml2sexpr-no-source-cdrom.sexpr", + "test", + 2); } static int testCompareFVclockUTC(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("xml2sexprdata/xml2sexpr-fv-utc.xml", - "xml2sexprdata/xml2sexpr-fv-utc.sexpr", - "fvtest", - 1); + "xml2sexprdata/xml2sexpr-fv-utc.sexpr", + "fvtest", + 1); } static int testCompareFVclockLocaltime(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("xml2sexprdata/xml2sexpr-fv-localtime.xml", - "xml2sexprdata/xml2sexpr-fv-localtime.sexpr", - "fvtest", - 1); + "xml2sexprdata/xml2sexpr-fv-localtime.sexpr", + "fvtest", + 1); } static int testCompareFVInputUSBMouse(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("xml2sexprdata/xml2sexpr-fv-usbmouse.xml", - "xml2sexprdata/xml2sexpr-fv-usbmouse.sexpr", - "fvtest", - 1); + "xml2sexprdata/xml2sexpr-fv-usbmouse.sexpr", + "fvtest", + 1); } static int testCompareFVInputUSBTablet(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("xml2sexprdata/xml2sexpr-fv-usbtablet.xml", - "xml2sexprdata/xml2sexpr-fv-usbtablet.sexpr", - "fvtest", - 1); + "xml2sexprdata/xml2sexpr-fv-usbtablet.sexpr", + "fvtest", + 1); } static int testCompareFVKernel(const void *data ATTRIBUTE_UNUSED) { return testCompareFiles("xml2sexprdata/xml2sexpr-fv-kernel.xml", - "xml2sexprdata/xml2sexpr-fv-kernel.sexpr", - "fvtest", - 1); + "xml2sexprdata/xml2sexpr-fv-kernel.sexpr", + "fvtest", + 1); } @@ -254,34 +254,34 @@ main(int argc, char **argv) abs_top_srcdir = getenv("abs_top_srcdir"); if (!abs_top_srcdir) { fprintf(stderr, "missing enviroment variable abs_top_srcdir\n"); - exit(EXIT_FAILURE); + exit(EXIT_FAILURE); } if (argc > 1) { - fprintf(stderr, "Usage: %s\n", progname); - exit(EXIT_FAILURE); + fprintf(stderr, "Usage: %s\n", progname); + exit(EXIT_FAILURE); } if (virtTestRun("XML-2-SEXPR PV config (format 1)", - 1, testComparePVversion1, NULL) != 0) - ret = -1; + 1, testComparePVversion1, NULL) != 0) + ret = -1; if (virtTestRun("XML-2-SEXPR FV config (format 1)", - 1, testCompareFVversion1, NULL) != 0) - ret = -1; + 1, testCompareFVversion1, NULL) != 0) + ret = -1; if (virtTestRun("XML-2-SEXPR PV config (format 2)", - 1, testComparePVversion2, NULL) != 0) - ret = -1; + 1, testComparePVversion2, NULL) != 0) + ret = -1; if (virtTestRun("XML-2-SEXPR FV config (format 2)", - 1, testCompareFVversion2, NULL) != 0) - ret = -1; + 1, testCompareFVversion2, NULL) != 0) + ret = -1; if (virtTestRun("XML-2-SEXPR FV config (format 2, VNC unused)", - 1, testCompareFVversion2VNC, NULL) != 0) - ret = -1; + 1, testCompareFVversion2VNC, NULL) != 0) + ret = -1; if (virtTestRun("XML-2-SEXPR PV config (Orig VFB)", 1, testComparePVOrigVFB, NULL) != 0) @@ -292,75 +292,75 @@ main(int argc, char **argv) ret = -1; if (virtTestRun("XML-2-SEXPR PV config with bootloader", - 1, testComparePVBootloader, NULL) != 0) - ret = -1; + 1, testComparePVBootloader, NULL) != 0) + ret = -1; if (virtTestRun("XML-2-SEXPR Disk File", - 1, testCompareDiskFile, NULL) != 0) - ret = -1; + 1, testCompareDiskFile, NULL) != 0) + ret = -1; if (virtTestRun("XML-2-SEXPR Disk Block", - 1, testCompareDiskBlock, NULL) != 0) - ret = -1; + 1, testCompareDiskBlock, NULL) != 0) + ret = -1; if (virtTestRun("XML-2-SEXPR Disk Shareable", - 1, testCompareDiskShareable, NULL) != 0) - ret = -1; + 1, testCompareDiskShareable, NULL) != 0) + ret = -1; if (virtTestRun("XML-2-SEXPR Disk Drv Loop", - 1, testCompareDiskDrvLoop, NULL) != 0) - ret = -1; + 1, testCompareDiskDrvLoop, NULL) != 0) + ret = -1; if (virtTestRun("XML-2-SEXPR Disk Drv Blkback", - 1, testCompareDiskDrvBlkback, NULL) != 0) - ret = -1; + 1, testCompareDiskDrvBlkback, NULL) != 0) + ret = -1; if (virtTestRun("XML-2-SEXPR Disk Drv Blktap", - 1, testCompareDiskDrvBlktap, NULL) != 0) - ret = -1; + 1, testCompareDiskDrvBlktap, NULL) != 0) + ret = -1; if (virtTestRun("XML-2-SEXPR Disk Drv Blktap QCow", - 1, testCompareDiskDrvBlktapQcow, NULL) != 0) - ret = -1; + 1, testCompareDiskDrvBlktapQcow, NULL) != 0) + ret = -1; if (virtTestRun("XML-2-SEXPR Disk Drv Blktap Raw", - 1, testCompareDiskDrvBlktapRaw, NULL) != 0) - ret = -1; + 1, testCompareDiskDrvBlktapRaw, NULL) != 0) + ret = -1; if (virtTestRun("XML-2-SEXPR Memory Resize", - 1, testCompareMemoryResize, NULL) != 0) - ret = -1; + 1, testCompareMemoryResize, NULL) != 0) + ret = -1; if (virtTestRun("XML-2-SEXPR Net Routed", - 1, testCompareNetRouted, NULL) != 0) - ret = -1; + 1, testCompareNetRouted, NULL) != 0) + ret = -1; if (virtTestRun("XML-2-SEXPR Net Bridged", - 1, testCompareNetBridged, NULL) != 0) - ret = -1; + 1, testCompareNetBridged, NULL) != 0) + ret = -1; if (virtTestRun("XML-2-SEXPR No Source CDRom", - 1, testCompareNoSourceCDRom, NULL) != 0) - ret = -1; + 1, testCompareNoSourceCDRom, NULL) != 0) + ret = -1; if (virtTestRun("XML-2-SEXPR FV usb mouse)", - 1, testCompareFVInputUSBMouse, NULL) != 0) - ret = -1; + 1, testCompareFVInputUSBMouse, NULL) != 0) + ret = -1; if (virtTestRun("XML-2-SEXPR FV usb tablet)", - 1, testCompareFVInputUSBTablet, NULL) != 0) - ret = -1; + 1, testCompareFVInputUSBTablet, NULL) != 0) + ret = -1; if (virtTestRun("XML-2-SEXPR clock UTC", - 1, testCompareFVclockUTC, NULL) != 0) - ret = -1; + 1, testCompareFVclockUTC, NULL) != 0) + ret = -1; if (virtTestRun("XML-2-SEXPR clock Localtime", - 1, testCompareFVclockLocaltime, NULL) != 0) - ret = -1; + 1, testCompareFVclockLocaltime, NULL) != 0) + ret = -1; if (virtTestRun("XML-2-SEXPR FV kernel", - 1, testCompareFVKernel, NULL) != 0) - ret = -1; + 1, testCompareFVKernel, NULL) != 0) + ret = -1; exit(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE); } diff --git a/tests/xmlrpctest.c b/tests/xmlrpctest.c index 5c16b0b9a3caf628d85b4ac2d75d8089279dcd47..1e1bb7ade2bfdfe026f8edc041bb122cc72c41e1 100644 --- a/tests/xmlrpctest.c +++ b/tests/xmlrpctest.c @@ -205,29 +205,29 @@ testBufferVSprintf(const void *data ATTRIBUTE_UNUSED) int main(int argc, char **argv) { - xmlRpcContextPtr cxt = NULL; + xmlRpcContextPtr cxt = NULL; int check = 1; - int ret = 0; + int ret = 0; const char *url = "http://localhost:8000"; - progname = argv[0]; + progname = argv[0]; - if (argc > 2) - { - fprintf(stderr, "Usage: %s [url]\n", progname); - exit(EXIT_FAILURE); - } + if (argc > 2) + { + fprintf(stderr, "Usage: %s [url]\n", progname); + exit(EXIT_FAILURE); + } if (argc == 2) url = argv[1]; /* * client-server tests */ - if (!(cxt = xmlRpcContextNew(url))) - { - fprintf(stderr, "%s: failed create new RPC context\n", progname); - exit(EXIT_FAILURE); - } + if (!(cxt = xmlRpcContextNew(url))) + { + fprintf(stderr, "%s: failed create new RPC context\n", progname); + exit(EXIT_FAILURE); + } if (virtTestRun("XML-RPC methodCall INT+INT", NLOOPS, testMethodPlusINT, (const void *) cxt) != 0) @@ -237,7 +237,7 @@ main(int argc, char **argv) NLOOPS, testMethodPlusDOUBLE, (const void *) cxt) != 0) ret = -1; - xmlRpcContextFree(cxt); + xmlRpcContextFree(cxt); /* * regression / performance tests @@ -269,7 +269,7 @@ main(int argc, char **argv) ret = -1; - exit(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE); + exit(ret==0 ? EXIT_SUCCESS : EXIT_FAILURE); }