Bug 1205925 - Error converting domain xml to qemu command back to domain xml: missing index/unit/bus parameter in drive
Summary: Error converting domain xml to qemu command back to domain xml: missing index...
Keywords:
Status: CLOSED DUPLICATE of bug 844845
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-03-25 23:02 UTC by Tom Herbert
Modified: 2016-04-21 22:09 UTC (History)
13 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-04-21 22:09:18 UTC
Embargoed:


Attachments (Terms of Use)
File shows commands to reproduce the problem (374 bytes, text/plain)
2015-03-25 23:02 UTC, Tom Herbert
no flags Details
xml from virsh dumpxml command. (1 bytes, text/plain)
2015-03-26 12:28 UTC, Tom Herbert
no flags Details
native qemu-argv format generated by domxml-to-native command is attached. (2.35 KB, text/plain)
2015-03-26 12:30 UTC, Tom Herbert
no flags Details

Description Tom Herbert 2015-03-25 23:02:28 UTC
Created attachment 1006541 [details]
File shows commands to reproduce the problem

virtman version 1.1.0

virsh version 1.2.9.0

$ qemu --version
QEMU emulator version 2.1.3 (qemu-2.1.3-3.fc21)

$ virsh domxml-to-native qemu-argv fed_21_1.xml > try.txt
$ virsh domxml-from-native qemu-argv try.txt > try.xml

internal error: missing index/unit/bus parameter in drive 'file=/var/lib/libvirt/images/fedora21_2.qcow2,if=none,id=drive-virtio-disk0,format=qcow2

Comment 1 Tom Herbert 2015-03-26 12:25:52 UTC
When attempting to convert xml to native qemu and back, domxml-from-native 
reports the following error in trying to convert the native format generated by 
domxml-to-native back to xml:

internal error: missing index/unit/bus parameter in drive 'file=/var/lib/libvirt/images/fedora21_2.qcow2,if=none,id=drive-virtio-disk0,format=qcow2

To reproduce, issue the following commands:

Generate xml for guest created by virt-manager.

# virsh dumpxml fed_21_1 > /tmp/1.xml

$ virsh domxml-to-native qemu-argv /tmp/1.xml > try.txt
$ virsh domxml-from-native qemu-argv try.txt > try.xml

internal error: missing index/unit/bus parameter in drive 'file=/var/lib/libvirt/images/fedora21_2.qcow2,if=none,id=drive-virtio-disk0,format=qcow2

Versions of utilities are shown in detail below: -----------------

Host is fed_21.

$ uname -a
Linux Fedora21 3.18.9-200.fc21.x86_64 #1 SMP Mon Mar 9 15:10:50 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

virt-manager version 1.1.0

$ virsh --version
virsh version 1.2.9.0

$ virsh --version=long 
Virsh command line tool of libvirt 1.2.9.2
See web site at http://libvirt.org/

Compiled with support for:
 Hypervisors: QEMU/KVM LXC UML Xen LibXL OpenVZ VMWare PHYP VirtualBox ESX Hyper-V Test
  Networking: Remote Network Bridging Interface netcf Nwfilter VirtualPort
   Storage: Dir Disk Filesystem SCSI Multipath iSCSI LVM RBD Gluster
    Miscellaneous: Daemon Nodedev SELinux Secrets Debug DTrace Readline Modular

virsh -c qemu:///system version --daemon
Compiled against library: libvirt 1.2.9
Using library: libvirt 1.2.9
Using API: QEMU 1.2.9
Running hypervisor: QEMU 2.1.3
Running against daemon: 1.2.9

$ qemu --version
QEMU emulator version 2.1.3 (qemu-2.1.3-3.fc21)

Guest is running Fedora 21. It was reated by virt-manager and is fully 
functioning.

xml was created by virsh dumpxml.

Comment 2 Tom Herbert 2015-03-26 12:28:18 UTC
Created attachment 1006778 [details]
xml from virsh dumpxml command.

This is the xml from the virsh dumpxml command.

Comment 3 Tom Herbert 2015-03-26 12:30:23 UTC
Created attachment 1006780 [details]
native qemu-argv format generated by domxml-to-native command is attached.

This attachment has the native format qemu command generated by dimxml-to-native virsh command.

Comment 4 Jiri Denemark 2015-03-26 12:42:54 UTC
Just of of curiosity, do you have any use case for this or did you just wanted to try it?

The domxml-from-native command is very limited in what it can do and it doesn't even understand a lot of advanced things libvirt itself puts into a QEMU command line. The main usage of this command is if you previously used QEMU directly and want to switch over to using libvirt. Then the command could help you create an XML which would start QEMU with the same devices you used when running QEMU directly. If it is able to understand the QEMU command line, of course.

Comment 5 Tom Herbert 2015-03-26 13:11:18 UTC
That is a good question and my use case is similar. I am trying to test vhost-cuse in DPDK/OVS data plane. I have the host side done and I am now trying to add the vHost device to the guest. I have two examples, one with a sample qemu command line and the other one with edits for the domain xml. I had trouble getting the qemu command to work so I then tried to see if I could edit the additional device info into the xml, but the format was different then my example as documented in OVS perhaps because of a version change in libvirt. Next I googled to see what the recommended way to get the additional device information into the domain xml. Googling, I encountered the following documentation, https://libvirt.org/drvqemu.html#xmlimport which suggested converting the domain to qemu-argv. That is why I tried doing it this way. Before I tried my device and netdev changes to the qemu-argv, I wanted to make sure that the qemu-argv created from the unmolested guest roman xml would work and I ran into the error documented here.
(In reply to Jiri Denemark from comment #4)
> Just of of curiosity, do you have any use case for this or did you just
> wanted to try it?
> 
> The domxml-from-native command is very limited in what it can do and it
> doesn't even understand a lot of advanced things libvirt itself puts into a
> QEMU command line. The main usage of this command is if you previously used
> QEMU directly and want to switch over to using libvirt. Then the command
> could help you create an XML which would start QEMU with the same devices
> you used when running QEMU directly. If it is able to understand the QEMU
> command line, of course.

Comment 6 Fedora End Of Life 2015-11-04 12:55:54 UTC
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '21'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 21 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 7 Cole Robinson 2015-11-04 23:22:16 UTC
Still relevant with libvirt-daemon-1.2.18.1-2.fc23.x86_64

Comment 8 Cole Robinson 2016-04-21 22:09:18 UTC

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


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