Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 808522 - regression in parsing libvirt-generated xml memory limits
Summary: regression in parsing libvirt-generated xml memory limits
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.3
Hardware: x86_64
OS: Linux
Target Milestone: rc
: ---
Assignee: Eric Blake
QA Contact: Virtualization Bugs
Depends On: 796526 813972
TreeView+ depends on / blocked
Reported: 2012-03-30 15:22 UTC by Eric Blake
Modified: 2012-06-20 06:51 UTC (History)
10 users (show)

Fixed In Version: libvirt-0.9.10-10.el6
Doc Type: Bug Fix
Doc Text:
Clone Of: 796526
Last Closed: 2012-06-20 06:51:36 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:0748 0 normal SHIPPED_LIVE Low: libvirt security, bug fix, and enhancement update 2012-06-19 19:31:38 UTC

Comment 1 Eric Blake 2012-03-30 15:24:21 UTC
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 15:56:31 UTC
Upstream patch proposed:

Comment 6 dyuan 2012-04-25 09:03:17 UTC
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 06:51:36 UTC
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.