From nobody Tue May 7 00:24:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 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=1574243744; cv=none; d=zoho.com; s=zohoarc; b=BRmtkeswo8jjupRBsrnjnTIWgRoU3tISQFZ+hFGgaKc2gTVLFFNQ+YOfpIXYlZM7Bjg9Flq4CbsnDTgoUO/tgOeP5LElklKf3nJ+7ETkMvwUthyCYeSB5WRsJD1X7rFF6RhV5NlscmEyctxWIHwIwnM7GgehvYO64ud3e4U8DIk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1574243744; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=TbZ5hIXzIJTSbTWVPQ50xhIpIohZ4uSUbZgZlSsxouI=; b=Lng/s8Zvk+WVRJJhYyhf11kgyCQ/uDLsjKh0/y/QwtFmt8Mh/BD5aR9OXcL3gVL5PeMecl1GSmPgkDlYGERt+Ai/5KXbeAAG4wOiRCWqXuyHiukGLKQz4nSVDWVtvmNl2yP9n+q51NsXAXA38Tn4rEBAsoVNXHE8UxknP8gt2XA= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 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 [207.211.31.81]) by mx.zohomail.com with SMTPS id 1574243744876913.7906616852355; Wed, 20 Nov 2019 01:55: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-157-GT2-x4ubOwWfQ_mUQnce1g-1; Wed, 20 Nov 2019 04:55: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 BF627801FA1; Wed, 20 Nov 2019 09:55:34 +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 8E96AF6E0; Wed, 20 Nov 2019 09:55:34 +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 3F63A4BB65; Wed, 20 Nov 2019 09:55:34 +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 xAK9tXcI025733 for ; Wed, 20 Nov 2019 04:55:33 -0500 Received: by smtp.corp.redhat.com (Postfix) id 80E864DA73; Wed, 20 Nov 2019 09:55:33 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.43.2.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id D7FEB4D9F7; Wed, 20 Nov 2019 09:55:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574243742; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=TbZ5hIXzIJTSbTWVPQ50xhIpIohZ4uSUbZgZlSsxouI=; b=KDIBIWw+SiPNz+2RcgofuKS7tD1IN+n+k26NtiXzNx2o5AWRXbBZ1t/uktr9x1RV3mBQY+ ntKGgkriwDSGwQKfy7v5aTdJrhlTL1lj0sykwj6DJ1FoStkxRBkh96Ul1DpLCAArKEH6lm 4h4U9yWQ5eGX+mdTyyoYn5gdlaCFaFw= From: Pavel Mores To: libvir-list@redhat.com Date: Wed, 20 Nov 2019 10:55:24 +0100 Message-Id: <20191120095527.18158-2-pmores@redhat.com> In-Reply-To: <20191120095527.18158-1-pmores@redhat.com> References: <20191120095527.18158-1-pmores@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Pavel Mores Subject: [libvirt] [PATCH 1/4] qemu: block: propagate the delete flag to where it can actually be used 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: GT2-x4ubOwWfQ_mUQnce1g-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" Since the blockcommit operation is asynchronous, this has conceptually two parts. First, we have to propagate the flag from qemuDomainBlockCommit() (which was just ignoring it until now) to qemuBlockJobDiskNewCommit(). Then it can be stored in the qemuBlockJobCommitData structure which holds information necessary to finish the job asynchronously. Signed-off-by: Pavel Mores --- src/qemu/qemu_blockjob.c | 4 +++- src/qemu/qemu_blockjob.h | 4 +++- src/qemu/qemu_driver.c | 5 +++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 5c294f8024..7d94a6ce38 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -250,7 +250,8 @@ qemuBlockJobDiskNewCommit(virDomainObjPtr vm, virDomainDiskDefPtr disk, virStorageSourcePtr topparent, virStorageSourcePtr top, - virStorageSourcePtr base) + virStorageSourcePtr base, + bool delete_imgs) { qemuDomainObjPrivatePtr priv =3D vm->privateData; g_autoptr(qemuBlockJobData) job =3D NULL; @@ -273,6 +274,7 @@ qemuBlockJobDiskNewCommit(virDomainObjPtr vm, job->data.commit.topparent =3D topparent; job->data.commit.top =3D top; job->data.commit.base =3D base; + job->data.commit.deleteCommittedImages =3D delete_imgs; =20 if (qemuBlockJobRegister(job, vm, disk, true) < 0) return NULL; diff --git a/src/qemu/qemu_blockjob.h b/src/qemu/qemu_blockjob.h index d8da918f2f..d77f1dcdb3 100644 --- a/src/qemu/qemu_blockjob.h +++ b/src/qemu/qemu_blockjob.h @@ -85,6 +85,7 @@ struct _qemuBlockJobCommitData { virStorageSourcePtr topparent; virStorageSourcePtr top; virStorageSourcePtr base; + bool deleteCommittedImages; }; =20 =20 @@ -165,7 +166,8 @@ qemuBlockJobDiskNewCommit(virDomainObjPtr vm, virDomainDiskDefPtr disk, virStorageSourcePtr topparent, virStorageSourcePtr top, - virStorageSourcePtr base); + virStorageSourcePtr base, + bool delete_imgs); =20 qemuBlockJobDataPtr qemuBlockJobNewCreate(virDomainObjPtr vm, diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index dc14ec86a3..75458f5c8a 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -18496,10 +18496,10 @@ qemuDomainBlockCommit(virDomainPtr dom, bool persistjob =3D false; bool blockdev =3D false; =20 - /* XXX Add support for COMMIT_DELETE */ virCheckFlags(VIR_DOMAIN_BLOCK_COMMIT_SHALLOW | VIR_DOMAIN_BLOCK_COMMIT_ACTIVE | VIR_DOMAIN_BLOCK_COMMIT_RELATIVE | + VIR_DOMAIN_BLOCK_COMMIT_DELETE | VIR_DOMAIN_BLOCK_COMMIT_BANDWIDTH_BYTES, -1); =20 if (!(vm =3D qemuDomainObjFromDomain(dom))) @@ -18638,7 +18638,8 @@ qemuDomainBlockCommit(virDomainPtr dom, goto endjob; =20 if (!(job =3D qemuBlockJobDiskNewCommit(vm, disk, top_parent, topSourc= e, - baseSource))) + baseSource, + flags & VIR_DOMAIN_BLOCK_COMMIT_= DELETE))) goto endjob; =20 disk->mirrorState =3D VIR_DOMAIN_DISK_MIRROR_STATE_NONE; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue May 7 00:24:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 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=1574243747; cv=none; d=zoho.com; s=zohoarc; b=HmFkfIt4+uy+2dBJrbB5zTOdEr5pW2MmedSmGhVO8o+vFwvObkU1lG6I11bNZY5JJJi/NshzZVZGcgij+IPjctjp8gfUsZL0QZSMST2GHGm81rqJNNed53wPPy5A5kLGDSzX0EpO4/BofcUMgdEbYjq5PkUS4uSjepctDmTnO7w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1574243747; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=CyCrZxVAgtcBUGR0jBXUoVjO9zXi145g7Xa69pi16K8=; b=E7Fndu6Jpjy+Sbo8/RtDaIt/Aa+fTCzOTmuzaDB4c5Yp039TDimdbvgID5j82BNOqFK6RpfmhpAbdTTnaaABgTuJbdqJ3ztIchdzzFs3+uJVOiFH8/dcMWk3dzZofqFci4KukPgH1mr4ce0+9fNp2fvxgCddj2d1ovMyCjdDh68= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 207.211.31.81 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 [207.211.31.81]) by mx.zohomail.com with SMTPS id 1574243747916831.9454447485527; Wed, 20 Nov 2019 01:55:47 -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-171-ZIUTzgmgNLKr3lOoZpU1RQ-1; Wed, 20 Nov 2019 04:55:44 -0500 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 1A423802689; Wed, 20 Nov 2019 09:55:39 +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 DF85267E60; Wed, 20 Nov 2019 09:55:38 +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 997CF4E562; Wed, 20 Nov 2019 09:55:38 +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 xAK9tYwx025741 for ; Wed, 20 Nov 2019 04:55:34 -0500 Received: by smtp.corp.redhat.com (Postfix) id 76E334DA73; Wed, 20 Nov 2019 09:55:34 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.43.2.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id CE2664D9F7; Wed, 20 Nov 2019 09:55:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574243746; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=CyCrZxVAgtcBUGR0jBXUoVjO9zXi145g7Xa69pi16K8=; b=bQzAfIv9qmrwSjg6Kt2P/1GEkEC95zJlkelm9hSutVXdWu0iteJhkqxEG140opFadhyCSo 8ZoJym0WW/HEI5pujeu4+Ijce3zU0w8lXeYykcLrTGDYxTihJHc4bMuc7y/pv69xEAIIAl 2olhNNxDVFgTuowYRi5MiLZd0nWNqU4= From: Pavel Mores To: libvir-list@redhat.com Date: Wed, 20 Nov 2019 10:55:25 +0100 Message-Id: <20191120095527.18158-3-pmores@redhat.com> In-Reply-To: <20191120095527.18158-1-pmores@redhat.com> References: <20191120095527.18158-1-pmores@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Pavel Mores Subject: [libvirt] [PATCH 2/4] qemu: block: use the delete flag to delete snapshot images if requested 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-MC-Unique: ZIUTzgmgNLKr3lOoZpU1RQ-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" When blockcommit finishes successfully, one of the qemuBlockJobProcessEventCompletedCommit() and qemuBlockJobProcessEventCompletedActiveCommit() event handlers is called. This is where the delete flag (stored in qemuBlockJobCommitData since the previous commit) can actually be used to delete the committed snapshot images if requested. Signed-off-by: Pavel Mores --- src/qemu/qemu_blockjob.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 7d94a6ce38..dae1fa44c8 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -965,6 +965,31 @@ qemuBlockJobProcessEventCompletedPull(virQEMUDriverPtr= driver, } =20 =20 +/** + * Helper for qemuBlockJobProcessEventCompletedCommit() and + * qemuBlockJobProcessEventCompletedActiveCommit(). Relies on adjustments + * these functions perform on the 'backingStore' chain to function correct= ly. + * + * TODO look into removing backing store for non-local snapshots too + */ +static void +qemuBlockJobUnlinkCommittedStorage(virStorageSourcePtr top) +{ + virStorageSourcePtr p =3D top; + const size_t errmsg_len =3D 128; + char errmsg[errmsg_len]; + + for (; p !=3D NULL; p =3D p->backingStore) { + if (virStorageSourceIsLocalStorage(p)) + if (unlink(p->path) < 0) { + char *dummy =3D strerror_r(errno, errmsg, errmsg_len); + (void)dummy; + VIR_WARN("Unable to remove snapshot image file %s (%s)", + p->path, errmsg); + } + } +} + /** * qemuBlockJobProcessEventCompletedCommit: * @driver: qemu driver object @@ -1031,6 +1056,9 @@ qemuBlockJobProcessEventCompletedCommit(virQEMUDriver= Ptr driver, job->data.commit.topparent->backingStore =3D job->data.commit.base; =20 qemuBlockJobEventProcessConcludedRemoveChain(driver, vm, asyncJob, job= ->data.commit.top); + + if (job->data.commit.deleteCommittedImages) + qemuBlockJobUnlinkCommittedStorage(job->data.commit.top); virObjectUnref(job->data.commit.top); job->data.commit.top =3D NULL; =20 @@ -1121,6 +1149,9 @@ qemuBlockJobProcessEventCompletedActiveCommit(virQEMU= DriverPtr driver, job->disk->src->readonly =3D job->data.commit.top->readonly; =20 qemuBlockJobEventProcessConcludedRemoveChain(driver, vm, asyncJob, job= ->data.commit.top); + + if (job->data.commit.deleteCommittedImages) + qemuBlockJobUnlinkCommittedStorage(job->data.commit.top); virObjectUnref(job->data.commit.top); job->data.commit.top =3D NULL; /* the mirror element does not serve functional purpose for the commit= job */ --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue May 7 00:24:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.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=1574243750; cv=none; d=zoho.com; s=zohoarc; b=lX7n+QCPCaEne9WaSW+ayfLB0i+sW5s9zWvY3WM0eVLxfEzAoPHQHc8Saq09raJqMs+2rZA4GZPe95TyLL5YGEEFB/wY8zpyV3hZPTZ0ILEWg+c7Vhpo67nO9YWUnOYSag/0Jn2owQj5FOifJXFx892XGNTov/56tb9NiQxnBWE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1574243750; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=hp+mICODXjn6dNdkTaM3z9E5odHjiGLD52yZGkDUIEE=; b=dhJgwi2z65o6Kx7OkklPl/SWpS8kmPpxzBb/M5ncV/4oYsGLUa38IkCs78G0RL2dnz4/hSoYEZ6XhCtU8qBmtmqVDsuJqi01PTOKN72CoMhRYcM1h/HcLtidvTXB8nIfxQ0zsQqiWXbEkNQaz86TDHxg3d88HlMZ1+kHZ5NNHxU= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.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 1574243750021874.6663114202877; Wed, 20 Nov 2019 01:55:50 -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-343-p73CE28SOFORY9wkSKSyOw-1; Wed, 20 Nov 2019 04:55:46 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F373280268D; Wed, 20 Nov 2019 09:55:39 +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 CDBD9196AD; Wed, 20 Nov 2019 09:55:39 +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 895174E567; Wed, 20 Nov 2019 09:55:39 +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 xAK9tcNl025757 for ; Wed, 20 Nov 2019 04:55:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id 1668566D50; Wed, 20 Nov 2019 09:55:38 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.43.2.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id C203F4DA73; Wed, 20 Nov 2019 09:55:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574243748; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=hp+mICODXjn6dNdkTaM3z9E5odHjiGLD52yZGkDUIEE=; b=JbGMZG7bveSA5EQVL9jxRJ+8DKQdNoR164aqXxB7Iv8ubDdDTn8UHJzV4ccs1sx67aSNzJ IIhqBQJSXWWh+CQA1RC6wA39FzNTtW1kc3oGMB86AUQR6lbJoQ29nqeThHJed0BGCe8wVY K7FUDBd1I/thIBHYSpy0Bg/bsmQvIEA= From: Pavel Mores To: libvir-list@redhat.com Date: Wed, 20 Nov 2019 10:55:26 +0100 Message-Id: <20191120095527.18158-4-pmores@redhat.com> In-Reply-To: <20191120095527.18158-1-pmores@redhat.com> References: <20191120095527.18158-1-pmores@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Pavel Mores Subject: [libvirt] [PATCH 3/4] qemu: block: store the delete flag in libvirtd's status XML 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.12 X-MC-Unique: p73CE28SOFORY9wkSKSyOw-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" Since blockcommit is asynchronous, libvirtd can be restarted while the operation runs. To ensure the information necessary to finish up the job is not lost, serialisation to and deserialisation from the status XML is added. Signed-off-by: Pavel Mores --- src/qemu/qemu_domain.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 262b74d1ab..dba287973c 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2512,6 +2512,8 @@ qemuDomainObjPrivateXMLFormatBlockjobIterator(void *p= ayload, virBufferAsprintf(&childBuf, "\n", job->= data.commit.top->nodeformat); if (job->data.commit.topparent) virBufferAsprintf(&childBuf, "\n",= job->data.commit.topparent->nodeformat); + if (job->data.commit.deleteCommittedImages) + virBufferAddLit(&childBuf, "\n"); break; =20 case QEMU_BLOCKJOB_TYPE_CREATE: @@ -3069,6 +3071,8 @@ qemuDomainObjPrivateXMLParseBlockjobDataSpecific(qemu= BlockJobDataPtr job, "string(./base/@n= ode)", &job->data.commit= .base, ctxt); + if (virXPathNode("./deleteCommittedImages", ctxt)) + job->data.commit.deleteCommittedImages =3D true; if (!job->data.commit.top || !job->data.commit.base) goto broken; --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue May 7 00:24:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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 (zoho.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 ARC-Seal: i=1; a=rsa-sha256; t=1574243764; cv=none; d=zoho.com; s=zohoarc; b=PVvFmbWImj7SLxLmfroIUhKJnP09XYPmqILhunr8g5snblWNKl0lXAjLyYvr0B6QedvRi2dVXFISuQtMRdI7x4UYVvEQRnUEwozyqoUKXdjBsadV7nTI8Y4yWJrdgueWAscx8fa+dqOpTBWqm/qw1RIrTDmqCJdOrR2ZsRwlmPI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1574243764; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kkZSOubc2hzxfqi3xP4fUVeWeWwX9eH2hoZoFjtDOuA=; b=oERbaftLG5VRyezkhyBvIINGk/MPMVjF7iuNCkxMCYup7j3vIGPyC/VJcUURX7sOwkmcO04ODKhkgTFzfgQLK7NWTWzR9zHmNDkeiSXYG3aLZbPniB/CVwUWiE6IOv9yVDRtb9+XL0KVTYM1y43oJh63yZ1bUC2Xw76qphRwR8Q= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=pass; spf=pass (zoho.com: domain of redhat.com designates 205.139.110.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 [205.139.110.120]) by mx.zohomail.com with SMTPS id 1574243764763395.7810554225523; Wed, 20 Nov 2019 01:56:04 -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-379-uRMP03mdN3GW5eB3rbC5_w-1; Wed, 20 Nov 2019 04:55:51 -0500 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6B25E1802CFE; Wed, 20 Nov 2019 09:55:45 +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 45A8463BBB; Wed, 20 Nov 2019 09:55:45 +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 EEC3B18089CD; Wed, 20 Nov 2019 09:55:44 +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 xAK9th7O025767 for ; Wed, 20 Nov 2019 04:55:43 -0500 Received: by smtp.corp.redhat.com (Postfix) id 4968866D49; Wed, 20 Nov 2019 09:55:43 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.43.2.54]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3F3554DA73; Wed, 20 Nov 2019 09:55:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574243762; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=kkZSOubc2hzxfqi3xP4fUVeWeWwX9eH2hoZoFjtDOuA=; b=ZN3e2ZLeD6O9h2CjGAWwDcTlT++WwN6Y1/es4ODUT3dk6ExGMq/4pbR0BeeHeMZ0rR5Fpy 6nGAE+E3oC5a4zwRXHYGBNM4ecI+MK/G5Lb5YXtrYHdkyCBVyWfkmPIJtbnrZ1h/KquREK qk50yOkLFkL44m2tTEROkRLvHMLyxuc= From: Pavel Mores To: libvir-list@redhat.com Date: Wed, 20 Nov 2019 10:55:27 +0100 Message-Id: <20191120095527.18158-5-pmores@redhat.com> In-Reply-To: <20191120095527.18158-1-pmores@redhat.com> References: <20191120095527.18158-1-pmores@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: Pavel Mores Subject: [libvirt] [PATCH 4/4] qemu: block: add unit test of storing the delete flag in status XML 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.15 X-MC-Unique: uRMP03mdN3GW5eB3rbC5_w-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" The new element was only added to the active commit test, the non-active commit test doesn't have the new element so as to test its absence. Signed-off-by: Pavel Mores --- tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml b/tests/q= emustatusxml2xmldata/blockjob-blockdev-in.xml index 4f6930001e..5fd2ed1d78 100644 --- a/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml +++ b/tests/qemustatusxml2xmldata/blockjob-blockdev-in.xml @@ -242,6 +242,7 @@ + --=20 2.21.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list