mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
Suppress cgroup error message on sucess startup
Even if qemudStartVMDaemon suceeds, an error was logged such as 'qemuRemoveCgroup:1778 : internal error Unable to find cgroup for'. This is because qemudStartVMDaemon calls qemuRemoveCgroup to ensure that old cgroup does not remain. This workaround makes sense but leaving an error message may confuse users. * src/qemu/qemu_driver.c: a an option to the function to suppress the error being logged
This commit is contained in:
parent
e2692e25de
commit
2597f8ecc9
@ -1924,7 +1924,8 @@ cleanup:
|
||||
|
||||
static int qemuRemoveCgroup(virConnectPtr conn,
|
||||
struct qemud_driver *driver,
|
||||
virDomainObjPtr vm)
|
||||
virDomainObjPtr vm,
|
||||
int quiet)
|
||||
{
|
||||
virCgroupPtr cgroup;
|
||||
int rc;
|
||||
@ -1934,9 +1935,10 @@ static int qemuRemoveCgroup(virConnectPtr conn,
|
||||
|
||||
rc = virCgroupForDomain(driver->cgroup, vm->def->name, &cgroup, 0);
|
||||
if (rc != 0) {
|
||||
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
||||
_("Unable to find cgroup for %s\n"),
|
||||
vm->def->name);
|
||||
if (!quiet)
|
||||
qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
|
||||
_("Unable to find cgroup for %s\n"),
|
||||
vm->def->name);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@ -2303,7 +2305,7 @@ static int qemudStartVMDaemon(virConnectPtr conn,
|
||||
return -1;
|
||||
|
||||
/* Ensure no historical cgroup for this VM is lieing around bogus settings */
|
||||
qemuRemoveCgroup(conn, driver, vm);
|
||||
qemuRemoveCgroup(conn, driver, vm, 1);
|
||||
|
||||
if ((vm->def->ngraphics == 1) &&
|
||||
vm->def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC &&
|
||||
@ -2505,7 +2507,7 @@ cleanup:
|
||||
VIR_FREE(vm->def->seclabel.label);
|
||||
VIR_FREE(vm->def->seclabel.imagelabel);
|
||||
}
|
||||
qemuRemoveCgroup(conn, driver, vm);
|
||||
qemuRemoveCgroup(conn, driver, vm, 0);
|
||||
if ((vm->def->ngraphics == 1) &&
|
||||
vm->def->graphics[0]->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC &&
|
||||
vm->def->graphics[0]->data.vnc.autoport)
|
||||
@ -2595,7 +2597,7 @@ static void qemudShutdownVMDaemon(virConnectPtr conn,
|
||||
qemuDomainReAttachHostDevices(conn, driver, vm->def);
|
||||
|
||||
retry:
|
||||
if ((ret = qemuRemoveCgroup(conn, driver, vm)) < 0) {
|
||||
if ((ret = qemuRemoveCgroup(conn, driver, vm, 0)) < 0) {
|
||||
if (ret == -EBUSY && (retries++ < 5)) {
|
||||
usleep(200*1000);
|
||||
goto retry;
|
||||
|
Loading…
Reference in New Issue
Block a user