Red Hat Bugzilla – Bug 808522
regression in parsing libvirt-generated xml memory limits
Last modified: 2012-06-20 02:51:36 EDT
The correct fix is to relax the parser to accept up to a megabyte discrepancy (since that's all the more that the qemu driver would introduce) and round down current memory when a discrepancy is found; as well as to fix the qemu driver to update the xml when rounding occurs.
Upstream patch proposed: https://www.redhat.com/archives/libvir-list/2012-March/msg01343.html
In POST: http://post-office.corp.redhat.com/archives/rhvirt-patches/2012-April/msg00024.html
Verified with libvirt-0.9.10-14.el6. Create a guest with the following xml: <memory unit='MB'>1000</memory> <currentMemory unit='MB'>1000</currentMemory> # virsh dumpxml xp|grep mem -i <memory unit='KiB'>976896</memory> <currentMemory unit='KiB'>976896</currentMemory> And the mem is using correct in guest. Reproduce this bug with libvirt-0.9.10-9.el6. Create a guest with the following xml: <memory unit='MB'>1000</memory> <currentMemory unit='MB'>1000</currentMemory> # virsh dumpxml xp <memory unit='KiB'>976563</memory> <currentMemory unit='KiB'>976896</currentMemory> # virsh list Id Name State ---------------------------------------------------- 1 xp running # service libvirtd restart Stopping libvirtd daemon: [ OK ] Starting libvirtd daemon: [ OK ] # virsh list Id Name State ---------------------------------------------------- but the qemu process is still existing. # ps aux|grep qemu qemu 23391 37.4 13.8 2175244 1050520 ? Sl 16:16 0:38 /usr/libexec/qemu-kvm -S -M rhel6.3.0 -enable-kvm -m 954 -smp 4,sockets=4,cores=1,threads=1 -name xp -uuid 18585065-c348-1c4f-46b9-fdfee279543b -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/xp.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base=utc -no-shutdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 -device virtio-serial-pci,id=virtio-serial0,bus=pci.0,addr=0x5 -drive file=/var/lib/libvirt/images/winXP-32-virtio.qcow2,if=none,id=drive-ide0-0-0,format=qcow2,cache=none -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=1 -drive file=/usr/share/virtio-win/virtio-win.vfd,if=none,id=drive-fdc0-0-0,format=raw,cache=none -global isa-fdc.driveA=drive-fdc0-0-0 -netdev tap,fd=22,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:3a:5f:6c,bus=pci.0,addr=0x3 -chardev pty,id=charserial0 -device isa-serial,chardev=charserial0,id=serial0 -chardev spicevmc,id=charchannel0,name=vdagent -device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 -spice port=5900,addr=127.0.0.1,disable-ticketing -vga qxl -global qxl-vga.vram_size=67108864 -device qxl,id=video1,vram_size=67108864,bus=pci.0,addr=0x7 -device qxl,id=video2,vram_size=67108864,bus=pci.0,addr=0x8 -device intel-hda,id=sound0,bus=pci.0,addr=0x4 -device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x6
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHSA-2012-0748.html