[libvirt-users] Problems moving qemu machine to libvirt

Erik de Castro Lopo mle+tools at mega-nerd.com
Sat Apr 24 15:03:42 UTC 2010


Hi all,

I have a qemu-system-arm machine that I am currently starting using:

    qemu-system-arm -M versatilepb -nographic \
      -hda img.qcow2 \
      -net vde,vlan=0,sock=/var/run/qemu-vde.ctl \
      -net nic,vlan=0,macaddr=52:54:00:12:34:22  \
      -kernel vmlinuz-2.6.18-6-versatile \
      -initrd initrd.img-2.6.18-6-versatile \
      -append "root=/dev/sda1 console=ttyAMA0,115200n8"

I converted the above to a virsh XML file using:

    virsh domxml-from-native qemu-argv run.argc > arm32.xml

which resulted in this (minor modifications to provide full paths):

    <domain type='qemu'>
      <name>arm32</name>
      <uuid>e433002b-107f-5b16-415b-7afb3e3a4d84</uuid>
      <memory>262144</memory>
      <currentMemory>262144</currentMemory>
      <vcpu>1</vcpu>
      <os>
        <type arch='arm' machine='versatilepb'>hvm</type>
        <kernel>/kvm/arm32/vmlinuz-2.6.18-6-versatile</kernel>
        <initrd>/kvm/arm32/initrd.img-2.6.18-6-versatile</initrd>
      </os>
      <features>
        <acpi/>
      </features>
      <clock offset='utc'/>
      <on_poweroff>destroy</on_poweroff>
      <on_reboot>restart</on_reboot>
      <on_crash>destroy</on_crash>
      <devices>
        <emulator>/kvm/arm32/arm32.sh</emulator>
        <disk type='file' device='disk'>
          <source file='/kvm/arm32/img.qcow2'/>
          <target dev='hda' bus='ide'/>
          <address type='drive' controller='0' bus='0' unit='0'/>
        </disk>
        <controller type='ide' index='0'/>
        <serial type='pty'>
          <target port='0'/>
        </serial>
        <console type='pty'>
          <target port='0'/>
        </console>
      </devices>
    </domain>

Since libvirt doesn't support VDE networking I use a wrapper around
qemu-system-arm (/kvm/arm32/arm32.sh) containing:

    #!/bin/bash
    exec /usr/bin/qemu-system-arm $@ \
	-net nic,vlan=0,macaddr=52:54:00:12:34:22 \
	-net vde,vlan=0,group=vde2-net,mode=0770,sock=/var/run/qemu-vde.ctl \
	-append "root=/dev/sda1 console=ttyAMA0,115200n8"

However, doing this I get the following error when I attempt to start
the VM:

    error: Failed to start domain arm32
    error: internal error Process exited while reading console log output:
           char device redirected to /dev/pts/10
    qemu: could not open disk image console=ttyAMA0,115200n8\"":
           No such file or directory

The first problem (console log output) is probably due to the second,
where it seems that this:

    <cmdline>root=/dev/sda1 console=ttyAMA0,115200n8</cmdline>

is not being passed to qemu correctly. I have tried quoting the command
line but that doesn't help.

Anyone have any clues?

Cheers,
Erik
-- 
----------------------------------------------------------------------
Erik de Castro Lopo
http://www.mega-nerd.com/




More information about the libvirt-users mailing list