[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH]: ignore empty type attribute, was Re: empty type parameter in driver tag for disk in machine xml file



Hi,
On Tue, Apr 06, 2010 at 12:50:31PM +0000, Frederik Himpe wrote:
> I updated my system from libvirt 0.7.1 to 0.7.7, one of my qemu-kvm VMs 
> was not starting anymore, with this error:
> 
> LC_ALL=C PATH=/sbin:/usr/sbin:/bin:/usr/bin HOME=/ TMPDIR=/tmp 
> QEMU_AUDIO_DRV=none /usr/bin/qemu-kvm -S -M pc-0.11 -enable-kvm -m 512 -
> smp 1,sockets=1,cores=1,threads=1 -name debian-testing -uuid 54f57a86-
> b84c-61ba-7f2a-c69f39f80a41 -nodefaults -chardev socket,id=monitor,path=/
> var/lib/libvirt/qemu/debian-testing.monitor,server,nowait -mon 
> chardev=monitor,mode=readline -rtc base=utc -boot c -drive file=/home/
> frederik/Software/iso/debian-testing-amd64-
> netinst.iso,if=none,media=cdrom,id=drive-ide0-1-0 -device ide-
> drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -drive file=/home/
> frederik/VM/debian-testing.img,if=none,id=drive-virtio-
> disk0,boot=on,format= -device virtio-blk-
> pci,bus=pci.0,addr=0x4,drive=drive-virtio-disk0,id=virtio-disk0 -device 
> virtio-net-pci,vlan=0,id=net0,mac=52:54:00:25:9c:a0,bus=pci.0,addr=0x5 -
> net tap,fd=19,vlan=0,name=hostnet0 -chardev pty,id=serial0 -device isa-
> serial,chardev=serial0 -usb -device usb-tablet,id=input0 -vnc 127.0.0.1:1 
> -k fr-be -vga vmware -device ES1370,id=sound0,bus=pci.0,addr=0x6 -device 
> virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3 
> char device redirected to /dev/pts/6
> qemu: '' invalid format
> 
> 
> It seems this part of the libvirt xml file was causing the problem:
> 
>     <disk type='file' device='disk'>
>       <driver name='qemu' type=''/>
>       <source file='/home/frederik/VM/debian-testing.img'/>
>       <target dev='vda' bus='virtio'/>
>       <address type='pci' domain='0x0000' bus='0x00' slot='0x04' 
> function='0x0'/>
>     </disk>
> 
> Notice the empty type parameter in the driver tag. Removing type='' 
> completely, makes the machine start fine.
> 
> Is this a bug which should be fixed, so that libvirt can deal empty type 
> tags, possible set by older versions?
This also popped up in Debian:
	http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=578347
A patch for ignoring an empty type attribute is attached. O.k. apply?
Cheers,
 -- Guido
From: =?UTF-8?q?Guido=20G=C3=BCnther?= <agx sigxcpu org>
Date: Mon, 19 Apr 2010 18:08:19 +0200
Subject: [PATCH] Ignore empty type statement in disk element

Closes: #578347
---
 src/qemu/qemu_conf.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/qemu/qemu_conf.c b/src/qemu/qemu_conf.c
index 48252a5..6749b1d 100644
--- a/src/qemu/qemu_conf.c
+++ b/src/qemu/qemu_conf.c
@@ -2459,7 +2459,7 @@ qemuBuildDriveStr(virDomainDiskDefPtr disk,
     if (disk->readonly &&
         qemuCmdFlags & QEMUD_CMD_FLAG_DEVICE)
         virBufferAddLit(&opt, ",readonly=on");
-    if (disk->driverType &&
+    if (disk->driverType && strlen(disk->driverType) &&
         disk->type != VIR_DOMAIN_DISK_TYPE_DIR &&
         qemuCmdFlags & QEMUD_CMD_FLAG_DRIVE_FORMAT)
         virBufferVSprintf(&opt, ",format=%s", disk->driverType);
-- 

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]