From nobody Sat May 4 10:10:31 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 ARC-Seal: i=1; a=rsa-sha256; t=1560872694; cv=none; d=zoho.com; s=zohoarc; b=gQknMEc9IwX/f9+Qm9XxFP/go8OZgSzBDzwmvwYtcX8nBDvcZNm0gEeh25uekRLAuvr62gcNuro4fJqVXV6wGM2sJxYYWufRIVRjoaSP8BN5iHw5Ro4B+GWU/05M1S8ByG9mFfbPbosT6/jP0/alr3x89ENr/8imWB3v4/ROEik= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560872694; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=GNyZxk6q0xwswONC/e6pyO2uQESkWL4Q23YMo6GBVhY=; b=DMUWtF4OjGAec/CtrMMcV/bId4uKt9/aPOoMo48kcnz8HUgbjmN7pie47hTR4wImmy6HI+oxVrYF1J3ZlJ+75guBJVPLirxpU1uFbM8e+ni32LhDkJUbznOLomiNgpSZQTBVa608NHW2ASMrEInxUDTVqXhceb3F3GmcBdKRStk= 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 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1560872694570742.7267119800954; Tue, 18 Jun 2019 08:44:54 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 594C630C1327; Tue, 18 Jun 2019 15:44:35 +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 F12E97D64D; Tue, 18 Jun 2019 15:44: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 B7C4A206D5; Tue, 18 Jun 2019 15:44:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x5IFiPbI016449 for ; Tue, 18 Jun 2019 11:44:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id B36961001DC3; Tue, 18 Jun 2019 15:44:25 +0000 (UTC) Received: from mx1.redhat.com (ext-mx10.extmail.prod.ext.phx2.redhat.com [10.5.110.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AD5751001B0D; Tue, 18 Jun 2019 15:44:22 +0000 (UTC) Received: from huawei.com (szxga03-in.huawei.com [45.249.212.189]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B8F8022388D; Tue, 18 Jun 2019 15:44:10 +0000 (UTC) Received: from DGGEML403-HUB.china.huawei.com (unknown [172.30.72.53]) by Forcepoint Email with ESMTP id 6FCA1E45B75F4EACA861; Tue, 18 Jun 2019 23:44:03 +0800 (CST) Received: from localhost.localdomain (10.175.104.211) by DGGEML403-HUB.china.huawei.com (10.3.17.33) with Microsoft SMTP Server id 14.3.439.0; Tue, 18 Jun 2019 23:43:55 +0800 From: Jie Wang To: Date: Tue, 18 Jun 2019 21:28:26 +0800 Message-ID: <1560864506-79243-1-git-send-email-wangjie88@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.104.211] X-CFilter-Loop: Reflected X-Greylist: Sender passed SPF test, Sender IP whitelisted by DNSRBL, ACL 216 matched, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 18 Jun 2019 15:44:11 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Tue, 18 Jun 2019 15:44:11 +0000 (UTC) for IP:'45.249.212.189' DOMAIN:'szxga03-in.huawei.com' HELO:'huawei.com' FROM:'wangjie88@huawei.com' RCPT:'' X-RedHat-Spam-Score: -0.002 (SPF_HELO_PASS, SPF_PASS) 45.249.212.189 szxga03-in.huawei.com 45.249.212.189 szxga03-in.huawei.com X-Scanned-By: MIMEDefang 2.78 on 10.5.110.39 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Cc: mprivozn@redhat.com, eric.fangyi@huawei.com, pkrempa@redhat.comm, wangjie88@huawei.com Subject: [libvirt] [PATCH] qemu: distinguish pr disk before qemuHotplugRemoveManagedPR 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.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Tue, 18 Jun 2019 15:44:53 +0000 (UTC) Content-Type: text/plain; charset="utf-8" when a disk without PR perform attach or detach operation, need not call qemuHotplugRemoveManagedPR, otherwise, it will print err log about PR, let us fix it. Signed-off-by: Jie Wang --- src/qemu/qemu_hotplug.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c index efda539..7ef92d0 100644 --- a/src/qemu/qemu_hotplug.c +++ b/src/qemu/qemu_hotplug.c @@ -928,7 +928,9 @@ qemuDomainAttachDiskGeneric(virQEMUDriverPtr driver, =20 if (qemuDomainObjExitMonitor(driver, vm) < 0) ret =3D -2; - if (qemuHotplugRemoveManagedPR(driver, vm, QEMU_ASYNC_JOB_NONE) < 0) + + if (virStorageSourceChainHasManagedPR(disk->src) && + qemuHotplugRemoveManagedPR(driver, vm, QEMU_ASYNC_JOB_NONE) < 0) ret =3D -2; =20 virDomainAuditDisk(vm, NULL, disk->src, "attach", false); @@ -4481,7 +4483,8 @@ qemuDomainRemoveDiskDevice(virQEMUDriverPtr driver, dev.data.disk =3D disk; ignore_value(qemuRemoveSharedDevice(driver, &dev, vm->def->name)); =20 - if (qemuHotplugRemoveManagedPR(driver, vm, QEMU_ASYNC_JOB_NONE) < 0) + if (virStorageSourceChainHasManagedPR(disk->src) && + qemuHotplugRemoveManagedPR(driver, vm, QEMU_ASYNC_JOB_NONE) < 0) goto cleanup; =20 ret =3D 0; --=20 1.8.3.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list