Bug 1826746 - [incremental_backup][pull_mode] nbd exprotname and exportbitmap should be able to be set respectively
Summary: [incremental_backup][pull_mode] nbd exprotname and exportbitmap should be abl...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: libvirt
Version: 8.2
Hardware: x86_64
OS: Linux
low
low
Target Milestone: rc
: 8.3
Assignee: Peter Krempa
QA Contact: yisun
URL:
Whiteboard:
Depends On:
Blocks: 1920896
TreeView+ depends on / blocked
 
Reported: 2020-04-22 13:39 UTC by yisun
Modified: 2021-01-27 08:39 UTC (History)
6 users (show)

Fixed In Version: libvirt-6.3.0-1.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1920896 (view as bug list)
Environment:
Last Closed: 2020-11-17 17:48:27 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description yisun 2020-04-22 13:39:36 UTC
Description of problem:
[incremental_backup][pull_mode] nbd exprotname and exportbitmap should be able to be set respectively

Version-Release number of selected component (if applicable):
libvirt-6.0.0-17.module+el8.2.0+6257+0d066c28.x86_64

How reproducible:
100%

Steps to Reproduce:
1. prepare backup xml and checkpoint xml. Pls note, the disk tag for vdb in the backup.xml having the optional "exportname" set as "vdb_custom_exp" 
(.libvirt-ci-venv-ci-runtest-l95mHu) [root@dell-per740xd-11 inc_bkup]# cat backup.xml
<domainbackup mode="pull">
    <server name="localhost" port="10809"/>
    <disks>
        <disk backup="no" name="vda"/>
        <disk backup="yes" exportname="vdb_custom_exp" name="vdb" type="file">
            <scratch file="/var/tmp/scratch_file_0" />
        </disk>
    </disks>
</domainbackup>

(.libvirt-ci-venv-ci-runtest-l95mHu) [root@dell-per740xd-11 inc_bkup]# cat checkpoint.xml
<domaincheckpoint>
  <name>check_full</name>
  <disks>
    <disk name='vda' checkpoint='no'/>
    <disk name='vdb' checkpoint='bitmap'/>
  </disks>
</domaincheckpoint>

2. start the backup, backup.xml hits rng validation failure 
(.libvirt-ci-venv-ci-runtest-l95mHu) [root@dell-per740xd-11 inc_bkup]# virsh backup-begin backup-test backup.xml checkpoint.xml
error: XML document failed to validate against schema: Unable to validate doc against /usr/share/libvirt/schemas/domainbackup.rng
Extra element server in interleave
Element domainbackup failed to validate content


3. let's have a check about the domainbackup.rng
(.libvirt-ci-venv-ci-runtest-l95mHu) [root@dell-per740xd-11 inc_bkup]# cat /usr/share/libvirt/schemas/domainbackup.rng | egrep "exportname|exportbitmap" -a4
...
            <optional>
              <attribute name='exportname'>
                <text/>
              </attribute>
              <attribute name='exportbitmap'>
                <text/>
              </attribute>
            </optional>
...
<==== in above xml, we can see the exportname and exportbitmap are put together in a pair of <optional/>. So they have to show up together, or a failure will happen. This is not reasonable, user should be able to customize nbd export name or bitmap name respectively. 


Actual results:
As above

Expected results:
The rng file should be something like:
            <optional>
              <attribute name='exportname'>
                <text/>
              </attribute>
+++         </optional>
+++         <optional>
              <attribute name='exportbitmap'>
                <text/>
              </attribute>
            </optional>

Comment 2 Peter Krempa 2020-04-24 09:04:35 UTC
Fixed upstream:

commit c3ace7e234ccd43d5a008d93e122e6d47cd58e17 
Author: Peter Krempa <pkrempa>
Date:   Fri Apr 24 10:37:54 2020 +0200

    schema: backup: Make 'exportname' and 'exportbitmap' independent
    
    Both are optional but don't have to be specified together. Fix the
    schema.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1826746
    
    Suggested-by: Yi Sun <yisun>
    Signed-off-by: Peter Krempa <pkrempa>

Comment 8 errata-xmlrpc 2020-11-17 17:48:27 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (virt:8.3 bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:5137


Note You need to log in before you can comment on or make changes to this bug.