From nobody Sun Feb 8 10:44:05 2026 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