qemuMonitorJSONEjectMedia: don't stringify the replay at all
Commit 256496e1 introduced a detection if "is locked" in error replay from qemu monitor. Commit c4073657 fixed a memory leak, but it was pointed out by Peter, that this could be done cleaner without stringifing the replay. Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
90791fbf96
commit
cbd3d06541
@ -2223,11 +2223,12 @@ int qemuMonitorJSONEjectMedia(qemuMonitorPtr mon,
|
|||||||
ret = qemuMonitorJSONCheckError(cmd, reply);
|
ret = qemuMonitorJSONCheckError(cmd, reply);
|
||||||
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
char *replyStr = virJSONValueToString(reply, false);
|
virJSONValuePtr error = virJSONValueObjectGet(reply, "error");
|
||||||
|
if (error) {
|
||||||
if (c_strcasestr(replyStr, "is locked"))
|
const char *errorStr = virJSONValueObjectGetString(error, "desc");
|
||||||
ret = -2;
|
if (errorStr && c_strcasestr(errorStr, "is locked"))
|
||||||
VIR_FREE(replyStr);
|
ret = -2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virJSONValueFree(cmd);
|
virJSONValueFree(cmd);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user