From nobody Tue May 7 21:54:32 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=git.sr.ht Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1643123303996292.6949107169055; Tue, 25 Jan 2022 07:08:23 -0800 (PST) Received: from localhost ([::1]:33388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nCNQk-0002H0-Fh for importer@patchew.org; Tue, 25 Jan 2022 10:08:22 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57380) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCHze-0003P1-Vc for qemu-devel@nongnu.org; Tue, 25 Jan 2022 04:20:03 -0500 Received: from mail-b.sr.ht ([173.195.146.151]:55560) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nCHzd-0003Dl-4k for qemu-devel@nongnu.org; Tue, 25 Jan 2022 04:20:02 -0500 Received: from git.sr.ht (unknown [173.195.146.142]) by mail-b.sr.ht (Postfix) with ESMTPSA id 7144611EFFE; Tue, 25 Jan 2022 09:19:57 +0000 (UTC) Authentication-Results: mail-b.sr.ht; dkim=none From: ~dengxuehua Date: Tue, 25 Jan 2022 14:33:10 +0800 Subject: [PATCH qemu] qxl: COLO secondary node not need to release resources MIME-Version: 1.0 Message-ID: <164310239719.1016.2386682120107304758-0@git.sr.ht> X-Mailer: git.sr.ht To: qemu-devel@nongnu.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=173.195.146.151; envelope-from=outgoing@sr.ht; helo=mail-b.sr.ht X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 25 Jan 2022 10:01:45 -0500 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ~dengxuehua Cc: dengxh2@chinatelecom.cn, kraxel@redhat.com, zhang.zhanghailiang@huawei.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZM-MESSAGEID: 1643123304828100001 From: Dengxuehua --- From: Dengxuehua 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 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" =20 #include "qxl.h" @@ -757,6 +758,10 @@ static void interface_release_resource(QXLInstance *si= n, if (!ext.info) { return; } + /* The SVM load PVM states,so it not need to release resources */ + if (get_colo_mode() =3D=3D COLO_MODE_SECONDARY) { + return; + } if (ext.group_id =3D=3D MEMSLOT_GROUP_HOST) { /* host group -> vga mode update request */ QXLCommandExt *cmdext =3D (void *)(intptr_t)(ext.info->id); @@ -880,6 +885,10 @@ static int interface_flush_resources(QXLInstance *sin) PCIQXLDevice *qxl =3D container_of(sin, PCIQXLDevice, ssd.qxl); int ret; =20 + /* The SVM load PVM states,so it not need to release resources */ + if (get_colo_mode() =3D=3D COLO_MODE_SECONDARY) { + return 0; + } ret =3D qxl->num_free_res; if (ret) { qxl_push_free_res(qxl, 1); --=20 2.32.0