From nobody Wed Apr 24 11:26:50 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 ARC-Seal: i=1; a=rsa-sha256; t=1560340729; cv=none; d=zoho.com; s=zohoarc; b=kNgup1DMewPZZ2Ll7PznL3f5lG7qvGysZqdImM4A3rOASyWGbF/Wn8VuO4IiYjW9BT2mC/YFDbd2y2paibgYfg+kBph61d0GRFo+QN06h5O3NlxixfyUeTPzIHg3e4S6YK6yidcSBYsVmItxse1cbEhbJByZhPjjvEJuxevVoUU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1560340729; h=Content-Type:Content-Transfer-Encoding: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=mAKHX8Atc8207xDoIJ/4ajhzjMdkNbA745AQhR3LWc8=; b=D2TlyoJSM1CXcB1KkIJx85nZTA+2Qey2D9Ia9mT304lJpEkWT5s75Bzbp48w25DyJaAauYm1y2HbcgE86Fnm1Av26Wk/li131omzlgxm2dGrcCYZYyAwA7uGippAezTIvKWvBRa3SWSJjIL1n+WyPP2azXnIw24BP3umu+/Z2+Y= 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; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1560340729092305.62343525145684; Wed, 12 Jun 2019 04:58:49 -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 15C0F3162918; Wed, 12 Jun 2019 11:58:11 +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 B6305377B; Wed, 12 Jun 2019 11:58:03 +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 76EDE1806B1A; Wed, 12 Jun 2019 11:57:52 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id x5CBrgqM030865 for ; Wed, 12 Jun 2019 07:53:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8B1C25D96F; Wed, 12 Jun 2019 11:53:42 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.229]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1501C5D961 for ; Wed, 12 Jun 2019 11:53:39 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Wed, 12 Jun 2019 13:53:39 +0200 Message-Id: <99cdb72be49eb7335474c9a274cac7466dcbc18c.1560340419.git.pkrempa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] qemu: domain: Log some useful data in qemuDomainStorageSourceAccessModify 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.41]); Wed, 12 Jun 2019 11:58:37 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Log the flags passed to the function in a exploded state so that it's easily visible what's happening to the image. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_domain.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 2095191cde..d28cfa4f42 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -9339,6 +9339,9 @@ qemuDomainStorageSourceAccessModify(virQEMUDriverPtr = driver, int ret =3D -1; virErrorPtr orig_err =3D NULL; bool chain =3D flags & QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_CHAIN; + bool force_ro =3D flags & QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_FORCE_READ= _ONLY; + bool force_rw =3D flags & QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_FORCE_READ= _WRITE; + bool revoke =3D flags & QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_REVOKE; int rc; bool was_readonly =3D src->readonly; bool revoke_cgroup =3D false; @@ -9346,14 +9349,18 @@ qemuDomainStorageSourceAccessModify(virQEMUDriverPt= r driver, bool revoke_namespace =3D false; bool revoke_lockspace =3D false; - if (flags & QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_FORCE_READ_ONLY) + VIR_DEBUG("VM: '%s', src: '%s', readonly: '%d, force_ro: '%d', force_r= w: '%d', revoke: '%d', chain: '%d'", + vm->def->name, NULLSTR(src->path), src->readonly, force_ro, + force_rw, revoke, chain); + + if (force_ro) src->readonly =3D true; - if (flags & QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_FORCE_READ_WRITE) + if (force_rw) src->readonly =3D false; /* just tear down the disk access */ - if (flags & QEMU_DOMAIN_STORAGE_SOURCE_ACCESS_REVOKE) { + if (revoke) { virErrorPreserveLast(&orig_err); revoke_cgroup =3D true; revoke_label =3D true; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list