From nobody Wed May 8 23:25:14 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1588768989; cv=none; d=zohomail.com; s=zohoarc; b=nWi+5yr5MMIwu+/b8WtqpiRRz+kk14eZTpRoH8NWWZ17H48CxB4gXG6uh4qnsh6Gzh+SyLWWlUufaWtKHYJOagCS2c5TPDG3ga8wKSmZV4GOteprKLXxqhkfJOCMlPcoyRSVN1begaFnMPsoUGq2WhkP52G41Wuf7dgC5ECHSf4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1588768989; 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=aa2vCkGlcfTRBBQGgVoLrk1elZtUwE6QkMtMf6ah9jY=; b=PY0qwbBtl8ftcwZr2+OHQTcojIAl4M1zV9fguFSJiE4i6Mc16uN9aEvYH6SU3zc+PkJQA2NykP3fhiRnhRFp5e7VlKCJPucY5xtDj4YaAkditGi8Y/4+G4VQSg/oF4YhNFQSLsNSLdL/wDNV4hEwjrYbBzWhvQUXm9kGK+Qq9eI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1588768989544228.77691671277307; Wed, 6 May 2020 05:43:09 -0700 (PDT) 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-212-fD6CkFbrNPyBfDQI-_XT2A-1; Wed, 06 May 2020 08:43:06 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 593B719200C0; Wed, 6 May 2020 12:42:59 +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 CBDD06607F; Wed, 6 May 2020 12:42:58 +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 C25924CAA7; Wed, 6 May 2020 12:42:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 046Cflws032374 for ; Wed, 6 May 2020 08:41:47 -0400 Received: by smtp.corp.redhat.com (Postfix) id 1B9065C1D4; Wed, 6 May 2020 12:41:47 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.193.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8E6E45C1D6 for ; Wed, 6 May 2020 12:41:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588768988; 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=aa2vCkGlcfTRBBQGgVoLrk1elZtUwE6QkMtMf6ah9jY=; b=cjMD0Io8uFg7ABRWCnda67PgDmEjU28ug8DbAtDICfbn6lSb42LM5o5LTyZg5Q6W9FbuBR SZxZSOo5XORr6wbssoJreCfA6H/7bGZ3OODX7AWolVZlUSQGicxVH73pddF0HxG6/UltTE IMKa18gP+jN+RpuRqEhMRHY0lBBNT2g= X-MC-Unique: fD6CkFbrNPyBfDQI-_XT2A-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] qemuProcessStop: Reattach NVMe disks a domain is mirroring into Date: Wed, 6 May 2020 14:41:36 +0200 Message-Id: <206ddd7fa6b3edce461f50fd2abe7b895ed65ff1.1588768886.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.79 on 10.5.11.13 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" In v5.10.0-rc1~42 (which was later fixed in v6.0.0-rc1~487) I am removing XATTRs for a file that QEMU is mirroring a disk into but it is killed meanwhile. Well, if we call qemuDomainStorageSourceAccessRevoke() instead of qemuBlockRemoveImageMetadata() then not only the file will have perms fixed (instead of left accessible to qemu) but if the mirror destination is not a file but a NVMe disk, then the disk will be reattached back to the host. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=3D1825785 Signed-off-by: Michal Privoznik --- src/qemu/qemu_process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 8ea470f75f..70c71e069c 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -7605,7 +7605,7 @@ void qemuProcessStop(virQEMUDriverPtr driver, virDomainDiskDefPtr disk =3D def->disks[i]; =20 if (disk->mirror) - qemuBlockRemoveImageMetadata(driver, vm, disk->dst, disk->= mirror); + qemuDomainStorageSourceAccessRevoke(driver, vm, disk->mirr= or); =20 qemuBlockRemoveImageMetadata(driver, vm, disk->dst, disk->src); } --=20 2.26.2