From nobody Tue Apr 30 05:24:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.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 (zohomail.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=1576848362; cv=none; d=zohomail.com; s=zohoarc; b=VXqaWRLsx3fUTNvoYM30ACyvnb0D7i51j32c8xDf5REh6yg55BwWDV8sWCCCIbaHDju/23i0ZN68+qdTIC8qk+/yOk4roTT4zqZW4lYziMta3+f3HEBLXNOKUT64+Y6kQN4Tc8HdawOTTl+/ndOQQRgBDx4CcrdOUwroNmfeWCM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576848362; h=Content-Type:Content-Transfer-Encoding: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=IK6cAxCbrZNRYgaWnLuFDUqLwbTOCsPXpVUM26LmM4s=; b=Slt4xrCMWjULgmibEkehx8HhkvbX3a4co+HOTQYBa8BdHK7jwswtGLmnSEzo+UXONplCQKCfF2GMBpqJ6A+ETSnfV/03b5B8W38PeyS5FAsCQafURsxIOvott38Pvw9r+A+8hwU6zhoYqkefqFVbTmKH1zw8BJgYtiyQ1KOYOj0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.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 1576848362301650.9186574560326; Fri, 20 Dec 2019 05:26:02 -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-366-KKJo-84YPMyCUgmmiYmgxw-1; Fri, 20 Dec 2019 08:25:59 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4A0511005516; Fri, 20 Dec 2019 13:25:53 +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 234EA5C578; Fri, 20 Dec 2019 13:25:53 +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 D58BD182B016; Fri, 20 Dec 2019 13:25:52 +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 xBKDPanN028837 for ; Fri, 20 Dec 2019 08:25:37 -0500 Received: by smtp.corp.redhat.com (Postfix) id ED9D51CE; Fri, 20 Dec 2019 13:25:36 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 771CC5C7DD for ; Fri, 20 Dec 2019 13:25:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576848361; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=IK6cAxCbrZNRYgaWnLuFDUqLwbTOCsPXpVUM26LmM4s=; b=gfPvG//fbIhRtruUiHPKalc+E2J5uf0jy49ZYTtI/Cp5zVEIZEVnWK1FCjq1g19/fk8irD L5fq+yAXQYQRR+JfakTkGEKEn5pCgn7upYT6HNv3Z7dQrksfdVt0qsdmQs6GhaeEfHEmSV 0IEMGbZ2cLYjC62TOmx+jQtaaW8WtRU= From: Peter Krempa To: libvir-list@redhat.com Date: Fri, 20 Dec 2019 14:25:19 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 01/11] qemu: block: Use proper asyncJob when waiting for completion of blockdev-create 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.16 X-MC-Unique: KKJo-84YPMyCUgmmiYmgxw-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 waiting loop used QEMU_ASYNC_JOB_NONE rather than 'asyncJob' passed from the caller. Signed-off-by: Peter Krempa Reviewed-by: Daniel P. Berrang=C3=A9 --- src/qemu/qemu_block.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c index 95a2702f9d..eab21bc107 100644 --- a/src/qemu/qemu_block.c +++ b/src/qemu/qemu_block.c @@ -2406,11 +2406,11 @@ qemuBlockStorageSourceCreateGeneric(virDomainObjPtr= vm, qemuBlockJobStarted(job, vm); - qemuBlockJobUpdate(vm, job, QEMU_ASYNC_JOB_NONE); + qemuBlockJobUpdate(vm, job, asyncJob); while (qemuBlockJobIsRunning(job)) { if (virDomainObjWait(vm) < 0) goto cleanup; - qemuBlockJobUpdate(vm, job, QEMU_ASYNC_JOB_NONE); + qemuBlockJobUpdate(vm, job, asyncJob); } if (job->state =3D=3D QEMU_BLOCKJOB_STATE_FAILED || --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 05:24:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.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 (zohomail.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=1576848364; cv=none; d=zohomail.com; s=zohoarc; b=AnJVxGCA7RAWYS6MuhXOJcfNj2n9GjfJEM2BPUuVCiuw60fK7zoQWbtY+6vdOaKbUFOh7KU85ittcOD95XVNJqTSsvY7e+1LZIlzK/K0hf4KrG3zPZtLFo6+BcyOhisSKf+hlYOBxuOYQ107tZq+6XVNcukutpFYT4nM9w+OZDo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576848364; h=Content-Type:Content-Transfer-Encoding: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=Pvxn4T42hWUbhIKtNYHoGfhdyXfmA1PUxsx8LVz1TGA=; b=ap1+cuhrTNZxcYGg3p0UFgz+xclsOphBSRW4L91CFyDbeINJOsd67Sa2vdalwnDjC0q8PQa5kixWwj97vqVhDjxyltfV6fF7am5PDwaLwNBtBlPH1OXPYS9zQK3s8rJ2gj7NdavzzRP5/VrXAbX+cWtoto62t82gQC9sKBaKpgc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.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 1576848364707968.211810297648; Fri, 20 Dec 2019 05:26: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-22-GVTIuJpkOTCln33O5taDiQ-1; Fri, 20 Dec 2019 08:26:01 -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 93DEA18543A8; Fri, 20 Dec 2019 13:25:56 +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 6F15B6B8E6; Fri, 20 Dec 2019 13:25:56 +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 2F58C182B015; Fri, 20 Dec 2019 13:25:56 +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 xBKDPbK2028844 for ; Fri, 20 Dec 2019 08:25:37 -0500 Received: by smtp.corp.redhat.com (Postfix) id BDB1B1CE; Fri, 20 Dec 2019 13:25:37 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 462D963B93 for ; Fri, 20 Dec 2019 13:25:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576848363; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Pvxn4T42hWUbhIKtNYHoGfhdyXfmA1PUxsx8LVz1TGA=; b=ZF35qnm9brRvxoTYCAVctH46wm6aTL88h7wyDSTHAwvrZ26xts/78YSH9zNLDY/B6q1CUS WQq1+rL4ptHjVaSk4cL4nXcegoHv6HB51gzujzY6aJ0KIQxMN4L5fWKkt8vIyZLsRuYNZA SwO6iuiZVupAlM3G01Ekx8DAuqhbMM0= From: Peter Krempa To: libvir-list@redhat.com Date: Fri, 20 Dec 2019 14:25:20 +0100 Message-Id: <3c8a426e0ca719ef8409ab2bfc46a2ee1bd45003.1576847165.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 02/11] qemu: Reset the node-name allocator in qemuDomainObjPrivateDataClear 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: GVTIuJpkOTCln33O5taDiQ-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" qemuDomainObjPrivateDataClear clears state which become invalid after VM stopped running and the node name allocator belongs there. Signed-off-by: Peter Krempa Reviewed-by: Daniel P. Berrang=C3=A9 --- src/qemu/qemu_domain.c | 3 +++ src/qemu/qemu_process.c | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index ff87720fd1..0e073c25e1 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2238,6 +2238,9 @@ qemuDomainObjPrivateDataClear(qemuDomainObjPrivatePtr= priv) virDomainBackupDefFree(priv->backup); priv->backup =3D NULL; + + /* reset node name allocator */ + qemuDomainStorageIdReset(priv); } diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 7e1db50e8f..e6c6c0bee2 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -7672,9 +7672,6 @@ void qemuProcessStop(virQEMUDriverPtr driver, /* clear all private data entries which are no longer needed */ qemuDomainObjPrivateDataClear(priv); - /* reset node name allocator */ - qemuDomainStorageIdReset(priv); - /* The "release" hook cleans up additional resources */ if (virHookPresent(VIR_HOOK_DRIVER_QEMU)) { char *xml =3D qemuDomainDefFormatXML(driver, NULL, vm->def, 0); --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 05:24:45 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=1576848350; cv=none; d=zohomail.com; s=zohoarc; b=TofQ/i9cRjabDG31Qg9JsegY+1gtBaRERs/DuMTho5XH8RKOkUO/7QWzm+3CTZTG0PA11k6i9eSbp1RffBN3/FdSbA7z5KwES08hMa22+z4NgrsBCmX/xGWyONgKfziBuk2KTCNlxUWC0gK6PkS2wXqYaEOex4Nqtx7+eYsz4aE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576848350; h=Content-Type:Content-Transfer-Encoding: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=SavHi58HUuINVrBoOkYmrLlOXgvG35BE0pTq5jowKuk=; b=iOHMHLypLau2nn65YMlXd7TDM1ADJcTwSP5gpKJwjhTgNviDDziZkia/Rr/DEH9mxdIYOEydqFnWNypIC5DH7ig+8IczFuWCEB+q6bm+URUFJM0WevL+hKMcCiv5FSqKzzoqAvDJRpnrFbTdh6bXyjt02KUR2Dp8Th/6B6D75os= 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 1576848350014779.9571663336118; Fri, 20 Dec 2019 05:25: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-131-TMU7-3f4NgaU4FvVQGX8WA-1; Fri, 20 Dec 2019 08:25:46 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EC4DC18543A3; Fri, 20 Dec 2019 13:25:40 +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 C21DF5C28F; Fri, 20 Dec 2019 13:25:40 +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 4C393182B00F; Fri, 20 Dec 2019 13:25:40 +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 xBKDPcEK028850 for ; Fri, 20 Dec 2019 08:25:38 -0500 Received: by smtp.corp.redhat.com (Postfix) id 8E6EE1CE; Fri, 20 Dec 2019 13:25:38 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 178105C7DD for ; Fri, 20 Dec 2019 13:25:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576848348; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=SavHi58HUuINVrBoOkYmrLlOXgvG35BE0pTq5jowKuk=; b=EJVpUR3+iIy0FhDQWFpsMN1q9dUkA/75SDNlqxWAwp/9PKQo+iRl9LLj+UfNHdKZuWhCBh XUiJZdXkxEcSjy7PEpnwcM08Fja0gFxOtprfzk8hn/bv/QOq1sdec0FDt1V9IRacpXiILE BOUId+KcNDzXLCA4sMoUjvTUSHiz8iw= From: Peter Krempa To: libvir-list@redhat.com Date: Fri, 20 Dec 2019 14:25:21 +0100 Message-Id: <24c8aad09cb6f7cfabfe73f4a3ab5313a5df1c13.1576847165.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 03/11] qemu: backup: Configure backup store image with backing file 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.16 X-MC-Unique: TMU7-3f4NgaU4FvVQGX8WA-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" In contrast to snapshots the backup job does not complain when the backup job's store file has backing pre-configured. It's actually required so that the NBD server exposes all the data properly. Remove our fake termination and use the existing disk source as backing. Signed-off-by: Peter Krempa Reviewed-by: Daniel P. Berrang=C3=A9 Reviewed-by: Eric Blake --- src/qemu/qemu_backup.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c index 294d5999a0..de4730441b 100644 --- a/src/qemu/qemu_backup.c +++ b/src/qemu/qemu_backup.c @@ -302,7 +302,6 @@ qemuBackupDiskPrepareDataOne(virDomainObjPtr vm, bool removeStore) { qemuDomainObjPrivatePtr priv =3D vm->privateData; - g_autoptr(virStorageSource) terminator =3D NULL; /* set data structure */ dd->backupdisk =3D backupdisk; @@ -331,17 +330,14 @@ qemuBackupDiskPrepareDataOne(virDomainObjPtr vm, return -1; } - /* install terminator to prevent qemu form opening backing images */ - if (!(terminator =3D virStorageSourceNew())) - return -1; - if (!(dd->blockjob =3D qemuBlockJobDiskNewBackup(vm, dd->domdisk, dd->= store, removeStore, dd->incrementalBitmap))) return -1; + /* use original disk as backing to prevent opening the backing chain */ if (!(dd->crdata =3D qemuBuildStorageSourceChainAttachPrepareBlockdevT= op(dd->store, - = terminator, + = dd->domdisk->src, = priv->qemuCaps))) return -1; --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 05:24:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.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 (zohomail.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=1576848370; cv=none; d=zohomail.com; s=zohoarc; b=Ou3287cZo+Yzx/MRFb5GmIoLcIko4BsFIrhT5dAfRWItzWeVFj9hA4wMBe/ZJ0kjYAOmqE4I0MANsiwU96DwpfopnPuFSfFhBNSA9b9UBnjEqM51PmaaqSrWl8xzP7OcJ3UmjygYuOaEmE0aytM9N4mVJtw8toBLHeIWApdgCf4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576848370; h=Content-Type:Content-Transfer-Encoding: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=XOOcRucbzjTfa+g6y8ZjOKNXY2wrIxh/uiLTGLG7SwQ=; b=exz1lGafawKqqOJ1ZiDnuPuEB7eZyJ7IvwrIsosKafrYwfYgt59mLbxtgQZtXCndfIMdy6o23RWB/pebTU6o+IUQpw89IQsOYRglzJgX9ZPFTQOYLDkFo7mt9q0qTwwN/Y/LwdMMxGNAB6NOZfeSMJBw4VJQEdHY9VY5fDyXfDc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.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 1576848370567809.4773035482964; Fri, 20 Dec 2019 05:26:10 -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-20-7HaBEHZ8NViqCtn2R07T5g-1; Fri, 20 Dec 2019 08:26:07 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 443FE800D48; Fri, 20 Dec 2019 13:26:00 +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 0E88F5C57C; Fri, 20 Dec 2019 13:26:00 +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 BB16B252ED; Fri, 20 Dec 2019 13:25:59 +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 xBKDPd9q028857 for ; Fri, 20 Dec 2019 08:25:39 -0500 Received: by smtp.corp.redhat.com (Postfix) id 5EBB21CE; Fri, 20 Dec 2019 13:25:39 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id DC35763B93 for ; Fri, 20 Dec 2019 13:25:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576848369; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=XOOcRucbzjTfa+g6y8ZjOKNXY2wrIxh/uiLTGLG7SwQ=; b=cOW0TcpUJSxM8FX7naJKa8iXFE2hSJ3aGpG27jBEcQguPDtARpHCkOn7HMsQXZh1RWzXic pnvhuIZV5GBZFGb54roWhvpeiCKzQen1s4n9xNztFqgxtLfc4s0ChAv8lvaRtdwvemBc8F Gqvd0lSI7kxNCTWtVUxj/NJzq5XCi9A= From: Peter Krempa To: libvir-list@redhat.com Date: Fri, 20 Dec 2019 14:25:22 +0100 Message-Id: <183e299733392efbfa37ba5d58f319bd3aa6f549.1576847165.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 04/11] qemu: backup: Move deletion of backup images to job termination 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.16 X-MC-Unique: 7HaBEHZ8NViqCtn2R07T5g-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" While qemu is running both locations are identical in semantics, but the move will allow us to fix the scenario when the VM is destroyed or crashes where we'd leak the images. Signed-off-by: Peter Krempa Reviewed-by: Daniel P. Berrang=C3=A9 --- src/qemu/qemu_backup.c | 24 ++++++++++++++++++++++++ src/qemu/qemu_blockjob.c | 15 +-------------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c index de4730441b..4ab9a2b17e 100644 --- a/src/qemu/qemu_backup.c +++ b/src/qemu/qemu_backup.c @@ -614,6 +614,7 @@ qemuBackupJobTerminate(virDomainObjPtr vm, { qemuDomainObjPrivatePtr priv =3D vm->privateData; + size_t i; qemuDomainJobInfoUpdateTime(priv->job.current); @@ -630,6 +631,29 @@ qemuBackupJobTerminate(virDomainObjPtr vm, qemuDomainEventEmitJobCompleted(priv->driver, vm); + if (!(priv->job.apiFlags & VIR_DOMAIN_BACKUP_BEGIN_REUSE_EXTERNAL) && + (priv->backup->type =3D=3D VIR_DOMAIN_BACKUP_TYPE_PULL || + (priv->backup->type =3D=3D VIR_DOMAIN_BACKUP_TYPE_PUSH && + jobstatus !=3D QEMU_DOMAIN_JOB_STATUS_COMPLETED))) { + + g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(priv= ->driver); + + for (i =3D 0; i < priv->backup->ndisks; i++) { + virDomainBackupDiskDefPtr backupdisk =3D priv->backup->disks += i; + uid_t uid; + gid_t gid; + + if (!backupdisk->store || + backupdisk->store->type !=3D VIR_STORAGE_TYPE_FILE) + continue; + + qemuDomainGetImageIds(cfg, vm, backupdisk->store, NULL, &uid, = &gid); + if (virFileRemove(backupdisk->store->path, uid, gid) < 0) + VIR_WARN("failed to remove scratch file '%s'", + backupdisk->store->path); + } + } + virDomainBackupDefFree(priv->backup); priv->backup =3D NULL; qemuDomainObjEndAsyncJob(priv->driver, vm); diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 498e2a716f..131b53d88d 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -1335,9 +1335,6 @@ qemuBlockJobProcessEventConcludedBackup(virQEMUDriver= Ptr driver, unsigned long long progressCurrent, unsigned long long progressTotal) { - g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(driver); - uid_t uid; - gid_t gid; g_autoptr(qemuBlockStorageSourceAttachData) backend =3D NULL; g_autoptr(virJSONValue) actions =3D NULL; @@ -1369,18 +1366,8 @@ qemuBlockJobProcessEventConcludedBackup(virQEMUDrive= rPtr driver, if (qemuDomainObjExitMonitor(driver, vm) < 0) return; - if (job->data.backup.store) { + if (job->data.backup.store) qemuDomainStorageSourceAccessRevoke(driver, vm, job->data.backup.s= tore); - - if (job->data.backup.deleteStore && - job->data.backup.store->type =3D=3D VIR_STORAGE_TYPE_FILE) { - qemuDomainGetImageIds(cfg, vm, job->data.backup.store, NULL, &= uid, &gid); - - if (virFileRemove(job->data.backup.store->path, uid, gid) < 0) - VIR_WARN("failed to remove scratch file '%s'", - job->data.backup.store->path); - } - } } --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 05:24:45 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=1576848353; cv=none; d=zohomail.com; s=zohoarc; b=Gtacv0R5bQR8NNhhXnE+q8OlYjrCqfFzS+t9Pp4qciwa7NHghAfNpKk2o2CcG40e51oXJnMtEd7W30EBQ/qTS6Erl3gu5jMQDdXyjh4S3CYOYwL1QCRxvpepoQF+TvQd733hvKxjc7HCdJW6a9o+wQRDKEfkY8yM1Rf6Dj62D9k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576848353; h=Content-Type:Content-Transfer-Encoding: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=f1MNDMm+jpnZJhaekFUfd4H99fvoShaA5Uxju5hLTvc=; b=c/oVRwihKv5prr+t60jgo2VV2QKct4y4OXkvEHAnrMh8CEcWoxs/A9QNaOkrTxwA13OApXgeGtQbfthxj0v6uBC2KusOQ7ikzplxalWKH33khThgofjMTg8PoBSk00m6q1mm3NujE/VGNyU3ZgycdlH8sSyTOo/OK2Srq3G85GQ= 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 15768483537021011.3085149216624; Fri, 20 Dec 2019 05:25:53 -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-359-QCFo_89UMUCRAOlOtXCfuA-1; Fri, 20 Dec 2019 08:25:49 -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 792F418543A1; Fri, 20 Dec 2019 13:25:44 +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 383BA26FD8; Fri, 20 Dec 2019 13:25:44 +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 E968A252EC; Fri, 20 Dec 2019 13:25:43 +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 xBKDPeBT028864 for ; Fri, 20 Dec 2019 08:25:40 -0500 Received: by smtp.corp.redhat.com (Postfix) id 2F4131CE; Fri, 20 Dec 2019 13:25:40 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id AC71D5C7DD for ; Fri, 20 Dec 2019 13:25:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576848352; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=f1MNDMm+jpnZJhaekFUfd4H99fvoShaA5Uxju5hLTvc=; b=YSvaYHdr3BB8444sQUns00qOQcm9P8KZ8iFG92KKtqIRzRdYu+BMnTqMdUNLb++wrE48v5 MeJUxZwrokhfqhIn0LqK7IQ4YbwkV9rwgRNuBXFQMbFyB/77tzjAtsXUfiEw8PhouWNfdT KVPzp/TkcK2KTdqB3PrDWZPhc59Rgrg= From: Peter Krempa To: libvir-list@redhat.com Date: Fri, 20 Dec 2019 14:25:23 +0100 Message-Id: <05e23b7e6ed2b27d37a5dec645c1576fb7c785c9.1576847165.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 05/11] qemu: blockjob: Remove infrastructure for remembering to delete image 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: QCFo_89UMUCRAOlOtXCfuA-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" Now that we delete the images elsewhere it's not required. Additionally it's safe to do as we never released an upstream version which required this being in place. Signed-off-by: Peter Krempa Reviewed-by: Daniel P. Berrang=C3=A9 --- src/qemu/qemu_backup.c | 12 ++++-------- src/qemu/qemu_blockjob.c | 2 -- src/qemu/qemu_blockjob.h | 2 -- src/qemu/qemu_domain.c | 7 ------- tests/qemustatusxml2xmldata/backup-pull-in.xml | 1 - 5 files changed, 4 insertions(+), 20 deletions(-) diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c index 4ab9a2b17e..fa9588ef28 100644 --- a/src/qemu/qemu_backup.c +++ b/src/qemu/qemu_backup.c @@ -298,8 +298,7 @@ qemuBackupDiskPrepareDataOne(virDomainObjPtr vm, virJSONValuePtr actions, virDomainMomentDefPtr *incremental, virHashTablePtr blockNamedNodeData, - virQEMUDriverConfigPtr cfg, - bool removeStore) + virQEMUDriverConfigPtr cfg) { qemuDomainObjPrivatePtr priv =3D vm->privateData; @@ -331,7 +330,6 @@ qemuBackupDiskPrepareDataOne(virDomainObjPtr vm, } if (!(dd->blockjob =3D qemuBlockJobDiskNewBackup(vm, dd->domdisk, dd->= store, - removeStore, dd->incrementalBitmap))) return -1; @@ -389,13 +387,11 @@ qemuBackupDiskPrepareData(virDomainObjPtr vm, virHashTablePtr blockNamedNodeData, virJSONValuePtr actions, virQEMUDriverConfigPtr cfg, - struct qemuBackupDiskData **rdd, - bool reuse_external) + struct qemuBackupDiskData **rdd) { struct qemuBackupDiskData *disks =3D NULL; ssize_t ndisks =3D 0; size_t i; - bool removeStore =3D !reuse_external && (def->type =3D=3D VIR_DOMAIN_B= ACKUP_TYPE_PULL); disks =3D g_new0(struct qemuBackupDiskData, def->ndisks); @@ -410,7 +406,7 @@ qemuBackupDiskPrepareData(virDomainObjPtr vm, if (qemuBackupDiskPrepareDataOne(vm, backupdisk, dd, actions, incremental, blockNamedNodeData, - cfg, removeStore) < 0) + cfg) < 0) goto error; if (def->type =3D=3D VIR_DOMAIN_BACKUP_TYPE_PULL) { @@ -827,7 +823,7 @@ qemuBackupBegin(virDomainObjPtr vm, goto endjob; if ((ndd =3D qemuBackupDiskPrepareData(vm, def, incremental, blockName= dNodeData, - actions, cfg, &dd, reuse)) <=3D 0= ) { + actions, cfg, &dd)) <=3D 0) { if (ndd =3D=3D 0) { virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("no disks selected for backup")); diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index 131b53d88d..c536c19bb6 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -382,7 +382,6 @@ qemuBlockJobDataPtr qemuBlockJobDiskNewBackup(virDomainObjPtr vm, virDomainDiskDefPtr disk, virStorageSourcePtr store, - bool deleteStore, const char *bitmap) { g_autoptr(qemuBlockJobData) job =3D NULL; @@ -395,7 +394,6 @@ qemuBlockJobDiskNewBackup(virDomainObjPtr vm, job->data.backup.bitmap =3D g_strdup(bitmap); job->data.backup.store =3D virObjectRef(store); - job->data.backup.deleteStore =3D deleteStore; /* backup jobs are usually started in bulk by transaction so the caller * shall save the status XML */ diff --git a/src/qemu/qemu_blockjob.h b/src/qemu/qemu_blockjob.h index 42b973fe96..7d584a2980 100644 --- a/src/qemu/qemu_blockjob.h +++ b/src/qemu/qemu_blockjob.h @@ -113,7 +113,6 @@ typedef qemuBlockJobBackupData *qemuBlockJobDataBackupP= tr; struct _qemuBlockJobBackupData { virStorageSourcePtr store; - bool deleteStore; char *bitmap; }; @@ -201,7 +200,6 @@ qemuBlockJobDataPtr qemuBlockJobDiskNewBackup(virDomainObjPtr vm, virDomainDiskDefPtr disk, virStorageSourcePtr store, - bool deleteStore, const char *bitmap); qemuBlockJobDataPtr diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 0e073c25e1..d76dfe3a87 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -2619,9 +2619,6 @@ qemuDomainObjPrivateXMLFormatBlockjobIterator(void *p= ayload, data= ->xmlopt, fals= e) < 0) return -1; - - if (job->data.backup.deleteStore) - virBufferAddLit(&childBuf, "\n"); } break; @@ -3224,10 +3221,6 @@ qemuDomainObjPrivateXMLParseBlockjobDataSpecific(qem= uBlockJobDataPtr job, if (!(tmp =3D virXPathNode("./store", ctxt)) || !(job->data.backup.store =3D qemuDomainObjPrivateXMLParseB= lockjobChain(tmp, ctxt, xmlopt))) goto broken; - - if (virXPathNode("./deleteStore", ctxt)) - job->data.backup.deleteStore =3D true; - break; case QEMU_BLOCKJOB_TYPE_BROKEN: diff --git a/tests/qemustatusxml2xmldata/backup-pull-in.xml b/tests/qemusta= tusxml2xmldata/backup-pull-in.xml index 6ef4965bed..3c69c41840 100644 --- a/tests/qemustatusxml2xmldata/backup-pull-in.xml +++ b/tests/qemustatusxml2xmldata/backup-pull-in.xml @@ -248,7 +248,6 @@ - -2 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 05:24:45 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=1576848358; cv=none; d=zohomail.com; s=zohoarc; b=gcm2HT5KaN1mPS4RyaEc9gbBxra/f2c9wC/AD+SFvsf90nnCYRTIhVbTnbeIJMuFyBFBaj5dZZCUM5uAD6ap5xRYO4QhW1/YXiZ1zl30w4buKlEzbS6x3xT7rAmvjd2SnCbEad7BZNN29q+MTLW7AYZ+5p9Fpn8uisnCLF+ulkY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576848358; h=Content-Type:Content-Transfer-Encoding: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=rNYJ0FXC50X95lVEpE4Nhlk3tJPPbe1Eu8jnn53CiZU=; b=WYvrOYmnFD2Zj0sF9K3crSmiLZQGe/Cpuq19q1oPNQwLD8qOKjYF40+7LCjKYsqDlnaHimG3XshIjNjva7XUDffsbQ6h/oQNN7yTAXXUufRP3LEk41/oDf0KcdhRR8uwXdlYL0hyAC3+DG4Dsuu6v25qarKVpoKNMheXjeC2nn8= 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 1576848358867238.5106456694583; Fri, 20 Dec 2019 05:25:58 -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-291-tNVPR0IrMVSdBiyfUZXixQ-1; Fri, 20 Dec 2019 08:25:56 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 39193100550E; Fri, 20 Dec 2019 13:25:50 +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 061F110016E8; Fri, 20 Dec 2019 13:25:50 +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 B7C07252F0; Fri, 20 Dec 2019 13:25:49 +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 xBKDPfmH028872 for ; Fri, 20 Dec 2019 08:25:41 -0500 Received: by smtp.corp.redhat.com (Postfix) id F38561CE; Fri, 20 Dec 2019 13:25:40 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7C87B63B93 for ; Fri, 20 Dec 2019 13:25:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576848357; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=rNYJ0FXC50X95lVEpE4Nhlk3tJPPbe1Eu8jnn53CiZU=; b=iGcO0i13PHsIlCnqyuumJqjhjulzOLLdRfDHAWJWQRmUp1fqLNZXjl19Rv7lnUDSJUmQFp ddeQVb3lxcjkF7XF5v7CoaJH44ews2ROqOdze/8Q4V7Xw3Fnp1Xk98F3Q0sVAO2cfikp7V zsekphSnmXNXptJP8akpPR1LZQlVQTA= From: Peter Krempa To: libvir-list@redhat.com Date: Fri, 20 Dec 2019 14:25:24 +0100 Message-Id: <6397f029953463e40e293371ace3834ea8cf581b.1576847165.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 06/11] qemu: backup: Properly propagate async job type when cancelling the job 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.22 X-MC-Unique: tNVPR0IrMVSdBiyfUZXixQ-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 cancelling the blockjobs as part of failed backup job startup recover we didn't pass in the correct async job type. Luckily the block job handler and cancellation code paths use no block job at all currently so those were correct. Signed-off-by: Peter Krempa Reviewed-by: Daniel P. Berrang=C3=A9 --- src/qemu/qemu_backup.c | 17 +++++++++++------ src/qemu/qemu_backup.h | 7 +++++-- src/qemu/qemu_blockjob.c | 3 ++- src/qemu/qemu_driver.c | 2 +- 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c index fa9588ef28..1381505d9f 100644 --- a/src/qemu/qemu_backup.c +++ b/src/qemu/qemu_backup.c @@ -661,6 +661,7 @@ qemuBackupJobTerminate(virDomainObjPtr vm, * @vm: domain object * @backup: backup definition * @terminatebackup: flag whether to terminate and unregister the backup + * @asyncJob: currently used qemu asynchronous job type * * Sends all active blockjobs which are part of @backup of @vm a signal to * cancel. If @terminatebackup is true qemuBackupJobTerminate is also call= ed @@ -669,7 +670,8 @@ qemuBackupJobTerminate(virDomainObjPtr vm, void qemuBackupJobCancelBlockjobs(virDomainObjPtr vm, virDomainBackupDefPtr backup, - bool terminatebackup) + bool terminatebackup, + int asyncJob) { qemuDomainObjPrivatePtr priv =3D vm->privateData; size_t i; @@ -703,7 +705,8 @@ qemuBackupJobCancelBlockjobs(virDomainObjPtr vm, if (backupdisk->state !=3D VIR_DOMAIN_BACKUP_DISK_STATE_RUNNING) continue; - qemuDomainObjEnterMonitor(priv->driver, vm); + if (qemuDomainObjEnterMonitorAsync(priv->driver, vm, asyncJob) < 0) + return; rc =3D qemuMonitorJobCancel(priv->mon, job->name, false); @@ -869,7 +872,7 @@ qemuBackupBegin(virDomainObjPtr vm, goto endjob; if (rc < 0) { - qemuBackupJobCancelBlockjobs(vm, priv->backup, false); + qemuBackupJobCancelBlockjobs(vm, priv->backup, false, QEMU_ASY= NC_JOB_BACKUP); goto endjob; } } @@ -920,7 +923,8 @@ qemuBackupNotifyBlockjobEnd(virDomainObjPtr vm, virDomainDiskDefPtr disk, qemuBlockjobState state, unsigned long long cur, - unsigned long long end) + unsigned long long end, + int asyncJob) { qemuDomainObjPrivatePtr priv =3D vm->privateData; bool has_running =3D false; @@ -938,7 +942,8 @@ qemuBackupNotifyBlockjobEnd(virDomainObjPtr vm, return; if (backup->type =3D=3D VIR_DOMAIN_BACKUP_TYPE_PULL) { - qemuDomainObjEnterMonitor(priv->driver, vm); + if (qemuDomainObjEnterMonitorAsync(priv->driver, vm, asyncJob) < 0) + return; ignore_value(qemuMonitorNBDServerStop(priv->mon)); if (qemuDomainObjExitMonitor(priv->driver, vm) < 0) return; @@ -1011,7 +1016,7 @@ qemuBackupNotifyBlockjobEnd(virDomainObjPtr vm, if (has_running && (has_failed || has_cancelled)) { /* cancel the rest of the jobs */ - qemuBackupJobCancelBlockjobs(vm, backup, false); + qemuBackupJobCancelBlockjobs(vm, backup, false, asyncJob); } else if (!has_running && !has_cancelling) { /* all sub-jobs have stopped */ diff --git a/src/qemu/qemu_backup.h b/src/qemu/qemu_backup.h index df67b849be..1b8a03612c 100644 --- a/src/qemu/qemu_backup.h +++ b/src/qemu/qemu_backup.h @@ -31,14 +31,17 @@ qemuBackupGetXMLDesc(virDomainObjPtr vm, void qemuBackupJobCancelBlockjobs(virDomainObjPtr vm, virDomainBackupDefPtr backup, - bool terminatebackup); + bool terminatebackup, + int asyncJob); void qemuBackupNotifyBlockjobEnd(virDomainObjPtr vm, virDomainDiskDefPtr disk, qemuBlockjobState state, unsigned long long cur, - unsigned long long end); + unsigned long long end, + int asyncJob); + int qemuBackupGetJobInfoStats(virQEMUDriverPtr driver, diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c index c536c19bb6..e04fcf69d1 100644 --- a/src/qemu/qemu_blockjob.c +++ b/src/qemu/qemu_blockjob.c @@ -1336,7 +1336,8 @@ qemuBlockJobProcessEventConcludedBackup(virQEMUDriver= Ptr driver, g_autoptr(qemuBlockStorageSourceAttachData) backend =3D NULL; g_autoptr(virJSONValue) actions =3D NULL; - qemuBackupNotifyBlockjobEnd(vm, job->disk, newstate, progressCurrent, = progressTotal); + qemuBackupNotifyBlockjobEnd(vm, job->disk, newstate, + progressCurrent, progressTotal, asyncJob); if (job->data.backup.store && !(backend =3D qemuBlockStorageSourceDetachPrepare(job->data.backup= .store, NULL))) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index ec8faf384c..e493755fb8 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -14124,7 +14124,7 @@ static int qemuDomainAbortJob(virDomainPtr dom) break; case QEMU_ASYNC_JOB_BACKUP: - qemuBackupJobCancelBlockjobs(vm, priv->backup, true); + qemuBackupJobCancelBlockjobs(vm, priv->backup, true, QEMU_ASYNC_JO= B_NONE); ret =3D 0; break; --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 05:24:45 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=1576848358; cv=none; d=zohomail.com; s=zohoarc; b=SM0aw7K7RuhCFyyE83s0t2HyPirc3zNcHwXHnYLFX0qfiMYygKFTAbPc10cykV9+gYMYciY/soZwc5SCTLgx25k2XCi++o5TbdtoMSnOxrm6xiFEHTJT41gE2GoF1QpLYVjs26/iqqpb8cWWeRFlYIMuZ8V/HIDLjzdXeNU7zis= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576848358; h=Content-Type:Content-Transfer-Encoding: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=M4qKQwNMSShJIiaJps/WM+FouZySNhGzC7+OQU1QlXI=; b=jbfHogpMLqcZTt7teXsZWI/fcVhMGb+nNhTCSfg+4XNxblyHYLLtPBqVQtL4+uYMF1elgHUMuVWV/CUu5RUqMbeQBtGvECrR17HF2y512Mzdb9/hl2bCWOEBBMuDlLcLQkvOeQGh0CrRtP+S/lYW/UiXDBz4fciBPMbngl4qbHI= 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 1576848358950561.0407775809053; Fri, 20 Dec 2019 05:25:58 -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-201-yIKulnLzPp-zVfFXRajNaw-1; Fri, 20 Dec 2019 08:25:56 -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 3503D64A8D; Fri, 20 Dec 2019 13:25:50 +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 05B1363BAC; Fri, 20 Dec 2019 13:25:50 +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 B93B5182B012; Fri, 20 Dec 2019 13:25:49 +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 xBKDPfN3028883 for ; Fri, 20 Dec 2019 08:25:41 -0500 Received: by smtp.corp.redhat.com (Postfix) id C3CD41CE; Fri, 20 Dec 2019 13:25:41 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4BD295C7DD for ; Fri, 20 Dec 2019 13:25:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576848357; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=M4qKQwNMSShJIiaJps/WM+FouZySNhGzC7+OQU1QlXI=; b=IX7z6WUl/HfLdOXnei7PREiXnDbAhYlArTppkdVw9VblhS7emaVLkS60A8jxfv+/HBtIq4 liok0Kul4CNGe9F3d93MZ1A4JUR/9+YV15RxOsIwBd0KFIczZMzwQdwckeIPxEUwm+D9tQ ml2J+l2667+IWUAU8hr3uI3mgVfRE3E= From: Peter Krempa To: libvir-list@redhat.com Date: Fri, 20 Dec 2019 14:25:25 +0100 Message-Id: <0df40bded9c7a898a21eb32ebd19e8d536a63e9f.1576847165.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 07/11] qemu: process: Terminate backup job on VM destroy 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: yIKulnLzPp-zVfFXRajNaw-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" Commit d75f865fb989b3e6330c78c28e1c3bf7fa28e6a5 caused a job-deadlock if a VM is running the backup job and being destroyed as it removed the cleanup of the async job type and there was nothing to clean up the backup job. Add an explicit cleanup of the backup job when destroying a VM. Signed-off-by: Peter Krempa Reviewed-by: Daniel P. Berrang=C3=A9 --- src/qemu/qemu_backup.c | 2 +- src/qemu/qemu_backup.h | 3 +++ src/qemu/qemu_process.c | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c index 1381505d9f..3bac6b353c 100644 --- a/src/qemu/qemu_backup.c +++ b/src/qemu/qemu_backup.c @@ -604,7 +604,7 @@ qemuBackupBeginCollectIncrementalCheckpoints(virDomainO= bjPtr vm, } -static void +void qemuBackupJobTerminate(virDomainObjPtr vm, qemuDomainJobStatus jobstatus) diff --git a/src/qemu/qemu_backup.h b/src/qemu/qemu_backup.h index 1b8a03612c..3321ba0b6f 100644 --- a/src/qemu/qemu_backup.h +++ b/src/qemu/qemu_backup.h @@ -42,6 +42,9 @@ qemuBackupNotifyBlockjobEnd(virDomainObjPtr vm, unsigned long long end, int asyncJob); +void +qemuBackupJobTerminate(virDomainObjPtr vm, + qemuDomainJobStatus jobstatus); int qemuBackupGetJobInfoStats(virQEMUDriverPtr driver, diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index e6c6c0bee2..3b036ac4bc 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -57,6 +57,7 @@ #include "qemu_security.h" #include "qemu_extdevice.h" #include "qemu_firmware.h" +#include "qemu_backup.h" #include "cpu/cpu.h" #include "cpu/cpu_x86.h" @@ -7609,6 +7610,10 @@ void qemuProcessStop(virQEMUDriverPtr driver, virResctrlAllocRemove(vm->def->resctrls[i]->alloc); } + /* clean up a possible backup job */ + if (priv->backup) + qemuBackupJobTerminate(vm, QEMU_DOMAIN_JOB_STATUS_CANCELED); + qemuProcessRemoveDomainStatus(driver, vm); /* Remove VNC and Spice ports from port reservation bitmap, but only if --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 05:24:45 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=1576848372; cv=none; d=zohomail.com; s=zohoarc; b=XAwrScy2T1JfaUBhOEeuaCDWChPZs4ur1A37UoWAJoL58hXNhFEGWAON8mdM+X3ltiPzaxmgOJ8soYgIVpfjquE0gOLP4MAIS8UKrnzAgPtk52du0RqMPM8Ym0TMBJAbFZLLDL1kWlfh/gRHDvOLtkcS85CZhJqQfZ861oYj0rA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576848372; h=Content-Type:Content-Transfer-Encoding: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=gf6VWm1fdw+Af00faYSqYEhIZ1mGyqy3Q79FW0AllX0=; b=JTLI1p8f+lgU0Ul9mO7MVxtxX7O1OlZrIOSSPuuyLY/h9xOdpmkCrfaIC3LG1pxqPqHmnC1KhR8ac2tQI28sbx/Dq0NYBEvstpMPZST90cpd8rSd426Pf5HDWRGK2GL9nu2l70kNgEajp8NI0NXSS6KR7CIjLeptAw2ulmL3HY0= 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 1576848372691147.81266535942189; Fri, 20 Dec 2019 05:26:12 -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-30-GcujuzLCOJuVDx8UtK3Sdw-1; Fri, 20 Dec 2019 08:26:09 -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 5040018543A2; Fri, 20 Dec 2019 13:26:04 +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 293EC63F68; Fri, 20 Dec 2019 13:26:04 +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 D162B182B01A; Fri, 20 Dec 2019 13:26:03 +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 xBKDPgRF028893 for ; Fri, 20 Dec 2019 08:25:42 -0500 Received: by smtp.corp.redhat.com (Postfix) id 925391CE; Fri, 20 Dec 2019 13:25:42 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1BFB563B93 for ; Fri, 20 Dec 2019 13:25:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576848371; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=gf6VWm1fdw+Af00faYSqYEhIZ1mGyqy3Q79FW0AllX0=; b=bQiCBsTr27UEIoatnp3PBY79aQDF4Wq+voEZdIc8ZPf1VSDnM4891IIW6slsXNSpW8JUek 0ijlnP59M7BNci6MsJfDwM2PsLCHxkgXIyZuF89T7nW9llyGomNeVCnerC5acy7nhYwPA7 ioQ12W2BXEp341G/KrPKYBpba8MQwRc= From: Peter Krempa To: libvir-list@redhat.com Date: Fri, 20 Dec 2019 14:25:26 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH 08/11] schemas: backup: Remove pointless for 'name' of backup disk 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: GcujuzLCOJuVDx8UtK3Sdw-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" One of the first versions thought of using disk path as the second option but this was dropped as being a legacy interface. Remove the leftover pointless wrapper for the disk name as there's just one option now. Signed-off-by: Peter Krempa Reviewed-by: Daniel P. Berrang=C3=A9 --- docs/schemas/domainbackup.rng | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/docs/schemas/domainbackup.rng b/docs/schemas/domainbackup.rng index 7286acb18c..c1e4d80302 100644 --- a/docs/schemas/domainbackup.rng +++ b/docs/schemas/domainbackup.rng @@ -104,9 +104,7 @@ - - - + @@ -165,9 +163,7 @@ - - - + --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 05:24:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.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 (zohomail.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=1576848362; cv=none; d=zohomail.com; s=zohoarc; b=bopEPt18VcLWvpR3mwFz9MBc7+nhfCC2iSL+6gZgTZbMfv6BXswflVxIZAwsAANsL3lLrJopKuh5DB3DicqVTtJBJ5c90cLAZki2hrgsD7ztUmF/3xVlGWonl8BwabepzZKE3QC5er5SqyyHZN1x1o4rdcsPY1+BvsvUq5ln5DQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576848362; h=Content-Type:Content-Transfer-Encoding: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=aQCviQCBVoYzuQUWL8BkpFcSDGKooMlcJtVQV3TFVIc=; b=WCVoZl/bzrkSDT61c0Bk2yJplLPwOOq+jEVkhTObLiHLS5vYQoXHDkqtjO5HaMPzHH1W3KabVFG7S0eUJm9N60bbdh5QHR/8zyEifMp5eYiEiMupnyrK9FUgfVx3Nw24pWKxVYR/+jhUWqDznGIM5oh/AdkIrmbbTfeGO+CBLNY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.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 157684836246634.29072090723207; Fri, 20 Dec 2019 05:26:02 -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-152-4t5wUPGcNemLWVidgaDKqg-1; Fri, 20 Dec 2019 08:25:59 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F16AD107ACE5; Fri, 20 Dec 2019 13:25:53 +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 7DAFF1001DD8; Fri, 20 Dec 2019 13:25:53 +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 39EA9252EC; Fri, 20 Dec 2019 13:25:53 +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 xBKDPhaM028900 for ; Fri, 20 Dec 2019 08:25:43 -0500 Received: by smtp.corp.redhat.com (Postfix) id 626FF1CE; Fri, 20 Dec 2019 13:25:43 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id DFBCF5C7DD for ; Fri, 20 Dec 2019 13:25:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576848361; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=aQCviQCBVoYzuQUWL8BkpFcSDGKooMlcJtVQV3TFVIc=; b=WeJpijnr/kjd+yZThe+h3YX7tO9gRcrMimcPSoPpVlB+mx2wi+wsKe7fvMYzQqPgqmNP7W eIEhAq6ssKJoslIsYblUXegxKRUwKLCxL97GM74FclKCND0+oMfuv5KcA+cI7ELVlk3KaS xhz5zHu4BQaUhNHiOAqbvTX0UQPWVQI= From: Peter Krempa To: libvir-list@redhat.com Date: Fri, 20 Dec 2019 14:25:27 +0100 Message-Id: <62b366f9f7f5d53ad86e30757000a3daaba9f0bb.1576847165.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH RFC 09/11] conf: backup: Allow configuration of names exported via NBD 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.22 X-MC-Unique: 4t5wUPGcNemLWVidgaDKqg-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" If users wish to use different name for exported disks or bitmaps the new fields allow to do so. Additionally they also document the current settings. Signed-off-by: Peter Krempa --- docs/formatbackup.html.in | 9 +++++++++ docs/schemas/domainbackup.rng | 8 ++++++++ src/conf/backup_conf.c | 11 +++++++++++ src/conf/backup_conf.h | 2 ++ tests/domainbackupxml2xmlin/backup-pull-seclabel.xml | 2 +- tests/domainbackupxml2xmlout/backup-pull-seclabel.xml | 2 +- 6 files changed, 32 insertions(+), 2 deletions(-) diff --git a/docs/formatbackup.html.in b/docs/formatbackup.html.in index 1c690901c7..7d2c6f1599 100644 --- a/docs/formatbackup.html.in +++ b/docs/formatbackup.html.in @@ -85,6 +85,15 @@
Setting this attribute to yes(default) spec= ifies that the disk should take part in the backup and using no excludes the disk from the backup.
+
exportname
+
Allows to modify the NBD export name for the given disk. + By default equal to disk target. + Valid only for pull mode backups.
+
exportbitmap
+
Allows to modify the name of the bitmap describing dirty + blocks for an incremental backup exported via NBD export n= ame + for the given disk. + Valid only for pull mode backups.
type
A mandatory attribute to describe the type of the disk, except when backup=3D'no' is diff --git a/docs/schemas/domainbackup.rng b/docs/schemas/domainbackup.rng index c1e4d80302..395ea841f9 100644 --- a/docs/schemas/domainbackup.rng +++ b/docs/schemas/domainbackup.rng @@ -165,6 +165,14 @@ + + + + + + + + diff --git a/src/conf/backup_conf.c b/src/conf/backup_conf.c index aa11967d2a..a4b87baa55 100644 --- a/src/conf/backup_conf.c +++ b/src/conf/backup_conf.c @@ -71,6 +71,8 @@ virDomainBackupDefFree(virDomainBackupDefPtr def) virDomainBackupDiskDefPtr disk =3D def->disks + i; g_free(disk->name); + g_free(disk->exportname); + g_free(disk->exportbitmap); virObjectUnref(disk->store); } @@ -124,6 +126,11 @@ virDomainBackupDiskDefParseXML(xmlNodePtr node, if (def->backup =3D=3D VIR_TRISTATE_BOOL_NO) return 0; + if (!push) { + def->exportname =3D virXMLPropString(node, "exportname"); + def->exportbitmap =3D virXMLPropString(node, "exportbitmap"); + } + if (internal) { if (!(state =3D virXMLPropString(node, "state")) || (tmp =3D virDomainBackupDiskStateTypeFromString(state)) < 0) { @@ -165,6 +172,7 @@ virDomainBackupDiskDefParseXML(xmlNodePtr node, storageSourceParseFlags, xmlopt) < 0) return -1; + if ((driver =3D virXPathString("string(./driver/@type)", ctxt))) { def->store->format =3D virStorageFileFormatTypeFromString(driver); if (def->store->format <=3D 0) { @@ -333,6 +341,9 @@ virDomainBackupDiskDefFormat(virBufferPtr buf, if (disk->backup =3D=3D VIR_TRISTATE_BOOL_YES) { virBufferAsprintf(&attrBuf, " type=3D'%s'", virStorageTypeToString= (disk->store->type)); + virBufferEscapeString(&attrBuf, " exportname=3D'%s'", disk->export= name); + virBufferEscapeString(&attrBuf, " exportbitmap=3D'%s'", disk->expo= rtbitmap); + if (disk->store->format > 0) virBufferEscapeString(&childBuf, "\n", virStorageFileFormatTypeToString(disk->s= tore->format)); diff --git a/src/conf/backup_conf.h b/src/conf/backup_conf.h index 7cf44245d4..672fd52ee7 100644 --- a/src/conf/backup_conf.h +++ b/src/conf/backup_conf.h @@ -51,6 +51,8 @@ typedef virDomainBackupDiskDef *virDomainBackupDiskDefPtr; struct _virDomainBackupDiskDef { char *name; /* name matching the 1525889631 - + diff --git a/tests/domainbackupxml2xmlout/backup-pull-seclabel.xml b/tests/= domainbackupxml2xmlout/backup-pull-seclabel.xml index c631c9b979..450f007d3a 100644 --- a/tests/domainbackupxml2xmlout/backup-pull-seclabel.xml +++ b/tests/domainbackupxml2xmlout/backup-pull-seclabel.xml @@ -2,7 +2,7 @@ 1525889631 - + --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 05:24:45 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=1576848377; cv=none; d=zohomail.com; s=zohoarc; b=VTHoMvNMagLbtH7sPyvof5NySmKqRyWRhYDTtWU0xj+SOww0PkVWIYLpxWm1iIsElYmliOiuWMYzkVYbyFM3MIQoHKM8rNdW+v+bXVaxb2HREPkxnx3oLv7Wto4hKJXd+lqbwVUCL6m+ujxWiaxsGH85W2XvQQgrxOdHcRd7d4Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576848377; h=Content-Type:Content-Transfer-Encoding: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=QHZVBMqSaue+delqF/N2Z4Pc5B1/lwmdHVKUQR/7t7M=; b=RBy4yJayMQeJbp23iKiZ59nORsFPHM0hG2i497NynVjRLWm+YHbtpVftOIRi9aMVuARxS9kv6HAnwkMG+epEXbkdbEDCvIih3azGLSjtbxECZ5BQbxXJjcuwvHIb+VQdwHW/nvmv8Umj+redrAVj3e3YTSsRzYC3+KT4NyZQ4sM= 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-2.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 157684837765823.128929241738547; Fri, 20 Dec 2019 05:26:17 -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-132-PXjgdemkPa6OrBGe_AuaLA-1; Fri, 20 Dec 2019 08:26:14 -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 36BB7800D5F; Fri, 20 Dec 2019 13:26:08 +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 15AF263BBC; Fri, 20 Dec 2019 13:26:08 +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 C05B3252F1; Fri, 20 Dec 2019 13:26:07 +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 xBKDPiJU028905 for ; Fri, 20 Dec 2019 08:25:44 -0500 Received: by smtp.corp.redhat.com (Postfix) id 317851CE; Fri, 20 Dec 2019 13:25:44 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id AF1B05C7DD for ; Fri, 20 Dec 2019 13:25:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576848376; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=QHZVBMqSaue+delqF/N2Z4Pc5B1/lwmdHVKUQR/7t7M=; b=CVdpv0g0ozacre7xuIeo2KPRxRKLFH23l/e6+TP9WenKg1X5/oX7Bta5hYeWAlotlxuJ08 GXUhHqZ5dpNrhXyOJE52jjp3wPNcsqKH4/+Puhxw0fo1ooQpnHp19viTGV6BDcVmPJCDpG AU7FKA4dhEIfbEetp39OYmO4+e/QaG4= From: Peter Krempa To: libvir-list@redhat.com Date: Fri, 20 Dec 2019 14:25:28 +0100 Message-Id: <40b3430f38303d6ed5295f24d66702fa79ac51c0.1576847165.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH RFC 10/11] qemu: backup: Implement support for backup disk export name configuration 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: PXjgdemkPa6OrBGe_AuaLA-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" Pass the exportname as configured when exporting the image via NBD and fill it with the default if it's not configured. Signed-off-by: Peter Krempa --- src/qemu/qemu_backup.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c index 3bac6b353c..54e726ca4a 100644 --- a/src/qemu/qemu_backup.c +++ b/src/qemu/qemu_backup.c @@ -548,9 +548,12 @@ qemuBackupBeginPullExportDisks(virDomainObjPtr vm, for (i =3D 0; i < ndisks; i++) { struct qemuBackupDiskData *dd =3D disks + i; + if (!dd->backupdisk->exportname) + dd->backupdisk->exportname =3D g_strdup(dd->domdisk->dst); + if (qemuMonitorNBDServerAdd(priv->mon, dd->store->nodeformat, - dd->domdisk->dst, + dd->backupdisk->exportname, false, dd->incrementalBitmap) < 0) return -1; --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Tue Apr 30 05:24:45 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.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 (zohomail.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=1576848366; cv=none; d=zohomail.com; s=zohoarc; b=J5U1Rl8YoeZKbdiPj2iD2hGDeTmFFcvlljLhjsGWHxeSm9XZDxo6yqyHBlPe7JNlir8forO8khCXX192fsIlk96KFRU502xWc2KJiqvBNbyxr/eTFhil+XR6Qx6bkfxVx9HxeGctwLWd1bVNS7UyHEhWq2vIgMVAT2xMG1KYmI4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1576848366; h=Content-Type:Content-Transfer-Encoding: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=mqzl0y28tPprpmDc00ZshJ/1w1pl+Ok00cG+Yxs92yg=; b=Gs/4ysQUFA/Rbb+ZEQflNFLFh390F59/t3A8xDg4Nkf/BjbGlavWWB7H3+E4yF+XIkvaTX4b4tphE4U/gIfjyOruQhUTd0CppdfdhEeCx12f652QsTgp6cZG+VuztNAVgjA4udiDhC3nBxOjHdu6Jcs+ADiorTyQDBaOt7eaP3s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.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-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 157684836620299.65717160693055; Fri, 20 Dec 2019 05:26:06 -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-203-y7cW5gWANIGeuStOodQ8qg-1; Fri, 20 Dec 2019 08:26:03 -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 AEEBC64A91; Fri, 20 Dec 2019 13:25:57 +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 83C0C63BB7; Fri, 20 Dec 2019 13:25:57 +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 3EF97182B016; Fri, 20 Dec 2019 13:25:57 +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 xBKDPjYa028913 for ; Fri, 20 Dec 2019 08:25:45 -0500 Received: by smtp.corp.redhat.com (Postfix) id 00BC863F62; Fri, 20 Dec 2019 13:25:45 +0000 (UTC) Received: from angien.redhat.com (unknown [10.43.2.48]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7DFE463BAC for ; Fri, 20 Dec 2019 13:25:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1576848364; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=mqzl0y28tPprpmDc00ZshJ/1w1pl+Ok00cG+Yxs92yg=; b=g5MBhWs23apvAWQ+0UYdSwlTvzyD7upM9TkqblONy3kJFSTE3RINpTkg4rYloys6qTnKjB uDg57hYZKV9sBQBppgG9pr5M9ixro43RcfIUZ4PjraoiLeimOMQWlcqq72eFYVY4mfBH9i vY9YVtnbwaJUn2UO5reuWdo/ZSiIXhE= From: Peter Krempa To: libvir-list@redhat.com Date: Fri, 20 Dec 2019 14:25:29 +0100 Message-Id: <01b72765f3d422500beb03f2bbde640cb4b0a77c.1576847165.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH RFC 11/11] qemu: backup: Implement support for backup disk bitmap name configuration 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: y7cW5gWANIGeuStOodQ8qg-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" Use the user-configured name of the bitmap when merging the appropriate bitmaps for an excremental backup so that the user can see it as configured. Additionally expose the default bitmap name if nothing is configured. Signed-off-by: Peter Krempa --- src/qemu/qemu_backup.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/qemu/qemu_backup.c b/src/qemu/qemu_backup.c index 54e726ca4a..795026d24b 100644 --- a/src/qemu/qemu_backup.c +++ b/src/qemu/qemu_backup.c @@ -322,7 +322,10 @@ qemuBackupDiskPrepareDataOne(virDomainObjPtr vm, return -1; if (incremental) { - dd->incrementalBitmap =3D g_strdup_printf("backup-%s", dd->domdisk= ->dst); + if (dd->backupdisk->exportbitmap) + dd->incrementalBitmap =3D g_strdup(dd->backupdisk->exportbitma= p); + else + dd->incrementalBitmap =3D g_strdup_printf("backup-%s", dd->dom= disk->dst); if (qemuBackupDiskPrepareOneBitmaps(dd, actions, incremental, blockNamedNodeData) < 0) @@ -368,6 +371,10 @@ static int qemuBackupDiskPrepareDataOnePull(virJSONValuePtr actions, struct qemuBackupDiskData *dd) { + if (!dd->backupdisk->exportbitmap && + dd->incrementalBitmap) + dd->backupdisk->exportbitmap =3D g_strdup(dd->incrementalBitmap); + if (qemuMonitorTransactionBackup(actions, dd->domdisk->src->nodeformat, dd->blockjob->name, --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list