Invoking qemuProcessSetupVcpus in process of VM reconnection. Signed-off-by: Wang Huaqiang <huaqiang.wang@xxxxxxxxx> --- src/qemu/qemu_process.c | 3 +++ src/util/virresctrl.c | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index a4bbef6..f85aef0 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -7987,6 +7987,9 @@ qemuProcessReconnect(void *opaque) } } + if (qemuProcessSetupVcpus(obj) < 0) + goto error; + /* update domain state XML with possibly updated state in virDomainObj */ if (virDomainSaveStatus(driver->xmlopt, cfg->stateDir, obj, driver->caps) < 0) goto error; diff --git a/src/util/virresctrl.c b/src/util/virresctrl.c index 67dfbb8..b5717b2 100644 --- a/src/util/virresctrl.c +++ b/src/util/virresctrl.c @@ -2495,9 +2495,16 @@ int virResctrlMonitorAddPID(virResctrlMonitorPtr monitor, pid_t pid) { + size_t i = 0; + if (virResctrlAddPID(monitor->path, pid) < 0) return -1; + for (i = 0; i < monitor->npids; i++) { + if (pid == monitor->pids[i]) + return 0; + } + if (VIR_APPEND_ELEMENT(monitor->pids, monitor->npids, pid) < 0) return -1; -- 2.7.4 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list