From a80f53aee36f177203a2d4e7a046dc0365e42150 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Sat, 30 Jul 2011 13:18:35 +0100 Subject: user: Restore debug usage message for '-d ?' in user mode emulation The code which prints the debug usage message on '-d ?' for *-user has to come before the check for "not enough arguments", so that "qemu-foo -d ?" prints the list of possible debug log items rather than the generic usage message. (This was inadvertently broken in commit c235d73.) Signed-off-by: Peter Maydell --- bsd-user/main.c | 8 +++++--- darwin-user/main.c | 8 +++++--- linux-user/main.c | 11 ++++++----- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index 6018a419e..a63b8777f 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -856,9 +856,6 @@ int main(int argc, char **argv) usage(); } } - if (optind >= argc) - usage(); - filename = argv[optind]; /* init debug */ cpu_set_log_filename(log_file); @@ -877,6 +874,11 @@ int main(int argc, char **argv) cpu_set_log(mask); } + if (optind >= argc) { + usage(); + } + filename = argv[optind]; + /* Zero out regs */ memset(regs, 0, sizeof(struct target_pt_regs)); diff --git a/darwin-user/main.c b/darwin-user/main.c index 35196a12c..72307adeb 100644 --- a/darwin-user/main.c +++ b/darwin-user/main.c @@ -809,9 +809,6 @@ int main(int argc, char **argv) usage(); } } - if (optind >= argc) - usage(); - filename = argv[optind]; /* init debug */ cpu_set_log_filename(log_file); @@ -830,6 +827,11 @@ int main(int argc, char **argv) cpu_set_log(mask); } + if (optind >= argc) { + usage(); + } + filename = argv[optind]; + /* Zero out regs */ memset(regs, 0, sizeof(struct target_pt_regs)); diff --git a/linux-user/main.c b/linux-user/main.c index 2135b9c71..6a8f4bdc1 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -3048,11 +3048,6 @@ int main(int argc, char **argv, char **envp) usage(); } } - if (optind >= argc) - usage(); - filename = argv[optind]; - exec_path = argv[optind]; - /* init debug */ cpu_set_log_filename(log_file); if (log_mask) { @@ -3070,6 +3065,12 @@ int main(int argc, char **argv, char **envp) cpu_set_log(mask); } + if (optind >= argc) { + usage(); + } + filename = argv[optind]; + exec_path = argv[optind]; + /* Zero out regs */ memset(regs, 0, sizeof(struct target_pt_regs)); -- cgit v1.2.3 From 2af86a2ff7a3c5f6afabc258fc2dd5f41411b3bf Mon Sep 17 00:00:00 2001 From: Brad Date: Sun, 7 Aug 2011 11:06:43 +0000 Subject: Fix forcing multicast msgs to loopback on OpenBSD. Fix forcing multicast msgs to loopback on OpenBSD. e.g. $ sudo qemu -m 128 -no-fd-bootchk \ -hda virtual.img -boot n -nographic \ -net nic,vlan=0,model=rtl8139,macaddr=52:54:00:12:34:03 \ -net user -tftp /usr/src/sys/arch/i386/compile/TEST -bootp pxeboot \ -net nic,vlan=1,model=rtl8139,macaddr=52:54:00:23:03:01 \ -net tap,vlan=1,script=no \ -net nic,vlan=3,model=rtl8139,macaddr=52:54:00:23:03:03 \ -net socket,vlan=3,mcast=230.0.0.1:10003 setsockopt(SOL_IP, IP_MULTICAST_LOOP): Invalid argument qemu: -net socket,vlan=3,mcast=230.0.0.1:10003: Device 'socket' could not be initialized Signed-off-by: Brad Smith Signed-off-by: Blue Swirl --- net/socket.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/net/socket.c b/net/socket.c index 11fe5f383..5cd0b9abf 100644 --- a/net/socket.c +++ b/net/socket.c @@ -154,6 +154,12 @@ static int net_socket_mcast_create(struct sockaddr_in *mcastaddr, struct in_addr struct ip_mreq imr; int fd; int val, ret; +#ifdef __OpenBSD__ + unsigned char loop; +#else + int loop; +#endif + if (!IN_MULTICAST(ntohl(mcastaddr->sin_addr.s_addr))) { fprintf(stderr, "qemu: error: specified mcastaddr \"%s\" (0x%08x) does not contain a multicast address\n", inet_ntoa(mcastaddr->sin_addr), @@ -197,9 +203,9 @@ static int net_socket_mcast_create(struct sockaddr_in *mcastaddr, struct in_addr } /* Force mcast msgs to loopback (eg. several QEMUs in same host */ - val = 1; + loop = 1; ret=setsockopt(fd, IPPROTO_IP, IP_MULTICAST_LOOP, - (const char *)&val, sizeof(val)); + (const char *)&loop, sizeof(loop)); if (ret < 0) { perror("setsockopt(SOL_IP, IP_MULTICAST_LOOP)"); goto fail; -- cgit v1.2.3 From ff5acedd8f472a39b2e11d0fad79d0e9b6c140c2 Mon Sep 17 00:00:00 2001 From: TeLeMan Date: Mon, 25 Jul 2011 16:29:14 +0800 Subject: monitor: fix build breakage with --disable-vnc The breakage was introduced by the commit 13661089810d3e59931f3e80d7cb541b99af7071 Signed-off-by: TeLeMan Signed-off-by: Anthony Liguori --- monitor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/monitor.c b/monitor.c index 718935b88..1b8ba2c1f 100644 --- a/monitor.c +++ b/monitor.c @@ -1200,10 +1200,12 @@ static int add_graphics_client(Monitor *mon, const QDict *qdict, QObject **ret_d } qerror_report(QERR_ADD_CLIENT_FAILED); return -1; +#ifdef CONFIG_VNC } else if (strcmp(protocol, "vnc") == 0) { int fd = monitor_get_fd(mon, fdname); vnc_display_add_client(NULL, fd, skipauth); return 0; +#endif } else if ((s = qemu_chr_find(protocol)) != NULL) { int fd = monitor_get_fd(mon, fdname); if (qemu_chr_add_client(s, fd) < 0) { -- cgit v1.2.3 From e19a4e89aeeae5ac9f91d4a28c2077f5dd5485d1 Mon Sep 17 00:00:00 2001 From: Jamie Iles Date: Wed, 10 Aug 2011 15:18:42 +0100 Subject: monitor: fix build breakage for !CONFIG_VNC Commit c62f6d1 (monitor: fix build breakage with --disable-vnc) conditionalised some VNC setup code but left an unused variable. Move the variable into the conditional code to fix the build breakage. Cc: Luiz Capitulino Cc: Markus Armbruster Signed-off-by: Jamie Iles Signed-off-by: Luiz Capitulino --- monitor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitor.c b/monitor.c index 1b8ba2c1f..fee572c21 100644 --- a/monitor.c +++ b/monitor.c @@ -1189,7 +1189,6 @@ static int add_graphics_client(Monitor *mon, const QDict *qdict, QObject **ret_d { const char *protocol = qdict_get_str(qdict, "protocol"); const char *fdname = qdict_get_str(qdict, "fdname"); - int skipauth = qdict_get_try_bool(qdict, "skipauth", 0); CharDriverState *s; if (strcmp(protocol, "spice") == 0) { @@ -1203,6 +1202,7 @@ static int add_graphics_client(Monitor *mon, const QDict *qdict, QObject **ret_d #ifdef CONFIG_VNC } else if (strcmp(protocol, "vnc") == 0) { int fd = monitor_get_fd(mon, fdname); + int skipauth = qdict_get_try_bool(qdict, "skipauth", 0); vnc_display_add_client(NULL, fd, skipauth); return 0; #endif -- cgit v1.2.3 From fbdd7c8bd53aa8228b6faca00d29ce60a42ae8b2 Mon Sep 17 00:00:00 2001 From: Luiz Capitulino Date: Fri, 26 Aug 2011 15:00:13 -0300 Subject: configure: Copy test data to build directory The QDict unit-tests (check-qdict) will fail when ran on a different build directory. That's, it only works when ran on the source dir. This happens because its data file (qdict-test-data.txt) is not copied to the build dir. Fix it. Signed-off-by: Luiz Capitulino Conflicts: configure --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 3d39d1b19..c55be366c 100755 --- a/configure +++ b/configure @@ -3566,7 +3566,7 @@ DIRS="$DIRS roms/seabios roms/vgabios" DIRS="$DIRS fsdev ui" DIRS="$DIRS qapi" DIRS="$DIRS qga" -FILES="Makefile tests/Makefile" +FILES="Makefile tests/Makefile qdict-test-data.txt" FILES="$FILES tests/cris/Makefile tests/cris/.gdbinit" FILES="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps" FILES="$FILES pc-bios/spapr-rtas/Makefile" -- cgit v1.2.3 From b89f4a7d2a9d4261288ae4d75ae103177c172c3f Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Fri, 26 Aug 2011 19:52:11 +0200 Subject: Fix qjson test of solidus encoding "\/" is supposed to be decoded as "/", but there is no need to encode "/" via escape. Fix the existing test and add a second one expressing this. Signed-off-by: Jan Kiszka Acked-by: Michael Roth Signed-off-by: Luiz Capitulino --- check-qjson.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/check-qjson.c b/check-qjson.c index 64fcdcb4a..36d4ac26b 100644 --- a/check-qjson.c +++ b/check-qjson.c @@ -33,7 +33,8 @@ START_TEST(escaped_string) { "\"\\n\"", "\n" }, { "\"\\r\"", "\r" }, { "\"\\t\"", "\t" }, - { "\"\\/\"", "\\/" }, + { "\"/\"", "/" }, + { "\"\\/\"", "/", .skip = 1 }, { "\"\\\\\"", "\\" }, { "\"\\\"\"", "\"" }, { "\"hello world \\\"embedded string\\\"\"", -- cgit v1.2.3 From 91b31d6158eb5a79bc1a1ef7f24f7d2efa41cc64 Mon Sep 17 00:00:00 2001 From: Brad Date: Sun, 28 Aug 2011 04:01:33 -0400 Subject: Fix install(1) usage to be compatible with OpenBSD's install(1). Fix install(1) usage to be compatible with OpenBSD's install(1). When creating a directory via the -d flag the -p flag cannot be used at the same time. Also in the context of installing QEMU it doesn't make sense to use the -p flag anyway so use the [default] -c flag instead. Signed-off-by: Brad Smith Signed-off-by: Anthony Liguori --- configure | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure b/configure index c55be366c..bfea0590e 100755 --- a/configure +++ b/configure @@ -3048,9 +3048,9 @@ echo "TOOLS=$tools" >> $config_host_mak echo "ROMS=$roms" >> $config_host_mak echo "MAKE=$make" >> $config_host_mak echo "INSTALL=$install" >> $config_host_mak -echo "INSTALL_DIR=$install -d -m0755 -p" >> $config_host_mak -echo "INSTALL_DATA=$install -m0644 -p" >> $config_host_mak -echo "INSTALL_PROG=$install -m0755 -p" >> $config_host_mak +echo "INSTALL_DIR=$install -d -m 0755" >> $config_host_mak +echo "INSTALL_DATA=$install -c -m 0644" >> $config_host_mak +echo "INSTALL_PROG=$install -c -m 0755" >> $config_host_mak echo "PYTHON=$python" >> $config_host_mak echo "CC=$cc" >> $config_host_mak echo "CC_I386=$cc_i386" >> $config_host_mak -- cgit v1.2.3 From 7095e715765e0b5ca57799142a712f0c761e98ee Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 26 Aug 2011 11:16:10 +0200 Subject: Fix linker scripts Remove PROVIDE_HIDDEN and ONLY_IF_{RO,RW} from linker scripts to make them work with older binutils versions. Fixes *-bsd-user build on OpenBSD 4.9 which ships binutils 2.15. Signed-off-by: Gerd Hoffmann Signed-off-by: Blue Swirl --- arm.ld | 12 ++++++------ hppa.ld | 18 ++++++++---------- i386.ld | 8 ++++---- mips.ld | 18 ++++++++---------- ppc.ld | 18 ++++++++---------- ppc64.ld | 6 ++---- sparc.ld | 12 ++++++------ x86_64.ld | 14 ++++++-------- 8 files changed, 48 insertions(+), 58 deletions(-) diff --git a/arm.ld b/arm.ld index 12b3edb5b..7f13da9eb 100644 --- a/arm.ld +++ b/arm.ld @@ -71,23 +71,23 @@ SECTIONS .data1 : { *(.data1) } .preinit_array : { - PROVIDE_HIDDEN (__preinit_array_start = .); + PROVIDE (__preinit_array_start = .); KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); + PROVIDE (__preinit_array_end = .); } .init_array : { - PROVIDE_HIDDEN (__init_array_start = .); + PROVIDE (__init_array_start = .); KEEP (*(SORT(.init_array.*))) KEEP (*(.init_array)) - PROVIDE_HIDDEN (__init_array_end = .); + PROVIDE (__init_array_end = .); } .fini_array : { - PROVIDE_HIDDEN (__fini_array_start = .); + PROVIDE (__fini_array_start = .); KEEP (*(.fini_array)) KEEP (*(SORT(.fini_array.*))) - PROVIDE_HIDDEN (__fini_array_end = .); + PROVIDE (__fini_array_end = .); } .ctors : { diff --git a/hppa.ld b/hppa.ld index 9a4b22c02..3555b3e8e 100644 --- a/hppa.ld +++ b/hppa.ld @@ -75,36 +75,34 @@ SECTIONS .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) } .PARISC.unwind : { *(.PARISC.unwind) } .eh_frame_hdr : { *(.eh_frame_hdr) } - .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } - .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } /* Adjust the address for the data segment. We want to adjust up to the same address within the page on the next page up. */ . = ALIGN(0x10000) + (. & (0x10000 - 1)); /* Exception handling */ - .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } - .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } + .eh_frame : { KEEP (*(.eh_frame)) } + .gcc_except_table : { *(.gcc_except_table .gcc_except_table.*) } /* Thread Local Storage sections */ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } .preinit_array : { - PROVIDE_HIDDEN (__preinit_array_start = .); + PROVIDE (__preinit_array_start = .); KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); + PROVIDE (__preinit_array_end = .); } .init_array : { - PROVIDE_HIDDEN (__init_array_start = .); + PROVIDE (__init_array_start = .); KEEP (*(SORT(.init_array.*))) KEEP (*(.init_array)) - PROVIDE_HIDDEN (__init_array_end = .); + PROVIDE (__init_array_end = .); } .fini_array : { - PROVIDE_HIDDEN (__fini_array_start = .); + PROVIDE (__fini_array_start = .); KEEP (*(.fini_array)) KEEP (*(SORT(.fini_array.*))) - PROVIDE_HIDDEN (__fini_array_end = .); + PROVIDE (__fini_array_end = .); } .ctors : { diff --git a/i386.ld b/i386.ld index f8df7bf8d..cc3f160af 100644 --- a/i386.ld +++ b/i386.ld @@ -42,16 +42,16 @@ SECTIONS .rel.plt : { *(.rel.plt) - PROVIDE_HIDDEN (__rel_iplt_start = .); + PROVIDE (__rel_iplt_start = .); *(.rel.iplt) - PROVIDE_HIDDEN (__rel_iplt_end = .); + PROVIDE (__rel_iplt_end = .); } .rela.plt : { *(.rela.plt) - PROVIDE_HIDDEN (__rela_iplt_start = .); + PROVIDE (__rela_iplt_start = .); *(.rela.iplt) - PROVIDE_HIDDEN (__rela_iplt_end = .); + PROVIDE (__rela_iplt_end = .); } .init : { *(.init) } =0x47ff041f .text : diff --git a/mips.ld b/mips.ld index 4294761c1..7b610ceed 100644 --- a/mips.ld +++ b/mips.ld @@ -79,36 +79,34 @@ SECTIONS } .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) } .eh_frame_hdr : { *(.eh_frame_hdr) } - .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } - .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } /* Adjust the address for the data segment. We want to adjust up to the same address within the page on the next page up. */ . = ALIGN (0x40000) - ((0x40000 - .) & (0x40000 - 1)); . = DATA_SEGMENT_ALIGN (0x40000, 0x1000); /* Exception handling */ - .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } - .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } + .eh_frame : { KEEP (*(.eh_frame)) } + .gcc_except_table : { *(.gcc_except_table .gcc_except_table.*) } /* Thread Local Storage sections */ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } .preinit_array : { - PROVIDE_HIDDEN (__preinit_array_start = .); + PROVIDE (__preinit_array_start = .); KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); + PROVIDE (__preinit_array_end = .); } .init_array : { - PROVIDE_HIDDEN (__init_array_start = .); + PROVIDE (__init_array_start = .); KEEP (*(SORT(.init_array.*))) KEEP (*(.init_array)) - PROVIDE_HIDDEN (__init_array_end = .); + PROVIDE (__init_array_end = .); } .fini_array : { - PROVIDE_HIDDEN (__fini_array_start = .); + PROVIDE (__fini_array_start = .); KEEP (*(.fini_array)) KEEP (*(SORT(.fini_array.*))) - PROVIDE_HIDDEN (__fini_array_end = .); + PROVIDE (__fini_array_end = .); } .ctors : { diff --git a/ppc.ld b/ppc.ld index 5248ef15a..69aa3f228 100644 --- a/ppc.ld +++ b/ppc.ld @@ -79,36 +79,34 @@ SECTIONS } .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) } .eh_frame_hdr : { *(.eh_frame_hdr) } - .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } - .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) } /* Adjust the address for the data segment. We want to adjust up to the same address within the page on the next page up. */ . = ALIGN (0x10000) - ((0x10000 - .) & (0x10000 - 1)); . = DATA_SEGMENT_ALIGN (0x10000, 0x1000); /* Exception handling */ - .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } - .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) } + .eh_frame : { KEEP (*(.eh_frame)) } + .gcc_except_table : { *(.gcc_except_table .gcc_except_table.*) } /* Thread Local Storage sections */ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } .preinit_array : { - PROVIDE_HIDDEN (__preinit_array_start = .); + PROVIDE (__preinit_array_start = .); KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); + PROVIDE (__preinit_array_end = .); } .init_array : { - PROVIDE_HIDDEN (__init_array_start = .); + PROVIDE (__init_array_start = .); KEEP (*(SORT(.init_array.*))) KEEP (*(.init_array)) - PROVIDE_HIDDEN (__init_array_end = .); + PROVIDE (__init_array_end = .); } .fini_array : { - PROVIDE_HIDDEN (__fini_array_start = .); + PROVIDE (__fini_array_start = .); KEEP (*(.fini_array)) KEEP (*(SORT(.fini_array.*))) - PROVIDE_HIDDEN (__fini_array_end = .); + PROVIDE (__fini_array_end = .); } .ctors : { diff --git a/ppc64.ld b/ppc64.ld index dea0dbda2..0059ee53a 100644 --- a/ppc64.ld +++ b/ppc64.ld @@ -81,14 +81,12 @@ SECTIONS .sdata2 : { *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) } .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) } .eh_frame_hdr : { *(.eh_frame_hdr) } - .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } - .gcc_except_table : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } /* Adjust the address for the data segment. We want to adjust up to + the same address within the page on the next page up. */ . = ALIGN (0x10000) - ((0x10000 - .) & (0x10000 - 1)); . = DATA_SEGMENT_ALIGN (0x10000, 0x1000); /* Exception handling */ - .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } - .gcc_except_table : ONLY_IF_RW { KEEP (*(.gcc_except_table)) + .eh_frame : { KEEP (*(.eh_frame)) } + .gcc_except_table : { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } /* Thread Local Storage sections */ .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } diff --git a/sparc.ld b/sparc.ld index 31321be53..56efe34e7 100644 --- a/sparc.ld +++ b/sparc.ld @@ -67,23 +67,23 @@ SECTIONS .tbss : { *(.tbss) } .preinit_array : { - PROVIDE_HIDDEN (__preinit_array_start = .); + PROVIDE (__preinit_array_start = .); KEEP (*(.preinit_array)) - PROVIDE_HIDDEN (__preinit_array_end = .); + PROVIDE (__preinit_array_end = .); } .init_array : { - PROVIDE_HIDDEN (__init_array_start = .); + PROVIDE (__init_array_start = .); KEEP (*(SORT(.init_array.*))) KEEP (*(.init_array)) - PROVIDE_HIDDEN (__init_array_end = .); + PROVIDE (__init_array_end = .); } .fini_array : { - PROVIDE_HIDDEN (__fini_array_start = .); + PROVIDE (__fini_array_start = .); KEEP (*(.fini_array)) KEEP (*(SORT(.fini_array.*))) - PROVIDE_HIDDEN (__fini_array_end = .); + PROVIDE (__fini_array_end = .); } .ctors : { diff --git a/x86_64.ld b/x86_64.ld index 46d8d4d9d..b7a9f4eb3 100644 --- a/x86_64.ld +++ b/x86_64.ld @@ -38,16 +38,16 @@ SECTIONS .rel.plt : { *(.rel.plt) - PROVIDE_HIDDEN (__rel_iplt_start = .); + PROVIDE (__rel_iplt_start = .); *(.rel.iplt) - PROVIDE_HIDDEN (__rel_iplt_end = .); + PROVIDE (__rel_iplt_end = .); } .rela.plt : { *(.rela.plt) - PROVIDE_HIDDEN (__rela_iplt_start = .); + PROVIDE (__rela_iplt_start = .); *(.rela.iplt) - PROVIDE_HIDDEN (__rela_iplt_end = .); + PROVIDE (__rela_iplt_end = .); } .init : { @@ -70,8 +70,6 @@ SECTIONS .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } .rodata1 : { *(.rodata1) } .eh_frame_hdr : { *(.eh_frame_hdr) } - .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } - .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table) } /* Adjust the address for the data segment. We want to adjust up to the same address within the page on the next page up. */ . = ALIGN (0x100000) - ((0x100000 - .) & (0x100000 - 1)); . = DATA_SEGMENT_ALIGN (0x100000, 0x1000); @@ -97,8 +95,8 @@ SECTIONS .data1 : { *(.data1) } .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } - .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } - .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table) } + .eh_frame : { KEEP (*(.eh_frame)) } + .gcc_except_table : { *(.gcc_except_table) } .dynamic : { *(.dynamic) } .ctors : { -- cgit v1.2.3 From 6a10ccca803764d67142e5faf309dcb1982c28f5 Mon Sep 17 00:00:00 2001 From: Brad Date: Fri, 2 Sep 2011 16:53:28 -0400 Subject: Allow overriding the location of Samba's smbd. Allow overriding the location of Samba's smbd. Pretty much every OS I look at has some means of changing this path (patching) so lets just make it easier for OS developers creating packages and/or end users to override the location. Signed-off-by: Brad Smith Reviewed-by: Stefan Hajnoczi Signed-off-by: Blue Swirl --- configure | 9 +++++++++ net.h | 5 ----- net/slirp.c | 2 +- qemu-options.hx | 6 +++--- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/configure b/configure index bfea0590e..605b51d14 100755 --- a/configure +++ b/configure @@ -409,6 +409,7 @@ SunOS) make="${MAKE-gmake}" install="${INSTALL-ginstall}" ld="gld" + smbd="${SMBD-/usr/sfw/sbin/smbd}" needs_libsunmath="no" solarisrev=`uname -r | cut -f2 -d.` # have to select again, because `uname -m` returns i86pc @@ -477,6 +478,7 @@ fi : ${make=${MAKE-make}} : ${install=${INSTALL-install}} : ${python=${PYTHON-python}} +: ${smbd=${SMBD-/usr/sbin/smbd}} if test "$mingw32" = "yes" ; then EXESUF=".exe" @@ -520,6 +522,8 @@ for opt do ;; --python=*) python="$optarg" ;; + --smbd=*) smbd="$optarg" + ;; --extra-cflags=*) ;; --extra-ldflags=*) @@ -932,6 +936,7 @@ echo " --extra-ldflags=LDFLAGS append extra linker flags LDFLAGS" echo " --make=MAKE use specified make [$make]" echo " --install=INSTALL use specified install [$install]" echo " --python=PYTHON use specified python [$python]" +echo " --smbd=SMBD use specified smbd [$smbd]" echo " --static enable static build [$static]" echo " --mandir=PATH install man pages in PATH" echo " --datadir=PATH install firmware in PATH" @@ -2638,6 +2643,9 @@ echo "LDFLAGS $LDFLAGS" echo "make $make" echo "install $install" echo "python $python" +if test "$slirp" = "yes" ; then + echo "smbd $smbd" +fi echo "host CPU $cpu" echo "host big endian $bigendian" echo "target list $target_list" @@ -2796,6 +2804,7 @@ if test $profiler = "yes" ; then fi if test "$slirp" = "yes" ; then echo "CONFIG_SLIRP=y" >> $config_host_mak + echo "CONFIG_SMBD_COMMAND=\"$smbd\"" >> $config_host_mak QEMU_INCLUDES="-I\$(SRC_PATH)/slirp $QEMU_INCLUDES" fi if test "$vde" = "yes" ; then diff --git a/net.h b/net.h index 5a7881cf6..9f633f843 100644 --- a/net.h +++ b/net.h @@ -174,11 +174,6 @@ int do_netdev_del(Monitor *mon, const QDict *qdict, QObject **ret_data); #define DEFAULT_NETWORK_SCRIPT "/etc/qemu-ifup" #define DEFAULT_NETWORK_DOWN_SCRIPT "/etc/qemu-ifdown" -#ifdef __sun__ -#define SMBD_COMMAND "/usr/sfw/sbin/smbd" -#else -#define SMBD_COMMAND "/usr/sbin/smbd" -#endif void qdev_set_nic_properties(DeviceState *dev, NICInfo *nd); diff --git a/net/slirp.c b/net/slirp.c index 157b80a9f..8199d006f 100644 --- a/net/slirp.c +++ b/net/slirp.c @@ -529,7 +529,7 @@ static int slirp_smb(SlirpState* s, const char *exported_dir, fclose(f); snprintf(smb_cmdline, sizeof(smb_cmdline), "%s -s %s", - SMBD_COMMAND, smb_conf); + CONFIG_SMBD_COMMAND, smb_conf); if (slirp_add_exec(s->slirp, 0, smb_cmdline, &vserver_addr, 139) < 0) { slirp_smb_cleanup(s); diff --git a/qemu-options.hx b/qemu-options.hx index 1d57f6488..623807504 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1256,9 +1256,9 @@ or @file{C:\WINNT\SYSTEM32\DRIVERS\ETC\LMHOSTS} (Windows NT/2000). Then @file{@var{dir}} can be accessed in @file{\\smbserver\qemu}. -Note that a SAMBA server must be installed on the host OS in -@file{/usr/sbin/smbd}. QEMU was tested successfully with smbd versions from -Red Hat 9, Fedora Core 3 and OpenSUSE 11.x. +Note that a SAMBA server must be installed on the host OS. +QEMU was tested successfully with smbd versions from Red Hat 9, +Fedora Core 3 and OpenSUSE 11.x. @item hostfwd=[tcp|udp]:[@var{hostaddr}]:@var{hostport}-[@var{guestaddr}]:@var{guestport} Redirect incoming TCP or UDP connections to the host port @var{hostport} to -- cgit v1.2.3 From 672aefeb5e0960e9f03d1d71eb1d0688fc54b8d2 Mon Sep 17 00:00:00 2001 From: Brad Date: Sun, 7 Aug 2011 20:02:11 -0400 Subject: Check for presence of compiler -pthread flag. OpenBSD / FreeBSD and some other OS's require the use of cc -pthread to link threaded programs so have QEMU's configure script check for the presence of the flag and use it if so. Signed-off-by: Brad Smith Signed-off-by: Blue Swirl --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 605b51d14..85c7aaefd 100755 --- a/configure +++ b/configure @@ -1849,7 +1849,7 @@ fi ########################################## # pthread probe -PTHREADLIBS_LIST="-lpthread -lpthreadGC2" +PTHREADLIBS_LIST="-pthread -lpthread -lpthreadGC2" pthread=no cat > $TMPC << EOF -- cgit v1.2.3 From 336398391a8b82863b4eaafcff250625f68a71a2 Mon Sep 17 00:00:00 2001 From: Brad Date: Sat, 30 Jul 2011 01:45:55 -0400 Subject: Add support for finding libpng via pkg-config. Signed-off-by: Brad Smith Signed-off-by: Anthony Liguori --- configure | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/configure b/configure index 85c7aaefd..29d621211 100755 --- a/configure +++ b/configure @@ -1518,11 +1518,17 @@ int main(void) { return 0; } EOF + if $pkg_config libpng --modversion >/dev/null 2>&1; then + vnc_png_cflags=`$pkg_config libpng --cflags 2> /dev/null` + vnc_png_libs=`$pkg_config libpng --libs 2> /dev/null` + else vnc_png_cflags="" vnc_png_libs="-lpng" + fi if compile_prog "$vnc_png_cflags" "$vnc_png_libs" ; then vnc_png=yes libs_softmmu="$vnc_png_libs $libs_softmmu" + QEMU_CFLAGS="$QEMU_CFLAGS $vnc_png_cflags" else if test "$vnc_png" = "yes" ; then feature_not_found "vnc-png" -- cgit v1.2.3 From fb524042dbc1142406c4d2e5858743c3dc8588c3 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Wed, 14 Sep 2011 15:38:40 +0200 Subject: Fix termination by signal with -no-shutdown On signals such as SIGTERM qemu should exit instead of just stopping the VM even with -no-shutdown. Signed-off-by: Kevin Wolf Signed-off-by: Anthony Liguori --- vl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/vl.c b/vl.c index 4b6688b55..63260e43e 100644 --- a/vl.c +++ b/vl.c @@ -1282,6 +1282,7 @@ void qemu_system_killed(int signal, pid_t pid) { shutdown_signal = signal; shutdown_pid = pid; + no_shutdown = 0; qemu_system_shutdown_request(); } -- cgit v1.2.3 From 68e3508eafd111c050e0a6f4dc8588dbe75d0e1c Mon Sep 17 00:00:00 2001 From: Jan Kiszka Date: Sat, 30 Jul 2011 11:39:04 +0200 Subject: sdl: Fix termination in -no-shutdown mode Just like the monitor does, we need to clear no_shutdown before calling qemu_system_shutdown_request on quit requests. Otherwise, QEMU just stops the VM. Signed-off-by: Jan Kiszka Signed-off-by: Anthony Liguori --- ui/sdl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/sdl.c b/ui/sdl.c index 6dbc5cb0e..9efcda507 100644 --- a/ui/sdl.c +++ b/ui/sdl.c @@ -672,8 +672,10 @@ static void sdl_refresh(DisplayState *ds) sdl_process_key(&ev->key); break; case SDL_QUIT: - if (!no_quit) + if (!no_quit) { + no_shutdown = 0; qemu_system_shutdown_request(); + } break; case SDL_MOUSEMOTION: if (gui_grab || kbd_mouse_is_absolute() || -- cgit v1.2.3 From 4a81ab81e4d947a3a0c8408c743ad94e7c1b8a30 Mon Sep 17 00:00:00 2001 From: Stefan Hajnoczi Date: Fri, 30 Sep 2011 11:39:11 +0100 Subject: qed: fix use-after-free during l2 cache commit QED's metadata caching strategy allows two parallel requests to race for metadata lookup. The first one to complete will populate the metadata cache and the second one will drop the data it just read in favor of the cached data. There is a use-after-free in qed_read_l2_table_cb() and qed_commit_l2_update() where l2_table->offset was used after the l2_table may have been freed due to a metadata lookup race. Fix this by keeping the l2_offset in a local variable and not reaching into the possibly freed l2_table. Reported-by: Amit Shah Signed-off-by: Stefan Hajnoczi Signed-off-by: Anthony Liguori --- block/qed-table.c | 6 +++--- block/qed.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/block/qed-table.c b/block/qed-table.c index d38c67354..5c5d4b400 100644 --- a/block/qed-table.c +++ b/block/qed-table.c @@ -230,21 +230,21 @@ static void qed_read_l2_table_cb(void *opaque, int ret) QEDRequest *request = read_l2_table_cb->request; BDRVQEDState *s = read_l2_table_cb->s; CachedL2Table *l2_table = request->l2_table; + uint64_t l2_offset = read_l2_table_cb->l2_offset; if (ret) { /* can't trust loaded L2 table anymore */ qed_unref_l2_cache_entry(l2_table); request->l2_table = NULL; } else { - l2_table->offset = read_l2_table_cb->l2_offset; + l2_table->offset = l2_offset; qed_commit_l2_cache_entry(&s->l2_cache, l2_table); /* This is guaranteed to succeed because we just committed the entry * to the cache. */ - request->l2_table = qed_find_l2_cache_entry(&s->l2_cache, - l2_table->offset); + request->l2_table = qed_find_l2_cache_entry(&s->l2_cache, l2_offset); assert(request->l2_table != NULL); } diff --git a/block/qed.c b/block/qed.c index 39703793e..4dc33be21 100644 --- a/block/qed.c +++ b/block/qed.c @@ -915,14 +915,14 @@ static void qed_commit_l2_update(void *opaque, int ret) QEDAIOCB *acb = opaque; BDRVQEDState *s = acb_to_s(acb); CachedL2Table *l2_table = acb->request.l2_table; + uint64_t l2_offset = l2_table->offset; qed_commit_l2_cache_entry(&s->l2_cache, l2_table); /* This is guaranteed to succeed because we just committed the entry to the * cache. */ - acb->request.l2_table = qed_find_l2_cache_entry(&s->l2_cache, - l2_table->offset); + acb->request.l2_table = qed_find_l2_cache_entry(&s->l2_cache, l2_offset); assert(acb->request.l2_table != NULL); qed_aio_next_io(opaque, ret); -- cgit v1.2.3 From 82b2b32a323bbb5824b4fbe63a3bca50f827e28e Mon Sep 17 00:00:00 2001 From: "Justin M. Forbes" Date: Tue, 11 Oct 2011 09:46:03 -0500 Subject: Version 0.15.1 Signed-off-by: Justin M. Forbes --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index a55105169..e815b861f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.15.0 +0.15.1 -- cgit v1.2.3