From nobody Sun Feb 8 06:56:18 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) client-ip=209.132.183.39; envelope-from=libvir-list-bounces@redhat.com; helo=mx6-phx2.redhat.com; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.39 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; Return-Path: Received: from mx6-phx2.redhat.com (mx6-phx2.redhat.com [209.132.183.39]) by mx.zohomail.com with SMTPS id 1487343227879813.7576534213533; Fri, 17 Feb 2017 06:53:47 -0800 (PST) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx6-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1HEnf2i042689; Fri, 17 Feb 2017 09:49:41 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id v1HEnTwq003770 for ; Fri, 17 Feb 2017 09:49:29 -0500 Received: from antique-work.brq.redhat.com (dhcp129-175.brq.redhat.com [10.34.129.175]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v1HEnIn9022242 for ; Fri, 17 Feb 2017 09:49:28 -0500 From: Pavel Hrdina To: libvir-list@redhat.com Date: Fri, 17 Feb 2017 15:49:16 +0100 Message-Id: <2a18eccc325eb0bbf70b5b4c9ddb2eae372ca762.1487341782.git.phrdina@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 12/13] qemu_driver: check whether iothread is used by controller 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-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This follows the same check for disk, because we cannot remove iothread if it's used by disk or by controller. It could lead to crashing QEMU. Signed-off-by: Pavel Hrdina --- src/qemu/qemu_driver.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 03fea2713d..1c3db4e13f 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -5747,6 +5747,17 @@ qemuDomainDelIOThreadCheck(virDomainDefPtr def, } } =20 + for (i =3D 0; i < def->ncontrollers; i++) { + if (def->controllers[i]->iothread =3D=3D iothread_id) { + const char *model =3D virDomainControllerModelSCSITypeToString= (def->controllers[i]->model); + virReportError(VIR_ERR_INVALID_ARG, + _("cannot remove IOThread '%u' since it " + "is being used by controller '%s'"), + iothread_id, model); + return -1; + } + } + return 0; } =20 --=20 2.11.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list