From nobody Mon May 6 17:13:54 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.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 207.211.31.120 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=1575892344; cv=none; d=zohomail.com; s=zohoarc; b=aC9vSrolFK7sf/83f2nUPQ4FaMi4RzB2o8hIllBmBD1UGnIju16VW+5xeEtOTSTcbRvpFSlEiCoQ21HQBG4huLkJC82Bp3sj4Dj9IGx0RYvW0i+mE8sh7wDq1Mov1LmKG0jOGRctFeg223Eres95CnidFFdrUuX1xk8aVCm6WyA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1575892344; 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; bh=5TSnPEe67NLhVEaQzm7s+gaxkN6hnRYN3ZkDpDf1N2U=; b=E/lMrt+BoDdZSnkAFrtrVA5+to1MNReZC2wy5JxjNMrARTHA22No7PF91A6mkNC9hvY0nUXh9llMtEBCYCIavL48noxCJ3HTSX7+XnElOVKuPaPODjfsLrUY4KFBs5G2nXTK9JEyn/MJpVwI41Abca+6LharDe+fqqquC+1AU/k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 157589234413016.645615088701447; Mon, 9 Dec 2019 03:52:24 -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-413-l0j-iYEyMs2j_ftASxaLIA-1; Mon, 09 Dec 2019 06:52:21 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B1D9C91230; Mon, 9 Dec 2019 11:52:15 +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 6710F600D3; Mon, 9 Dec 2019 11:52:14 +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 C95D34EBC5; Mon, 9 Dec 2019 11:52:10 +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 xB9Bq8kI020555 for ; Mon, 9 Dec 2019 06:52:08 -0500 Received: by smtp.corp.redhat.com (Postfix) id 52B0C600D3; Mon, 9 Dec 2019 11:52:08 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id CDAAD6055F for ; Mon, 9 Dec 2019 11:52:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575892342; 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=5TSnPEe67NLhVEaQzm7s+gaxkN6hnRYN3ZkDpDf1N2U=; b=TIV6EhISizWij1Iq+wQuhIPGkJCUrQnrqXM194ao7KagJ7tJwptNP4sLH6V5E8b8jlqLRw BOFinCBbcJAkhc+/PSiPDcWYwTG7140tkpEqNspOJLhmi2qP0eOno7vmAHtf5IVH6NtSCX SzHI/aCKUZ1p3a6qftbTGLtWBsTEzb0= From: Peter Krempa To: libvir-list@redhat.com Date: Mon, 9 Dec 2019 12:52:04 +0100 Message-Id: <23d8b3ef814b0eab3b9f5c5d4f83d31dedd934d8.1575892235.git.pkrempa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] qemu: snapshot: Mark file becoming backingStore as read-only 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.79 on 10.5.11.11 X-MC-Unique: l0j-iYEyMs2j_ftASxaLIA-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" For any backing file we set 'read-only' to true, but didn't do this when modifying the recorded backing store when creating external snapshots. This meant that qemu would attempt to open the backing-file read-write. This would fail for example when selinux is used as qemu doesn't have write permission for the backing file. https://bugzilla.redhat.com/show_bug.cgi?id=3D1781079 Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_driver.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 738e8832cc..96e811a893 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -14659,6 +14659,7 @@ qemuDomainSnapshotCreateInactiveExternal(virQEMUDri= verPtr driver, goto cleanup; if (virStorageSourceHasBacking(defdisk->src)) { + defdisk->src->readonly =3D true; newsrc->backingStore =3D g_steal_pointer(&defdisk->src); } else { virObjectUnref(defdisk->src); @@ -15510,6 +15511,7 @@ qemuDomainSnapshotDiskUpdateSource(virQEMUDriverPtr= driver, qemuDomainSnapshotDiskUpdateSourceRenumber(dd->disk->src); if (dd->persistdisk) { + dd->persistdisk->src->readonly =3D true; dd->persistsrc->backingStore =3D g_steal_pointer(&dd->persistdisk-= >src); dd->persistdisk->src =3D g_steal_pointer(&dd->persistsrc); } --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list