From nobody Thu May 2 15:15:33 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1566891258; cv=none; d=zoho.com; s=zohoarc; b=PS00gir/ISSpyUmkurNyrd2shCaX1sEMxFQ0PgqKMh3QsnRUraUPdBD++B4ZnmA3o0V9X+aTsPvq94WsBUeQSivG3ITDDX5/PfdSn7xp6HVR4YSBmpr8fdqkFeCM33PVPzpV3Fh0+qlg86v8qClYGGkRpomajj+L0Gb+9XSd7AA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566891258; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=JohzAXd/P1bBtxKrIxH3Gp7lxLyTe92XnFO031BDam0=; b=GoUhi7LgG/y86tT1m9BB7RHyZO9lFyxJrClQwwJsfUf76qk1BO4nulk5r+cxm8FusHSYPkflf34tVxrF/JMYErsLckjyJSY0y0jXWoqDpG7X/KTcdJ0ToZfsSaWBy8NpLiQ+BntHAhq1GZU2gIdnl2dlKOQXlCUT0ObSVJuowrw= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566891258221370.471335913776; Tue, 27 Aug 2019 00:34:18 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F1DB63084025; Tue, 27 Aug 2019 07:34:16 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C575A600D1; Tue, 27 Aug 2019 07:34:16 +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 8D75C1806B00; Tue, 27 Aug 2019 07:34:16 +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 x7R7YFS3006655 for ; Tue, 27 Aug 2019 03:34:15 -0400 Received: by smtp.corp.redhat.com (Postfix) id 87C165DA8B; Tue, 27 Aug 2019 07:34:15 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 117DC5D9CC for ; Tue, 27 Aug 2019 07:34:14 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 27 Aug 2019 09:34:07 +0200 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/2] qemu: Acquire domain job in qemuDomainGetFSInfo and qemuDomainGetGuestInfo 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: , 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.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Tue, 27 Aug 2019 07:34:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" These two functions work with vm->def in their critical sections (i.e. after the job was acquired and before it is released). But that means, they need QUERY domain job too to prevent vm->def change. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_driver.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index c5a0c38c16..2b70f9f83e 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -22143,7 +22143,9 @@ qemuDomainGetFSInfo(virDomainPtr dom, if (virDomainGetFSInfoEnsureACL(dom->conn, vm->def) < 0) goto cleanup; =20 - if (qemuDomainObjBeginAgentJob(driver, vm, QEMU_AGENT_JOB_QUERY) < 0) + if (qemuDomainObjBeginJobWithAgent(driver, vm, + QEMU_JOB_QUERY, + QEMU_AGENT_JOB_QUERY) < 0) goto cleanup; =20 if (virDomainObjCheckActive(vm) < 0) @@ -22163,7 +22165,7 @@ qemuDomainGetFSInfo(virDomainPtr dom, qemuDomainObjExitAgent(vm, agent); =20 endjob: - qemuDomainObjEndAgentJob(vm); + qemuDomainObjEndJobWithAgent(driver, vm); =20 cleanup: virDomainObjEndAPI(&vm); @@ -23241,7 +23243,9 @@ qemuDomainGetGuestInfo(virDomainPtr dom, if (virDomainGetGuestInfoEnsureACL(dom->conn, vm->def) < 0) goto cleanup; =20 - if (qemuDomainObjBeginAgentJob(driver, vm, QEMU_AGENT_JOB_QUERY) < 0) + if (qemuDomainObjBeginJobWithAgent(driver, vm, + QEMU_JOB_QUERY, + QEMU_AGENT_JOB_QUERY) < 0) goto cleanup; =20 if (!qemuDomainAgentAvailable(vm, true)) @@ -23291,7 +23295,7 @@ qemuDomainGetGuestInfo(virDomainPtr dom, qemuDomainObjExitAgent(vm, agent); =20 endjob: - qemuDomainObjEndAgentJob(vm); + qemuDomainObjEndJobWithAgent(driver, vm); =20 cleanup: virDomainObjEndAPI(&vm); --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Thu May 2 15:15:33 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1566891262; cv=none; d=zoho.com; s=zohoarc; b=oIH87vMK6Xfb2lhlR+3hTF5spN67FYwqNE9Sfw9DVIvVx09ylhkvl/y/uQMie7fTwdzuNFWnBHp6zI8Yuge9BzPzJoqgbnJ+WNv62yIGcJBGZMSg9fT5Bt28815afxsiPYXQ/VNjWq+lfEa7i5U+kkJDxWryhNwgpW4lZavrJoE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1566891262; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=+1T9Ci8xUWsDG1nsdBuZlW7ABA927bTZm4ndA5Giz6s=; b=jJrAN7oBkXyBd36mSi8Ezf4hXEUYReMK/D1UR/IYHvus0hIK5IsCQRqC19xxLHcokYST/36Surwg7lqoLSmU8SzkLJhQ4wrAtBn8qp9sObUtpGknHezS2EUXSJVEPGrb3gpW6lvymT0VT+NqZQGH6Ga9n6MnSH/4dIIEuStWpCg= ARC-Authentication-Results: i=1; mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1566891262943184.9540106813406; Tue, 27 Aug 2019 00:34:22 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 59D293090FC5; Tue, 27 Aug 2019 07:34:21 +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 2FB1110013A1; Tue, 27 Aug 2019 07:34:21 +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 EC1662551E; Tue, 27 Aug 2019 07:34:20 +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 x7R7YGGn006668 for ; Tue, 27 Aug 2019 03:34:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 563FE5DC18; Tue, 27 Aug 2019 07:34:16 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id D3F905D9CC for ; Tue, 27 Aug 2019 07:34:15 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Tue, 27 Aug 2019 09:34:08 +0200 Message-Id: <2dab0b80b436a3ee120393e9eca4b5a269b022d3.1566891200.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/2] qemu: Don't duplicate domain def in qemuDomainGetFSInfo 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: , Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Tue, 27 Aug 2019 07:34:21 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Introduced in v3.0.0-rc1~336, the commit message doesn't really justifies the expensive domain def copy creation. Now, that vm->def is guarded in this function by job acquirement we can use vm->def directly. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_driver.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 2b70f9f83e..d0e67863ea 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -22126,11 +22126,8 @@ qemuDomainGetFSInfo(virDomainPtr dom, unsigned int flags) { virQEMUDriverPtr driver =3D dom->conn->privateData; - qemuDomainObjPrivatePtr priv; virDomainObjPtr vm; qemuAgentPtr agent; - virCapsPtr caps =3D NULL; - virDomainDefPtr def =3D NULL; int ret =3D -1; =20 virCheckFlags(0, ret); @@ -22138,8 +22135,6 @@ qemuDomainGetFSInfo(virDomainPtr dom, if (!(vm =3D qemuDomObjFromDomain(dom))) return ret; =20 - priv =3D vm->privateData; - if (virDomainGetFSInfoEnsureACL(dom->conn, vm->def) < 0) goto cleanup; =20 @@ -22154,14 +22149,8 @@ qemuDomainGetFSInfo(virDomainPtr dom, if (!qemuDomainAgentAvailable(vm, true)) goto endjob; =20 - if (!(caps =3D virQEMUDriverGetCapabilities(driver, false))) - goto endjob; - - if (!(def =3D virDomainDefCopy(vm->def, caps, driver->xmlopt, priv->qe= muCaps, false))) - goto endjob; - agent =3D qemuDomainObjEnterAgent(vm); - ret =3D qemuAgentGetFSInfo(agent, info, def); + ret =3D qemuAgentGetFSInfo(agent, info, vm->def); qemuDomainObjExitAgent(vm, agent); =20 endjob: @@ -22169,8 +22158,6 @@ qemuDomainGetFSInfo(virDomainPtr dom, =20 cleanup: virDomainObjEndAPI(&vm); - virDomainDefFree(def); - virObjectUnref(caps); return ret; } =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list