Bug 675029 - virsh domxml-from-native is broken
Summary: virsh domxml-from-native is broken
Keywords:
Status: CLOSED DUPLICATE of bug 640122
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.1
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: rc
: ---
Assignee: Osier Yang
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-02-03 23:13 UTC by Eric Blake
Modified: 2011-11-22 09:47 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-11-22 09:47:48 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Eric Blake 2011-02-03 23:13:07 UTC
Description of problem:
qemu 0.12 introduced -chardev arguments, but libvirt 0.8.7 doesn't know how to parse those back into XML.  As a result, the conversion from qemu command line to libvirt XML ends up sucking in the <qemu:commandline> namespace, even though a proper conversion to <devices> would be more appropriate.

Round-tripping ALL libvirt-generated qemu command lines back to libvirt is not quite possible, at least, not without further enhancing virsh domxml-to-native to support a new 'argz' or 'shell' mode (where the arguments are either NUL-terminated or shell-quoted); the current output is ambiguous for any qemu argument that legitimately contains whitespace (such as smbios entries).  But that may also be worth fixing upstream.

Version-Release number of selected component (if applicable):
libvirt-0.8.7-4.el6

How reproducible:
100%

Steps to Reproduce:
1. find a simple libvirt XML for a domain with at least one device. To save me typing, I did cp libvirt/tests/qemuxml2argvdata/qemuxml2argv-console-virtio.xml dom.xml
2. convert the xml to native: virsh domxml-to-native qemu-argv dom.xml > dom.args
3. try to convert it back: virsh domxml-from-native dom.args

Actual results:
the resulting output is full of <qemu:arg> entries that libvirt couldn't parse, even though the original XML was completely understood by libvirt to generate the qemu command line in the first place

Expected results:
the output should be more or less identical to the original input (this doesn't completely have to be true, since libvirt may have modernized old xml constructs into newer), at least to the point of no <qemu:...> namespace elements.

Additional info:
So far, no one has reported this as a bug upstream, so it might not be a very-often used feature.  But since RHEL supports only libvirt and not direct qemu invocation, getting this to work well would ease conversion from people with qemu setups into supported libvirt setups.

Comment 2 RHEL Program Management 2011-04-04 02:07:35 UTC
Since RHEL 6.1 External Beta has begun, and this bug remains
unresolved, it has been rejected as it is not proposed as
exception or blocker.

Red Hat invites you to ask your support representative to
propose this request, if appropriate and relevant, in the
next release of Red Hat Enterprise Linux.

Comment 5 Osier Yang 2011-11-22 09:47:48 UTC

*** This bug has been marked as a duplicate of bug 640122 ***


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