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) {
* 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, ...)
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) {
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
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) {
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;
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);
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
else if (bootDevs[i] == VIR_DOMAIN_BOOT_NET)
val = (char *)"n";
if (val)
- virBufferEscapeString(&ret,"%s",val);
+ virBufferEscapeString(&ret, "%s", val);
}
return virBufferContentAndReset(&ret);
}
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;
}
if (hvm &&
def->os.loader == NULL) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- "%s",_("no HVM domain loader"));
+ "%s", _("no HVM domain loader"));
goto error;
}
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;
}