mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
qemu: Don't duplicate virGetLastErrorMessage
These uses of virGetLastError message are just duplicating virGetLastErrorMessage.
This commit is contained in:
parent
98354e362c
commit
2c20574d5b
@ -3089,10 +3089,8 @@ virQEMUCapsInitCached(virQEMUCapsPtr qemuCaps, const char *cacheDir)
|
||||
|
||||
if (virQEMUCapsLoadCache(qemuCaps, capsfile, &qemuctime, &selfctime,
|
||||
&selfvers) < 0) {
|
||||
virErrorPtr err = virGetLastError();
|
||||
VIR_WARN("Failed to load cached caps from '%s' for '%s': %s",
|
||||
capsfile, qemuCaps->binary, err ? NULLSTR(err->message) :
|
||||
_("unknown error"));
|
||||
capsfile, qemuCaps->binary, virGetLastErrorMessage());
|
||||
virResetLastError();
|
||||
ret = 0;
|
||||
virQEMUCapsReset(qemuCaps);
|
||||
@ -3320,9 +3318,8 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps,
|
||||
/* @mon is supposed to be locked by callee */
|
||||
|
||||
if (qemuMonitorSetCapabilities(mon) < 0) {
|
||||
virErrorPtr err = virGetLastError();
|
||||
VIR_DEBUG("Failed to set monitor capabilities %s",
|
||||
err ? err->message : "<unknown problem>");
|
||||
virGetLastErrorMessage());
|
||||
ret = 0;
|
||||
goto cleanup;
|
||||
}
|
||||
@ -3330,9 +3327,8 @@ virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps,
|
||||
if (qemuMonitorGetVersion(mon,
|
||||
&major, &minor, µ,
|
||||
&package) < 0) {
|
||||
virErrorPtr err = virGetLastError();
|
||||
VIR_DEBUG("Failed to query monitor version %s",
|
||||
err ? err->message : "<unknown problem>");
|
||||
virGetLastErrorMessage());
|
||||
ret = 0;
|
||||
goto cleanup;
|
||||
}
|
||||
@ -3561,15 +3557,13 @@ virQEMUCapsLogProbeFailure(const char *binary)
|
||||
{ .key = "LIBVIRT_QEMU_BINARY", .s = binary, .iv = 0 },
|
||||
{ .key = NULL },
|
||||
};
|
||||
virErrorPtr err = virGetLastError();
|
||||
|
||||
virLogMessage(&virLogSelf,
|
||||
VIR_LOG_WARN,
|
||||
__FILE__, __LINE__, __func__,
|
||||
meta,
|
||||
_("Failed to probe capabilities for %s: %s"),
|
||||
binary, err && err->message ? err->message :
|
||||
_("unknown failure"));
|
||||
binary, virGetLastErrorMessage());
|
||||
}
|
||||
|
||||
|
||||
|
@ -276,7 +276,6 @@ qemuAutostartDomain(virDomainObjPtr vm,
|
||||
void *opaque)
|
||||
{
|
||||
struct qemuAutostartData *data = opaque;
|
||||
virErrorPtr err;
|
||||
int flags = 0;
|
||||
virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(data->driver);
|
||||
int ret = -1;
|
||||
@ -290,19 +289,15 @@ qemuAutostartDomain(virDomainObjPtr vm,
|
||||
if (vm->autostart &&
|
||||
!virDomainObjIsActive(vm)) {
|
||||
if (qemuProcessBeginJob(data->driver, vm) < 0) {
|
||||
err = virGetLastError();
|
||||
VIR_ERROR(_("Failed to start job on VM '%s': %s"),
|
||||
vm->def->name,
|
||||
err ? err->message : _("unknown error"));
|
||||
vm->def->name, virGetLastErrorMessage());
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (qemuDomainObjStart(data->conn, data->driver, vm, flags,
|
||||
QEMU_ASYNC_JOB_START) < 0) {
|
||||
err = virGetLastError();
|
||||
VIR_ERROR(_("Failed to autostart VM '%s': %s"),
|
||||
vm->def->name,
|
||||
err ? err->message : _("unknown error"));
|
||||
vm->def->name, virGetLastErrorMessage());
|
||||
}
|
||||
|
||||
qemuProcessEndJob(data->driver, vm);
|
||||
|
Loading…
x
Reference in New Issue
Block a user