提交 5bf824ea 编写于 作者: J 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
上级 dc42a9d2
2008-04-10 Jim Meyering <meyering@redhat.com>
Thu Apr 10 18:54:03 CEST 2008 Jim Meyering <meyering@redhat.com>
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:
......
......@@ -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() {
......
......@@ -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);
}
......@@ -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);
......
......@@ -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);
......
......@@ -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
......
此差异已折叠。
......@@ -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);
......
......@@ -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
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
......@@ -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;
......
......@@ -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);
......
......@@ -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)))
......
......@@ -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;
};
......
......@@ -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)
......
......@@ -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.
......
......@@ -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);
......
......@@ -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);
......
此差异已折叠。
此差异已折叠。
......@@ -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
此差异已折叠。
......@@ -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 */
......
......@@ -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;
}
......
此差异已折叠。
......@@ -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);
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册