From nobody Tue May 7 05:34:13 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1550138199285101.65473707056537; Thu, 14 Feb 2019 01:56:39 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B13B737E8B; Thu, 14 Feb 2019 09:56:36 +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 472B319C7B; Thu, 14 Feb 2019 09:56:36 +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 92D5E3D39D; Thu, 14 Feb 2019 09:56:35 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1E9uWJn017282 for ; Thu, 14 Feb 2019 04:56:32 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4CD13600C5; Thu, 14 Feb 2019 09:56:32 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9CE67600C4; Thu, 14 Feb 2019 09:56:31 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Thu, 14 Feb 2019 10:56:26 +0100 Message-Id: <210005bc13572906e3cb27f7fef475d6d7cc24e2.1550138139.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 1/2] qemu_hotplug: Don't build device string in qemuDomainDetachChrDevice 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.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 14 Feb 2019 09:56:37 +0000 (UTC) Content-Type: text/plain; charset="utf-8" This is basically an old artefact from 24b0821926e when the idea was: 1) Build device string only to see if chardev has any -device associated with it and thus if device_del is needed 2) Detach chardev using chardev_del Now, that DEVICE and DEVICE_DELETED capabilities are assumed for every domain 1) does not make sense anymore. Signed-off-by: Michal Privoznik Reviewed-by: John Ferlan --- src/qemu/qemu_hotplug.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 107d0fb7a9..60b393234a 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -6129,7 +6129,6 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver, qemuDomainObjPrivatePtr priv =3D vm->privateData; virDomainDefPtr vmdef =3D vm->def; virDomainChrDefPtr tmpChr; - char *devstr =3D NULL; bool guestfwd =3D false; =20 if (!(tmpChr =3D virDomainChrFind(vmdef, chr))) { @@ -6150,9 +6149,6 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver, =20 sa_assert(tmpChr->info.alias); =20 - if (qemuBuildChrDeviceStr(&devstr, vmdef, tmpChr, priv->qemuCaps) < 0) - goto cleanup; - if (!async && !guestfwd) qemuDomainMarkDeviceForRemoval(vm, &tmpChr->info); =20 @@ -6163,7 +6159,7 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver, goto cleanup; } } else { - if (devstr && qemuMonitorDelDevice(priv->mon, tmpChr->info.alias) = < 0) { + if (qemuMonitorDelDevice(priv->mon, tmpChr->info.alias) < 0) { ignore_value(qemuDomainObjExitMonitor(driver, vm)); goto cleanup; } @@ -6183,7 +6179,6 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr driver, cleanup: if (!async) qemuDomainResetDeviceRemoval(vm); - VIR_FREE(devstr); return ret; } =20 --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue May 7 05:34:13 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1550138212247445.1680323571221; Thu, 14 Feb 2019 01:56:52 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BE44E89AE1; Thu, 14 Feb 2019 09:56:49 +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 8B1085DD7E; Thu, 14 Feb 2019 09:56:49 +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 14D973F7CB; Thu, 14 Feb 2019 09:56:49 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x1E9uXoD017292 for ; Thu, 14 Feb 2019 04:56:33 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4B5D8600C5; Thu, 14 Feb 2019 09:56:33 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9BECA600C7; Thu, 14 Feb 2019 09:56:32 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Thu, 14 Feb 2019 10:56:27 +0100 Message-Id: <11728d04f86d22179b3491aa16bb57446093fe84.1550138139.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 2/2] qemu_hotplug: Assume chardev alias always exists in qemuDomainDetachChrDevice 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 14 Feb 2019 09:56:50 +0000 (UTC) Content-Type: text/plain; charset="utf-8" The @tmpChr is looked up in domain definition based on user provided chardev XML. Therefore, the alias must have been allocated already when domain was started up. Signed-off-by: Michal Privoznik Reviewed-by: John Ferlan --- src/qemu/qemu_hotplug.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index 60b393234a..a5c352f44b 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -6144,11 +6144,6 @@ int qemuDomainDetachChrDevice(virQEMUDriverPtr drive= r, guestfwd =3D tmpChr->deviceType =3D=3D VIR_DOMAIN_CHR_DEVICE_TYPE_CHAN= NEL && tmpChr->targetType =3D=3D VIR_DOMAIN_CHR_CHANNEL_TARGET_TYP= E_GUESTFWD; =20 - if (!tmpChr->info.alias && qemuAssignDeviceChrAlias(vmdef, tmpChr, -1)= < 0) - goto cleanup; - - sa_assert(tmpChr->info.alias); - if (!async && !guestfwd) qemuDomainMarkDeviceForRemoval(vm, &tmpChr->info); =20 --=20 2.19.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list