From nobody Fri May 3 16:18:13 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=1568616620; cv=none; d=zoho.com; s=zohoarc; b=B68KZ4PMg2lTLjp7DISB+410lhbKL7Cm3jRyV7ejB5hIAgpOc2ZSocWVAxigNYk2m7dVCW2edm1UiWqBedLpltIXyKyehbcHZq0effaqtzimEXhL492V2Gr9j5JsdaGD+2MOFXgLkcERIQa8g32dR3bot8Xp7AmsO20f32lB8qg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568616620; 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=N80l8Wq9C2KkFBwmS3HmcFMsKbnymqCtVTh1f9/UIag=; b=KehmFdoOPhudNU7sq5HAG5H9sY0aPGuJiIxSErdRiobj0stUZYRSy4w+aR0CA2CkrslySxoXKOZUioBheW06ShKWJj4rhnK7M02JLPPBPZY/ba7GhO8BH7OGzAl+KJ6fhx0hmQJbF8ZNSx416rPMYu87FhmkQQoophRL+m+Hw5k= 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 15686166201951.9738577441775078; Sun, 15 Sep 2019 23:50:20 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 5C5A4C08E284; Mon, 16 Sep 2019 06:50:17 +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 DA36E60610; Mon, 16 Sep 2019 06:50:16 +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 E8E5C180085A; Mon, 16 Sep 2019 06:50:14 +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 x8G6ng8a006744 for ; Mon, 16 Sep 2019 02:49:42 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2371D6012A; Mon, 16 Sep 2019 06:49:42 +0000 (UTC) Received: from moe.brq.redhat.com (unknown [10.43.2.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id A1A50600F8 for ; Mon, 16 Sep 2019 06:49:38 +0000 (UTC) From: Michal Privoznik To: libvir-list@redhat.com Date: Mon, 16 Sep 2019 08:49:37 +0200 Message-Id: <59633fe407bce059daedaff75de1279f4cfc93f3.1568616568.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 Subject: [libvirt] [PATCH] qemu_blockjob: Remove image metadata on blockcommit 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.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 16 Sep 2019 06:50:18 +0000 (UTC) Content-Type: text/plain; charset="utf-8" When doing a blockcommit, the base and possibly top parent are relabelled in qemuDomainBlockCommit(). However, once the block job is finished, we need to remove the secdriver metadata (XATTRs) created at the beginning. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1741456 Signed-off-by: Michal Privoznik --- src/qemu/qemu_blockjob.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index a991309ee7..47715f12f6 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -677,6 +677,25 @@ qemuBlockJobEventProcessLegacyCompleted(virQEMUDriverP= tr driver, } =20 virObjectUnref(disk->mirror); + } else if (job->type =3D=3D QEMU_BLOCKJOB_TYPE_COMMIT) { + if (qemuSecurityMoveImageMetadata(driver, vm, + job->data.commit.base, NULL)= < 0) { + VIR_WARN("Unable to remove disk metadata on " + "vm %s from %s (disk target %s)", + vm->def->name, + NULLSTR(job->data.commit.base->path), + disk->dst); + } + if (job->data.commit.topparent && + job->data.commit.topparent !=3D disk->src && + qemuSecurityMoveImageMetadata(driver, vm, + job->data.commit.topparent, = NULL) < 0) { + VIR_WARN("Unable to remove disk metadata on " + "vm %s from %s (disk target %s)", + vm->def->name, + NULLSTR(job->data.commit.topparent->path), + disk->dst); + } } } =20 --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list