&& { echo '$(ME): newline at end of message(s)' 1>&2; \
exit 1; } || :
+# Look for diagnostics that lack a % in the format string, except that we
+# allow VIR_ERROR to do this, and ignore functions that take a single
+# string rather than a format argument.
+sc_prohibit_diagnostic_without_format:
+ @{ grep -nE '\<$(func_re) *\(.*;$$' $$($(VC_LIST_EXCEPT)); \
+ grep -A2 -nE '\<$(func_re) *\(.*,$$' $$($(VC_LIST_EXCEPT)); } \
+ | sed -rn -e ':l; /[,"]$$/ {N;b l;}' \
+ -e '/(xenapiSessionErrorHandler|vah_(error|warning))/d' \
+ -e '/\<$(func_re) *\([^"]*"([^%"]|"\n[^"]*")*"[,)]/p' \
+ | grep -vE 'VIR_ERROR' && \
+ { echo '$(ME): found diagnostic without %' 1>&2; \
+ exit 1; } || :
+
# The strings "" and "%s" should never be marked for translation.
sc_prohibit_useless_translation:
@prohibit='_\("(%s)?"\)' \
(*def)->label = p;
if ((*def)->label && (*def)->norelabel) {
- virReportError(VIR_ERR_XML_ERROR,
+ virReportError(VIR_ERR_XML_ERROR, "%s",
_("Cannot specify a label if relabelling is turned off"));
VIR_FREE((*def)->label);
VIR_FREE(*def);
}
if (!(source = virXMLPropString(cur, "name")) &&
def->protocol != VIR_DOMAIN_DISK_PROTOCOL_NBD) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("missing name for disk source"));
goto error;
}
} else if (xmlStrEqual(cur->name, BAD_CAST "auth")) {
authUsername = virXMLPropString(cur, "username");
if (authUsername == NULL) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("missing username for auth"));
goto error;
}
xmlStrEqual(child->name, BAD_CAST "secret")) {
usageType = virXMLPropString(child, "type");
if (usageType == NULL) {
- virReportError(VIR_ERR_XML_ERROR,
+ virReportError(VIR_ERR_XML_ERROR, "%s",
_("missing type for secret"));
goto error;
}
authUsage = virXMLPropString(child, "usage");
if (authUUID != NULL && authUsage != NULL) {
- virReportError(VIR_ERR_XML_ERROR,
+ virReportError(VIR_ERR_XML_ERROR, "%s",
_("only one of uuid and usage can be specified"));
goto error;
}
def->blkdeviotune.read_bytes_sec) ||
(def->blkdeviotune.total_bytes_sec &&
def->blkdeviotune.write_bytes_sec)) {
- virReportError(VIR_ERR_XML_ERROR,
+ virReportError(VIR_ERR_XML_ERROR, "%s",
_("total and read/write bytes_sec "
"cannot be set at the same time"));
goto error;
def->blkdeviotune.read_iops_sec) ||
(def->blkdeviotune.total_iops_sec &&
def->blkdeviotune.write_iops_sec)) {
- virReportError(VIR_ERR_XML_ERROR,
+ virReportError(VIR_ERR_XML_ERROR, "%s",
_("total and read/write iops_sec "
"cannot be set at the same time"));
goto error;
if (ioeventfd) {
if (def->bus != VIR_DOMAIN_DISK_BUS_VIRTIO) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("disk ioeventfd mode supported "
"only for virtio bus"));
goto error;
if (event_idx) {
if (def->bus != VIR_DOMAIN_DISK_BUS_VIRTIO) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("disk event_idx mode supported "
"only for virtio bus"));
goto error;
if ((compressionVal =
virDomainGraphicsSpicePlaybackCompressionTypeFromString(compression)) <= 0) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("unknown spice playback compression"));
VIR_FREE(compression);
goto error;
}
if ((modeVal =
virDomainGraphicsSpiceStreamingModeTypeFromString(mode)) <= 0) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("unknown spice streaming mode"));
VIR_FREE(mode);
goto error;
if (!(ip = virXMLPropString(node, "ip")) ||
(virSocketAddrParse(&inaddr, ip, AF_UNSPEC) < 0)) {
- virReportError(VIR_ERR_XML_DETAIL,
+ virReportError(VIR_ERR_XML_DETAIL, "%s",
_("Missing IP address in DNS host definition"));
VIR_FREE(ip);
goto error;
nForwardPfs = virXPathNodeSet("./pf", ctxt, &forwardPfNodes);
if (nForwardIfs < 0 || nForwardPfs < 0) {
- virReportError(VIR_ERR_XML_ERROR,
+ virReportError(VIR_ERR_XML_ERROR, "%s",
_("No interface pool or SRIOV physical device given"));
goto error;
}
}
if (forwardDev) {
- virReportError(VIR_ERR_XML_ERROR,
+ virReportError(VIR_ERR_XML_ERROR, "%s",
_("A forward Dev should not be used when using a SRIOV PF"));
goto error;
}
forwardDev = NULL;
def->nForwardPfs++;
} else if (nForwardPfs > 1) {
- virReportError(VIR_ERR_XML_ERROR,
+ virReportError(VIR_ERR_XML_ERROR, "%s",
_("Use of more than one physical interface is not allowed"));
goto error;
}
* nwfilter_conf.c: network filter XML processing
* (derived from storage_conf.c)
*
- * Copyright (C) 2006-2011 Red Hat, Inc.
+ * Copyright (C) 2006-2012 Red Hat, Inc.
* Copyright (C) 2006-2008 Daniel P. Berrange
*
* Copyright (C) 2010-2011 IBM Corporation
}
if (chainname[strspn(chainname, VALID_CHAINNAME)] != 0) {
- virReportError(VIR_ERR_INVALID_ARG,
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
_("Chain name contains invalid characters"));
return false;
}
virNWFilterVarValuePtr val;
if (!isValidVarValue(value)) {
- virReportError(VIR_ERR_INVALID_ARG,
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
_("Variable value contains invalid character"));
return NULL;
}
}
if (parseError) {
if (dest->accessType == VIR_NWFILTER_VAR_ACCESS_ELEMENT)
- virReportError(VIR_ERR_INVALID_ARG,
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
_("Malformatted array index"));
else
- virReportError(VIR_ERR_INVALID_ARG,
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
_("Malformatted iterator id"));
goto err_exit;
}
return dest;
} else {
- virReportError(VIR_ERR_INVALID_ARG,
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
_("Malformatted variable"));
}
/*
* datatypes.h: management of structs for public data types
*
- * Copyright (C) 2006-2011 Red Hat, Inc.
+ * Copyright (C) 2006-2012 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
int refs;
if ((!VIR_IS_CONNECT(conn))) {
- virLibConnError(VIR_ERR_INVALID_CONN, _("no connection"));
+ virLibConnError(VIR_ERR_INVALID_CONN, "%s", _("no connection"));
return -1;
}
virMutexLock(&conn->lock);
char uuidstr[VIR_UUID_STRING_BUFLEN];
if (!VIR_IS_CONNECT(conn)) {
- virLibConnError(VIR_ERR_INVALID_CONN, _("no connection"));
+ virLibConnError(VIR_ERR_INVALID_CONN, "%s", _("no connection"));
return NULL;
}
virCheckNonNullArgReturn(name, NULL);
int refs;
if (!VIR_IS_CONNECTED_DOMAIN(domain)) {
- virLibConnError(VIR_ERR_INVALID_DOMAIN, _("bad domain or no connection"));
+ virLibConnError(VIR_ERR_INVALID_DOMAIN, "%s",
+ _("bad domain or no connection"));
return -1;
}
virMutexLock(&domain->conn->lock);
char uuidstr[VIR_UUID_STRING_BUFLEN];
if (!VIR_IS_CONNECT(conn)) {
- virLibConnError(VIR_ERR_INVALID_CONN, _("no connection"));
+ virLibConnError(VIR_ERR_INVALID_CONN, "%s", _("no connection"));
return NULL;
}
virCheckNonNullArgReturn(name, NULL);
int refs;
if (!VIR_IS_CONNECTED_NETWORK(network)) {
- virLibConnError(VIR_ERR_INVALID_NETWORK,
+ virLibConnError(VIR_ERR_INVALID_NETWORK, "%s",
_("bad network or no connection"));
return -1;
}
virInterfacePtr ret = NULL;
if (!VIR_IS_CONNECT(conn)) {
- virLibConnError(VIR_ERR_INVALID_CONN, _("no connection"));
+ virLibConnError(VIR_ERR_INVALID_CONN, "%s", _("no connection"));
return NULL;
}
virCheckNonNullArgReturn(name, NULL);
int refs;
if (!VIR_IS_CONNECTED_INTERFACE(iface)) {
- virLibConnError(VIR_ERR_INVALID_INTERFACE,
+ virLibConnError(VIR_ERR_INVALID_INTERFACE, "%s",
_("bad interface or no connection"));
return -1;
}
char uuidstr[VIR_UUID_STRING_BUFLEN];
if (!VIR_IS_CONNECT(conn)) {
- virLibConnError(VIR_ERR_INVALID_CONN, _("no connection"));
+ virLibConnError(VIR_ERR_INVALID_CONN, "%s", _("no connection"));
return NULL;
}
virCheckNonNullArgReturn(name, NULL);
int refs;
if (!VIR_IS_CONNECTED_STORAGE_POOL(pool)) {
- virLibConnError(VIR_ERR_INVALID_STORAGE_POOL,
+ virLibConnError(VIR_ERR_INVALID_STORAGE_POOL, "%s",
_("bad storage pool or no connection"));
return -1;
}
virStorageVolPtr ret = NULL;
if (!VIR_IS_CONNECT(conn)) {
- virLibConnError(VIR_ERR_INVALID_CONN, _("no connection"));
+ virLibConnError(VIR_ERR_INVALID_CONN, "%s", _("no connection"));
return NULL;
}
virCheckNonNullArgReturn(name, NULL);
int refs;
if (!VIR_IS_CONNECTED_STORAGE_VOL(vol)) {
- virLibConnError(VIR_ERR_INVALID_STORAGE_VOL,
+ virLibConnError(VIR_ERR_INVALID_STORAGE_VOL, "%s",
_("bad storage volume or no connection"));
return -1;
}
virNodeDevicePtr ret = NULL;
if (!VIR_IS_CONNECT(conn)) {
- virLibConnError(VIR_ERR_INVALID_CONN, _("no connection"));
+ virLibConnError(VIR_ERR_INVALID_CONN, "%s", _("no connection"));
return NULL;
}
virCheckNonNullArgReturn(name, NULL);
char uuidstr[VIR_UUID_STRING_BUFLEN];
if (!VIR_IS_CONNECT(conn)) {
- virLibConnError(VIR_ERR_INVALID_CONN, _("no connection"));
+ virLibConnError(VIR_ERR_INVALID_CONN, "%s", _("no connection"));
return NULL;
}
virCheckNonNullArgReturn(uuid, NULL);
int refs;
if (!VIR_IS_CONNECTED_SECRET(secret)) {
- virLibConnError(VIR_ERR_INVALID_SECRET, _("bad secret or no connection"));
+ virLibConnError(VIR_ERR_INVALID_SECRET, "%s",
+ _("bad secret or no connection"));
return -1;
}
virMutexLock(&secret->conn->lock);
char uuidstr[VIR_UUID_STRING_BUFLEN];
if (!VIR_IS_CONNECT(conn)) {
- virLibConnError(VIR_ERR_INVALID_CONN, _("no connection"));
+ virLibConnError(VIR_ERR_INVALID_CONN, "%s", _("no connection"));
return NULL;
}
virCheckNonNullArgReturn(name, NULL);
int refs;
if (!VIR_IS_CONNECTED_NWFILTER(nwfilter)) {
- virLibConnError(VIR_ERR_INVALID_NWFILTER,
+ virLibConnError(VIR_ERR_INVALID_NWFILTER, "%s",
_("bad nwfilter or no connection"));
return -1;
}
virDomainSnapshotPtr ret = NULL;
if (!VIR_IS_DOMAIN(domain)) {
- virLibConnError(VIR_ERR_INVALID_DOMAIN, _("bad domain"));
+ virLibConnError(VIR_ERR_INVALID_DOMAIN, "%s", _("bad domain"));
return NULL;
}
virCheckNonNullArgReturn(name, NULL);
int refs;
if (!VIR_IS_DOMAIN_SNAPSHOT(snapshot)) {
- virLibConnError(VIR_ERR_INVALID_DOMAIN_SNAPSHOT, _("not a snapshot"));
+ virLibConnError(VIR_ERR_INVALID_DOMAIN_SNAPSHOT, "%s",
+ _("not a snapshot"));
return -1;
}
/* We must absolutize the file path as the save is done out of process */
if (virFileAbsPath(to, &absolute_to) < 0) {
- virLibConnError(VIR_ERR_INTERNAL_ERROR,
+ virLibConnError(VIR_ERR_INTERNAL_ERROR, "%s",
_("could not build absolute output file path"));
goto error;
}
/* We must absolutize the file path as the save is done out of process */
if (virFileAbsPath(to, &absolute_to) < 0) {
- virLibConnError(VIR_ERR_INTERNAL_ERROR,
+ virLibConnError(VIR_ERR_INTERNAL_ERROR, "%s",
_("could not build absolute output file path"));
goto error;
}
/* We must absolutize the file path as the restore is done out of process */
if (virFileAbsPath(from, &absolute_from) < 0) {
- virLibConnError(VIR_ERR_INTERNAL_ERROR,
+ virLibConnError(VIR_ERR_INTERNAL_ERROR, "%s",
_("could not build absolute input file path"));
goto error;
}
/* We must absolutize the file path as the restore is done out of process */
if (virFileAbsPath(from, &absolute_from) < 0) {
- virLibConnError(VIR_ERR_INTERNAL_ERROR,
+ virLibConnError(VIR_ERR_INTERNAL_ERROR, "%s",
_("could not build absolute input file path"));
goto error;
}
virCheckNonNullArgGoto(file, error);
if ((conn->flags & VIR_CONNECT_RO) && (flags & VIR_DOMAIN_XML_SECURE)) {
- virLibConnError(VIR_ERR_OPERATION_DENIED,
+ virLibConnError(VIR_ERR_OPERATION_DENIED, "%s",
_("virDomainSaveImageGetXMLDesc with secure flag"));
goto error;
}
/* We must absolutize the file path as the read is done out of process */
if (virFileAbsPath(file, &absolute_file) < 0) {
- virLibConnError(VIR_ERR_INTERNAL_ERROR,
+ virLibConnError(VIR_ERR_INTERNAL_ERROR, "%s",
_("could not build absolute input file path"));
goto error;
}
/* We must absolutize the file path as the read is done out of process */
if (virFileAbsPath(file, &absolute_file) < 0) {
- virLibConnError(VIR_ERR_INTERNAL_ERROR,
+ virLibConnError(VIR_ERR_INTERNAL_ERROR, "%s",
_("could not build absolute input file path"));
goto error;
}
/* We must absolutize the file path as the save is done out of process */
if (virFileAbsPath(to, &absolute_to) < 0) {
- virLibConnError(VIR_ERR_INTERNAL_ERROR,
+ virLibConnError(VIR_ERR_INTERNAL_ERROR, "%s",
_("could not build absolute core file path"));
goto error;
}
conn = domain->conn;
if ((conn->flags & VIR_CONNECT_RO) && (flags & VIR_DOMAIN_XML_SECURE)) {
- virLibConnError(VIR_ERR_OPERATION_DENIED,
+ virLibConnError(VIR_ERR_OPERATION_DENIED, "%s",
_("virDomainGetXMLDesc with secure flag"));
goto error;
}
goto done;
if (uri == NULL && uri_out == NULL) {
- virLibConnError(VIR_ERR_INTERNAL_ERROR,
+ virLibConnError(VIR_ERR_INTERNAL_ERROR, "%s",
_("domainMigratePrepare did not set uri"));
goto done;
}
goto done;
if (uri == NULL && uri_out == NULL) {
- virLibConnError(VIR_ERR_INTERNAL_ERROR,
+ virLibConnError(VIR_ERR_INTERNAL_ERROR, "%s",
_("domainMigratePrepare2 did not set uri"));
virDispatchError(domain->conn);
cancelled = 1;
}
if (uri == NULL && uri_out == NULL) {
- virLibConnError(VIR_ERR_INTERNAL_ERROR,
+ virLibConnError(VIR_ERR_INTERNAL_ERROR, "%s",
_("domainMigratePrepare3 did not set uri"));
virDispatchError(domain->conn);
goto finish;
}
flags &= ~VIR_MIGRATE_CHANGE_PROTECTION;
if (flags & VIR_MIGRATE_TUNNELLED) {
- virLibConnError(VIR_ERR_OPERATION_INVALID,
+ virLibConnError(VIR_ERR_OPERATION_INVALID, "%s",
_("cannot perform tunnelled migration without using peer2peer flag"));
goto error;
}
}
flags &= ~VIR_MIGRATE_CHANGE_PROTECTION;
if (flags & VIR_MIGRATE_TUNNELLED) {
- virLibConnError(VIR_ERR_OPERATION_INVALID,
+ virLibConnError(VIR_ERR_OPERATION_INVALID, "%s",
_("cannot perform tunnelled migration without using peer2peer flag"));
goto error;
}
virCheckNonNullArgGoto(handler, cleanup);
if (stream->flags & VIR_STREAM_NONBLOCK) {
- virLibConnError(VIR_ERR_OPERATION_INVALID,
+ virLibConnError(VIR_ERR_OPERATION_INVALID, "%s",
_("data sources cannot be used for non-blocking streams"));
goto cleanup;
}
virCheckNonNullArgGoto(handler, cleanup);
if (stream->flags & VIR_STREAM_NONBLOCK) {
- virLibConnError(VIR_ERR_OPERATION_INVALID,
+ virLibConnError(VIR_ERR_OPERATION_INVALID, "%s",
_("data sinks cannot be used for non-blocking streams"));
goto cleanup;
}
conn = snapshot->domain->conn;
if ((conn->flags & VIR_CONNECT_RO) && (flags & VIR_DOMAIN_XML_SECURE)) {
- virLibConnError(VIR_ERR_OPERATION_DENIED,
+ virLibConnError(VIR_ERR_OPERATION_DENIED, "%s",
_("virDomainSnapshotGetXMLDesc with secure flag"));
goto error;
}
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
if (!lxcCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_BLKIO)) {
- lxcError(VIR_ERR_OPERATION_INVALID, _("blkio cgroup isn't mounted"));
+ lxcError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("blkio cgroup isn't mounted"));
goto cleanup;
}
if (flags & VIR_DOMAIN_AFFECT_LIVE) {
if (!lxcCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_BLKIO)) {
- lxcError(VIR_ERR_OPERATION_INVALID, _("blkio cgroup isn't mounted"));
+ lxcError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("blkio cgroup isn't mounted"));
goto cleanup;
}
* nwfilter_dhcpsnoop.c: support for DHCP snooping used by a VM
* on an interface
*
+ * Copyright (C) 2012 Red Hat, Inc.
* Copyright (C) 2011,2012 IBM Corp.
*
* Authors:
if (req->techdriver &&
req->techdriver->applyDHCPOnlyRules(req->ifname, &req->macaddr,
dhcpsrvrs, false) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("virNWFilterSnoopListDel failed"));
ret = -1;
}
if (techdriver->applyDHCPOnlyRules(req->ifname, &req->macaddr,
dhcpsrvrs, false) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("applyDHCPOnlyRules "
"failed - spoofing not protected!"));
goto exit_snoopreqput;
|| cur->accessmode != fs->accessmode
|| cur->wrpolicy != fs->wrpolicy
|| cur->readonly != fs->readonly) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Can only modify disk quota"));
return -1;
}
if (kb_per_pages > 0) {
kb_per_pages /= 1024;
} else {
- virReportError(VIR_ERR_INTERNAL_ERROR,
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Can't determine page size"));
kb_per_pages = 0;
return -1;
}
}
} else {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Block I/O tuning is not available on this host"));
goto cleanup;
}
}
}
} else {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Memory cgroup is not available on this host"));
}
}
}
if (!qemuCapsGet(qemuCaps, QEMU_CAPS_USB_HUB)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("usb-hub not supported by QEMU binary"));
goto error;
}
case VIR_DOMAIN_CHR_TYPE_SPICEVMC:
if (!qemuCapsGet(qemuCaps, QEMU_CAPS_CHARDEV_SPICEVMC)) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("spicevmc not supported in this QEMU binary"));
goto error;
}
cont->model == -1 &&
!qemuCapsGet(qemuCaps, QEMU_CAPS_PIIX3_USB_UHCI)) {
if (usblegacy) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("Multiple legacy USB controllers are "
"not supported"));
goto error;
switch (mode) {
case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_SECURE:
if (!driver->spiceTLS) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("spice secure channels set in XML configuration, but TLS is disabled in qemu.conf"));
goto error;
}
if (!map[i]) {
cpu_time = 0;
} else if (virStrToLong_ull(pos, &pos, 10, &cpu_time) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("cpuacct parse error"));
goto cleanup;
} else {
goto try_remove;
}
} else {
- virReportError(VIR_ERR_OPERATION_FAILED,
+ virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("setting of link state not supported: Link is up"));
}
/*
* virnetsaslcontext.c: SASL encryption/auth handling
*
- * Copyright (C) 2010-2011 Red Hat, Inc.
+ * Copyright (C) 2010-2012 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
goto cleanup;
}
if (val == NULL) {
- virReportError(VIR_ERR_AUTH_FAILED,
+ virReportError(VIR_ERR_AUTH_FAILED, "%s",
_("no client username was found"));
goto cleanup;
}
remoteAddr.len = sizeof(remoteAddr.data.un);
if (spawnDaemon && !binary) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Auto-spawn of daemon requested, but no binary specified"));
return -1;
}
{
int ret = -1;
if (!virNetSocketHasPassFD(sock)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Sending file descriptors is not supported on this socket"));
return -1;
}
*fd = -1;
if (!virNetSocketHasPassFD(sock)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("Receiving file descriptors is not supported on this socket"));
return -1;
}
/*
* storage_backend_disk.c: storage backend for disk handling
*
- * Copyright (C) 2007-2008, 2010-2011 Red Hat, Inc.
+ * Copyright (C) 2007-2008, 2010-2012 Red Hat, Inc.
* Copyright (C) 2007-2008 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
if (flags == (VIR_STORAGE_POOL_BUILD_OVERWRITE |
VIR_STORAGE_POOL_BUILD_NO_OVERWRITE)) {
- virReportError(VIR_ERR_OPERATION_INVALID,
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("Overwrite and no overwrite flags"
" are mutually exclusive"));
goto error;
if (check > 0) {
ok_to_mklabel = true;
} else if (check < 0) {
- virReportError(VIR_ERR_OPERATION_FAILED,
+ virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("Error checking for disk label"));
} else {
- virReportError(VIR_ERR_OPERATION_INVALID,
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("Disk label already present"));
}
}
/*
* storage_backend_fs.c: storage backend for FS and directory handling
*
- * Copyright (C) 2007-2011 Red Hat, Inc.
+ * Copyright (C) 2007-2012 Red Hat, Inc.
* Copyright (C) 2007-2008 Daniel P. Berrange
*
* This library is free software; you can redistribute it and/or
}
if (blkid_do_probe(probe) != 1) {
- virReportError(VIR_ERR_STORAGE_PROBE_FAILED,
+ virReportError(VIR_ERR_STORAGE_PROBE_FAILED, "%s",
_("Found additional probes to run, "
"filesystem probing may be incorrect"));
ret = FILESYSTEM_PROBE_ERROR;
virStorageBackendFileSystemProbe(const char *device ATTRIBUTE_UNUSED,
const char *format ATTRIBUTE_UNUSED)
{
- virReportError(VIR_ERR_OPERATION_INVALID,
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("probing for filesystems is unsupported "
"by this build"));
if (flags == (VIR_STORAGE_POOL_BUILD_OVERWRITE |
VIR_STORAGE_POOL_BUILD_NO_OVERWRITE)) {
- virReportError(VIR_ERR_OPERATION_INVALID,
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("Overwrite and no overwrite flags"
" are mutually exclusive"));
goto error;
VIR_DEBUG("Using cephx authorization");
if (rados_create(&ptr->cluster,
pool->def->source.auth.cephx.username) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("failed to initialize RADOS"));
goto cleanup;
}
}
if (secret == NULL) {
- virReportError(VIR_ERR_NO_SECRET,
+ virReportError(VIR_ERR_NO_SECRET, "%s",
_("failed to find the secret"));
goto cleanup;
}
memset(secret_value, 0, secret_value_size);
if (rados_key == NULL) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("failed to decode the RADOS key"));
goto cleanup;
}
} else {
VIR_DEBUG("Not using cephx authorization");
if (rados_create(&ptr->cluster, NULL) < 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("failed to create the RADOS cluster"));
goto cleanup;
}
storageDriverUnlock(driver);
if (!pool) {
- virReportError(VIR_ERR_NO_STORAGE_POOL,
+ virReportError(VIR_ERR_NO_STORAGE_POOL, "%s",
_("no storage pool with matching uuid"));
goto out;
}
if (!virStoragePoolObjIsActive(pool)) {
- virReportError(VIR_ERR_OPERATION_INVALID,
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("storage pool is not active"));
goto out;
}
}
if (abs_capacity < vol->allocation) {
- virReportError(VIR_ERR_INVALID_ARG,
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
_("can't shrink capacity below "
"existing allocation"));
goto out;
}
if (abs_capacity > vol->capacity + pool->def->available) {
- virReportError(VIR_ERR_OPERATION_FAILED,
+ virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("Not enough space left on storage pool"));
goto out;
}
if (!backend->resizeVol) {
- virReportError(VIR_ERR_NO_SUPPORT,
+ virReportError(VIR_ERR_NO_SUPPORT, "%s",
_("storage pool does not support changing of "
"volume capacity"));
goto out;
testDriverLock(privconn);
if (privconn->transaction_running) {
- virReportError(VIR_ERR_OPERATION_INVALID,
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("there is another transaction running."));
goto cleanup;
}
testDriverLock(privconn);
if (!privconn->transaction_running) {
- virReportError(VIR_ERR_OPERATION_INVALID,
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("no transaction running, "
"nothing to be committed."));
goto cleanup;
testDriverLock(privconn);
if (!privconn->transaction_running) {
- virReportError(VIR_ERR_OPERATION_INVALID,
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("no transaction running, "
"nothing to rollback."));
goto cleanup;
if (MATCH(VIR_CONNECT_LIST_FILTERS_SNAPSHOT)) {
rc = machine->vtbl->GetSnapshotCount(machine, &snapshotCount);
if (NS_FAILED(rc)) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("could not get snapshot count for listed domains"));
goto cleanup;
}
else
virBufferAddLit(buf, "(mode 'w')");
if (def->transient) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("transient disks not supported yet"));
return -1;
}
break;
case VIR_DOMAIN_CLOCK_OFFSET_UTC:
if (def->clock.data.utc_reset) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("unsupported clock adjustment='reset'"));
goto error;
}
break;
case VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME:
if (def->clock.data.utc_reset) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("unsupported clock adjustment='reset'"));
goto error;
}
virConfValuePtr val;
if (!uuid || !name || !conf) {
- virReportError(VIR_ERR_INVALID_ARG,
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
_("Arguments must be non null"));
return -1;
}
else
virBufferAddLit(&buf, ",w");
if (disk->transient) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("transient disks not supported yet"));
return -1;
}
break;
case VIR_DOMAIN_CLOCK_OFFSET_UTC:
if (def->clock.data.utc_reset) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("unsupported clock adjustment='reset'"));
goto cleanup;
}
break;
case VIR_DOMAIN_CLOCK_OFFSET_LOCALTIME:
if (def->clock.data.utc_reset) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("unsupported clock adjustment='reset'"));
goto cleanup;
}