From nobody Thu Apr 25 23:19:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) client-ip=205.139.110.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by mx.zohomail.com with SMTPS id 158168674407963.80498715382305; Fri, 14 Feb 2020 05:25:44 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-138-52cllSj3MWGhPvziFG4x0A-1; Fri, 14 Feb 2020 08:25:40 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0CDE5189F763; Fri, 14 Feb 2020 13:25:34 +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 037DA387; Fri, 14 Feb 2020 13:25:32 +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 C92CA18089C8; Fri, 14 Feb 2020 13:25:29 +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 01EDPRSQ017401 for ; Fri, 14 Feb 2020 08:25:27 -0500 Received: by smtp.corp.redhat.com (Postfix) id 3D75388854; Fri, 14 Feb 2020 13:25:27 +0000 (UTC) Received: from moe.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id B820519E9C for ; Fri, 14 Feb 2020 13:25:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581686742; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=ULelh3R+uZFZc9EZE1dk82MqpeiaFgyy0mNUIwWts9o=; b=HgICb97YGtM4ek/yDnHgNgnPqNyq5o6Mh28NxAd6cpPccoe83I5glLOvljDFaFOsBzwR9z FmRcMm4+rC183K3qFNcyJOdr/gDjO1VGE3euEyfPQn8HrcZ6Ov7UkeuIhemf4kwZoVyHaa e6Yg98DSpvSKdSRmmnz74ZKLCRrmWog= From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] qemu_domain: Modify access to a NVMe disk iff needed Date: Fri, 14 Feb 2020 14:25:15 +0100 Message-Id: <06212c93c77502086c0ca15a862db67d4a72afb8.1581686654.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com 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: , 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-MC-Unique: 52cllSj3MWGhPvziFG4x0A-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" If a domain has a NVMe disk it already has the access configured. Trying to configure it again on a commit or some other operation is wrong and condemned to failure. Signed-off-by: Michal Privoznik Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_domain.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 72f03c3a35..b0e90f818d 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -11676,13 +11676,13 @@ qemuDomainStorageSourceAccessModify(virQEMUDriver= Ptr driver, =20 revoke_lockspace =3D true; =20 - if (qemuDomainStorageSourceAccessModifyNVMe(driver, vm, src, false) < = 0) - goto revoke; - - revoke_nvme =3D true; - /* When modifying access of existing @src namespace does not need upda= te */ if (!(flags & QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_MODIFY_ACCESS)) { + if (qemuDomainStorageSourceAccessModifyNVMe(driver, vm, src, false= ) < 0) + goto revoke; + + revoke_nvme =3D true; + if (qemuDomainNamespaceSetupDisk(vm, src) < 0) goto revoke; =20 --=20 2.24.1