Luiz Capitulino dcc6ceffc0 virtio-balloon: fix integer overflow in BALLOON_CHANGE QMP event
Because dev->actual is uint32_t, the expression 'dev->actual <<
VIRTIO_BALLOON_PFN_SHIFT' is truncated to 32 bits. This overflows when
dev->actual >= 1048576.

To reproduce:

 1. Start a VM with a QMP socket and 5G of RAM
 2. Connect to the QMP socket, negotiate capabilities and issue:

   { "execute":"balloon", "arguments": { "value": 1073741824 } }

 3. Watch for BALLOON_CHANGE QMP events, the last one will incorretly be:

   { "timestamp": { "seconds": 1366228965, "microseconds": 245466 },
     "event": "BALLOON_CHANGE", "data": { "actual": 5368709120 } }

To fix it this commit casts it to ram_addr_t, which is ram_size's type.

Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
2013-04-19 08:32:44 -04:00
2013-04-15 10:18:05 +02:00
2013-04-12 14:33:20 +02:00
2013-04-18 13:50:53 +02:00
2013-04-08 18:13:10 +02:00
2013-04-04 00:28:37 +02:00
2013-03-26 16:16:43 -05:00
2013-03-26 16:16:43 -05:00
2013-04-08 18:13:10 +02:00
2013-04-08 18:13:10 +02:00
2013-04-15 20:09:55 +02:00
2013-04-17 10:27:47 -05:00
2013-04-18 13:50:53 +02:00
2013-04-08 18:13:10 +02:00
2013-04-08 18:13:10 +02:00
2013-04-18 14:12:31 +02:00
2013-04-08 18:13:10 +02:00
2013-03-11 13:32:03 +01:00
2013-04-08 18:13:10 +02:00
2013-04-08 18:13:10 +02:00

Read the documentation in qemu-doc.html or on http://wiki.qemu.org

- QEMU team
Description
No description provided
Readme 404 MiB
Languages
C 82.6%
C++ 6.5%
Python 3.4%
Dylan 2.9%
Shell 1.6%
Other 2.8%