提交 86f6748b 编写于 作者: E Eric Blake

maint: fix comma style issues: xen

Most of our code base uses space after comma but not before;
fix the remaining uses before adding a syntax check.

* src/libxl/libxl_driver.c: Consistently use commas.
* src/xen/xend_internal.c: Likewise.
* src/xen/xs_internal.c: Likewise.
* src/xenapi/xenapi_driver.c: Likewise.
* src/xenapi/xenapi_utils.c: Likewise.
* src/xenxs/xen_sxpr.c: Likewise.
* src/xenxs/xen_xm.c: Likewise.
Signed-off-by: NEric Blake <eblake@redhat.com>
上级 6f4901e1
......@@ -1501,7 +1501,7 @@ libxlDomainDestroyFlags(virDomainPtr dom,
goto cleanup;
}
event = virDomainEventNewFromObj(vm,VIR_DOMAIN_EVENT_STOPPED,
event = virDomainEventNewFromObj(vm, VIR_DOMAIN_EVENT_STOPPED,
VIR_DOMAIN_EVENT_STOPPED_DESTROYED);
if (libxlVmReap(driver, vm, VIR_DOMAIN_SHUTOFF_DESTROYED) != 0) {
......
......@@ -549,7 +549,7 @@ xend_op(virConnectPtr xend, const char *name, const char *key, ...)
* Returns a parsed S-Expression in case of success, NULL in case of failure
*/
static struct sexpr *sexpr_get(virConnectPtr xend, const char *fmt, ...)
ATTRIBUTE_FMT_PRINTF(2,3);
ATTRIBUTE_FMT_PRINTF(2, 3);
static struct sexpr *
sexpr_get(virConnectPtr xend, const char *fmt, ...)
......
......@@ -815,7 +815,7 @@ retry:
if (new_domain_cnt < 0)
return -1;
if (VIR_ALLOC_N(new_domids,new_domain_cnt) < 0)
if (VIR_ALLOC_N(new_domids, new_domain_cnt) < 0)
return -1;
nread = xenStoreDoListDomains(conn, priv, new_domids, new_domain_cnt);
if (nread != new_domain_cnt) {
......@@ -898,7 +898,7 @@ retry:
if (new_domain_cnt < 0)
return -1;
if (VIR_ALLOC_N(new_domids,new_domain_cnt) < 0)
if (VIR_ALLOC_N(new_domids, new_domain_cnt) < 0)
return -1;
nread = xenStoreDoListDomains(conn, priv, new_domids, new_domain_cnt);
if (nread != new_domain_cnt) {
......
/*
* xenapi_driver.c: Xen API driver.
* Copyright (C) 2011-2012 Red Hat, Inc.
* Copyright (C) 2011-2013 Red Hat, Inc.
* Copyright (C) 2009, 2010 Citrix Ltd.
*
* This library is free software; you can redistribute it and/or
......@@ -637,7 +637,7 @@ xenapiDomainLookupByUUID(virConnectPtr conn,
char uuidStr[VIR_UUID_STRING_BUFLEN];
virDomainPtr domP = NULL;
xen_session *session = ((struct _xenapiPrivate *)(conn->privateData))->session;
virUUIDFormat(uuid,uuidStr);
virUUIDFormat(uuid, uuidStr);
if (xen_vm_get_by_uuid(session, &vm, uuidStr)) {
xen_vm_get_record(session, &record, vm);
if (record != NULL) {
......@@ -1393,7 +1393,7 @@ xenapiDomainGetXMLDesc(virDomainPtr dom, unsigned int flags)
if (VIR_STRDUP(defPtr->name, dom->name) < 0)
goto error;
xen_vm_get_hvm_boot_policy(session, &boot_policy, vm);
if (STREQ(boot_policy,"BIOS order")) {
if (STREQ(boot_policy, "BIOS order")) {
if (VIR_STRDUP(defPtr->os.type, "hvm") < 0) {
VIR_FREE(boot_policy);
goto error;
......@@ -2019,7 +2019,7 @@ write_func(void *ptr, size_t size, size_t nmemb, void *comms_)
size_t n = size * nmemb;
#ifdef PRINT_XML
printf("\n\n---Result from server -----------------------\n");
printf("%s\n",((char*) ptr));
printf("%s\n", (char*) ptr);
fflush(stdout);
#endif
return (size_t) (comms->func(ptr, n, comms->handle) ? n : 0);
......@@ -2036,7 +2036,7 @@ call_func(const void *data, size_t len, void *user_handle,
struct _xenapiPrivate *priv = (struct _xenapiPrivate *)user_handle;
#ifdef PRINT_XML
printf("\n\n---Data to server: -----------------------\n");
printf("%s\n",((char*) data));
printf("%s\n", (char*) data);
fflush(stdout);
#endif
CURL *curl = curl_easy_init();
......
/*
* xenapi_utils.c: Xen API driver -- utils parts.
* Copyright (C) 2011-2012 Red Hat, Inc.
* Copyright (C) 2011-2013 Red Hat, Inc.
* Copyright (C) 2009, 2010 Citrix Ltd.
*
* This library is free software; you can redistribute it and/or
......@@ -172,7 +172,7 @@ createXenAPIBootOrderString(int nboot, int *bootDevs)
else if (bootDevs[i] == VIR_DOMAIN_BOOT_NET)
val = (char *)"n";
if (val)
virBufferEscapeString(&ret,"%s",val);
virBufferEscapeString(&ret, "%s", val);
}
return virBufferContentAndReset(&ret);
}
......@@ -231,20 +231,20 @@ xenapiCrashExitEnum2virDomainLifecycle(enum xen_on_crash_behaviour action)
int
getStorageVolumeType(char *type)
{
if (STREQ(type,"lvmoiscsi") ||
STREQ(type,"lvmohba") ||
STREQ(type,"lvm") ||
STREQ(type,"file") ||
STREQ(type,"iso") ||
STREQ(type,"ext") ||
STREQ(type,"nfs"))
if (STREQ(type, "lvmoiscsi") ||
STREQ(type, "lvmohba") ||
STREQ(type, "lvm") ||
STREQ(type, "file") ||
STREQ(type, "iso") ||
STREQ(type, "ext") ||
STREQ(type, "nfs"))
return (int)VIR_STORAGE_VOL_FILE;
else if (STREQ(type,"iscsi") ||
STREQ(type,"equal") ||
STREQ(type,"hba") ||
STREQ(type,"cslg") ||
STREQ(type,"udev") ||
STREQ(type,"netapp"))
else if (STREQ(type, "iscsi") ||
STREQ(type, "equal") ||
STREQ(type, "hba") ||
STREQ(type, "cslg") ||
STREQ(type, "udev") ||
STREQ(type, "netapp"))
return (int)VIR_STORAGE_VOL_BLOCK;
return -1;
}
......
......@@ -2257,7 +2257,7 @@ xenFormatSxpr(virConnectPtr conn,
if (hvm &&
def->os.loader == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s",_("no HVM domain loader"));
"%s", _("no HVM domain loader"));
goto error;
}
......
......@@ -1891,7 +1891,7 @@ virConfPtr xenFormatXM(virConnectPtr conn,
netVal->list = NULL;
for (i = 0; i < def->nnets; i++) {
if (xenFormatXMNet(conn, netVal,def->nets[i],
if (xenFormatXMNet(conn, netVal, def->nets[i],
hvm, xendConfigVersion) < 0)
goto cleanup;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册