Trivial patches for 6 to 13 January 2012
The following changes since commit bee5a5fb11de34aa422cfc830adbd51cfc8f5b55:
cris: Update paths to match the move of tests/cris (2012-01-13 11:09:56 +0100)
are available in the git repository at:
git://github.com/stefanha/qemu.git trivial-patches
Aurelien Jarno (1):
tcg-arm: fix a typo in comments
Stefan Berger (1):
hmp: Fix freeing of PciInfoList
Stefan Hajnoczi (4):
vvfat: avoid leaking file descriptor in commit_one_file()
vnc: fix no-lock-key-sync strncmp() length
omap_dss: correct chip[1] index in RFBI_READ/RFBI_STATUS
bt-host: add missing break statement
Stefan Weil (6):
configure: Modify detection of supported warning options Spelling fixes in comments and documentation
Add 'fall through' comments to case statements without break
virtfs-proxy-helper: Fix compilation on newer systems
virtfs-proxy-helper: Clean include files
virtfs-proxy-helper: Add missing printf format attribute
block/vvfat.c | 3 +++ bt-host.c | 1 + configure | 2 +- docs/writing-qmp-commands.txt | 2 +- exec.c | 2 +- fsdev/virtfs-proxy-helper.c | 19 ++++--------------- hmp.c | 8 ++++---- hw/omap_dss.c | 4 ++-- hw/pcnet.c | 1 + json-lexer.c | 1 + memory.h | 4 ++-- qemu-ga.c | 2 +- qemu-option.c | 4 ++++ tcg/arm/tcg-target.c | 2 +- ui/vnc.c | 2 +- 15 files changed, 28 insertions(+), 29 deletions(-)
Signature · 1 line
1.7.7.3
PATCH 5/12 vnc: fix no-lock-key-sync strncmp() length
The no-lock-key-sync option is being parsed incorrectly because of an outdated strcmp() length value. Use the correct length so that invalid option names do not match.
--- ui/vnc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
ui/vnc.c +1 -1
@@ -2763,7 +2763,7 @@ int vnc_display_open(DisplayState *ds, const char *display) password =1 ;/* Require password auth */ }else if (strncmp (options,"reverse" ,7 ) ==0 ) { reverse =1 ; - }else if (strncmp (options,"no-lock-key-sync" ,9 ) ==0 ) { + }else if (strncmp (options,"no-lock-key-sync" ,16 ) ==0 ) { lock_key_sync =0 ; #ifdef CONFIG_VNC_SASL }else if (strncmp (options,"sasl" ,4 ) ==0 ) {
Signature · 1 line
1.7.7.3
PATCH 1/12 configure: Modify detection of supported warning options
In reply to Stefan HajnocziFrom: Stefan Weil <[email protected]>
Reversing the order of the warning options and -Werror is important when clang is used instead of gcc. It changes nothing for gcc.
--- configure | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
configure +1 -1
@@ -1105,7 +1105,7 @@ cat > $TMPC << EOF int main(void) { return 0; } EOF for flag in $gcc_flags; do - if compile_prog "$flag -Werror" "" ; then + if compile_prog "-Werror $flag" "" ; then QEMU_CFLAGS="$QEMU_CFLAGS $flag" fi done
Signature · 1 line
1.7.7.3
PATCH 2/12 tcg-arm: fix a typo in comments
In reply to Stefan HajnocziFrom: Aurelien Jarno <[email protected]>
ARM still doesn't support 16GB buffers in 32-bit modes, replace the 16GB by 16MB in the comment.
--- exec.c | 2 +- tcg/arm/tcg-target.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
exec.c +1 -1
@@ -511,7 +511,7 @@ static void code_gen_alloc(unsigned long tb_size)if (code_gen_buffer_size > (512 *1024 *1024 )) code_gen_buffer_size = (512 *1024 *1024 );#elif defined(__arm__) -/* Keep the buffer no bigger than 16GB to branch between blocks */ +/* Keep the buffer no bigger than 16MB to branch between blocks */ if (code_gen_buffer_size >16 *1024 *1024 ) code_gen_buffer_size =16 *1024 *1024 ;#elif defined(__s390x__)
tcg/arm/tcg-target.c +1 -1
@@ -843,7 +843,7 @@ static inline void tcg_out_st8(TCGContext *s, int cond, }/* The _goto case is normally between TBs within the same code buffer, -* and with the code buffer limited to 16GB we shouldn't need the long +* and with the code buffer limited to 16MB we shouldn't need the long * case. * * .... except to the prologue that is in its own buffer.
Signature · 1 line
1.7.7.3
PATCH 3/12 Spelling fixes in comments and documentation
In reply to Stefan HajnocziFrom: Stefan Weil <[email protected]>
Codespell detected these new spelling issues.
--- docs/writing-qmp-commands.txt | 2 +- memory.h | 4 ++-- qemu-ga.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
docs/writing-qmp-commands.txt +1 -1
@@ -435,7 +435,7 @@ There are a number of things to be noticed: for all QMP functions) 3. The "clock" variable (which will point to our QAPI type instance) is allocated by the regular g_malloc0() function. Note that we chose to - initialize the memory to zero. This is recomended for all QAPI types, as + initialize the memory to zero. This is recommended for all QAPI types, as it helps avoiding bad surprises (specially with booleans) 4. Remember that "next_deadline" is optional? All optional members have a 'has_TYPE_NAME' member that should be properly set by the implementation,
memory.h +2 -2
@@ -561,7 +561,7 @@ void memory_region_add_subregion_overlap(MemoryRegion *mr,* memory_region_get_ram_addr: Get the ram address associated with a memory * region * -* DO NOT USE THIS FUCNTION. This is a temporary workaround while the Xen +* DO NOT USE THIS FUNCTION. This is a temporary workaround while the Xen * code is being reworked. */ ram_addr_t memory_region_get_ram_addr (MemoryRegion *mr);
@@ -650,7 +650,7 @@ void memory_global_sync_dirty_bitmap(MemoryRegion *address_space);* memory_region_transaction_begin: Start a transaction. * * During a transaction, changes will be accumulated and made visible -* only when the transaction ends (is commited). +* only when the transaction ends (is committed). */ void memory_region_transaction_begin (void );
qemu-ga.c +1 -1
@@ -92,7 +92,7 @@ static void usage(const char *cmd)" -v, --verbose log extra debugging information\n" " -V, --version print version information and exit\n" " -d, --daemonize become a daemon\n" -" -b, --blacklist comma-seperated list of RPCs to disable (no spaces, \"?\"" +" -b, --blacklist comma-separated list of RPCs to disable (no spaces, \"?\"" " to list available RPCs)\n" " -h, --help display this help and exit\n" "\n"
Signature · 1 line
1.7.7.3
PATCH 4/12 vvfat: avoid leaking file descriptor in commit_one_file()
In reply to Stefan Hajnoczi--- block/vvfat.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
block/vvfat.c +3 -0
@@ -2218,6 +2218,7 @@ static int commit_one_file(BDRVVVFATState* s, }if (offset >0 ) {if (lseek (fd, offset,SEEK_SET ) != offset) { +close (fd);g_free (cluster);return -3 ; }
@@ -2238,11 +2239,13 @@ static int commit_one_file(BDRVVVFATState* s, (uint8_t*)cluster, (rest_size + 0x1ff) / 0x200);if (ret <0 ) { +close (fd);g_free (cluster);return ret; }if (write (fd, cluster, rest_size) <0 ) { +close (fd);g_free (cluster);return -2 ; }
Signature · 1 line
1.7.7.3
PATCH 10/12 virtfs-proxy-helper: Clean include files
In reply to Stefan HajnocziFrom: Stefan Weil <[email protected]>
The common standard include files are already included via qemu-common.h, and for the socket related include files there is qemu_socket.h, so the code can be reduced by some lines.
--- fsdev/virtfs-proxy-helper.c | 15 ++------------- 1 files changed, 2 insertions(+), 13 deletions(-)
fsdev/virtfs-proxy-helper.c +2 -13
@@ -8,31 +8,20 @@* This work is licensed under the terms of the GNU GPL, version 2. See * the COPYING file in the top-level directory. */ -#include <stdio.h> -#include <sys/socket.h> -#include <string.h> -#include <sys/un.h> -#include <limits.h> -#include <signal.h> -#include <errno.h> -#include <stdlib.h> +#include <sys/resource.h> -#include <sys/stat.h> #include <getopt.h> -#include <unistd.h> #include <syslog.h> #include <sys/capability.h> #include <sys/fsuid.h> -#include <stdarg.h> -#include <stdbool.h> #include <sys/vfs.h> -#include <sys/stat.h> #include <sys/ioctl.h> #include <linux/fs.h> #ifdef CONFIG_LINUX_MAGIC_H #include <linux/magic.h> #endif #include "qemu-common.h" +#include "qemu_socket.h" #include "qemu-xattr.h" #include "virtio-9p-marshal.h" #include "hw/9pfs/virtio-9p-proxy.h"
Signature · 1 line
1.7.7.3
PATCH 6/12 omap_dss: correct chip[1] index in RFBI_READ/RFBI_STATUS
In reply to Stefan HajnocziThe RFBI_READ/RFBI_STATUS code incorrectly uses chip[0] when it should be using chip[1]. Andrzej Zaborowski <[email protected]> confirmed this bug since I don't know this code well.
--- hw/omap_dss.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
hw/omap_dss.c +2 -2
@@ -793,7 +793,7 @@ static void omap_rfbi_write(void *opaque, target_phys_addr_t addr,if ((s->rfbi.control & (1 <<2 )) && s->rfbi.chip[0 ]) s->rfbi.rxbuf = s->rfbi.chip[0 ]->read (s->rfbi.chip[0 ]->opaque,1 );else if ((s->rfbi.control & (1 <<3 )) && s->rfbi.chip[1 ]) - s->rfbi.rxbuf = s->rfbi.chip[0 ]->read (s->rfbi.chip[0 ]->opaque,1 ); + s->rfbi.rxbuf = s->rfbi.chip[1 ]->read (s->rfbi.chip[1 ]->opaque,1 );if (!-- s->rfbi.pixels)omap_rfbi_transfer_stop (s);break ;
@@ -802,7 +802,7 @@ static void omap_rfbi_write(void *opaque, target_phys_addr_t addr,if ((s->rfbi.control & (1 <<2 )) && s->rfbi.chip[0 ]) s->rfbi.rxbuf = s->rfbi.chip[0 ]->read (s->rfbi.chip[0 ]->opaque,0 );else if ((s->rfbi.control & (1 <<3 )) && s->rfbi.chip[1 ]) - s->rfbi.rxbuf = s->rfbi.chip[0 ]->read (s->rfbi.chip[0 ]->opaque,0 ); + s->rfbi.rxbuf = s->rfbi.chip[1 ]->read (s->rfbi.chip[1 ]->opaque,0 );if (!-- s->rfbi.pixels)omap_rfbi_transfer_stop (s);break ;
Signature · 1 line
1.7.7.3
PATCH 11/12 virtfs-proxy-helper: Add missing printf format attribute
In reply to Stefan HajnocziFrom: Stefan Weil <[email protected]>
Every function with printf like arguments must have it (see file HACKING), so add it.
--- fsdev/virtfs-proxy-helper.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
fsdev/virtfs-proxy-helper.c +1 -1
@@ -54,7 +54,7 @@ static struct option helper_opts[] = {static bool is_daemon;static bool get_version;/* IOC getversion IOCTL supported */ -static void do_log (int loglevel,const char *format, ...) +static void GCC_FMT_ATTR(2, 3) do_log(int loglevel, const char *format, ...) { va_list ap;
Signature · 1 line
1.7.7.3
PATCH 9/12 virtfs-proxy-helper: Fix compilation on newer systems
In reply to Stefan HajnocziFrom: Stefan Weil <[email protected]>
Include file attr/xattr.h is not available on "newer" systems (for example Fedora 12 or Debian Squeeze).
See comments in qemu-xattr.h for more information. This file handles the system dependencies automatically.
--- fsdev/virtfs-proxy-helper.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
fsdev/virtfs-proxy-helper.c +1 -1
@@ -27,13 +27,13 @@#include <stdbool.h> #include <sys/vfs.h> #include <sys/stat.h> -#include <attr/xattr.h> #include <sys/ioctl.h> #include <linux/fs.h> #ifdef CONFIG_LINUX_MAGIC_H #include <linux/magic.h> #endif #include "qemu-common.h" +#include "qemu-xattr.h" #include "virtio-9p-marshal.h" #include "hw/9pfs/virtio-9p-proxy.h" #include "fsdev/virtio-9p-marshal.h"
Signature · 1 line
1.7.7.3
PATCH 12/12 bt-host: add missing break statement
In reply to Stefan HajnocziThe switch statement in bt_host_read() is missing a break in one case. Andrzej Zaborowski <[email protected]> confirmed that this is not an intentional fall-through.
--- bt-host.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
bt-host.c +1 -0
@@ -130,6 +130,7 @@ static void bt_host_read(void *opaque) pktlen =MIN (pkt[2 ] +3 , s->len); s->len -= pktlen; pkt += pktlen; +break ;default : bad_pkt:
Signature · 1 line
1.7.7.3
PATCH 7/12 Add 'fall through' comments to case statements without break
In reply to Stefan HajnocziFrom: Stefan Weil <[email protected]>
These comments are used by static code analysis tools and in code reviews to avoid false warnings because of missing break statements.
The case statements handled here were reported by coverity.
--- hw/pcnet.c | 1 + json-lexer.c | 1 + qemu-option.c | 4 ++++ 3 files changed, 6 insertions(+), 0 deletions(-)
hw/pcnet.c +1 -0
@@ -1505,6 +1505,7 @@ static void pcnet_bcr_writew(PCNetState *s, uint32_t rap, uint32_t val)#ifdef PCNET_DEBUG printf ("BCR_SWS=0x%04x\n" , val);#endif +/* fall through */ case BCR_LNKST :case BCR_LED1 :case BCR_LED2 :
json-lexer.c +1 -0
@@ -301,6 +301,7 @@ static int json_lexer_feed_char(JSONLexer *lexer, char ch, bool flush)case JSON_KEYWORD :case JSON_STRING : lexer->emit (lexer, lexer->token, new_state, lexer->x, lexer->y); +/* fall through */ case JSON_SKIP :QDECREF (lexer->token); lexer->token =qstring_new ();
qemu-option.c +4 -0
@@ -214,13 +214,17 @@ static int parse_option_size(const char *name, const char *value, uint64_t *ret)switch (*postfix) {case 'T' : sizef *=1024 ; +/* fall through */ case 'G' : sizef *=1024 ; +/* fall through */ case 'M' : sizef *=1024 ; +/* fall through */ case 'K' :case 'k' : sizef *=1024 ; +/* fall through */ case 'b' :case '\0' : *ret = (uint64_t ) sizef;
Signature · 1 line
1.7.7.3
PATCH 8/12 hmp: Fix freeing of PciInfoList
In reply to Stefan HajnocziFrom: Stefan Berger <[email protected]>
Remember the original PciInfoList in info_list and use the info variable to traverse the list.
--- hmp.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
hmp.c +4 -4
@@ -486,17 +486,17 @@ static void hmp_info_pci_device(Monitor *mon, const PciDeviceInfo *dev)void hmp_info_pci (Monitor *mon) { -PciInfoList *info; +PciInfoList *info_list, *info;Error *err =NULL ; - info =qmp_query_pci (&err); + info_list =qmp_query_pci (&err);if (err) {monitor_printf (mon,"PCI devices not supported\n" );error_free (err);return ; } -for (; info; info = info->next) { +for (info = info_list; info; info = info->next) {PciDeviceInfoList *dev;for (dev = info->value->devices; dev; dev = dev->next) {
@@ -504,7 +504,7 @@ void hmp_info_pci(Monitor *mon) } } -qapi_free_PciInfoList (info); +qapi_free_PciInfoList (info_list); }void hmp_quit (Monitor *mon,const QDict *qdict)
Signature · 1 line
1.7.7.3
Quoted 3 lines · Stefan Hajnoczi
The following changes since commit
bee5a5fb11de34aa422cfc830adbd51cfc8f5b55:cris: Update paths to match the move of tests/cris (2012-01-13 11:09:56 +0100)
Pulled. Thanks.
Regards,
Anthony Liguori
Quoted 40 lines
are available in the git repository at:
git://github.com/stefanha/qemu.gittrivial-patchesAurelien Jarno (1):
tcg-arm: fix a typo in commentsStefan Berger (1):
hmp: Fix freeing of PciInfoListStefan Hajnoczi (4):
vvfat: avoid leaking file descriptor incommit_one_file()
vnc: fix no-lock-key-syncstrncmp()length
omap_dss: correct chip[1] index in RFBI_READ/RFBI_STATUS
bt-host: add missing break statementStefan Weil (6):
configure: Modify detection of supported warning options Spelling fixes in comments and documentation
Add 'fall through' comments to case statements without break
virtfs-proxy-helper: Fix compilation on newer systems
virtfs-proxy-helper: Clean include files
virtfs-proxy-helper: Add missing printf format attributeblock/vvfat.c | 3 +++ bt-host.c | 1 + configure | 2 +- docs/writing-qmp-commands.txt | 2 +- exec.c | 2 +- fsdev/virtfs-proxy-helper.c | 19 ++++--------------- hmp.c | 8 ++++---- hw/omap_dss.c | 4 ++-- hw/pcnet.c | 1 + json-lexer.c | 1 + memory.h | 4 ++-- qemu-ga.c | 2 +- qemu-option.c | 4 ++++ tcg/arm/tcg-target.c | 2 +- ui/vnc.c | 2 +- 15 files changed, 28 insertions(+), 29 deletions(-)