mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 19:11:16 +00:00
Add bare format string to printf-derivatives troubles
* src/datatypes.c src/domain_conf.c src/interface_conf.c src/lxc_driver.c src/qemu_driver.c src/storage_backend.c src/virsh.c: add bare %s format string to printf-derivatives called with no format string
This commit is contained in:
parent
ed5a25841f
commit
165ed4a00e
@ -289,7 +289,7 @@ virGetDomain(virConnectPtr conn, const char *name, const unsigned char *uuid) {
|
|||||||
if (virHashAddEntry(conn->domains, name, ret) < 0) {
|
if (virHashAddEntry(conn->domains, name, ret) < 0) {
|
||||||
virMutexUnlock(&conn->lock);
|
virMutexUnlock(&conn->lock);
|
||||||
virLibConnError(conn, VIR_ERR_INTERNAL_ERROR,
|
virLibConnError(conn, VIR_ERR_INTERNAL_ERROR,
|
||||||
_("failed to add domain to connection hash table"));
|
"%s", _("failed to add domain to connection hash table"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
conn->refs++;
|
conn->refs++;
|
||||||
@ -330,7 +330,7 @@ virReleaseDomain(virDomainPtr domain) {
|
|||||||
if (virHashRemoveEntry(conn->domains, domain->name, NULL) < 0) {
|
if (virHashRemoveEntry(conn->domains, domain->name, NULL) < 0) {
|
||||||
virMutexUnlock(&conn->lock);
|
virMutexUnlock(&conn->lock);
|
||||||
virLibConnError(conn, VIR_ERR_INTERNAL_ERROR,
|
virLibConnError(conn, VIR_ERR_INTERNAL_ERROR,
|
||||||
_("domain missing from connection hash table"));
|
"%s", _("domain missing from connection hash table"));
|
||||||
conn = NULL;
|
conn = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -430,7 +430,7 @@ virGetNetwork(virConnectPtr conn, const char *name, const unsigned char *uuid) {
|
|||||||
if (virHashAddEntry(conn->networks, name, ret) < 0) {
|
if (virHashAddEntry(conn->networks, name, ret) < 0) {
|
||||||
virMutexUnlock(&conn->lock);
|
virMutexUnlock(&conn->lock);
|
||||||
virLibConnError(conn, VIR_ERR_INTERNAL_ERROR,
|
virLibConnError(conn, VIR_ERR_INTERNAL_ERROR,
|
||||||
_("failed to add network to connection hash table"));
|
"%s", _("failed to add network to connection hash table"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
conn->refs++;
|
conn->refs++;
|
||||||
@ -468,7 +468,7 @@ virReleaseNetwork(virNetworkPtr network) {
|
|||||||
if (virHashRemoveEntry(conn->networks, network->name, NULL) < 0) {
|
if (virHashRemoveEntry(conn->networks, network->name, NULL) < 0) {
|
||||||
virMutexUnlock(&conn->lock);
|
virMutexUnlock(&conn->lock);
|
||||||
virLibConnError(conn, VIR_ERR_INTERNAL_ERROR,
|
virLibConnError(conn, VIR_ERR_INTERNAL_ERROR,
|
||||||
_("network missing from connection hash table"));
|
"%s", _("network missing from connection hash table"));
|
||||||
conn = NULL;
|
conn = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -603,7 +603,7 @@ _("Failed to change interface mac address from %s to %s due to differing lengths
|
|||||||
if (virHashAddEntry(conn->interfaces, name, ret) < 0) {
|
if (virHashAddEntry(conn->interfaces, name, ret) < 0) {
|
||||||
virMutexUnlock(&conn->lock);
|
virMutexUnlock(&conn->lock);
|
||||||
virLibConnError(conn, VIR_ERR_INTERNAL_ERROR,
|
virLibConnError(conn, VIR_ERR_INTERNAL_ERROR,
|
||||||
_("failed to add interface to connection hash table"));
|
"%s", _("failed to add interface to connection hash table"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
conn->refs++;
|
conn->refs++;
|
||||||
@ -642,7 +642,7 @@ virReleaseInterface(virInterfacePtr iface) {
|
|||||||
/* unlock before reporting error because error report grabs lock */
|
/* unlock before reporting error because error report grabs lock */
|
||||||
virMutexUnlock(&conn->lock);
|
virMutexUnlock(&conn->lock);
|
||||||
virLibConnError(conn, VIR_ERR_INTERNAL_ERROR,
|
virLibConnError(conn, VIR_ERR_INTERNAL_ERROR,
|
||||||
_("interface missing from connection hash table"));
|
"%s", _("interface missing from connection hash table"));
|
||||||
/* don't decr the conn refct if we weren't connected to it */
|
/* don't decr the conn refct if we weren't connected to it */
|
||||||
conn = NULL;
|
conn = NULL;
|
||||||
}
|
}
|
||||||
@ -744,7 +744,7 @@ virGetStoragePool(virConnectPtr conn, const char *name, const unsigned char *uui
|
|||||||
if (virHashAddEntry(conn->storagePools, name, ret) < 0) {
|
if (virHashAddEntry(conn->storagePools, name, ret) < 0) {
|
||||||
virMutexUnlock(&conn->lock);
|
virMutexUnlock(&conn->lock);
|
||||||
virLibConnError(conn, VIR_ERR_INTERNAL_ERROR,
|
virLibConnError(conn, VIR_ERR_INTERNAL_ERROR,
|
||||||
_("failed to add storage pool to connection hash table"));
|
"%s", _("failed to add storage pool to connection hash table"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
conn->refs++;
|
conn->refs++;
|
||||||
@ -783,7 +783,7 @@ virReleaseStoragePool(virStoragePoolPtr pool) {
|
|||||||
if (virHashRemoveEntry(conn->storagePools, pool->name, NULL) < 0) {
|
if (virHashRemoveEntry(conn->storagePools, pool->name, NULL) < 0) {
|
||||||
virMutexUnlock(&conn->lock);
|
virMutexUnlock(&conn->lock);
|
||||||
virLibConnError(conn, VIR_ERR_INTERNAL_ERROR,
|
virLibConnError(conn, VIR_ERR_INTERNAL_ERROR,
|
||||||
_("pool missing from connection hash table"));
|
"%s", _("pool missing from connection hash table"));
|
||||||
conn = NULL;
|
conn = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -887,7 +887,7 @@ virGetStorageVol(virConnectPtr conn, const char *pool, const char *name, const c
|
|||||||
if (virHashAddEntry(conn->storageVols, key, ret) < 0) {
|
if (virHashAddEntry(conn->storageVols, key, ret) < 0) {
|
||||||
virMutexUnlock(&conn->lock);
|
virMutexUnlock(&conn->lock);
|
||||||
virLibConnError(conn, VIR_ERR_INTERNAL_ERROR,
|
virLibConnError(conn, VIR_ERR_INTERNAL_ERROR,
|
||||||
_("failed to add storage vol to connection hash table"));
|
"%s", _("failed to add storage vol to connection hash table"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
conn->refs++;
|
conn->refs++;
|
||||||
@ -927,7 +927,7 @@ virReleaseStorageVol(virStorageVolPtr vol) {
|
|||||||
if (virHashRemoveEntry(conn->storageVols, vol->key, NULL) < 0) {
|
if (virHashRemoveEntry(conn->storageVols, vol->key, NULL) < 0) {
|
||||||
virMutexUnlock(&conn->lock);
|
virMutexUnlock(&conn->lock);
|
||||||
virLibConnError(conn, VIR_ERR_INTERNAL_ERROR,
|
virLibConnError(conn, VIR_ERR_INTERNAL_ERROR,
|
||||||
_("vol missing from connection hash table"));
|
"%s", _("vol missing from connection hash table"));
|
||||||
conn = NULL;
|
conn = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1023,7 +1023,7 @@ virGetNodeDevice(virConnectPtr conn, const char *name)
|
|||||||
if (virHashAddEntry(conn->nodeDevices, name, ret) < 0) {
|
if (virHashAddEntry(conn->nodeDevices, name, ret) < 0) {
|
||||||
virMutexUnlock(&conn->lock);
|
virMutexUnlock(&conn->lock);
|
||||||
virLibConnError(conn, VIR_ERR_INTERNAL_ERROR,
|
virLibConnError(conn, VIR_ERR_INTERNAL_ERROR,
|
||||||
_("failed to add node dev to conn hash table"));
|
"%s", _("failed to add node dev to conn hash table"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
conn->refs++;
|
conn->refs++;
|
||||||
@ -1061,7 +1061,7 @@ virReleaseNodeDevice(virNodeDevicePtr dev) {
|
|||||||
if (virHashRemoveEntry(conn->nodeDevices, dev->name, NULL) < 0) {
|
if (virHashRemoveEntry(conn->nodeDevices, dev->name, NULL) < 0) {
|
||||||
virMutexUnlock(&conn->lock);
|
virMutexUnlock(&conn->lock);
|
||||||
virLibConnError(conn, VIR_ERR_INTERNAL_ERROR,
|
virLibConnError(conn, VIR_ERR_INTERNAL_ERROR,
|
||||||
_("dev missing from connection hash table"));
|
"%s", _("dev missing from connection hash table"));
|
||||||
conn = NULL;
|
conn = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2189,7 +2189,7 @@ virSecurityLabelDefParseXML(virConnectPtr conn,
|
|||||||
VIR_FREE(p);
|
VIR_FREE(p);
|
||||||
if (def->seclabel.type < 0) {
|
if (def->seclabel.type < 0) {
|
||||||
virDomainReportError(conn, VIR_ERR_XML_ERROR,
|
virDomainReportError(conn, VIR_ERR_XML_ERROR,
|
||||||
_("invalid security type"));
|
"%s", _("invalid security type"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2211,7 +2211,7 @@ virSecurityLabelDefParseXML(virConnectPtr conn,
|
|||||||
VIR_SECURITY_LABEL_BUFLEN-1, ctxt);
|
VIR_SECURITY_LABEL_BUFLEN-1, ctxt);
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
virDomainReportError(conn, VIR_ERR_XML_ERROR,
|
virDomainReportError(conn, VIR_ERR_XML_ERROR,
|
||||||
_("security label is missing"));
|
"%s", _("security label is missing"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2225,7 +2225,7 @@ virSecurityLabelDefParseXML(virConnectPtr conn,
|
|||||||
VIR_SECURITY_LABEL_BUFLEN-1, ctxt);
|
VIR_SECURITY_LABEL_BUFLEN-1, ctxt);
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
virDomainReportError(conn, VIR_ERR_XML_ERROR,
|
virDomainReportError(conn, VIR_ERR_XML_ERROR,
|
||||||
_("security imagelabel is missing"));
|
"%s", _("security imagelabel is missing"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
def->seclabel.imagelabel = p;
|
def->seclabel.imagelabel = p;
|
||||||
|
@ -601,7 +601,7 @@ virInterfaceDefParseXML(virConnectPtr conn, xmlXPathContextPtr ctxt) {
|
|||||||
tmp = virXPathString(conn, "string(./@type)", ctxt);
|
tmp = virXPathString(conn, "string(./@type)", ctxt);
|
||||||
if (tmp == NULL) {
|
if (tmp == NULL) {
|
||||||
virInterfaceReportError(conn, VIR_ERR_XML_ERROR,
|
virInterfaceReportError(conn, VIR_ERR_XML_ERROR,
|
||||||
_("interface misses the type attribute"));
|
"%s", _("interface misses the type attribute"));
|
||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
type = virInterfaceTypeFromString(tmp);
|
type = virInterfaceTypeFromString(tmp);
|
||||||
@ -643,7 +643,7 @@ virInterfaceDefParseXML(virConnectPtr conn, xmlXPathContextPtr ctxt) {
|
|||||||
bridge = virXPathNode(conn, "./bridge[1]", ctxt);
|
bridge = virXPathNode(conn, "./bridge[1]", ctxt);
|
||||||
if (bridge == NULL) {
|
if (bridge == NULL) {
|
||||||
virInterfaceReportError(conn, VIR_ERR_XML_ERROR,
|
virInterfaceReportError(conn, VIR_ERR_XML_ERROR,
|
||||||
_("bridge interface misses the bridge element"));
|
"%s", _("bridge interface misses the bridge element"));
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
tmp = virXMLPropString(bridge, "stp");
|
tmp = virXMLPropString(bridge, "stp");
|
||||||
|
@ -107,7 +107,7 @@ static virDrvOpenStatus lxcOpen(virConnectPtr conn,
|
|||||||
/* URI was good, but driver isn't active */
|
/* URI was good, but driver isn't active */
|
||||||
if (lxc_driver == NULL) {
|
if (lxc_driver == NULL) {
|
||||||
lxcError(conn, NULL, VIR_ERR_INTERNAL_ERROR,
|
lxcError(conn, NULL, VIR_ERR_INTERNAL_ERROR,
|
||||||
_("lxc state driver is not active"));
|
"%s", _("lxc state driver is not active"));
|
||||||
return VIR_DRV_OPEN_ERROR;
|
return VIR_DRV_OPEN_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1599,7 +1599,7 @@ static int qemudSecurityHook(void *data) {
|
|||||||
|
|
||||||
if (qemudDomainSetSecurityLabel(h->conn, h->driver, h->vm) < 0) {
|
if (qemudDomainSetSecurityLabel(h->conn, h->driver, h->vm) < 0) {
|
||||||
qemudReportError(h->conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemudReportError(h->conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Failed to set security label"));
|
"%s", _("Failed to set security label"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3592,7 +3592,7 @@ static int qemudDomainGetSecurityLabel(virDomainPtr dom, virSecurityLabelPtr sec
|
|||||||
if (driver->securityDriver && driver->securityDriver->domainGetSecurityLabel) {
|
if (driver->securityDriver && driver->securityDriver->domainGetSecurityLabel) {
|
||||||
if (driver->securityDriver->domainGetSecurityLabel(dom->conn, vm, seclabel) == -1) {
|
if (driver->securityDriver->domainGetSecurityLabel(dom->conn, vm, seclabel) == -1) {
|
||||||
qemudReportError(dom->conn, dom, NULL, VIR_ERR_INTERNAL_ERROR,
|
qemudReportError(dom->conn, dom, NULL, VIR_ERR_INTERNAL_ERROR,
|
||||||
_("Failed to get security label"));
|
"%s", _("Failed to get security label"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -423,7 +423,7 @@ virStorageBackendCreateQemuImg(virConnectPtr conn,
|
|||||||
use_kvmimg = 0;
|
use_kvmimg = 0;
|
||||||
else {
|
else {
|
||||||
virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
|
virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
|
||||||
_("unable to find kvm-img or qemu-img"));
|
"%s", _("unable to find kvm-img or qemu-img"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -472,8 +472,7 @@ virStorageBackendCreateQcowCreate(virConnectPtr conn,
|
|||||||
const char *imgargv[4];
|
const char *imgargv[4];
|
||||||
|
|
||||||
if (inputvol) {
|
if (inputvol) {
|
||||||
virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
|
virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR, "%s",
|
||||||
"%s",
|
|
||||||
_("cannot copy from volume with qcow-create"));
|
_("cannot copy from volume with qcow-create"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -485,7 +484,7 @@ virStorageBackendCreateQcowCreate(virConnectPtr conn,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (vol->backingStore.path != NULL) {
|
if (vol->backingStore.path != NULL) {
|
||||||
virStorageReportError(conn, VIR_ERR_NO_SUPPORT,
|
virStorageReportError(conn, VIR_ERR_NO_SUPPORT, "%s",
|
||||||
_("copy-on-write image not supported with "
|
_("copy-on-write image not supported with "
|
||||||
"qcow-create"));
|
"qcow-create"));
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -4873,7 +4873,7 @@ cmdVolClone(vshControl *ctl, const vshCmd *cmd)
|
|||||||
|
|
||||||
origpool = virStoragePoolLookupByVolume(origvol);
|
origpool = virStoragePoolLookupByVolume(origvol);
|
||||||
if (!origpool) {
|
if (!origpool) {
|
||||||
vshError(ctl, FALSE, _("failed to get parent pool"));
|
vshError(ctl, FALSE, "%s", _("failed to get parent pool"));
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6589,7 +6589,8 @@ cmdCd(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED)
|
|||||||
int found;
|
int found;
|
||||||
|
|
||||||
if (!ctl->imode) {
|
if (!ctl->imode) {
|
||||||
vshError(ctl, FALSE, _("cd: command valid only in interactive mode"));
|
vshError(ctl, FALSE, "%s",
|
||||||
|
_("cd: command valid only in interactive mode"));
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user