mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-26 18:41:17 +00:00
Stop free'ing 'const char *' strings
The VIR_FREE() macro will cast away any const-ness. This masked a number of places where we passed a 'const char *' string to VIR_FREE. Fortunately in all of these cases, the variable was not in fact const data, but a heap allocated string. Fix all the variable declarations to reflect this. Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
This commit is contained in:
parent
41b5505679
commit
bbcdd9b5dc
@ -6777,9 +6777,9 @@ virDomainChrDefParseTargetXML(virDomainChrDefPtr def,
|
|||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
unsigned int port;
|
unsigned int port;
|
||||||
const char *targetType = virXMLPropString(cur, "type");
|
char *targetType = virXMLPropString(cur, "type");
|
||||||
const char *addrStr = NULL;
|
char *addrStr = NULL;
|
||||||
const char *portStr = NULL;
|
char *portStr = NULL;
|
||||||
|
|
||||||
if ((def->targetType =
|
if ((def->targetType =
|
||||||
virDomainChrTargetTypeFromString(def, def->deviceType,
|
virDomainChrTargetTypeFromString(def, def->deviceType,
|
||||||
@ -8193,7 +8193,7 @@ virDomainGraphicsDefParseXML(xmlNodePtr node,
|
|||||||
while (cur != NULL) {
|
while (cur != NULL) {
|
||||||
if (cur->type == XML_ELEMENT_NODE) {
|
if (cur->type == XML_ELEMENT_NODE) {
|
||||||
if (xmlStrEqual(cur->name, BAD_CAST "channel")) {
|
if (xmlStrEqual(cur->name, BAD_CAST "channel")) {
|
||||||
const char *name, *mode;
|
char *name, *mode;
|
||||||
int nameval, modeval;
|
int nameval, modeval;
|
||||||
name = virXMLPropString(cur, "name");
|
name = virXMLPropString(cur, "name");
|
||||||
mode = virXMLPropString(cur, "mode");
|
mode = virXMLPropString(cur, "mode");
|
||||||
@ -8227,7 +8227,7 @@ virDomainGraphicsDefParseXML(xmlNodePtr node,
|
|||||||
|
|
||||||
def->data.spice.channels[nameval] = modeval;
|
def->data.spice.channels[nameval] = modeval;
|
||||||
} else if (xmlStrEqual(cur->name, BAD_CAST "image")) {
|
} else if (xmlStrEqual(cur->name, BAD_CAST "image")) {
|
||||||
const char *compression = virXMLPropString(cur, "compression");
|
char *compression = virXMLPropString(cur, "compression");
|
||||||
int compressionVal;
|
int compressionVal;
|
||||||
|
|
||||||
if (!compression) {
|
if (!compression) {
|
||||||
@ -8248,7 +8248,7 @@ virDomainGraphicsDefParseXML(xmlNodePtr node,
|
|||||||
|
|
||||||
def->data.spice.image = compressionVal;
|
def->data.spice.image = compressionVal;
|
||||||
} else if (xmlStrEqual(cur->name, BAD_CAST "jpeg")) {
|
} else if (xmlStrEqual(cur->name, BAD_CAST "jpeg")) {
|
||||||
const char *compression = virXMLPropString(cur, "compression");
|
char *compression = virXMLPropString(cur, "compression");
|
||||||
int compressionVal;
|
int compressionVal;
|
||||||
|
|
||||||
if (!compression) {
|
if (!compression) {
|
||||||
@ -8269,7 +8269,7 @@ virDomainGraphicsDefParseXML(xmlNodePtr node,
|
|||||||
|
|
||||||
def->data.spice.jpeg = compressionVal;
|
def->data.spice.jpeg = compressionVal;
|
||||||
} else if (xmlStrEqual(cur->name, BAD_CAST "zlib")) {
|
} else if (xmlStrEqual(cur->name, BAD_CAST "zlib")) {
|
||||||
const char *compression = virXMLPropString(cur, "compression");
|
char *compression = virXMLPropString(cur, "compression");
|
||||||
int compressionVal;
|
int compressionVal;
|
||||||
|
|
||||||
if (!compression) {
|
if (!compression) {
|
||||||
@ -8290,7 +8290,7 @@ virDomainGraphicsDefParseXML(xmlNodePtr node,
|
|||||||
|
|
||||||
def->data.spice.zlib = compressionVal;
|
def->data.spice.zlib = compressionVal;
|
||||||
} else if (xmlStrEqual(cur->name, BAD_CAST "playback")) {
|
} else if (xmlStrEqual(cur->name, BAD_CAST "playback")) {
|
||||||
const char *compression = virXMLPropString(cur, "compression");
|
char *compression = virXMLPropString(cur, "compression");
|
||||||
int compressionVal;
|
int compressionVal;
|
||||||
|
|
||||||
if (!compression) {
|
if (!compression) {
|
||||||
@ -8311,7 +8311,7 @@ virDomainGraphicsDefParseXML(xmlNodePtr node,
|
|||||||
|
|
||||||
def->data.spice.playback = compressionVal;
|
def->data.spice.playback = compressionVal;
|
||||||
} else if (xmlStrEqual(cur->name, BAD_CAST "streaming")) {
|
} else if (xmlStrEqual(cur->name, BAD_CAST "streaming")) {
|
||||||
const char *mode = virXMLPropString(cur, "mode");
|
char *mode = virXMLPropString(cur, "mode");
|
||||||
int modeVal;
|
int modeVal;
|
||||||
|
|
||||||
if (!mode) {
|
if (!mode) {
|
||||||
@ -8331,7 +8331,7 @@ virDomainGraphicsDefParseXML(xmlNodePtr node,
|
|||||||
|
|
||||||
def->data.spice.streaming = modeVal;
|
def->data.spice.streaming = modeVal;
|
||||||
} else if (xmlStrEqual(cur->name, BAD_CAST "clipboard")) {
|
} else if (xmlStrEqual(cur->name, BAD_CAST "clipboard")) {
|
||||||
const char *copypaste = virXMLPropString(cur, "copypaste");
|
char *copypaste = virXMLPropString(cur, "copypaste");
|
||||||
int copypasteVal;
|
int copypasteVal;
|
||||||
|
|
||||||
if (!copypaste) {
|
if (!copypaste) {
|
||||||
@ -8351,7 +8351,7 @@ virDomainGraphicsDefParseXML(xmlNodePtr node,
|
|||||||
|
|
||||||
def->data.spice.copypaste = copypasteVal;
|
def->data.spice.copypaste = copypasteVal;
|
||||||
} else if (xmlStrEqual(cur->name, BAD_CAST "mouse")) {
|
} else if (xmlStrEqual(cur->name, BAD_CAST "mouse")) {
|
||||||
const char *mode = virXMLPropString(cur, "mode");
|
char *mode = virXMLPropString(cur, "mode");
|
||||||
int modeVal;
|
int modeVal;
|
||||||
|
|
||||||
if (!mode) {
|
if (!mode) {
|
||||||
@ -8543,9 +8543,9 @@ virDomainRNGDefParseXML(const xmlNodePtr node,
|
|||||||
xmlXPathContextPtr ctxt,
|
xmlXPathContextPtr ctxt,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
const char *model = NULL;
|
char *model = NULL;
|
||||||
const char *backend = NULL;
|
char *backend = NULL;
|
||||||
const char *type = NULL;
|
char *type = NULL;
|
||||||
virDomainRNGDefPtr def;
|
virDomainRNGDefPtr def;
|
||||||
xmlNodePtr save = ctxt->node;
|
xmlNodePtr save = ctxt->node;
|
||||||
xmlNodePtr *backends = NULL;
|
xmlNodePtr *backends = NULL;
|
||||||
@ -15220,7 +15220,7 @@ virDomainChrDefFormat(virBufferPtr buf,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *addr = virSocketAddrFormat(def->target.addr);
|
char *addr = virSocketAddrFormat(def->target.addr);
|
||||||
if (addr == NULL)
|
if (addr == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
@ -36,8 +36,8 @@ virNetDevVlanParse(xmlNodePtr node, xmlXPathContextPtr ctxt, virNetDevVlanPtr de
|
|||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
xmlNodePtr save = ctxt->node;
|
xmlNodePtr save = ctxt->node;
|
||||||
const char *trunk = NULL;
|
char *trunk = NULL;
|
||||||
const char *nativeMode = NULL;
|
char *nativeMode = NULL;
|
||||||
xmlNodePtr *tagNodes = NULL;
|
xmlNodePtr *tagNodes = NULL;
|
||||||
int nTags;
|
int nTags;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
@ -2432,7 +2432,8 @@ static const char *
|
|||||||
virNWFilterIsAllowedChain(const char *chainname)
|
virNWFilterIsAllowedChain(const char *chainname)
|
||||||
{
|
{
|
||||||
enum virNWFilterChainSuffixType i;
|
enum virNWFilterChainSuffixType i;
|
||||||
const char *name, *msg;
|
const char *name;
|
||||||
|
char *msg;
|
||||||
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
||||||
bool printed = false;
|
bool printed = false;
|
||||||
|
|
||||||
|
@ -367,7 +367,7 @@ udevLogFunction(struct udev *udev ATTRIBUTE_UNUSED,
|
|||||||
va_list args)
|
va_list args)
|
||||||
{
|
{
|
||||||
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
||||||
const char *format = NULL;
|
char *format = NULL;
|
||||||
|
|
||||||
virBufferAdd(&buf, fmt, -1);
|
virBufferAdd(&buf, fmt, -1);
|
||||||
virBufferTrim(&buf, "\n", -1);
|
virBufferTrim(&buf, "\n", -1);
|
||||||
|
@ -499,7 +499,7 @@ virNWFilterDetermineMissingVarsRec(virNWFilterDefPtr filter,
|
|||||||
for (j = 0; j < rule->nVarAccess; j++) {
|
for (j = 0; j < rule->nVarAccess; j++) {
|
||||||
if (!virNWFilterVarAccessIsAvailable(rule->varAccess[j],
|
if (!virNWFilterVarAccessIsAvailable(rule->varAccess[j],
|
||||||
vars)) {
|
vars)) {
|
||||||
const char *varAccess;
|
char *varAccess;
|
||||||
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
||||||
|
|
||||||
virNWFilterVarAccessPrint(rule->varAccess[j], &buf);
|
virNWFilterVarAccessPrint(rule->varAccess[j], &buf);
|
||||||
|
@ -6147,7 +6147,8 @@ static char *qemuBuildTPMBackendStr(const virDomainDefPtr def,
|
|||||||
const virDomainTPMDefPtr tpm = def->tpm;
|
const virDomainTPMDefPtr tpm = def->tpm;
|
||||||
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
||||||
const char *type = virDomainTPMBackendTypeToString(tpm->type);
|
const char *type = virDomainTPMBackendTypeToString(tpm->type);
|
||||||
const char *cancel_path, *tpmdev;
|
char *cancel_path;
|
||||||
|
const char *tpmdev;
|
||||||
|
|
||||||
virBufferAsprintf(&buf, "%s,id=tpm-%s", type, tpm->info.alias);
|
virBufferAsprintf(&buf, "%s,id=tpm-%s", type, tpm->info.alias);
|
||||||
|
|
||||||
@ -7772,7 +7773,7 @@ qemuBuildCommandLine(virConnectPtr conn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_RTC)) {
|
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_RTC)) {
|
||||||
const char *rtcopt;
|
char *rtcopt;
|
||||||
virCommandAddArg(cmd, "-rtc");
|
virCommandAddArg(cmd, "-rtc");
|
||||||
if (!(rtcopt = qemuBuildClockArgStr(&def->clock)))
|
if (!(rtcopt = qemuBuildClockArgStr(&def->clock)))
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -1383,7 +1383,7 @@ qemuDomainDefCopy(virQEMUDriverPtr driver,
|
|||||||
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
||||||
virDomainDefPtr ret = NULL;
|
virDomainDefPtr ret = NULL;
|
||||||
virCapsPtr caps = NULL;
|
virCapsPtr caps = NULL;
|
||||||
const char *xml = NULL;
|
char *xml = NULL;
|
||||||
|
|
||||||
if (qemuDomainDefFormatBuf(driver, src, flags, &buf) < 0)
|
if (qemuDomainDefFormatBuf(driver, src, flags, &buf) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
@ -14658,7 +14658,7 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
|
|||||||
virDomainDefPtr persistentDef = NULL;
|
virDomainDefPtr persistentDef = NULL;
|
||||||
virDomainBlockIoTuneInfo info;
|
virDomainBlockIoTuneInfo info;
|
||||||
virDomainBlockIoTuneInfo *oldinfo;
|
virDomainBlockIoTuneInfo *oldinfo;
|
||||||
const char *device = NULL;
|
char *device = NULL;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
size_t i;
|
size_t i;
|
||||||
int idx = -1;
|
int idx = -1;
|
||||||
@ -14836,7 +14836,7 @@ qemuDomainGetBlockIoTune(virDomainPtr dom,
|
|||||||
qemuDomainObjPrivatePtr priv;
|
qemuDomainObjPrivatePtr priv;
|
||||||
virDomainDefPtr persistentDef = NULL;
|
virDomainDefPtr persistentDef = NULL;
|
||||||
virDomainBlockIoTuneInfo reply;
|
virDomainBlockIoTuneInfo reply;
|
||||||
const char *device = NULL;
|
char *device = NULL;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
size_t i;
|
size_t i;
|
||||||
virCapsPtr caps = NULL;
|
virCapsPtr caps = NULL;
|
||||||
|
@ -268,8 +268,9 @@ virNetSSHKbIntCb(const char *name ATTRIBUTE_UNUSED,
|
|||||||
cleanup:
|
cleanup:
|
||||||
if (askcred) {
|
if (askcred) {
|
||||||
for (i = 0; i < num_prompts; i++) {
|
for (i = 0; i < num_prompts; i++) {
|
||||||
|
char *prompt = (char *)askcred[i].prompt;
|
||||||
VIR_FREE(askcred[i].result);
|
VIR_FREE(askcred[i].result);
|
||||||
VIR_FREE(askcred[i].prompt);
|
VIR_FREE(prompt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -291,6 +292,8 @@ virNetSSHCheckHostKey(virNetSSHSessionPtr sess)
|
|||||||
int ret;
|
int ret;
|
||||||
const char *key;
|
const char *key;
|
||||||
const char *keyhash;
|
const char *keyhash;
|
||||||
|
char *keyhashstr;
|
||||||
|
char *tmp;
|
||||||
int keyType;
|
int keyType;
|
||||||
size_t keyLength;
|
size_t keyLength;
|
||||||
char *errmsg;
|
char *errmsg;
|
||||||
@ -372,16 +375,16 @@ virNetSSHCheckHostKey(virNetSSHSessionPtr sess)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
keyhash = virBufferContentAndReset(&buff);
|
keyhashstr = virBufferContentAndReset(&buff);
|
||||||
|
|
||||||
askKey.type = VIR_CRED_ECHOPROMPT;
|
askKey.type = VIR_CRED_ECHOPROMPT;
|
||||||
if (virAsprintf((char **)&askKey.prompt,
|
if (virAsprintf((char **)&askKey.prompt,
|
||||||
_("Accept SSH host key with hash '%s' for "
|
_("Accept SSH host key with hash '%s' for "
|
||||||
"host '%s:%d' (%s/%s)?"),
|
"host '%s:%d' (%s/%s)?"),
|
||||||
keyhash,
|
keyhashstr,
|
||||||
sess->hostname, sess->port,
|
sess->hostname, sess->port,
|
||||||
"y", "n") < 0) {
|
"y", "n") < 0) {
|
||||||
VIR_FREE(keyhash);
|
VIR_FREE(keyhashstr);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -389,23 +392,25 @@ virNetSSHCheckHostKey(virNetSSHSessionPtr sess)
|
|||||||
virReportError(VIR_ERR_SSH, "%s",
|
virReportError(VIR_ERR_SSH, "%s",
|
||||||
_("failed to retrieve decision to accept "
|
_("failed to retrieve decision to accept "
|
||||||
"host key"));
|
"host key"));
|
||||||
VIR_FREE(askKey.prompt);
|
tmp = (char*)askKey.prompt;
|
||||||
VIR_FREE(keyhash);
|
VIR_FREE(tmp);
|
||||||
|
VIR_FREE(keyhashstr);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_FREE(askKey.prompt);
|
tmp = (char*)askKey.prompt;
|
||||||
|
VIR_FREE(tmp);
|
||||||
|
|
||||||
if (!askKey.result ||
|
if (!askKey.result ||
|
||||||
STRCASENEQ(askKey.result, "y")) {
|
STRCASENEQ(askKey.result, "y")) {
|
||||||
virReportError(VIR_ERR_SSH,
|
virReportError(VIR_ERR_SSH,
|
||||||
_("SSH host key for '%s' (%s) was not accepted"),
|
_("SSH host key for '%s' (%s) was not accepted"),
|
||||||
sess->hostname, keyhash);
|
sess->hostname, keyhashstr);
|
||||||
VIR_FREE(keyhash);
|
VIR_FREE(keyhashstr);
|
||||||
VIR_FREE(askKey.result);
|
VIR_FREE(askKey.result);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
VIR_FREE(keyhash);
|
VIR_FREE(keyhashstr);
|
||||||
VIR_FREE(askKey.result);
|
VIR_FREE(askKey.result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -590,6 +595,7 @@ virNetSSHAuthenticatePrivkey(virNetSSHSessionPtr sess,
|
|||||||
size_t i;
|
size_t i;
|
||||||
char *errmsg;
|
char *errmsg;
|
||||||
int ret;
|
int ret;
|
||||||
|
char *tmp;
|
||||||
|
|
||||||
/* try open the key with no password */
|
/* try open the key with no password */
|
||||||
if ((ret = libssh2_userauth_publickey_fromfile(sess->session,
|
if ((ret = libssh2_userauth_publickey_fromfile(sess->session,
|
||||||
@ -644,11 +650,13 @@ virNetSSHAuthenticatePrivkey(virNetSSHSessionPtr sess,
|
|||||||
virReportError(VIR_ERR_SSH, "%s",
|
virReportError(VIR_ERR_SSH, "%s",
|
||||||
_("failed to retrieve private key passphrase: "
|
_("failed to retrieve private key passphrase: "
|
||||||
"callback has failed"));
|
"callback has failed"));
|
||||||
VIR_FREE(retr_passphrase.prompt);
|
tmp = (char *)retr_passphrase.prompt;
|
||||||
|
VIR_FREE(tmp);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
VIR_FREE(retr_passphrase.prompt);
|
tmp = (char *)retr_passphrase.prompt;
|
||||||
|
VIR_FREE(tmp);
|
||||||
|
|
||||||
ret = libssh2_userauth_publickey_fromfile(sess->session,
|
ret = libssh2_userauth_publickey_fromfile(sess->session,
|
||||||
priv->username,
|
priv->username,
|
||||||
|
@ -931,7 +931,7 @@ virStorageBackendCreateQemuImg(virConnectPtr conn,
|
|||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
{
|
{
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
const char *create_tool;
|
char *create_tool;
|
||||||
int imgformat;
|
int imgformat;
|
||||||
virCommandPtr cmd;
|
virCommandPtr cmd;
|
||||||
|
|
||||||
|
@ -1450,7 +1450,7 @@ storageVolLookupByPath(virConnectPtr conn,
|
|||||||
virStoragePoolObjLock(driver->pools.objs[i]);
|
virStoragePoolObjLock(driver->pools.objs[i]);
|
||||||
if (virStoragePoolObjIsActive(driver->pools.objs[i])) {
|
if (virStoragePoolObjIsActive(driver->pools.objs[i])) {
|
||||||
virStorageVolDefPtr vol;
|
virStorageVolDefPtr vol;
|
||||||
const char *stable_path;
|
char *stable_path;
|
||||||
|
|
||||||
stable_path = virStorageBackendStablePath(driver->pools.objs[i],
|
stable_path = virStorageBackendStablePath(driver->pools.objs[i],
|
||||||
cleanpath,
|
cleanpath,
|
||||||
|
@ -405,6 +405,7 @@ virExec(virCommandPtr cmd)
|
|||||||
int childout = -1;
|
int childout = -1;
|
||||||
int childerr = -1;
|
int childerr = -1;
|
||||||
int tmpfd;
|
int tmpfd;
|
||||||
|
char *binarystr = NULL;
|
||||||
const char *binary = NULL;
|
const char *binary = NULL;
|
||||||
int forkRet, ret;
|
int forkRet, ret;
|
||||||
struct sigaction waxon, waxoff;
|
struct sigaction waxon, waxoff;
|
||||||
@ -412,7 +413,7 @@ virExec(virCommandPtr cmd)
|
|||||||
int ngroups;
|
int ngroups;
|
||||||
|
|
||||||
if (cmd->args[0][0] != '/') {
|
if (cmd->args[0][0] != '/') {
|
||||||
if (!(binary = virFindFileInPath(cmd->args[0]))) {
|
if (!(binary = binarystr = virFindFileInPath(cmd->args[0]))) {
|
||||||
virReportSystemError(ENOENT,
|
virReportSystemError(ENOENT,
|
||||||
_("Cannot find '%s' in path"),
|
_("Cannot find '%s' in path"),
|
||||||
cmd->args[0]);
|
cmd->args[0]);
|
||||||
@ -506,8 +507,7 @@ virExec(virCommandPtr cmd)
|
|||||||
|
|
||||||
cmd->pid = pid;
|
cmd->pid = pid;
|
||||||
|
|
||||||
if (binary != cmd->args[0])
|
VIR_FREE(binarystr);
|
||||||
VIR_FREE(binary);
|
|
||||||
VIR_FREE(groups);
|
VIR_FREE(groups);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -713,8 +713,7 @@ virExec(virCommandPtr cmd)
|
|||||||
should never jump here on error */
|
should never jump here on error */
|
||||||
|
|
||||||
VIR_FREE(groups);
|
VIR_FREE(groups);
|
||||||
if (binary != cmd->args[0])
|
VIR_FREE(binarystr);
|
||||||
VIR_FREE(binary);
|
|
||||||
|
|
||||||
/* NB we don't virReportError() on any failures here
|
/* NB we don't virReportError() on any failures here
|
||||||
because the code which jumped here already raised
|
because the code which jumped here already raised
|
||||||
|
@ -94,7 +94,7 @@ static regex_t *virLogRegex = NULL;
|
|||||||
* based on a matching pattern (currently a substring)
|
* based on a matching pattern (currently a substring)
|
||||||
*/
|
*/
|
||||||
struct _virLogFilter {
|
struct _virLogFilter {
|
||||||
const char *match;
|
char *match;
|
||||||
virLogPriority priority;
|
virLogPriority priority;
|
||||||
unsigned int flags;
|
unsigned int flags;
|
||||||
};
|
};
|
||||||
@ -115,7 +115,7 @@ struct _virLogOutput {
|
|||||||
virLogCloseFunc c;
|
virLogCloseFunc c;
|
||||||
virLogPriority priority;
|
virLogPriority priority;
|
||||||
virLogDestination dest;
|
virLogDestination dest;
|
||||||
const char *name;
|
char *name;
|
||||||
};
|
};
|
||||||
typedef struct _virLogOutput virLogOutput;
|
typedef struct _virLogOutput virLogOutput;
|
||||||
typedef virLogOutput *virLogOutputPtr;
|
typedef virLogOutput *virLogOutputPtr;
|
||||||
|
@ -2346,8 +2346,8 @@ cmdDomIfSetLink(vshControl *ctl, const vshCmd *cmd)
|
|||||||
virDomainPtr dom;
|
virDomainPtr dom;
|
||||||
const char *iface;
|
const char *iface;
|
||||||
const char *state;
|
const char *state;
|
||||||
const char *value;
|
char *value;
|
||||||
const char *desc;
|
char *desc;
|
||||||
virMacAddr macaddr;
|
virMacAddr macaddr;
|
||||||
const char *element;
|
const char *element;
|
||||||
const char *attr;
|
const char *attr;
|
||||||
@ -6186,7 +6186,7 @@ cmdCPUBaseline(vshControl *ctl, const vshCmd *cmd)
|
|||||||
bool ret = false;
|
bool ret = false;
|
||||||
char *buffer;
|
char *buffer;
|
||||||
char *result = NULL;
|
char *result = NULL;
|
||||||
const char **list = NULL;
|
char **list = NULL;
|
||||||
unsigned int flags = 0;
|
unsigned int flags = 0;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
@ -6243,7 +6243,8 @@ cmdCPUBaseline(vshControl *ctl, const vshCmd *cmd)
|
|||||||
list[i] = vshStrdup(ctl, (const char *)xmlBufferContent(xml_buf));
|
list[i] = vshStrdup(ctl, (const char *)xmlBufferContent(xml_buf));
|
||||||
}
|
}
|
||||||
|
|
||||||
result = virConnectBaselineCPU(ctl->conn, list, count, flags);
|
result = virConnectBaselineCPU(ctl->conn,
|
||||||
|
(const char **)list, count, flags);
|
||||||
|
|
||||||
if (result) {
|
if (result) {
|
||||||
vshPrint(ctl, "%s", result);
|
vshPrint(ctl, "%s", result);
|
||||||
@ -6398,7 +6399,7 @@ cmdCPUStats(vshControl *ctl, const vshCmd *cmd)
|
|||||||
params[pos].value.ul / 1000000000,
|
params[pos].value.ul / 1000000000,
|
||||||
params[pos].value.ul % 1000000000);
|
params[pos].value.ul % 1000000000);
|
||||||
} else {
|
} else {
|
||||||
const char *s = vshGetTypedParamValue(ctl, ¶ms[pos]);
|
char *s = vshGetTypedParamValue(ctl, ¶ms[pos]);
|
||||||
vshPrint(ctl, _("%s\n"), s);
|
vshPrint(ctl, _("%s\n"), s);
|
||||||
VIR_FREE(s);
|
VIR_FREE(s);
|
||||||
}
|
}
|
||||||
@ -9874,8 +9875,8 @@ vshPrepareDiskXML(xmlNodePtr disk_node,
|
|||||||
{
|
{
|
||||||
xmlNodePtr cur = NULL;
|
xmlNodePtr cur = NULL;
|
||||||
xmlBufferPtr xml_buf = NULL;
|
xmlBufferPtr xml_buf = NULL;
|
||||||
const char *disk_type = NULL;
|
char *disk_type = NULL;
|
||||||
const char *device_type = NULL;
|
char *device_type = NULL;
|
||||||
xmlNodePtr new_node = NULL;
|
xmlNodePtr new_node = NULL;
|
||||||
char *ret = NULL;
|
char *ret = NULL;
|
||||||
|
|
||||||
@ -10211,9 +10212,9 @@ cmdChangeMedia(vshControl *ctl, const vshCmd *cmd)
|
|||||||
virDomainPtr dom = NULL;
|
virDomainPtr dom = NULL;
|
||||||
const char *source = NULL;
|
const char *source = NULL;
|
||||||
const char *path = NULL;
|
const char *path = NULL;
|
||||||
const char *doc = NULL;
|
char *doc = NULL;
|
||||||
xmlNodePtr disk_node = NULL;
|
xmlNodePtr disk_node = NULL;
|
||||||
const char *disk_xml = NULL;
|
char *disk_xml = NULL;
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
int prepare_type = 0;
|
int prepare_type = 0;
|
||||||
const char *action = NULL;
|
const char *action = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user