Bug 808522 - regression in parsing libvirt-generated xml memory limits
regression in parsing libvirt-generated xml memory limits
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt (Show other bugs)
x86_64 Linux
medium Severity low
: rc
: ---
Assigned To: Eric Blake
Virtualization Bugs
: Regression
Depends On: 796526 813972
  Show dependency treegraph
Reported: 2012-03-30 11:22 EDT by Eric Blake
Modified: 2012-06-20 02:51 EDT (History)
10 users (show)

See Also:
Fixed In Version: libvirt-0.9.10-10.el6
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 796526
Last Closed: 2012-06-20 02:51:36 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Comment 1 Eric Blake 2012-03-30 11:24:21 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.
Comment 2 Eric Blake 2012-03-30 11:56:31 EDT
Upstream patch proposed:
Comment 6 dyuan 2012-04-25 05:03:17 EDT
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=,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
Comment 8 errata-xmlrpc 2012-06-20 02:51:36 EDT
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.


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