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 816662 - Improve virsh blockpull error message for a offline domain
Summary: Improve virsh blockpull error message for a offline domain
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.3
Hardware: x86_64
OS: Linux
medium
low
Target Milestone: rc
: ---
Assignee: Eric Blake
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 816674
TreeView+ depends on / blocked
 
Reported: 2012-04-26 16:04 UTC by Alex Jia
Modified: 2012-06-20 06:57 UTC (History)
8 users (show)

Fixed In Version: libvirt-0.9.10-15.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 816674 (view as bug list)
Environment:
Last Closed: 2012-06-20 06:57:46 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:0748 0 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2012-06-19 19:31:38 UTC

Description Alex Jia 2012-04-26 16:04:52 UTC
Description of problem:
virsh blockpull raises a improper error message for a offline domain.

Version-Release number of selected component (if applicable):
# rpm -q libvirt qemu-kvm-rhev
libvirt-0.9.10-14.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.285.el6.x86_64

How reproducible:
always

Steps to Reproduce:
$ qemu-img create /var/lib/libvirt/images/test 1M

$ cat > /tmp/test.xml <<EOF
<domain type='qemu'>
  <name>test</name>
  <memory>219200</memory>
  <vcpu>1</vcpu>
  <os>
    <type arch='x86_64'>hvm</type>
    <boot dev='hd'/>
  </os>
  <devices>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/test'/>
      <target dev='vda' bus='virtio'/>
    </disk>
    <input type='mouse' bus='ps2'/>
    <graphics type='spice' autoport='yes' listen='0.0.0.0'/>
  </devices>
</domain>
EOF

$ virsh define /tmp/test.xml
$ valgrind -v virsh blockpull test /var/lib/libvirt/images/test --wait

  
Actual results:
error: unsupported configuration: block jobs not supported with this QEMU
binary

Expected results:


Additional info:
Eric has confirmed this issues, the following is his comments:
"the error message for an offline domain should be nicer."

Comment 1 Alex Jia 2012-04-26 16:07:02 UTC
(In reply to comment #0)
> $ valgrind -v virsh blockpull test /var/lib/libvirt/images/test --wait
It should be 'virsh blockpull test /var/lib/libvirt/images/test --wait' without
valgrind.

Comment 2 Eric Blake 2012-04-26 16:18:22 UTC
Yuck.  The problem here is that we don't learn some of qemu's capabilities until after we start the guest, so the behavior depends on what you have previously done with the guest:

offline
check capability -> not present
start guest
check capability -> present
stop guest
check capability -> present

I can do a quick fix for the symptoms (for the 3 or 4 capabilities that are conditional until the guest is first started, ensure that we are _always_ checking for an online guest before checking those caps), but the _real_ fix is to cache qemu capabilities once, instead of re-computing them per-VM, and as part of the up-front caching, compute even the capabilities that right now are only visible through the guest monitor.

Comment 3 Eric Blake 2012-04-26 16:24:03 UTC
Keeping this bug for the quick fix for 6.3 (swapping the checks is trivial to give us a better error message for offline domains); and cloning into 6.4 for the bigger issue of caching capabilities checks.

Comment 4 Eric Blake 2012-04-26 19:56:52 UTC
Upstream patch proposed:
https://www.redhat.com/archives/libvir-list/2012-April/msg01413.html

Comment 6 Alex Jia 2012-04-27 03:21:05 UTC
Hi Eric,
The blockcopy has the same issue for a offline domain:

# virsh domstate test2
shut off

# virsh blockcopy test2 /var/lib/libvirt/images/test2 /var/lib/libvirt/images/
error: unsupported configuration: block copy is not supported with this QEMU binary

Need I separately open a new bug to track it?

Thanks,
Alex

Comment 7 Eric Blake 2012-04-27 12:13:32 UTC
(In reply to comment #6)
> Hi Eric,
> The blockcopy has the same issue for a offline domain:
> 
> # virsh domstate test2
> shut off
> 
> # virsh blockcopy test2 /var/lib/libvirt/images/test2 /var/lib/libvirt/images/
> error: unsupported configuration: block copy is not supported with this QEMU
> binary

As does 'virsh dompmsuspend' and 'virsh snapshot-create --atomic --disk-only'.

> 
> Need I separately open a new bug to track it?

Nope - the patch in POST fixes all those issues at once.

Comment 8 Alex Jia 2012-04-27 15:55:47 UTC
(In reply to comment #7)
> 
> As does 'virsh dompmsuspend' and 'virsh snapshot-create --atomic --disk-only'.
But virsh blockcopy is different with above commands, as usual, the above commands will judge whether the domain is running, if not, libvirt will raise some error messages, for example:

# virsh dompmsuspend test2 disk
error: Domain test2 could not be suspended
error: argument unsupported: QEMU guest agent is not configured

Notes, in fact, the guest isn't running and guest agent is configured in the guest.

# virsh snapshot-create test2 --atomic --disk-only
error: unsupported configuration: disk snapshots of inactive domains not implemented yet

Notes, in fact, I gave a error argument without xml file in here.

Comment 9 Eric Blake 2012-04-27 19:40:13 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > 
> > As does 'virsh dompmsuspend' and 'virsh snapshot-create --atomic --disk-only'.
> But virsh blockcopy is different with above commands, as usual, the above
> commands will judge whether the domain is running, if not, libvirt will raise
> some error messages, for example:

Indeed, virsh blockcopy has to be patched separately, since it is (at the moment) a RHEL-only patch.  I'll post a 2nd patch shortly; until then, this is back in ASSIGNED.

> 
> # virsh dompmsuspend test2 disk
> error: Domain test2 could not be suspended
> error: argument unsupported: QEMU guest agent is not configured
> 
> Notes, in fact, the guest isn't running and guest agent is configured in the
> guest.

Yep, this is a misleading message that should be fixed by the first patch.

> 
> # virsh snapshot-create test2 --atomic --disk-only
> error: unsupported configuration: disk snapshots of inactive domains not
> implemented yet
> 
> Notes, in fact, I gave a error argument without xml file in here.

No, it is not an error to omit the xml file; doing that lets libvirt generate everything on your behalf (if you don't mind the snapshot having a timestamp for its name).  But the error message is correct for now (it may be worth a separate BZ to add support for offline disk-only snapshots in 6.4).

Comment 10 Eric Blake 2012-04-27 22:20:14 UTC
Back in POST; 2-part patch, with second patch:
http://post-office.corp.redhat.com/archives/rhvirt-patches/2012-April/msg00864.html

Comment 11 Alex Jia 2012-04-28 06:41:20 UTC
(In reply to comment #9)
> No, it is not an error to omit the xml file; doing that lets libvirt generate
> everything on your behalf (if you don't mind the snapshot having a timestamp
> for its name).  But the error message is correct for now (it may be worth a
> separate BZ to add support for offline disk-only snapshots in 6.4).
Okay, I will file a separate BZ to add support for offline disk-only snapshots in 6.4, thanks for your comments.

Comment 14 Huang Wenlong 2012-05-02 05:45:10 UTC
Verify this bug :
libvirt-0.9.10-15.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.285.el6.x86_64


#qemu-img create /var/lib/libvirt/images/test 1M

# cat > /tmp/test.xml <<EOF
<domain type='qemu'>
  <name>test</name>
  <memory>219200</memory>
  <vcpu>1</vcpu>
  <os>
    <type arch='x86_64'>hvm</type>
    <boot dev='hd'/>
  </os>
  <devices>
    <disk type='file' device='disk'>
      <driver name='qemu' type='raw'/>
      <source file='/var/lib/libvirt/images/test'/>
      <target dev='vda' bus='virtio'/>
    </disk>
    <input type='mouse' bus='ps2'/>
    <graphics type='spice' autoport='yes' listen='0.0.0.0'/>
  </devices>
</domain>
EOF

# virsh define /tmp/test.xml
Domain test defined from /tmp/test.xml
# virsh blockpull test /var/lib/libvirt/images/test --wait
error: Requested operation is not valid: domain is not running

# /etc/init.d/libvirtd status
libvirtd (pid  2033) is running...

Comment 16 errata-xmlrpc 2012-06-20 06:57:46 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, and where to find the updated
files, follow the link below.

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

http://rhn.redhat.com/errata/RHSA-2012-0748.html


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