From nobody Tue May 13 12:27:11 2025 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1539963779672698.5957399905899; Fri, 19 Oct 2018 08:42:59 -0700 (PDT) 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 F0D38307D923; Fri, 19 Oct 2018 15:42:54 +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 AB94F6AE94; Fri, 19 Oct 2018 15:42:54 +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 54775180B5B7; Fri, 19 Oct 2018 15:42:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w9JFDaDk007246 for ; Fri, 19 Oct 2018 11:13:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id A6C306AE94; Fri, 19 Oct 2018 15:13:36 +0000 (UTC) Received: from unknown54ee7586bd10.attlocal.net.com (ovpn-116-156.phx2.redhat.com [10.3.116.156]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5DBA06AE90 for ; Fri, 19 Oct 2018 15:13:36 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Fri, 19 Oct 2018 11:13:22 -0400 Message-Id: <20181019151326.16793-9-jferlan@redhat.com> In-Reply-To: <20181019151326.16793-1-jferlan@redhat.com> References: <20181019151326.16793-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 08/12] qemu: Alter qemuDomainChgIOThread to take qemuMonitorIOThreadInfo 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.48]); Fri, 19 Oct 2018 15:42:55 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Rather than passing an iothread_id, let's pass a qemuMonitorIOThreadInfo structure so that a subsequent change to modify the iothread info can just generate and pass one. Signed-off-by: John Ferlan ACKed-by: Michal Privoznik --- src/qemu/qemu_driver.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 6835d3e875..4ddca2f765 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -6026,7 +6026,7 @@ typedef enum { static int qemuDomainChgIOThread(virQEMUDriverPtr driver, virDomainObjPtr vm, - unsigned int iothread_id, + qemuMonitorIOThreadInfo iothread, virDomainIOThreadAction action, unsigned int flags) { @@ -6055,19 +6055,19 @@ qemuDomainChgIOThread(virQEMUDriverPtr driver, =20 switch (action) { case VIR_DOMAIN_IOTHREAD_ACTION_ADD: - if (qemuDomainAddIOThreadCheck(def, iothread_id) < 0) + if (qemuDomainAddIOThreadCheck(def, iothread.iothread_id) < 0) goto endjob; =20 - if (qemuDomainHotplugAddIOThread(driver, vm, iothread_id) < 0) + if (qemuDomainHotplugAddIOThread(driver, vm, iothread.iothread= _id) < 0) goto endjob; =20 break; =20 case VIR_DOMAIN_IOTHREAD_ACTION_DEL: - if (qemuDomainDelIOThreadCheck(def, iothread_id) < 0) + if (qemuDomainDelIOThreadCheck(def, iothread.iothread_id) < 0) goto endjob; =20 - if (qemuDomainHotplugDelIOThread(driver, vm, iothread_id) < 0) + if (qemuDomainHotplugDelIOThread(driver, vm, iothread.iothread= _id) < 0) goto endjob; =20 break; @@ -6080,19 +6080,19 @@ qemuDomainChgIOThread(virQEMUDriverPtr driver, if (persistentDef) { switch (action) { case VIR_DOMAIN_IOTHREAD_ACTION_ADD: - if (qemuDomainAddIOThreadCheck(persistentDef, iothread_id) < 0) + if (qemuDomainAddIOThreadCheck(persistentDef, iothread.iothrea= d_id) < 0) goto endjob; =20 - if (!virDomainIOThreadIDAdd(persistentDef, iothread_id)) + if (!virDomainIOThreadIDAdd(persistentDef, iothread.iothread_i= d)) goto endjob; =20 break; =20 case VIR_DOMAIN_IOTHREAD_ACTION_DEL: - if (qemuDomainDelIOThreadCheck(persistentDef, iothread_id) < 0) + if (qemuDomainDelIOThreadCheck(persistentDef, iothread.iothrea= d_id) < 0) goto endjob; =20 - virDomainIOThreadIDDel(persistentDef, iothread_id); + virDomainIOThreadIDDel(persistentDef, iothread.iothread_id); =20 break; } @@ -6119,6 +6119,7 @@ qemuDomainAddIOThread(virDomainPtr dom, { virQEMUDriverPtr driver =3D dom->conn->privateData; virDomainObjPtr vm =3D NULL; + qemuMonitorIOThreadInfo iothread =3D {0}; int ret =3D -1; =20 virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | @@ -6136,7 +6137,8 @@ qemuDomainAddIOThread(virDomainPtr dom, if (virDomainAddIOThreadEnsureACL(dom->conn, vm->def, flags) < 0) goto cleanup; =20 - ret =3D qemuDomainChgIOThread(driver, vm, iothread_id, + iothread.iothread_id =3D iothread_id; + ret =3D qemuDomainChgIOThread(driver, vm, iothread, VIR_DOMAIN_IOTHREAD_ACTION_ADD, flags); =20 cleanup: @@ -6152,6 +6154,7 @@ qemuDomainDelIOThread(virDomainPtr dom, { virQEMUDriverPtr driver =3D dom->conn->privateData; virDomainObjPtr vm =3D NULL; + qemuMonitorIOThreadInfo iothread =3D {0}; int ret =3D -1; =20 virCheckFlags(VIR_DOMAIN_AFFECT_LIVE | @@ -6169,7 +6172,8 @@ qemuDomainDelIOThread(virDomainPtr dom, if (virDomainDelIOThreadEnsureACL(dom->conn, vm->def, flags) < 0) goto cleanup; =20 - ret =3D qemuDomainChgIOThread(driver, vm, iothread_id, + iothread.iothread_id =3D iothread_id; + ret =3D qemuDomainChgIOThread(driver, vm, iothread, VIR_DOMAIN_IOTHREAD_ACTION_DEL, flags); =20 cleanup: --=20 2.17.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list