qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH qemu] qxl: COLO secondary node not need to release resources


From: ~dengxuehua
Subject: [PATCH qemu] qxl: COLO secondary node not need to release resources
Date: Tue, 25 Jan 2022 14:33:10 +0800

From: Dengxuehua <dengxh2@chinatelecom.cn>

---
From: Dengxuehua<dengxh2@chinatelecom.cn>

During COLO checkpoint,
the Secondary VM's qemu has loaded Primary VM's qxl states,
so it not
need to release qxl resources.

Resolves: https://gitlab.com/qemu-
project/qemu/-/issues/839
Signed-off-by:
Dengxuehua<dengxh2@chinatelecom.cn>

 hw/display/qxl.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/hw/display/qxl.c b/hw/display/qxl.c
index 1f9ad31943..41af36344a 100644
--- a/hw/display/qxl.c
+++ b/hw/display/qxl.c
@@ -31,6 +31,7 @@
 #include "hw/qdev-properties.h"
 #include "sysemu/runstate.h"
 #include "migration/vmstate.h"
+#include "migration/colo.h"
 #include "trace.h"
 
 #include "qxl.h"
@@ -757,6 +758,10 @@ static void interface_release_resource(QXLInstance *sin,
     if (!ext.info) {
         return;
     }
+    /* The SVM load PVM states,so it not need to release resources */
+    if (get_colo_mode() == COLO_MODE_SECONDARY) {
+        return;
+    }
     if (ext.group_id == MEMSLOT_GROUP_HOST) {
         /* host group -> vga mode update request */
         QXLCommandExt *cmdext = (void *)(intptr_t)(ext.info->id);
@@ -880,6 +885,10 @@ static int interface_flush_resources(QXLInstance *sin)
     PCIQXLDevice *qxl = container_of(sin, PCIQXLDevice, ssd.qxl);
     int ret;
 
+    /* The SVM load PVM states,so it not need to release resources */
+    if (get_colo_mode() == COLO_MODE_SECONDARY) {
+        return 0;
+    }
     ret = qxl->num_free_res;
     if (ret) {
         qxl_push_free_res(qxl, 1);
-- 
2.32.0



reply via email to

[Prev in Thread] Current Thread [Next in Thread]