aboutsummaryrefslogtreecommitdiff
path: root/hw/i386/vmmouse.c
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2019-08-23 14:56:32 +0100
committerEduardo Habkost <ehabkost@redhat.com>2019-09-03 14:39:46 -0300
commit7faae95ebc966c2981b78cf7c25009dfa32d4b72 (patch)
tree7839eb2383b619d9ce283e164c9b254146bd355d /hw/i386/vmmouse.c
parent04109957d47307cdedd19afc3687bd6307466b53 (diff)
downloadqemu-7faae95ebc966c2981b78cf7c25009dfa32d4b72.zip
qemu-7faae95ebc966c2981b78cf7c25009dfa32d4b72.tar.gz
qemu-7faae95ebc966c2981b78cf7c25009dfa32d4b72.tar.bz2
hostmem-file: fix pmem file size check
Commit 314aec4a6e06844937f1677f6cba21981005f389 ("hostmem-file: reject invalid pmem file sizes") added a file size check that verifies the hostmem object's size parameter against the actual devdax pmem file. This is useful because getting the size wrong results in confusing errors inside the guest. However, the code doesn't work properly for files where struct stat::st_size is zero. Hostmem-file's ->alloc() function returns early without setting an Error, causing the following assertion failure: qemu/memory.c:2215: memory_region_get_ram_ptr: Assertion `mr->ram_block' failed. This patch handles the case where qemu_get_pmem_size() returns 0 but there is no error. Fixes: 314aec4a6e06844937f1677f6cba21981005f389 Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-Id: <20190823135632.25010-1-stefanha@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/i386/vmmouse.c')
0 files changed, 0 insertions, 0 deletions