But the problem on the channel, it happened when I put the code as below:
<channel type='pty'>
<source mode='bind'
path='/var/lib/libvirt/qemu/va-i5E36098H-virtio.sock'/>
<target type='virtio'
name='org.qemu.guest_agent.0'/>
<address type='virtio-serial'
controller='0' bus='0' port='0'/>
</channel>
when I remove the code, the VM can up.
________________________________
From: Laine Stump <laine(a)laine.org>
To: libvir-list(a)redhat.com
Cc: azahaziz(a)yahoo.com
Sent: Wednesday, August 8, 2012 10:23 PM
Subject: Re: [libvirt] Channel with virtio problem
On 08/08/2012 03:29 AM, norazah aziz wrote:
I have configured the kvm and edit the xml as below, however there are an error when I
want to run the guest. The error as follows:
virsh create libvirt.xml
error: Failed to create domain from libvirt-test.xml
error: XML description for unknown target type for
character device:
virtio is not well formed or invalid
Please help me to solve this problem.
############################################################
<domain type='kvm'>
<name>i-5E36098H</name>
<os>
<type>hvm</type>
<kernel>/opt/eucalyptus-data/suria/i-5E36098H/kernel</kernel>
<initrd>/opt/eucalyptus-data/suria/i-5E36098H/ramdisk</initrd>
<cmdline>root=LABEL=root
console=ttyS0</cmdline>
</os>
<features>
<acpi/>
</features>
<memory>13107200</memory>
<vcpu>1</vcpu>
<devices>
<emulator>/usr/bin/kvm</emulator>
<disk type='file'>
<source
file='/opt/eucalyptus-data/suria/i-5E36098H/disk'/>
<target dev='vda' bus='virtio'/>
</disk>
<interface type='network'>
<source network='default'/>
<mac address='d0:0d:45:D2:08:01'/>
<model type='virtio'/>
</interface>
<controller type='ide' index='0'/>
<controller type='virtio-serial'
index='0' ports='16' vectors='4'/>
<controller type='virtio-serial'
index='1'>
<address type='pci' domain='0x0000'
bus='0x00' slot='0x0a' function='0x0'/>
</controller>
<parallel type='pty'>
<source path='/dev/pts/2'/>
<target port='0'/>
</parallel>
<serial type='pty'>
<source path='/dev/pts/3'/>
<!-- <source mode='bind'
path='/var/lib/libvirt/qemu/va-i-5E36098H-isa.sock'/>-->
<target type='virtio'
port='0'/>
^^^^^^^^^^^^^
This is your problem. serial targets don't accept a type attribute.
Only channel and console character devices understand target type.
</serial>
<console type='pty'>
<source path='/dev/pts/4'/>
<target type='virtio' port='0'/>
</console>
<channel type='pty'>
<source mode='bind'
path='/var/lib/libvirt/qemu/va-i5E36098H-virtio.sock'/>
<target type='virtio'
name='org.qemu.guest_agent.0'/>
<address type='virtio-serial'
controller='0' bus='0' port='0'/>
</channel>
<graphics type='vnc' port='-1' autoport='yes'
keymap='en-us'/>
</devices>
########################################################################
--
libvir-list mailing list libvir-list(a)redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list