From nobody Sun May 5 23:54:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1510677033780640.4923535639563; Tue, 14 Nov 2017 08:30:33 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 193E3C04AC5E; Tue, 14 Nov 2017 16:30:32 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B22CF8A9DB; Tue, 14 Nov 2017 16:30:31 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 47C623D380; Tue, 14 Nov 2017 16:30:31 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id vAEGUTxE027880 for ; Tue, 14 Nov 2017 11:30:29 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5E36E8B163; Tue, 14 Nov 2017 16:30:29 +0000 (UTC) Received: from antique-work.brq.redhat.com (unknown [10.43.2.152]) by smtp.corp.redhat.com (Postfix) with ESMTP id D64058B175 for ; Tue, 14 Nov 2017 16:30:27 +0000 (UTC) From: Pavel Hrdina To: libvir-list@redhat.com Date: Tue, 14 Nov 2017 17:30:26 +0100 Message-Id: <6a2adca00d0138fb7abef647d086a131c76f35f2.1510677018.git.phrdina@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] qemu: taint domain if virDomainQemuAgentCommand API is used X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 14 Nov 2017 16:30:32 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This is similar to the virDomainQemuMonitorCommand API, it can change the domain state in a way that libvirt may not understand. Signed-off-by: Pavel Hrdina --- src/conf/domain_conf.c | 3 ++- src/conf/domain_conf.h | 1 + src/qemu/qemu_driver.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index fffcc8e9da..55b3cb2430 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -100,7 +100,8 @@ VIR_ENUM_IMPL(virDomainTaint, VIR_DOMAIN_TAINT_LAST, "host-cpu", "hook-script", "cdrom-passthrough", - "custom-dtb"); + "custom-dtb", + "custom-ga-command"); =20 VIR_ENUM_IMPL(virDomainVirt, VIR_DOMAIN_VIRT_LAST, "none", diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index e3f060b122..af5e379468 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2444,6 +2444,7 @@ typedef enum { VIR_DOMAIN_TAINT_HOOK, /* Domain (possibly) changed via ho= ok script */ VIR_DOMAIN_TAINT_CDROM_PASSTHROUGH,/* CDROM passthrough */ VIR_DOMAIN_TAINT_CUSTOM_DTB, /* Custom device tree blob was spec= ified */ + VIR_DOMAIN_TAINT_CUSTOM_GA_COMMAND, /* Custom guest agent command */ =20 VIR_DOMAIN_TAINT_LAST } virDomainTaintFlags; diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 6132bc4a9a..3a0e3b6cec 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -18737,6 +18737,8 @@ qemuDomainQemuAgentCommand(virDomainPtr domain, if (!qemuDomainAgentAvailable(vm, true)) goto endjob; =20 + qemuDomainObjTaint(driver, vm, VIR_DOMAIN_TAINT_CUSTOM_GA_COMMAND, NUL= L); + agent =3D qemuDomainObjEnterAgent(vm); ret =3D qemuAgentArbitraryCommand(agent, cmd, &result, timeout); qemuDomainObjExitAgent(vm, agent); --=20 2.13.6 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list