From 37e3645ad3974db6008c212edf68c7f9da1bedc7 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Date: Wed, 8 Jun 2016 13:54:48 +0300 Subject: docs: Fix description of the leaky bucket algorithm in throttle.txt Commit 0bab0ebb17759c926bd48fd396bd8cbb2c8e4a3e was supposed to fix a mistake in the description of the leaky bucket algorithm, but the version that finally landed after the review process was incorrect. This patch solves that problem and hopefully clarifies the description a bit better. Signed-off-by: Alberto Garcia Signed-off-by: Michael Tokarev --- docs/throttle.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/throttle.txt b/docs/throttle.txt index 26d4d5107f..cd4e109d39 100644 --- a/docs/throttle.txt +++ b/docs/throttle.txt @@ -235,7 +235,10 @@ consider the following values: - Water leaks from the bucket at a rate of 100 IOPS. - Water can be added to the bucket at a rate of 2000 IOPS. - The size of the bucket is 2000 x 60 = 120000 - - If 'iops-total-max' is unset then the bucket size is 100 x 60. + - If 'iops-total-max-length' is unset then it defaults to 1 and the + size of the bucket is 2000. + - If 'iops-total-max' is unset then 'iops-total-max-length' must be + unset as well. In this case the bucket size is 100. The bucket is initially empty, therefore water can be added until it's full at a rate of 2000 IOPS (the burst rate). Once the bucket is full -- cgit v1.2.3 From 270a4b6739462d30a63033aa29e983c03d5104df Mon Sep 17 00:00:00 2001 From: Michael Tokarev Date: Mon, 13 Jun 2016 12:42:27 +0300 Subject: hw/bt/hci: spelling fix: endianness Signed-off-by: Michael Tokarev --- hw/bt/hci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/bt/hci.c b/hw/bt/hci.c index 351123fab7..476ebec0ab 100644 --- a/hw/bt/hci.c +++ b/hw/bt/hci.c @@ -421,7 +421,7 @@ static void bt_submit_raw_acl(struct bt_piconet_s *net, int length, uint8_t *dat /* HCI layer emulation */ -/* Note: we could ignore endiannes because unswapped handles will still +/* Note: we could ignore endianness because unswapped handles will still * be valid as connection identifiers for the guest - they don't have to * be continuously allocated. We do it though, to preserve similar * behaviour between hosts. Some things, like the BD_ADDR cannot be -- cgit v1.2.3 From 0aadb5a15f00c9170ca81915987d7d3a5858e815 Mon Sep 17 00:00:00 2001 From: Michael Tokarev Date: Mon, 13 Jun 2016 12:40:25 +0300 Subject: hw/dma/omap: spelling fix: endianness Signed-off-by: Michael Tokarev --- hw/dma/omap_dma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/dma/omap_dma.c b/hw/dma/omap_dma.c index 700cd6b43e..f6f86f9639 100644 --- a/hw/dma/omap_dma.c +++ b/hw/dma/omap_dma.c @@ -1975,7 +1975,7 @@ static void omap_dma4_write(void *opaque, hwaddr addr, ch->endian[1] =(value >> 19) & 1; ch->endian_lock[1] =(value >> 18) & 1; if (ch->endian[0] != ch->endian[1]) - fprintf(stderr, "%s: DMA endiannes conversion enable attempt\n", + fprintf(stderr, "%s: DMA endianness conversion enable attempt\n", __FUNCTION__); ch->write_mode = (value >> 16) & 3; ch->burst[1] = (value & 0xc000) >> 14; -- cgit v1.2.3 From 39cba610a78ad0d9dc24e6124a945a75e8f91b3d Mon Sep 17 00:00:00 2001 From: Michael Tokarev Date: Mon, 13 Jun 2016 12:55:57 +0300 Subject: arm: spelling fix: mismatch Signed-off-by: Michael Tokarev --- target-arm/helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target-arm/helper.c b/target-arm/helper.c index bdb842cc45..5484c15d1a 100644 --- a/target-arm/helper.c +++ b/target-arm/helper.c @@ -7498,7 +7498,7 @@ static bool get_phys_addr_lpae(CPUARMState *env, target_ulong address, * is unpredictable. Flag this as a guest error. */ if (sign != sext) { qemu_log_mask(LOG_GUEST_ERROR, - "AArch32: VTCR.S / VTCR.T0SZ[3] missmatch\n"); + "AArch32: VTCR.S / VTCR.T0SZ[3] mismatch\n"); } } t1sz = extract32(tcr->raw_tcr, 16, 6); -- cgit v1.2.3 From bc82585a8fd5d38e7c2402999a7ccc9a97d762c9 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 16 Jun 2016 14:25:04 +0200 Subject: vl: remove unnecessary duplicate call to tpm_cleanup tpm_cleanup is called from main() and also registered with atexit from tpm_init. The function only visits the tpm_backends linked list, and the atexit registration happens right after tpm_init fills in the list from -tpmdev options. Therefore, the direct call is unnecessary. Remove it. Signed-off-by: Paolo Bonzini Signed-off-by: Michael Tokarev --- vl.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/vl.c b/vl.c index ee557a1d3f..82cf85b1b4 100644 --- a/vl.c +++ b/vl.c @@ -4620,9 +4620,6 @@ int main(int argc, char **argv, char **envp) bdrv_close_all(); pause_all_vcpus(); res_free(); -#ifdef CONFIG_TPM - tpm_cleanup(); -#endif /* vhost-user must be cleaned up before chardevs. */ net_cleanup(); -- cgit v1.2.3 From a337f295defad7eb977da4d6317cf70f7f2fa4b4 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Thu, 16 Jun 2016 19:33:38 +0200 Subject: sparc: Use g_memdup() instead of g_new0() + memcpy() There is no need to make sure that the memory is zeroed after the allocation if we also immediatly fill the whole buffer afterwards with memcpy(). Thus g_new0 should be g_new instead. But since we are also doing a memcpy() here, we can also simply replace both with g_memdup() instead. Signed-off-by: Thomas Huth Acked-By: Artyom Tarasenko Signed-off-by: Michael Tokarev --- target-sparc/cpu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/target-sparc/cpu.c b/target-sparc/cpu.c index e4089f2074..800a25aa57 100644 --- a/target-sparc/cpu.c +++ b/target-sparc/cpu.c @@ -117,8 +117,7 @@ static int cpu_sparc_register(SPARCCPU *cpu, const char *cpu_model) return -1; } - env->def = g_new0(sparc_def_t, 1); - memcpy(env->def, def, sizeof(*def)); + env->def = g_memdup(def, sizeof(*def)); featurestr = strtok(NULL, ","); sparc_cpu_parse_features(CPU(cpu), featurestr, &err); -- cgit v1.2.3 From 8928473699d5fc7a3914abb928af35b3a0dfa5ec Mon Sep 17 00:00:00 2001 From: Bruce Rogers Date: Fri, 17 Jun 2016 09:08:16 -0600 Subject: pic: fix typo in error message: KVM_GET_IRQCHIP -> KVM_SET_IRQCHIP Signed-off-by: Bruce Rogers Signed-off-by: Michael Tokarev --- hw/i386/kvm/i8259.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/kvm/i8259.c b/hw/i386/kvm/i8259.c index 2b207de01b..11d1b726b6 100644 --- a/hw/i386/kvm/i8259.c +++ b/hw/i386/kvm/i8259.c @@ -92,7 +92,7 @@ static void kvm_pic_put(PICCommonState *s) ret = kvm_vm_ioctl(kvm_state, KVM_SET_IRQCHIP, &chip); if (ret < 0) { - fprintf(stderr, "KVM_GET_IRQCHIP failed: %s\n", strerror(ret)); + fprintf(stderr, "KVM_SET_IRQCHIP failed: %s\n", strerror(ret)); abort(); } } -- cgit v1.2.3 From 8223f345b9ba787eff1ae65114523f513fd27906 Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Mon, 20 Jun 2016 11:51:32 +0200 Subject: linux-user, trivial: display "0x%x" instead of "0x%d" Display an exception number, generally defined as an hexadecimal number (for instance, EXCP_HLT is 0x10001). Signed-off-by: Laurent Vivier Reviewed-by: Eric Blake Acked-by: Riku Voipio Signed-off-by: Michael Tokarev --- linux-user/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/main.c b/linux-user/main.c index 6004ece152..3ad70f8a6e 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -2030,7 +2030,7 @@ void cpu_loop(CPUPPCState *env) /* just indicate that signals should be handled asap */ break; default: - cpu_abort(cs, "Unknown exception 0x%d. Aborting\n", trapnr); + cpu_abort(cs, "Unknown exception 0x%x. Aborting\n", trapnr); break; } process_pending_signals(env); -- cgit v1.2.3 From deff0ddb869d4a32f9c55fe3e420b7128792f798 Mon Sep 17 00:00:00 2001 From: Laurent Vivier Date: Wed, 22 Jun 2016 17:34:02 +0200 Subject: trace-event: display "%d" instead of "0x%d" Display the slot number of mhp_pc_dimm_assigned_slot() using "%d" without the "0x". Signed-off-by: Laurent Vivier Reviewed-by: Eric Blake Signed-off-by: Michael Tokarev --- hw/i386/trace-events | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/trace-events b/hw/i386/trace-events index 7735e46eaf..5b99eba7b9 100644 --- a/hw/i386/trace-events +++ b/hw/i386/trace-events @@ -8,7 +8,7 @@ xen_pv_mmio_read(uint64_t addr) "WARNING: read from Xen PV Device MMIO space (ad xen_pv_mmio_write(uint64_t addr) "WARNING: write to Xen PV Device MMIO space (address %"PRIx64")" # hw/i386/pc.c -mhp_pc_dimm_assigned_slot(int slot) "0x%d" +mhp_pc_dimm_assigned_slot(int slot) "%d" mhp_pc_dimm_assigned_address(uint64_t addr) "0x%"PRIx64 # hw/i386/x86-iommu.c -- cgit v1.2.3 From 32945472cef09306c96635cb030704d5bd8f85be Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Wed, 22 Jun 2016 17:48:31 +0200 Subject: Document that curses usually needs -k option too Signed-off-by: Samuel Thibault Signed-off-by: Michael Tokarev --- qemu-options.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-options.hx b/qemu-options.hx index 70dfe986a2..cde4a05a32 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -303,7 +303,7 @@ STEXI @findex -k Use keyboard layout @var{language} (for example @code{fr} for French). This option is only needed where it is not easy to get raw PC -keycodes (e.g. on Macs, with some X11 servers or with a VNC +keycodes (e.g. on Macs, with some X11 servers or with a VNC or curses display). You don't normally need to use it on PC/Linux or PC/Windows hosts. -- cgit v1.2.3 From e2f310ec384d51c85c1498b49d66893d6dd036b7 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Wed, 8 Jun 2016 14:26:59 -0600 Subject: maint: Ignore generated version file Commit 67a1de0d created a generated version file, and, in some circumstances, also a temporary file. Make sure 'git add .' won't check them into the repository. Signed-off-by: Eric Blake Signed-off-by: Michael Tokarev --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 88ec2497b6..5ffc84ba9f 100644 --- a/.gitignore +++ b/.gitignore @@ -53,6 +53,8 @@ /qemu-bridge-helper /qemu-monitor.texi /qemu-monitor-info.texi +/qemu-version.h +/qemu-version.h.tmp /qmp-commands.txt /vscclient /fsdev/virtfs-proxy-helper -- cgit v1.2.3 From 083b96e22153cae3658f4defa202f1ce58423463 Mon Sep 17 00:00:00 2001 From: Cao jin Date: Thu, 7 Jul 2016 18:15:58 +0800 Subject: timer.h: fix typo Signed-off-by: Cao jin Reviewed-by: Peter Maydell Signed-off-by: Michael Tokarev --- include/qemu/timer.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/qemu/timer.h b/include/qemu/timer.h index 309f3d09e9..41e8325b17 100644 --- a/include/qemu/timer.h +++ b/include/qemu/timer.h @@ -179,7 +179,7 @@ int64_t qemu_clock_deadline_ns_all(QEMUClockType type); * qemu_clock_get_main_loop_timerlist: * @type: the clock type * - * Return the default timer list assocatiated with a clock. + * Return the default timer list associated with a clock. * * Returns: the default timer list */ @@ -509,7 +509,7 @@ static inline void timer_init_ms(QEMUTimer *ts, QEMUClockType type, * @cb: the callback to be called when the timer expires * @opaque: the opaque pointer to be passed to the callback * - * Creeate a new timer and associate it with @timer_list. + * Create a new timer and associate it with @timer_list. * The memory is allocated by the function. * * This is not the preferred interface unless you know you @@ -534,7 +534,7 @@ static inline QEMUTimer *timer_new_tl(QEMUTimerList *timer_list, * @cb: the callback to be called when the timer expires * @opaque: the opaque pointer to be passed to the callback * - * Creeate a new timer and associate it with the default + * Create a new timer and associate it with the default * timer list for the clock type @type. * * Returns: a pointer to the timer -- cgit v1.2.3 From 04ecbb783441d5d51587d23bad1c0a7b8ce27193 Mon Sep 17 00:00:00 2001 From: Cao jin Date: Thu, 7 Jul 2016 21:27:35 +0800 Subject: timer.h: fix inconsistency between comment and function prototype Signed-off-by: Cao jin Signed-off-by: Michael Tokarev --- include/qemu/timer.h | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/include/qemu/timer.h b/include/qemu/timer.h index 41e8325b17..e6c089e8b4 100644 --- a/include/qemu/timer.h +++ b/include/qemu/timer.h @@ -431,6 +431,7 @@ void timer_init_tl(QEMUTimer *ts, /** * timer_init: + * @ts: the timer to be initialised * @type: the clock to associate with the timer * @scale: the scale value for the timer * @cb: the callback to call when the timer expires @@ -450,6 +451,7 @@ static inline void timer_init(QEMUTimer *ts, QEMUClockType type, int scale, /** * timer_init_ns: + * @ts: the timer to be initialised * @type: the clock to associate with the timer * @cb: the callback to call when the timer expires * @opaque: the opaque pointer to pass to the callback @@ -468,6 +470,7 @@ static inline void timer_init_ns(QEMUTimer *ts, QEMUClockType type, /** * timer_init_us: + * @ts: the timer to be initialised * @type: the clock to associate with the timer * @cb: the callback to call when the timer expires * @opaque: the opaque pointer to pass to the callback @@ -486,6 +489,7 @@ static inline void timer_init_us(QEMUTimer *ts, QEMUClockType type, /** * timer_init_ms: + * @ts: the timer to be initialised * @type: the clock to associate with the timer * @cb: the callback to call when the timer expires * @opaque: the opaque pointer to pass to the callback @@ -547,8 +551,8 @@ static inline QEMUTimer *timer_new(QEMUClockType type, int scale, /** * timer_new_ns: - * @clock: the clock to associate with the timer - * @callback: the callback to call when the timer expires + * @type: the clock type to associate with the timer + * @cb: the callback to call when the timer expires * @opaque: the opaque pointer to pass to the callback * * Create a new timer with nanosecond scale on the default timer list @@ -564,8 +568,8 @@ static inline QEMUTimer *timer_new_ns(QEMUClockType type, QEMUTimerCB *cb, /** * timer_new_us: - * @clock: the clock to associate with the timer - * @callback: the callback to call when the timer expires + * @type: the clock type to associate with the timer + * @cb: the callback to call when the timer expires * @opaque: the opaque pointer to pass to the callback * * Create a new timer with microsecond scale on the default timer list @@ -581,8 +585,8 @@ static inline QEMUTimer *timer_new_us(QEMUClockType type, QEMUTimerCB *cb, /** * timer_new_ms: - * @clock: the clock to associate with the timer - * @callback: the callback to call when the timer expires + * @type: the clock type to associate with the timer + * @cb: the callback to call when the timer expires * @opaque: the opaque pointer to pass to the callback * * Create a new timer with millisecond scale on the default timer list @@ -691,6 +695,7 @@ bool timer_pending(QEMUTimer *ts); /** * timer_expired: * @ts: the timer + * @current_time: the current time * * Determines whether a timer has expired. * -- cgit v1.2.3 From 3224e8786fcbe531746f1530c37210c425625213 Mon Sep 17 00:00:00 2001 From: Cao jin Date: Fri, 8 Jul 2016 18:31:37 +0800 Subject: timer/cpus: fix some typos and update some comments Signed-off-by: Cao jin Signed-off-by: Michael Tokarev --- cpus.c | 6 +++--- include/qemu/timer.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cpus.c b/cpus.c index 84c3520d44..0ab4ab1ef2 100644 --- a/cpus.c +++ b/cpus.c @@ -229,7 +229,7 @@ static int64_t cpu_get_clock_locked(void) return ticks; } -/* return the host CPU monotonic timer and handle stop/restart */ +/* return the host CPU monotonic time */ int64_t cpu_get_clock(void) { int64_t ti; @@ -244,7 +244,7 @@ int64_t cpu_get_clock(void) } /* enable cpu_get_ticks() - * Caller must hold BQL which server as mutex for vm_clock_seqlock. + * Caller must hold BQL which serves as mutex for vm_clock_seqlock. */ void cpu_enable_ticks(void) { @@ -260,7 +260,7 @@ void cpu_enable_ticks(void) /* disable cpu_get_ticks() : the clock is stopped. You must not call * cpu_get_ticks() after that. - * Caller must hold BQL which server as mutex for vm_clock_seqlock. + * Caller must hold BQL which serves as mutex for vm_clock_seqlock. */ void cpu_disable_ticks(void) { diff --git a/include/qemu/timer.h b/include/qemu/timer.h index e6c089e8b4..4bfcd35560 100644 --- a/include/qemu/timer.h +++ b/include/qemu/timer.h @@ -802,7 +802,7 @@ static inline int64_t get_max_clock_jump(void) * Low level clock functions */ -/* real time host monotonic timer */ +/* get host real time in nanosecond */ static inline int64_t get_clock_realtime(void) { struct timeval tv; -- cgit v1.2.3 From 5ce747cfac697f61668ab4fa4a71c1dba15cc272 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 15 Jul 2016 17:29:22 +0200 Subject: target-m68k: fix get_mac_extf helper val is assigned twice; the second one should be combined with "|". Reported by Coverity. Signed-off-by: Paolo Bonzini Signed-off-by: Michael Tokarev --- target-m68k/helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target-m68k/helper.c b/target-m68k/helper.c index f52d0e3036..89bbe6dfa6 100644 --- a/target-m68k/helper.c +++ b/target-m68k/helper.c @@ -812,7 +812,7 @@ uint32_t HELPER(get_mac_extf)(CPUM68KState *env, uint32_t acc) { uint32_t val; val = env->macc[acc] & 0x00ff; - val = (env->macc[acc] >> 32) & 0xff00; + val |= (env->macc[acc] >> 32) & 0xff00; val |= (env->macc[acc + 1] << 16) & 0x00ff0000; val |= (env->macc[acc + 1] >> 16) & 0xff000000; return val; -- cgit v1.2.3 From eb83c2030aa037b4c6037bfa3cbe181343dc6a8b Mon Sep 17 00:00:00 2001 From: Changlong Xie Date: Mon, 25 Jul 2016 11:48:00 +0800 Subject: hw/net/e1000e: Fix compiler warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit slave:~/.xie/qemu-colo # gcc --version gcc (SUSE Linux) 4.3.4 [gcc-4_3-branch revision 152973] slave:~/.xie/qemu-colo # make -j8 CC hw/net/e1000e_core.o hw/net/e1000e_core.c:56: warning: ‘e1000e_set_interrupt_cause’ declared inline after being called hw/net/e1000e_core.c:56: warning: previous declaration of ‘e1000e_set_interrupt_cause’ was here LINK x86_64-softmmu/qemu-system-x86_64 Signed-off-by: Changlong Xie Reviewed-by: Dmitry Fleytman Signed-off-by: Michael Tokarev --- hw/net/e1000e_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/net/e1000e_core.c b/hw/net/e1000e_core.c index badb1feb7d..e0bd31c577 100644 --- a/hw/net/e1000e_core.c +++ b/hw/net/e1000e_core.c @@ -52,7 +52,7 @@ second according to spec 10.2.4.2 */ #define E1000E_MAX_TX_FRAGS (64) -static void +static inline void e1000e_set_interrupt_cause(E1000ECore *core, uint32_t val); static inline void -- cgit v1.2.3