virtqueue: Sanity-check the length of indirect descriptors.

We were previously allowing arbitrarily-long descriptors, which could lead to a
buffer overflow in the qemu-kvm process.
Description: don't try to hotplug a cpu

qemu-kvm will end up crashing when qdev finds hotplug is not enabled.
Let's instead gracefully refuse.

Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/libvirt/+bug/878422

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Subject: e1000: check for overflow whenever issuing PCI dma reads

Reported-by: Nicolae Mogoreanu <mogo@google.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Description: make sure AT_EMPTHY_PATH is defined

It was being defined inside an ifdef but used outside of it.  The define
could also come from linux/fcntl.h.

Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/qemu-kvm/+bug/930181

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
block/vdi: Zero unused parts when allocating a new block (fix #919242)

The new block was filled with zero when it was allocated by g_malloc0,
but when it was reused later and only partially used, data from the
previously allocated block were still present and written to the new
block.

This caused the problems reported by bug #919242
(https://bugs.launchpad.net/qemu/+bug/919242).

Now the unused parts of the new block which are before and after the data
are always filled with zero, so it is no longer necessary to zero the whole
block with g_malloc0.

I also updated the copyright comment.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
vga-vmware + vnc: don't try to set_bit to negative offsets

If x or y < 0, set them to 0 (and decrement width/height accordingly)

Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/qemu-kvm/+bug/918791

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>