From e7b1d0ea950fc760371c9580ba6b34c912369a38 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Wed, 5 Dec 2012 15:28:05 +0100 Subject: [PATCH 1/6] 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 Signed-off-by: Stefan Hajnoczi --- hw/pc_sysfw.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/pc_sysfw.c b/hw/pc_sysfw.c index 87e1fa961b..7567593a63 100644 --- a/hw/pc_sysfw.c +++ b/hw/pc_sysfw.c @@ -84,6 +84,10 @@ static void pc_fw_add_pflash_drv(void) bios_name = BIOS_FILENAME; } filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name); + if (!filename) { + error_report("Can't open BIOS image %s", bios_name); + exit(1); + } opts = drive_add(IF_PFLASH, -1, filename, "readonly=on"); From e2af7a4dc8d218c5fb5b41dd1d008fa111d0636e Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Thu, 20 Dec 2012 07:50:41 +0100 Subject: [PATCH 2/6] pseries: Remove unneeded include statement (fixes MinGW builds) sys/mman.h is not needed (tested on Linux) and unavailable for MinGW, so remove it. Signed-off-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- hw/spapr_nvram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/spapr_nvram.c b/hw/spapr_nvram.c index f20f6b4fdd..680cdba928 100644 --- a/hw/spapr_nvram.c +++ b/hw/spapr_nvram.c @@ -21,7 +21,7 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ -#include + #include #include "sysemu/device_tree.h" From c242222c978d2c09411f2560915708c364ca2ce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=B3=E9=9F=8B=E4=BB=BB=20=28Wei-Ren=20Chen=29?= Date: Thu, 20 Dec 2012 16:41:34 +0800 Subject: [PATCH 3/6] Remove --sparc_cpu option from the configure list commit 9b9c37c36439ee0452632253dac7a31897f27f70 always assume sparcv9, the others are no longer supported. Remove --sparc_cpu option from the configure list. Signed-off-by: Chen Wei-Ren Signed-off-by: Stefan Hajnoczi --- configure | 1 - 1 file changed, 1 deletion(-) diff --git a/configure b/configure index 9538041d05..db11e511f0 100755 --- a/configure +++ b/configure @@ -1096,7 +1096,6 @@ echo " --fmod-inc path to FMOD includes" echo " --oss-lib path to OSS library" echo " --enable-uname-release=R Return R for uname -r in usermode emulation" echo " --cpu=CPU Build for host CPU [$cpu]" -echo " --sparc_cpu=V Build qemu for Sparc architecture v7, v8, v8plus, v8plusa, v9" echo " --disable-uuid disable uuid support" echo " --enable-uuid enable uuid support" echo " --disable-vde disable support for vde network" From 715857cbbabc8740792b608f9bc4cd9fad6ecb1d Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sat, 22 Dec 2012 13:59:22 +0100 Subject: [PATCH 4/6] hw/mcf5206: Reduce size of lookup table This typically reduces the size from 512 bytes to 128 bytes. Signed-off-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- hw/mcf5206.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/mcf5206.c b/hw/mcf5206.c index fe7a48864f..d8c0059ed6 100644 --- a/hw/mcf5206.c +++ b/hw/mcf5206.c @@ -359,7 +359,7 @@ static void m5206_mbar_write(m5206_mbar_state *s, uint32_t offset, /* Internal peripherals use a variety of register widths. This lookup table allows a single routine to handle all of them. */ -static const int m5206_mbar_width[] = +static const uint8_t m5206_mbar_width[] = { /* 000-040 */ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, /* 040-080 */ 1, 2, 2, 2, 4, 1, 2, 4, 1, 2, 4, 2, 2, 4, 2, 2, From 586b0bef84c202bb2256a35eb71bfd6670262bd7 Mon Sep 17 00:00:00 2001 From: John Spencer Date: Wed, 26 Dec 2012 00:49:49 +0100 Subject: [PATCH 5/6] linux-user/syscall.c: remove forward declarations instead use the correct headers that define these functions. Requested-by: Stefan Weil Signed-off-by: John Spencer Reviewed-by: Amos Kong Reviewed-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- linux-user/syscall.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index e99adab492..3167a87549 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -36,6 +36,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -581,11 +584,6 @@ _syscall4(int, sys_prlimit64, pid_t, pid, int, resource, struct host_rlimit64 *, old_limit) #endif -extern int personality(int); -extern int flock(int, int); -extern int setfsuid(int); -extern int setfsgid(int); - /* ARM EABI and MIPS expect 64bit types aligned even on pairs or registers */ #ifdef TARGET_ARM static inline int regpairs_aligned(void *cpu_env) { From bfb82a28752d29291adf932c3a9941e8383203af Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Wed, 19 Dec 2012 14:07:16 +0100 Subject: [PATCH 6/6] spice: drop incorrect vm_change_state_handler() opaque The spice_server pointer is a global variable and vm_change_state_handler() therefore does not use its opaque parameter. The vm change state handler is added with a pointer to the spice_server pointer. This is useless and we probably would not want 2 levels of pointers. Signed-off-by: Stefan Hajnoczi Reviewed-by: Uri Lublin --- ui/spice-core.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ui/spice-core.c b/ui/spice-core.c index 3e44779107..d83de2a46e 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -709,7 +709,7 @@ void qemu_spice_init(void) qemu_spice_input_init(); qemu_spice_audio_init(); - qemu_add_vm_change_state_handler(vm_change_state_handler, &spice_server); + qemu_add_vm_change_state_handler(vm_change_state_handler, NULL); g_free(x509_key_file); g_free(x509_cert_file); @@ -736,8 +736,7 @@ int qemu_spice_add_interface(SpiceBaseInstance *sin) */ spice_server = spice_server_new(); spice_server_init(spice_server, &core_interface); - qemu_add_vm_change_state_handler(vm_change_state_handler, - &spice_server); + qemu_add_vm_change_state_handler(vm_change_state_handler, NULL); } return spice_server_add_interface(spice_server, sin);