From 038d3d44598232f5aad40d1c84c215f38a21576c Mon Sep 17 00:00:00 2001 From: Peter Crosthwaite Date: Thu, 15 Nov 2012 16:32:53 +1000 Subject: [PATCH 01/13] sd: Send debug printfery to stderr not stdout Some debug printfs for SD are coming up in stdout. Redirected them to stderr instead. Signed-off-by: Peter Crosthwaite Reviewed-by: Peter Maydell Signed-off-by: Stefan Hajnoczi --- hw/sd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/sd.c b/hw/sd.c index 3c34d43ad4..607edba9c8 100644 --- a/hw/sd.c +++ b/hw/sd.c @@ -1439,8 +1439,8 @@ send_response: int i; DPRINTF("Response:"); for (i = 0; i < rsplen; i++) - printf(" %02x", response[i]); - printf(" state %d\n", sd->state); + fprintf(stderr, " %02x", response[i]); + fprintf(stderr, " state %d\n", sd->state); } else { DPRINTF("No response %d\n", sd->state); } From bb5b5c20b7f68c79e036cd3ec5e9e6362c112670 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Sat, 20 Oct 2012 20:37:04 +0100 Subject: [PATCH 02/13] configure: Remove stray debug output Rather than printing a message saying we're silently falling back to gthread coroutines when running on MacOS, actually do it silently. Signed-off-by: Peter Maydell Signed-off-by: Stefan Hajnoczi --- configure | 2 -- 1 file changed, 2 deletions(-) diff --git a/configure b/configure index 994f7310b8..447e6ed976 100755 --- a/configure +++ b/configure @@ -2969,8 +2969,6 @@ EOF else coroutine_backend=gthread fi - else - echo "Silently falling back into gthread backend under darwin" fi elif test "$coroutine" = "gthread" ; then coroutine_backend=gthread From eac29d87c883fcbb54913ae20ed2bdccb4bcf7a3 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Fri, 2 Nov 2012 08:14:12 +0100 Subject: [PATCH 03/13] Fix spelling (prefered -> preferred) Signed-off-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- configure | 2 +- net/tap-win32.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 447e6ed976..79605d2b75 100755 --- a/configure +++ b/configure @@ -2130,7 +2130,7 @@ if test "$pixman" = "system"; then else if test ! -d ${source_path}/pixman/pixman; then echo "ERROR: pixman not present. Your options:" - echo " (1) Prefered: Install the pixman devel package (any recent" + echo " (1) Preferred: Install the pixman devel package (any recent" echo " distro should have packages as Xorg needs pixman too)." echo " (2) Fetch the pixman submodule, using:" echo " git submodule update --init pixman" diff --git a/net/tap-win32.c b/net/tap-win32.c index 8d2d32b1c3..f9bd74109c 100644 --- a/net/tap-win32.c +++ b/net/tap-win32.c @@ -565,7 +565,7 @@ static void tap_win32_free_buffer(tap_win32_overlapped_t *overlapped, } static int tap_win32_open(tap_win32_overlapped_t **phandle, - const char *prefered_name) + const char *preferred_name) { char device_path[256]; char device_guid[0x100]; @@ -581,8 +581,9 @@ static int tap_win32_open(tap_win32_overlapped_t **phandle, DWORD version_len; DWORD idThread; - if (prefered_name != NULL) - snprintf(name_buffer, sizeof(name_buffer), "%s", prefered_name); + if (preferred_name != NULL) { + snprintf(name_buffer, sizeof(name_buffer), "%s", preferred_name); + } rc = get_device_guid(device_guid, sizeof(device_guid), name_buffer, sizeof(name_buffer)); if (rc) From a93cf9dfba171aa94e3c4002d58abef2a3732bfb Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Fri, 2 Nov 2012 08:29:53 +0100 Subject: [PATCH 04/13] Fix comments (adress -> address, layed -> laid, wierd -> weird) Remove also a duplicated 'the'. Signed-off-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- slirp/ip_icmp.c | 2 +- tcg/tcg.h | 4 ++-- uri.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/slirp/ip_icmp.c b/slirp/ip_icmp.c index d571fd0b76..9f1cb08a18 100644 --- a/slirp/ip_icmp.c +++ b/slirp/ip_icmp.c @@ -352,7 +352,7 @@ icmp_error(struct mbuf *msrc, u_char type, u_char code, int minsize, ip->ip_ttl = MAXTTL; ip->ip_p = IPPROTO_ICMP; - ip->ip_dst = ip->ip_src; /* ip adresses */ + ip->ip_dst = ip->ip_src; /* ip addresses */ ip->ip_src = m->slirp->vhost_addr; (void ) ip_output((struct socket *)NULL, m); diff --git a/tcg/tcg.h b/tcg/tcg.h index 9481e35ab4..e7de8c00a3 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -290,8 +290,8 @@ typedef int TCGv_i64; #define TCG_CALL_DUMMY_TCGV MAKE_TCGV_I32(-1) #define TCG_CALL_DUMMY_ARG ((TCGArg)(-1)) -/* Conditions. Note that these are layed out for easy manipulation by - the the functions below: +/* Conditions. Note that these are laid out for easy manipulation by + the functions below: bit 0 is used for inverting; bit 1 is signed, bit 2 is unsigned, diff --git a/uri.c b/uri.c index dd922de339..138547b821 100644 --- a/uri.c +++ b/uri.c @@ -432,7 +432,7 @@ rfc3986_parse_host(URI *uri, const char **str) host = cur; /* - * IPv6 and future adressing scheme are enclosed between brackets + * IPv6 and future addressing scheme are enclosed between brackets */ if (*cur == '[') { cur++; @@ -1917,7 +1917,7 @@ done: * http://site1.com/docs/pic1.gif http://site1.com/docs/pic1.gif * * - * Note: if the URI reference is really wierd or complicated, it may be + * Note: if the URI reference is really weird or complicated, it may be * worthwhile to first convert it into a "nice" one by calling * uri_resolve (using 'base') before calling this routine, * since this routine (for reasonable efficiency) assumes URI has From 8367a14fd3c1ecd5551c91cd3f951ffc61ad7c12 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Fri, 2 Nov 2012 08:35:54 +0100 Subject: [PATCH 05/13] s390x: Spelling fixes (endianess -> endianness, occured -> occurred) Replace also "write into" by "write to". Signed-off-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- hw/s390x/sclp.h | 4 ++-- hw/s390x/sclpconsole.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/s390x/sclp.h b/hw/s390x/sclp.h index fe89dadd68..231a38aa09 100644 --- a/hw/s390x/sclp.h +++ b/hw/s390x/sclp.h @@ -51,7 +51,7 @@ /* * Normally packed structures are not the right thing to do, since all code - * must take care of endianess. We cant use ldl_phys and friends for two + * must take care of endianness. We cannot use ldl_phys and friends for two * reasons, though: * - some of the embedded structures below the SCCB can appear multiple times * at different locations, so there is no fixed offset @@ -60,7 +60,7 @@ * alter the structure while we parse it. We cannot use ldl_p and friends * either without doing pointer arithmetics * So we have to double check that all users of sclp data structures use the - * right endianess wrappers. + * right endianness wrappers. */ typedef struct SCCBHeader { uint16_t length; diff --git a/hw/s390x/sclpconsole.c b/hw/s390x/sclpconsole.c index 0ec5623f57..fece878e88 100644 --- a/hw/s390x/sclpconsole.c +++ b/hw/s390x/sclpconsole.c @@ -179,8 +179,8 @@ static int read_event_data(SCLPEvent *event, EventBufferHeader *evt_buf_hdr, } /* triggered by SCLP's write_event_data - * - write console data into character layer - * returns < 0 if an error occured + * - write console data to character layer + * returns < 0 if an error occurred */ static ssize_t write_console_data(SCLPEvent *event, const uint8_t *buf, size_t len) From c47d08ceff8ac76ff857016c80a8864fcf45a7d6 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Fri, 2 Nov 2012 08:36:35 +1100 Subject: [PATCH 06/13] target-alpha: Remove t0, t1 from CPUAlphaState These fields are no longer (or were never?) used. Signed-off-by: Richard Henderson Signed-off-by: Stefan Hajnoczi --- target-alpha/cpu.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/target-alpha/cpu.h b/target-alpha/cpu.h index 34221fb184..9939d61ca8 100644 --- a/target-alpha/cpu.h +++ b/target-alpha/cpu.h @@ -280,13 +280,6 @@ struct CPUAlphaState { struct QEMUTimer *alarm_timer; uint64_t alarm_expire; -#if TARGET_LONG_BITS > HOST_LONG_BITS - /* temporary fixed-point registers - * used to emulate 64 bits target on 32 bits hosts - */ - target_ulong t0, t1; -#endif - /* Those resources are used only in QEMU core */ CPU_COMMON From d694516440ca31bbcc7ad73f5e99b45fbeb2a6e6 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Fri, 2 Nov 2012 08:36:36 +1100 Subject: [PATCH 07/13] target-m68k: Remove t1 from CPUM68KState This field is no longer used. Cc: Paul Brook Signed-off-by: Richard Henderson Signed-off-by: Stefan Hajnoczi --- target-m68k/cpu.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/target-m68k/cpu.h b/target-m68k/cpu.h index 780e2c94e7..f4fcdeee7a 100644 --- a/target-m68k/cpu.h +++ b/target-m68k/cpu.h @@ -103,9 +103,6 @@ typedef struct CPUM68KState { uint32_t rambar0; uint32_t cacr; - /* ??? remove this. */ - uint32_t t1; - int pending_vector; int pending_level; From dee17bf9e5d29bd08592c6fc47541aad70444bbc Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Fri, 2 Nov 2012 08:36:37 +1100 Subject: [PATCH 08/13] target-sparc: Remove t0, t1 from CPUSPARCState These fields are no longer used. Cc: Blue Swirl Signed-off-by: Richard Henderson Signed-off-by: Stefan Hajnoczi --- target-sparc/cpu.h | 1 - 1 file changed, 1 deletion(-) diff --git a/target-sparc/cpu.h b/target-sparc/cpu.h index 042d52a310..375f20a71e 100644 --- a/target-sparc/cpu.h +++ b/target-sparc/cpu.h @@ -392,7 +392,6 @@ struct CPUSPARCState { target_ulong cc_dst; uint32_t cc_op; - target_ulong t0, t1; /* temporaries live across basic blocks */ target_ulong cond; /* conditional branch result (XXX: save it in a temporary register when possible) */ From 036f0f8356936dba36b952c16f477b3f04f54e37 Mon Sep 17 00:00:00 2001 From: Peter Crosthwaite Date: Mon, 19 Nov 2012 15:13:49 +1000 Subject: [PATCH 09/13] arm: a9mpcore: remove un-used ptimer_iomem field I'm guessing this is a hangover from a previous coreification of the mptimer sub-module. This field is completely unused - removed. Signed-off-by: Peter Crosthwaite Reviewed-by: Peter Maydell Signed-off-by: Stefan Hajnoczi --- hw/a9mpcore.c | 1 - 1 file changed, 1 deletion(-) diff --git a/hw/a9mpcore.c b/hw/a9mpcore.c index 824ff0a4de..f802de0824 100644 --- a/hw/a9mpcore.c +++ b/hw/a9mpcore.c @@ -19,7 +19,6 @@ typedef struct a9mp_priv_state { uint32_t old_timer_status[8]; uint32_t num_cpu; MemoryRegion scu_iomem; - MemoryRegion ptimer_iomem; MemoryRegion container; DeviceState *mptimer; DeviceState *gic; From 4dbd84e26f53d3283baa463f390f9623e8913e8f Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Thu, 22 Nov 2012 15:16:36 +0100 Subject: [PATCH 10/13] Clean up pci_drive_hot_add()'s use of BlockInterfaceType pci_drive_hot_add() parameter type has the wrong type: int instead of BlockInterfaceType. It's actually redundant, so we can just drop it. Signed-off-by: Markus Armbruster Signed-off-by: Stefan Hajnoczi --- hw/device-hotplug.c | 11 ++++------- hw/pci-hotplug.c | 7 +++---- sysemu.h | 3 +-- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/hw/device-hotplug.c b/hw/device-hotplug.c index eec0fe3148..6d9c080381 100644 --- a/hw/device-hotplug.c +++ b/hw/device-hotplug.c @@ -49,18 +49,16 @@ DriveInfo *add_init_drive(const char *optstr) } #if !defined(TARGET_I386) -int pci_drive_hot_add(Monitor *mon, const QDict *qdict, - DriveInfo *dinfo, int type) +int pci_drive_hot_add(Monitor *mon, const QDict *qdict, DriveInfo *dinfo) { /* On non-x86 we don't do PCI hotplug */ - monitor_printf(mon, "Can't hot-add drive to type %d\n", type); + monitor_printf(mon, "Can't hot-add drive to type %d\n", dinfo->type); return -1; } #endif void drive_hot_add(Monitor *mon, const QDict *qdict) { - int type; DriveInfo *dinfo = NULL; const char *opts = qdict_get_str(qdict, "opts"); @@ -72,14 +70,13 @@ void drive_hot_add(Monitor *mon, const QDict *qdict) monitor_printf(mon, "Parameter addr not supported\n"); goto err; } - type = dinfo->type; - switch (type) { + switch (dinfo->type) { case IF_NONE: monitor_printf(mon, "OK\n"); break; default: - if (pci_drive_hot_add(mon, qdict, dinfo, type)) { + if (pci_drive_hot_add(mon, qdict, dinfo)) { goto err; } } diff --git a/hw/pci-hotplug.c b/hw/pci-hotplug.c index 0ca5546fc6..3bcfdcc1a6 100644 --- a/hw/pci-hotplug.c +++ b/hw/pci-hotplug.c @@ -111,15 +111,14 @@ static int scsi_hot_add(Monitor *mon, DeviceState *adapter, return 0; } -int pci_drive_hot_add(Monitor *mon, const QDict *qdict, - DriveInfo *dinfo, int type) +int pci_drive_hot_add(Monitor *mon, const QDict *qdict, DriveInfo *dinfo) { int dom, pci_bus; unsigned slot; PCIDevice *dev; const char *pci_addr = qdict_get_str(qdict, "pci_addr"); - switch (type) { + switch (dinfo->type) { case IF_SCSI: if (pci_read_devaddr(mon, pci_addr, &dom, &pci_bus, &slot)) { goto err; @@ -135,7 +134,7 @@ int pci_drive_hot_add(Monitor *mon, const QDict *qdict, } break; default: - monitor_printf(mon, "Can't hot-add drive to type %d\n", type); + monitor_printf(mon, "Can't hot-add drive to type %d\n", dinfo->type); goto err; } diff --git a/sysemu.h b/sysemu.h index f5ac664067..c1b370b781 100644 --- a/sysemu.h +++ b/sysemu.h @@ -145,8 +145,7 @@ extern unsigned int nb_prom_envs; /* pci-hotplug */ void pci_device_hot_add(Monitor *mon, const QDict *qdict); -int pci_drive_hot_add(Monitor *mon, const QDict *qdict, - DriveInfo *dinfo, int type); +int pci_drive_hot_add(Monitor *mon, const QDict *qdict, DriveInfo *dinfo); void do_pci_device_hot_remove(Monitor *mon, const QDict *qdict); /* generic hotplug */ From 993d46ce7e54f3d035d344ed1b145b13f9ac54b9 Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Fri, 23 Nov 2012 07:26:04 +0100 Subject: [PATCH 11/13] Fix spelling in comments and documentation These spelling bugs were found by codespell: supressing -> suppressing transfered -> transferred Signed-off-by: Stefan Weil Signed-off-by: Stefan Hajnoczi --- hw/usb.h | 6 +++--- tests/qemu-iotests/iotests.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/usb.h b/hw/usb.h index 7d6de69ec4..f05eb1797f 100644 --- a/hw/usb.h +++ b/hw/usb.h @@ -282,7 +282,7 @@ typedef struct USBDeviceClass { * Called from handle_packet(). * * Status gets stored in p->status, and if p->status == USB_RET_SUCCESS - * then the number of bytes transfered is stored in p->actual_length + * then the number of bytes transferred is stored in p->actual_length */ void (*handle_control)(USBDevice *dev, USBPacket *p, int request, int value, int index, int length, uint8_t *data); @@ -292,7 +292,7 @@ typedef struct USBDeviceClass { * Called from handle_packet(). * * Status gets stored in p->status, and if p->status == USB_RET_SUCCESS - * then the number of bytes transfered is stored in p->actual_length + * then the number of bytes transferred is stored in p->actual_length */ void (*handle_data)(USBDevice *dev, USBPacket *p); @@ -358,7 +358,7 @@ struct USBPacket { bool short_not_ok; bool int_req; int status; /* USB_RET_* status code */ - int actual_length; /* Number of bytes actually transfered */ + int actual_length; /* Number of bytes actually transferred */ /* Internal use by the USB layer. */ USBPacketState state; USBCombinedPacket *combined; diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py index b2eaf20f0b..0be5c7e13f 100644 --- a/tests/qemu-iotests/iotests.py +++ b/tests/qemu-iotests/iotests.py @@ -43,7 +43,7 @@ def qemu_img(*args): return subprocess.call(qemu_img_args + list(args), stdin=devnull, stdout=devnull) def qemu_img_verbose(*args): - '''Run qemu-img without supressing its output and return the exit code''' + '''Run qemu-img without suppressing its output and return the exit code''' return subprocess.call(qemu_img_args + list(args)) def qemu_io(*args): From 3528a3cba1f59de520fad7b1c843759e8655ea2c Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Fri, 23 Nov 2012 09:52:39 +0100 Subject: [PATCH 12/13] qemu-options: Fix space at EOL There's no need to add a space at the end of line. Moreover, it can make problems in some projects that store the help output into a file (and run couple of tests based on that) and have space at EOL forbidden. Signed-off-by: Michal Privoznik Reviewed-by: Peter Maydell Signed-off-by: Stefan Hajnoczi --- qemu-options.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-options.hx b/qemu-options.hx index de43b1b48b..231cc4f55f 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -1331,7 +1331,7 @@ DEF("net", HAS_ARG, QEMU_OPTION_net, " connect the host TAP network interface to VLAN 'n'\n" #else "-net tap[,vlan=n][,name=str][,fd=h][,ifname=name][,script=file][,downscript=dfile][,helper=helper][,sndbuf=nbytes][,vnet_hdr=on|off][,vhost=on|off][,vhostfd=h][,vhostforce=on|off]\n" - " connect the host TAP network interface to VLAN 'n' \n" + " connect the host TAP network interface to VLAN 'n'\n" " use network scripts 'file' (default=" DEFAULT_NETWORK_SCRIPT ")\n" " to configure it and 'dfile' (default=" DEFAULT_NETWORK_DOWN_SCRIPT ")\n" " to deconfigure it\n" From 654598c944aa31cdbea435bd468055af9c918d16 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 23 Nov 2012 19:12:18 +0100 Subject: [PATCH 13/13] pc_sysfw: Plug memory leak on pc_fw_add_pflash_drv() error path Harmless, because we the error inevitably leads to another, fatal one in pc_system_flash_init(): PC system firmware (pflash) not available. Fix it anyway. Signed-off-by: Markus Armbruster Signed-off-by: Stefan Hajnoczi --- hw/pc_sysfw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/pc_sysfw.c b/hw/pc_sysfw.c index 9d7c5f4003..40bced2322 100644 --- a/hw/pc_sysfw.c +++ b/hw/pc_sysfw.c @@ -98,7 +98,9 @@ static void pc_fw_add_pflash_drv(void) return; } - drive_init(opts, machine->use_scsi); + if (!drive_init(opts, machine->use_scsi)) { + qemu_opts_del(opts); + } } static void pc_system_flash_init(MemoryRegion *rom_memory,