{
auth->login = virXPathString("string(./auth/@login)", ctxt);
if (auth->login == NULL) {
- virReportError(VIR_ERR_XML_ERROR,
- "%s", _("missing auth login attribute"));
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("missing auth login attribute"));
return -1;
}
auth->passwd = virXPathString("string(./auth/@passwd)", ctxt);
if (auth->passwd == NULL) {
- virReportError(VIR_ERR_XML_ERROR,
- "%s", _("missing auth passwd attribute"));
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("missing auth passwd attribute"));
return -1;
}
auth->username = virXPathString("string(./auth/@username)", ctxt);
if (auth->username == NULL) {
- virReportError(VIR_ERR_XML_ERROR,
- "%s", _("missing auth username attribute"));
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("missing auth username attribute"));
return -1;
}
goto cleanup;
}
if (virUUIDParse(uuid, auth->secret.uuid) < 0) {
- virReportError(VIR_ERR_XML_ERROR,
- "%s", _("invalid auth secret uuid"));
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("invalid auth secret uuid"));
goto cleanup;
}
auth->secret.uuidUsable = true;
for (i = 0; i < source->nhost; i++) {
name = virXMLPropString(nodeset[i], "name");
if (name == NULL) {
- virReportError(VIR_ERR_XML_ERROR,
- "%s", _("missing storage pool host name"));
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("missing storage pool host name"));
goto cleanup;
}
source->hosts[i].name = name;
char *path = virXMLPropString(nodeset[i], "path");
if (path == NULL) {
VIR_FREE(nodeset);
- virReportError(VIR_ERR_XML_ERROR,
- "%s", _("missing storage pool source device path"));
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("missing storage pool source device path"));
goto cleanup;
}
source->devices[i].path = path;
if (virStrToLong_i(mode, NULL, 8, &tmp) < 0 || (tmp & ~0777)) {
VIR_FREE(mode);
- virReportError(VIR_ERR_XML_ERROR,
- "%s", _("malformed octal mode"));
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("malformed octal mode"));
goto error;
}
perms->mode = tmp;
perms->uid = (uid_t) -1;
} else {
if (virXPathLong("number(./owner)", ctxt, &v) < 0) {
- virReportError(VIR_ERR_XML_ERROR,
- "%s", _("malformed owner element"));
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("malformed owner element"));
goto error;
}
perms->uid = (int)v;
perms->gid = (gid_t) -1;
} else {
if (virXPathLong("number(./group)", ctxt, &v) < 0) {
- virReportError(VIR_ERR_XML_ERROR,
- "%s", _("malformed group element"));
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("malformed group element"));
goto error;
}
perms->gid = (int)v;
options->flags & VIR_STORAGE_POOL_SOURCE_NAME)
ret->name = ret->source.name;
if (ret->name == NULL) {
- virReportError(VIR_ERR_XML_ERROR,
- "%s", _("missing pool source name element"));
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("missing pool source name element"));
goto cleanup;
}
uuid = virXPathString("string(./uuid)", ctxt);
if (uuid == NULL) {
if (virUUIDGenerate(ret->uuid) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("unable to generate uuid"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("unable to generate uuid"));
goto cleanup;
}
} else {
if (virUUIDParse(uuid, ret->uuid) < 0) {
- virReportError(VIR_ERR_XML_ERROR,
- "%s", _("malformed uuid element"));
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("malformed uuid element"));
goto cleanup;
}
VIR_FREE(uuid);
if (options->flags & VIR_STORAGE_POOL_SOURCE_HOST) {
if (!ret->source.nhost) {
- virReportError(VIR_ERR_XML_ERROR,
- "%s",
+ virReportError(VIR_ERR_XML_ERROR, "%s",
_("missing storage pool source host name"));
goto cleanup;
}
if (options->flags & VIR_STORAGE_POOL_SOURCE_DIR) {
if (!ret->source.dir) {
- virReportError(VIR_ERR_XML_ERROR,
- "%s", _("missing storage pool source path"));
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("missing storage pool source path"));
goto cleanup;
}
}
} else if (ret->source.adapter.type ==
VIR_STORAGE_POOL_SOURCE_ADAPTER_TYPE_SCSI_HOST) {
if (!ret->source.adapter.data.name) {
- virReportError(VIR_ERR_XML_ERROR,
- "%s", _("missing storage pool source adapter name"));
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("missing storage pool source adapter name"));
goto cleanup;
}
}
/* If DEVICE is the only source type, then its required */
if (options->flags == VIR_STORAGE_POOL_SOURCE_DEVICE) {
if (!ret->source.ndevice) {
- virReportError(VIR_ERR_XML_ERROR,
- "%s", _("missing storage pool source device name"));
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("missing storage pool source device name"));
goto cleanup;
}
}
* path and permissions */
if (!(options->flags & VIR_STORAGE_POOL_SOURCE_NETWORK)) {
if ((tmppath = virXPathString("string(./target/path)", ctxt)) == NULL) {
- virReportError(VIR_ERR_XML_ERROR,
- "%s", _("missing storage pool target path"));
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("missing storage pool target path"));
goto cleanup;
}
ret->target.path = virFileSanitizePath(tmppath);
type = virStoragePoolTypeToString(def->type);
if (!type) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("unexpected pool type"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("unexpected pool type"));
goto cleanup;
}
virBufferAsprintf(&buf, "<pool type='%s'>\n", type);
unsigned long long *ret)
{
if (virStrToLong_ull(val, NULL, 10, ret) < 0) {
- virReportError(VIR_ERR_XML_ERROR,
- "%s", _("malformed capacity element"));
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("malformed capacity element"));
return -1;
}
/* off_t is signed, so you cannot create a file larger than 2**63
ret->name = virXPathString("string(./name)", ctxt);
if (ret->name == NULL) {
- virReportError(VIR_ERR_XML_ERROR,
- "%s", _("missing volume name element"));
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("missing volume name element"));
goto cleanup;
}
capacity = virXPathString("string(./capacity)", ctxt);
unit = virXPathString("string(./capacity/@unit)", ctxt);
if (capacity == NULL) {
- virReportError(VIR_ERR_XML_ERROR,
- "%s", _("missing capacity element"));
+ virReportError(VIR_ERR_XML_ERROR, "%s",
+ _("missing capacity element"));
goto cleanup;
}
if (virStorageSize(unit, capacity, &ret->capacity) < 0)
}
if (virMutexInit(&pool->lock) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("cannot initialize mutex"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("cannot initialize mutex"));
VIR_FREE(pool);
return NULL;
}
}
if (!(xml = virStoragePoolDefFormat(def))) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("failed to generate XML"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("failed to generate XML"));
return -1;
}
type = virStoragePoolTypeToString(def->type);
if (!type) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("unexpected pool type"));
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("unexpected pool type"));
goto cleanup;
}