summary refs log tree commit diff stats
path: root/linux-user/syscall.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2012-12-05 15:28:05 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2013-01-04 14:38:04 +0100
commite7b1d0ea950fc760371c9580ba6b34c912369a38 (patch)
treef57f57c5a582bb860e0eaf45f79feed62289deba /linux-user/syscall.c
parent25bbf61e4bacd1e4fa4115ffcf151051b9d6608e (diff)
downloadfocaccia-qemu-e7b1d0ea950fc760371c9580ba6b34c912369a38.tar.gz
focaccia-qemu-e7b1d0ea950fc760371c9580ba6b34c912369a38.zip
pc_sysfw: Check for qemu_find_file() failure
pc_fw_add_pflash_drv() ignores qemu_find_file() failure, and happily
creates a drive without a medium.

When pc_system_flash_init() asks for its size, bdrv_getlength() fails
with -ENOMEDIUM, which isn't checked either.  It fails relatively
cleanly only because -ENOMEDIUM isn't a multiple of 4096:

    $ qemu-system-x86_64 -S -vnc :0 -bios nonexistant
    qemu: PC system firmware (pflash) must be a multiple of 0x1000
    [Exit 1 ]

Fix by handling the qemu_find_file() failure.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'linux-user/syscall.c')
0 files changed, 0 insertions, 0 deletions