RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2078274 - Blockcopy failed with catchXMLError
Summary: Blockcopy failed with catchXMLError
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: libvirt
Version: 9.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: Meina Li
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-04-25 02:19 UTC by Meina Li
Modified: 2022-11-15 10:39 UTC (History)
6 users (show)

Fixed In Version: libvirt-8.3.0-1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-15 10:04:06 UTC
Type: Bug
Target Upstream Version: 8.3.0
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-119764 0 None None None 2022-04-25 02:35:39 UTC
Red Hat Product Errata RHSA-2022:8003 0 None None None 2022-11-15 10:04:26 UTC

Description Meina Li 2022-04-25 02:19:16 UTC
Description of problem:
Blockcopy failed with catchXMLError

Version-Release number of selected component (if applicable):
libvirt-8.2.0-1.el9.x86_64
qemu-kvm-7.0.0-1.el9.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Prepare a running guest.
# virsh domstate avocado-vt-vm1
running
2. Do blockcopy for the disk.
# virsh blockcopy avocado-vt-vm1 vda /tmp/test.copy --wait --verbose --transient-job
error: (disk_definition):1: Start tag expected, '<' not found
 type='file''/tmp/test.copy'/>
-^

Actual results:
Blockcopy failed 

Expected results:
Can blockcopy successfully

Additional info:
1. Can blockcopy with --xml option successfully.
2. Check the libvirtd log:
...

2022-04-24 09:40:27.391+0000: 113418: debug : virThreadJobSet:93 : Thread 113418 (rpc-virtqemud) is now running job remoteDispatchDomainBlockCopy
2022-04-24 09:40:27.391+0000: 113418: debug : virDomainBlockCopy:10613 : dom=0x7fbaa0006950, (VM: name=avocado-vt-vm1, uuid=bf74e948-5579-4f86-895d-168d56193853), disk=vda, destxml= type='file''/tmp/test.copy'/>
<disk>
<source file=</disk>
, params=(nil), nparams=0, flags=0x4
2022-04-24 09:40:27.391+0000: 113418: error : catchXMLError:990 : (disk_definition):1: Start tag expected, '<' not found
 type='file''/tmp/test.copy'/>
-^
2022-04-24 09:40:27.391+0000: 113418: debug : virThreadJobClear:118 : Thread 113418 (rpc-virtqemud) finished job remoteDispatchDomainBlockCopy with ret=-1
3. May related with:
commit 1cd95f858a
Author: Peter Krempa <pkrempa>
Date:   Mon Feb 28 14:48:37 2022 +0100

    virsh: cmdBlockcopy: Use virXMLFormatElement
   
    Rewrite the formatting of the block copy target xml using
    virXMLFormatElement.

Comment 1 Peter Krempa 2022-04-26 08:55:32 UTC
Fixed upstream:

commit 9223ebbc85b024c114aab53a5fffc535e30b3082
Author: Peter Krempa <pkrempa>
Date:   Mon Apr 25 10:16:13 2022 +0200

    virsh: cmdBlockcopy: Fix generator of block copy disk XML
    
    In a recent commit I've attempted to rewrite the XML generator to use
    virXMLFormatElement instead of manual steps. Unfortunately the commit
    had multiple problems resulting in a garbled XML:
    
    1) in certain cases the wrong buffer was used resulting in misplaced
       snippets
    2) the child element buffer was improperly set up so sub-elements were
       not indented
    
    This resulted in following XML being generated:
    
     $ virsh blockcopy cd vda /tmp/test.copy --raw --print-xml
     type='file''/tmp/test.copy'/>
     <driver type='raw'/>
     <disk>
     <source file=</disk>
    
    To fix this we'll generate the '<source>' element in one go and use the
    proper buffer for it and other places.
    
    Fixes: 1cd95f858ab83f2baab0e35070d00766bb06ce3a
    Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2078274
    Signed-off-by: Peter Krempa <pkrempa>
    Reviewed-by: Michal Privoznik <mprivozn>

v8.2.0-237-g9223ebbc85

Comment 2 Meina Li 2022-05-07 10:08:20 UTC
Pre-verified Version:
libvirt-8.3.0-1.el9.x86_64
qemu-kvm-7.0.0-2.el9.x86_64

Pre-verified Steps:
1. Prepare a running guest.
# virsh domstate lmn
running
2. Do blockcopy for the disk.
# virsh blockcopy lmn vda /tmp/test.copy --wait --verbose --transient-job
Block Copy: [100 %]
Now in mirroring phase
# virsh blockjob lmn vda --pivot
3. Check the dumpxml.
# virsh dumpxml lmn | xmllint --xpath //disk -
<disk type="file" device="disk">
      <driver name="qemu" type="qcow2"/>
      <source file="/tmp/test.copy" index="2"/>
      <backingStore/>
      <target dev="vda" bus="virtio"/>
      <alias name="virtio-disk0"/>
      <address type="pci" domain="0x0000" bus="0x04" slot="0x00" function="0x0"/>
    </disk>

Comment 6 Meina Li 2022-05-24 07:29:10 UTC
Verified Version:
libvirt-8.3.0-1.el9.x86_64
qemu-kvm-7.0.0-4.el9.x86_64

Verified Steps:
S1: Do blockcopy to file disk.
1. Prepare a guest with snapshot.
# virsh domstate avocado-vt-vm1
running
# virsh snapshot-create-as avocado-vt-vm1 s1 --disk-only
Domain snapshot s1 created
2. Do blockcopy for the disk.
# virsh blockcopy avocado-vt-vm1 vda /tmp/test.copy --wait --verbose --transient-job
Block Copy: [100 %]
Now in mirroring phase
3. Pivot the job and check the dumpxml.
# virsh blockjob avocado-vt-vm1 vda --pivot
# virsh dumpxml avocado-vt-vm1 | xmllint --xpath //disk -
<disk type="file" device="disk">
      <driver name="qemu" type="qcow2"/>
      <source file="/tmp/test.copy" index="3"/>
      <backingStore/>
      <target dev="vda" bus="virtio"/>
      <alias name="virtio-disk0"/>
      <address type="pci" domain="0x0000" bus="0x04" slot="0x00" function="0x0"/>
    </disk>
S2. Do blockcopy to block disk.
1. Prepare a guest with snapshot.
# virsh domstate avocado-vt-vm1
running
# virsh snapshot-create-as avocado-vt-vm1 s1 --disk-only
Domain snapshot s1 created
2. Do blockcopy for the disk.
# virsh blockcopy avocado-vt-vm1 vda /dev/sdb --wait --verbose --transient-job --blockdev
Block Copy: [100 %]
Now in mirroring phase
3. Pivot the job and check the dumpxml.
# virsh blockjob avocado-vt-vm1 vda --pivot
# virsh dumpxml avocado-vt-vm1 | xmllint --xpath //disk -
<disk type="block" device="disk">
      <driver name="qemu" type="qcow2"/>
      <source dev="/dev/sdb" index="3"/>
      <backingStore/>
      <target dev="vda" bus="virtio"/>
      <alias name="virtio-disk0"/>
      <address type="pci" domain="0x0000" bus="0x04" slot="0x00" function="0x0"/>
    </disk>

Comment 8 errata-xmlrpc 2022-11-15 10:04:06 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 (Low: libvirt security, 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/RHSA-2022:8003


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