[Qemu-devel] [PATCH v3] Prevent disk data loss when closing qemu

2012-05-30 Thread Pavel Dovgaluk
Prevent disk data loss when closing qemu console window under Windows 7. v3. Comment for Sleep() parameter was updated. Signed-off-by: Pavel Dovgalyukpavel.dovga...@gmail.com --- os-win32.c |8 +++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/os-win32.c b/os-win32.c

Re: [Qemu-devel] [PATCH v3] Prevent disk data loss when closing qemu

2012-05-30 Thread Pavel Dovgaluk
From: Anthony Liguori [mailto:anth...@codemonkey.ws] Sent: Wednesday, May 30, 2012 6:29 AM On 05/29/2012 09:26 PM, Pavel Dovgaluk wrote: Prevent disk data loss when closing qemu console window under Windows 7. v3. Comment for Sleep() parameter was updated. Signed-off-by: Pavel

Re: [Qemu-devel] [RESEND PATCH 1.1] vnc: fix segfault in vnc_display_pw_expire()

2012-05-30 Thread Anthony Liguori
On 05/24/2012 04:55 PM, Gerd Hoffmann wrote: NULL pointer dereference in case no vnc server is configured. Catch this and return -EINVAL like vnc_display_password() does. Signed-off-by: Gerd Hoffmannkra...@redhat.com Applied. Thanks. Regards, Anthony Liguori --- ui/vnc.c |4

Re: [Qemu-devel] [PATCH 1.1] xhci: add usage info to docs

2012-05-30 Thread Anthony Liguori
On 05/29/2012 05:20 PM, Gerd Hoffmann wrote: Signed-off-by: Gerd Hoffmannkra...@redhat.com Applied. Thanks. Regards, Anthony Liguori --- docs/usb2.txt | 15 +++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/docs/usb2.txt b/docs/usb2.txt index

Re: [Qemu-devel] [QEMU 1.1 PATCH v3] Expose CPUID leaf 7 only for -cpu host

2012-05-30 Thread Anthony Liguori
On 05/21/2012 10:27 PM, Eduardo Habkost wrote: Changes v2 - v3; - Check for kvm_enabled() before setting cpuid_7_0_ebx_features Changes v1 - v2: - Use kvm_arch_get_supported_cpuid() instead of host_cpuid() on cpu_x86_fill_host(). We should use GET_SUPPORTED_CPUID for all bits

Re: [Qemu-devel] [PATCH 08/22] linux-user: remove two unchecked uses of strdup

2012-05-30 Thread Anthony Liguori
On 05/09/2012 10:12 PM, Jim Meyering wrote: Peter Maydell wrote: On 9 May 2012 15:01, Jim Meyeringj...@meyering.net wrote: From 402100deb7e27b1d7ac619ebac963f861fae91b0 Mon Sep 17 00:00:00 2001 From: Jim Meyeringmeyer...@redhat.com Date: Mon, 7 May 2012 18:34:26 +0200 Subject: [PATCH]

Re: [Qemu-devel] [RFC next] ui: Split main() in two to not have Cocoa hijack it

2012-05-30 Thread Anthony Liguori
On 05/29/2012 02:18 AM, Andreas Färber wrote: Only call into cocoa.m when determined necessary by QEMU's option handling. Avoids redoing all option parsing in ui/cocoa.m:main() and constantly missing new options like -machine accel=qtest. Move function declarations to a new ui.h header to avoid

Re: [Qemu-devel] [PATCH 08/22] linux-user: remove two unchecked uses of strdup

2012-05-30 Thread Jim Meyering
Anthony Liguori wrote: On 05/09/2012 10:12 PM, Jim Meyering wrote: Peter Maydell wrote: On 9 May 2012 15:01, Jim Meyeringj...@meyering.net wrote: From 402100deb7e27b1d7ac619ebac963f861fae91b0 Mon Sep 17 00:00:00 2001 From: Jim Meyeringmeyer...@redhat.com Date: Mon, 7 May 2012 18:34:26

Re: [Qemu-devel] [PATCH 08/22] linux-user: remove two unchecked uses of strdup

2012-05-30 Thread Anthony Liguori
On 05/30/2012 03:12 PM, Jim Meyering wrote: Anthony Liguori wrote: On 05/09/2012 10:12 PM, Jim Meyering wrote: Peter Maydell wrote: On 9 May 2012 15:01, Jim Meyeringj...@meyering.net wrote: From 402100deb7e27b1d7ac619ebac963f861fae91b0 Mon Sep 17 00:00:00 2001 From: Jim

Re: [Qemu-devel] [RFC prep-next 0/2] prep_pci: Prepare for QOM realize

2012-05-30 Thread Anthony Liguori
On 05/27/2012 02:15 AM, Andreas Färber wrote: Hello, This mini-series, based on master, starts fixing issues in the way of calling recursive object_realize() at machine-level (vl.c). Patch 1 is a cherry-pick from Anthony's / Wan Peng's i440fx series, fixing Coding Style issues and dropping

Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts

2012-05-30 Thread Stefan Hajnoczi
On Wed, May 30, 2012 at 3:26 AM, Anthony Liguori aligu...@us.ibm.com wrote: 3) It's not how the rest of QEMU is written.  Consistency is the most important purpose of Coding Style. (3) is the most important consideration of all. Fair enough if its a style choice and you want QEMU to be

Re: [Qemu-devel] [PATCH 1/3 v9] add-cow file format

2012-05-30 Thread Kevin Wolf
Am 30.05.2012 04:10, schrieb Anthony Liguori: On 05/08/2012 01:34 AM, Dong Xu Wang wrote: Provide a new file format: add-cow. The usage can be found in add-cow.txt of this patch. CC: Kevin Wolfkw...@redhat.com CC: Stefan Hajnoczistefa...@linux.vnet.ibm.com Signed-off-by: Dong Xu

Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts

2012-05-30 Thread Peter Maydell
On 30 May 2012 08:33, Stefan Hajnoczi stefa...@gmail.com wrote: I'd love to use them because they keep variables and the code that uses them together - great for checking that correct types are being used during code review and also less noise in the patch. Just open a new scope with { and

Re: [Qemu-devel] [PATCH 1.1 v2] sheepdog: add coroutine_fn markers to coroutine functions

2012-05-30 Thread Stefan Hajnoczi
On Wed, May 30, 2012 at 1:03 AM, MORITA Kazutaka morita.kazut...@lab.ntt.co.jp wrote: Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- Changes from v1:  - use spaces for indentation  block/sheepdog.c |    9 +  1 files changed, 5 insertions(+), 4 deletions(-) It's

Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts

2012-05-30 Thread Stefan Hajnoczi
On Wed, May 30, 2012 at 8:34 AM, Peter Maydell peter.mayd...@linaro.org wrote: On 30 May 2012 08:33, Stefan Hajnoczi stefa...@gmail.com wrote: I'd love to use them because they keep variables and the code that uses them together - great for checking that correct types are being used during

Re: [Qemu-devel] [PATCH 1.1] virtio: Fix compiler warning for non Linux hosts

2012-05-30 Thread Kevin Wolf
Am 30.05.2012 09:33, schrieb Stefan Hajnoczi: On Wed, May 30, 2012 at 3:26 AM, Anthony Liguori aligu...@us.ibm.com wrote: 3) It's not how the rest of QEMU is written. Consistency is the most important purpose of Coding Style. (3) is the most important consideration of all. Fair enough if

[Qemu-devel] [PATCHv2 03/22] block: avoid buffer overrun by using pstrcpy, not strncpy

2012-05-30 Thread Jim Meyering
From: Jim Meyering meyer...@redhat.com Also, use PATH_MAX, rather than the arbitrary 1024. Using PATH_MAX is more consistent with other filename-related variables in this file, like backing_filename and tmp_filename. Acked-by: Kevin Wolf kw...@redhat.com Signed-off-by: Jim Meyering

[Qemu-devel] [PATCHv2 20/22] hw/r2d: add comment: this strncpy use is ok

2012-05-30 Thread Jim Meyering
From: Jim Meyering meyer...@redhat.com Signed-off-by: Jim Meyering meyer...@redhat.com --- hw/r2d.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/r2d.c b/hw/r2d.c index c55de01..ed841c5 100644 --- a/hw/r2d.c +++ b/hw/r2d.c @@ -328,6 +328,8 @@ static void r2d_init(ram_addr_t ram_size,

Re: [Qemu-devel] [PATCH 08/22] linux-user: remove two unchecked uses of strdup

2012-05-30 Thread Jim Meyering
Anthony Liguori wrote: On 05/30/2012 03:12 PM, Jim Meyering wrote: Anthony Liguori wrote: On 05/09/2012 10:12 PM, Jim Meyering wrote: Peter Maydell wrote: On 9 May 2012 15:01, Jim Meyeringj...@meyering.net wrote: From 402100deb7e27b1d7ac619ebac963f861fae91b0 Mon Sep 17 00:00:00 2001

Re: [Qemu-devel] [PATCH 1.1 v2] sheepdog: add coroutine_fn markers to coroutine functions

2012-05-30 Thread Kevin Wolf
Am 30.05.2012 09:36, schrieb Stefan Hajnoczi: On Wed, May 30, 2012 at 1:03 AM, MORITA Kazutaka morita.kazut...@lab.ntt.co.jp wrote: Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- Changes from v1: - use spaces for indentation block/sheepdog.c |9 + 1 files

Re: [Qemu-devel] Virtio-pci issue

2012-05-30 Thread Stefan Hajnoczi
On Tue, May 29, 2012 at 4:48 AM, Evgeny Voevodin e.voevo...@samsung.com wrote: On 28.05.2012 16:37, Stefan Hajnoczi wrote: On Thu, May 24, 2012 at 4:18 AM, Evgeny Voevodine.voevo...@samsung.com  wrote: And also there is another problem that I've faced with. It is the ability to plug as

[Qemu-devel] [PATCHv2 09/22] ppc: avoid buffer overrun: use pstrcpy, not strncpy

2012-05-30 Thread Jim Meyering
From: Jim Meyering meyer...@redhat.com A terminal NUL is required by caller's use of strchr. It's better not to use strncpy at all, since there is no need to zero out hundreds of trailing bytes for each iteration. Signed-off-by: Jim Meyering meyer...@redhat.com --- target-ppc/kvm.c | 2 +- 1

Re: [Qemu-devel] [PATCH] Avoid segfault in cpu_dump_state

2012-05-30 Thread Alexander Graf
On 23.05.2012, at 17:43, Fabien Chouteau wrote: On 05/16/2012 03:39 PM, Fabien Chouteau wrote: On 05/16/2012 10:29 AM, Fabien Chouteau wrote: On 05/16/2012 05:50 AM, Andreas Färber wrote: Am 15.05.2012 18:08, schrieb Fabien Chouteau: On 05/15/2012 03:31 PM, Andreas Färber wrote: Am

Re: [Qemu-devel] [PATCH 1.1 v2] sheepdog: fix return value of do_load_save_vm_state

2012-05-30 Thread Kevin Wolf
Am 29.05.2012 18:05, schrieb MORITA Kazutaka: bdrv_save_vmstate and bdrv_load_vmstate should return the vmstate size on success, and -errno on error. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- Changes from v1 - return an error for short reads/writes - fix a coding

[Qemu-devel] [PATCHv2 02/22] sparc: use g_strdup in place of unchecked strdup

2012-05-30 Thread Jim Meyering
From: Jim Meyering meyer...@redhat.com This avoids a NULL-deref upon strdup failure. Also update matching free to g_free. Signed-off-by: Jim Meyering meyer...@redhat.com --- target-sparc/cpu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target-sparc/cpu.c

Re: [Qemu-devel] [PATCH] Avoid segfault in cpu_dump_state

2012-05-30 Thread Fabien Chouteau
On 05/30/2012 09:58 AM, Alexander Graf wrote: On 23.05.2012, at 17:43, Fabien Chouteau wrote: On 05/16/2012 03:39 PM, Fabien Chouteau wrote: On 05/16/2012 10:29 AM, Fabien Chouteau wrote: On 05/16/2012 05:50 AM, Andreas Färber wrote: Am 15.05.2012 18:08, schrieb Fabien Chouteau: On

Re: [Qemu-devel] [PATCH V2] booke_206_tlbwe: Discard invalid bits in MAS2

2012-05-30 Thread Alexander Graf
On 21.05.2012, at 18:11, Fabien Chouteau wrote: The size of EPN field in MAS2 depends on page size. This patch adds a mask to discard invalid bits in EPN field. Definition of EPN field from e500v2 RM: EPN Effective page number: Depending on page size, only the bits associated with a page

Re: [Qemu-devel] [PATCH 1/3 v9] add-cow file format

2012-05-30 Thread Stefan Hajnoczi
On Wed, May 30, 2012 at 2:50 AM, Dong Xu Wang wdon...@linux.vnet.ibm.com wrote: On Tue, May 29, 2012 at 11:50 PM, Stefan Hajnoczi stefa...@gmail.com wrote: I thought a bit more about locking. Because the metadata is simple not much locking is necessary except when fetching new bitmap clusters

[Qemu-devel] [PATCHv2 12/22] bt: replace fragile snprintf use and unwarranted strncpy

2012-05-30 Thread Jim Meyering
From: Jim Meyering meyer...@redhat.com In bt_hci_name_req a failed snprintf could return len larger than sizeof(params.name), which means the following memset call would have a length value of (size_t)-1, -2, etc... Sounds scary. But currently, one can deduce that there is no problem:

Re: [Qemu-devel] [PATCH block-next 0/3] qemu-img check/qcow2: Allow fixing refcounts

2012-05-30 Thread Zhi Yong Wu
On Sat, May 12, 2012 at 12:48 AM, Kevin Wolf kw...@redhat.com wrote: A prerequisite for a QED mode in qcow2, which doesn't update the refcount Recently some new concepts such as QED mode in qcow2 are seen frequencely, can anyone explain what it means? thanks. table except on clean shutdown, is

[Qemu-devel] [PATCHv2 14/22] vscsi: avoid unwarranted strncpy

2012-05-30 Thread Jim Meyering
From: Jim Meyering meyer...@redhat.com Don't use strncpy when the source string is known to fit in the destination buffer. Use equivalent memcpy. We could even use strcpy, here, but some static analyzers warn about that, so don't add new uses. Acked-by: David Gibson da...@gibson.dropbear.id.au

[Qemu-devel] [PATCHv2 13/22] virtio-9p: avoid unwarranted uses of strncpy

2012-05-30 Thread Jim Meyering
From: Jim Meyering meyer...@redhat.com In all of these cases, the uses of strncpy were unnecessary, since at each point of use we know that the NUL-terminated source bytes fit in the destination buffer. Use memcpy in place of strncpy. Acked-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com

[Qemu-devel] [PATCHv2 16/22] qemu-ga: prefer pstrcpy: consistently NUL-terminate ifreq.ifr_name

2012-05-30 Thread Jim Meyering
From: Jim Meyering meyer...@redhat.com NUL-termination of the .ifr_name field is not required, but is fine (and preferable to using strncpy and leaving the reader to wonder), since the first thing the linux kernel does is to clear the last byte. Besides, using pstrcpy here makes this setting of

[Qemu-devel] [PATCH 1.1] ahci: Fix reset of MSI function

2012-05-30 Thread Jan Kiszka
Call msi_reset on device reset as still required by the core. Acked-by: Alexander Graf ag...@suse.de Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- hw/ide/ich.c | 12 ++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/hw/ide/ich.c b/hw/ide/ich.c index

Re: [Qemu-devel] [ANNOUNCE] QEMU 1.1-rc3 release

2012-05-30 Thread Jan Kiszka
On 2012-05-30 04:32, Anthony Liguori wrote: On 05/22/2012 11:09 PM, Jan Kiszka wrote: On 2012-05-22 11:32, Anthony Liguori wrote: Hi, On behalf of the QEMU Team, I'd like to announce the availability of the third release candidate for the QEMU 1.1 release. This release is meant for testing

[Qemu-devel] [PATCHv2 04/22] sheepdog: avoid a few buffer overruns

2012-05-30 Thread Jim Meyering
From: Jim Meyering meyer...@redhat.com * parse_vdiname: Use pstrcpy, not strncpy, when the destination buffer must be NUL-terminated. * sd_open: Likewise, avoid buffer overrun. * do_sd_create: Likewise. Leave the preceding memset, since pstrcpy does not NUL-fill, and filename needs that. *

[Qemu-devel] [PATCH 0/4] VFIO

2012-05-30 Thread Alex Williamson
This series implements the core VFIO infrastructure, documentation, an IOMMU backend suitable for x86 usage, and a PCI device driver. These patches are based on the previous v2 IOMMU Groups + VFIO patches and are dependent on the previously sent out PCI and IOMMU groups series found here:

[Qemu-devel] [PATCH 1/4] vfio: VFIO core

2012-05-30 Thread Alex Williamson
VFIO is a secure user level driver for use with both virtual machines and user level drivers. VFIO makes use of IOMMU groups to ensure the isolation of devices in use, allowing unprivileged user access. It's intended that VFIO will replace KVM device assignment and UIO drivers (in cases where

[Qemu-devel] frame reordering in qemu_net_queue_send() ?

2012-05-30 Thread Luigi Rizzo
Hi, while investigating rx performance for emulated network devices (i am looking at the userspace version, relying on net=tap or similar approaches) i noticed the code in net/queue.c :: qemu_net_queue_send() which look strange to me (same goes for the iov version). The whole function is below,

[Qemu-devel] Q: frame reordering in qemu_net_queue_send() ?

2012-05-30 Thread Luigi Rizzo
Hi, while investigating rx performance for emulated network devices (i am looking at the userspace version, relying on net=tap or similar approaches) i noticed the code in net/queue.c :: qemu_net_queue_send() which look strange to me (same goes for the iov version). The whole function is below,

Re: [Qemu-devel] [PATCH qom-next 57/59] cpu: Introduce mandatory tlb_flush callback

2012-05-30 Thread Wei-Ren Chen
On Wed, May 30, 2012 at 09:53:20AM +0200, Alexander Graf wrote: Mind to elaborate (in the patch description maybe) why we need a CPU specific TLB flush callback that merely calls the globally visible tlb_flush? :) For future extension? ;) Regards, chenwj -- Wei-Ren Chen (陳韋任) Computer

[Qemu-devel] [PATCHv2 01/22] scsi, pci, qdev, isa-bus, sysbus: don't let *_get_fw_dev_path return NULL

2012-05-30 Thread Jim Meyering
From: Jim Meyering meyer...@redhat.com Use g_strdup rather than strdup, because the sole caller (qdev_get_fw_dev_path_helper) assumes it gets non-NULL, and dereferences it. Besides, in that caller, the allocated buffer is already freed with g_free, so it's better to allocate with a matching

Re: [Qemu-devel] Android Goldfish on QEMU

2012-05-30 Thread Jan Kiszka
On 2012-05-30 04:19, 陳韋任 (Wei-Ren Chen) wrote: Is goldfish still a relevant Android dev platform? In other words - would goldfish be useful to Android developers or just cool for QEMU hackers and old-school Android enthusiasts? It's still the base of the emulator you get with current SDKs.

[Qemu-devel] [PATCHv2 19/22] qcow2: mark this file's sole strncpy use as justified

2012-05-30 Thread Jim Meyering
From: Jim Meyering meyer...@redhat.com Acked-by: Kevin Wolf kw...@redhat.com Signed-off-by: Jim Meyering meyer...@redhat.com --- block/qcow2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/qcow2.c b/block/qcow2.c index c2e49cd..6d34f1a 100644 --- a/block/qcow2.c +++ b/block/qcow2.c

Re: [Qemu-devel] [PATCH v2] hmp/qxl: info spice: add qxl info

2012-05-30 Thread Alon Levy
On Tue, May 29, 2012 at 01:44:35PM -0300, Luiz Capitulino wrote: On Tue, 29 May 2012 17:51:50 +0300 Alon Levy al...@redhat.com wrote: On Tue, May 29, 2012 at 10:38:20AM -0300, Luiz Capitulino wrote: On Tue, 29 May 2012 09:25:40 +0200 Gerd Hoffmann kra...@redhat.com wrote: Hi,

[Qemu-devel] [PATCHv2 06/22] hw/9pfs: avoid buffer overrun

2012-05-30 Thread Jim Meyering
From: Jim Meyering meyer...@redhat.com v9fs_add_dir_node and qemu_v9fs_synth_add_file used strncpy to form node-name, which requires NUL-termination, but strncpy does not ensure NUL-termination. Use pstrcpy, which does. Acked-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Signed-off-by:

Re: [Qemu-devel] [PATCH v3] pci: call object_unparent() before free_qdev()

2012-05-30 Thread Michael S. Tsirkin
On Wed, May 30, 2012 at 08:14:03AM +0300, Michael S. Tsirkin wrote: On Wed, May 30, 2012 at 10:13:07AM +0800, Anthony Liguori wrote: On 05/20/2012 05:57 PM, Amos Kong wrote: Start VM with 8 multiple-function block devs, hot-removing those block devs by 'device_del ...' would cause qemu

Re: [Qemu-devel] [RFC next] ui: Split main() in two to not have Cocoa hijack it

2012-05-30 Thread Paolo Bonzini
Il 28/05/2012 20:18, Andreas Färber ha scritto: Only call into cocoa.m when determined necessary by QEMU's option handling. Avoids redoing all option parsing in ui/cocoa.m:main() and constantly missing new options like -machine accel=qtest. Move function declarations to a new ui.h header to

[Qemu-devel] [RFC PATCH 0/4] asynchronous migration state change handlers

2012-05-30 Thread Yonit Halperin
Hi, This patch series introduces async handlers for notifiers, and integrates them with migration state change notifications. Asynchronous migration completion notifier is essential for allowing spice to cleanly complete the src server connection to the client and transfer it to the target.

[Qemu-devel] [PATCHv2 22/22] doc: update HACKING wrt strncpy/pstrcpy

2012-05-30 Thread Jim Meyering
From: Jim Meyering meyer...@redhat.com Reword the section on strncpy: its NUL-filling is important in some cases. Mention that pstrcpy's signature is different. Signed-off-by: Jim Meyering meyer...@redhat.com --- HACKING | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff

[Qemu-devel] [PATCHv2 08/22] os-posix: avoid buffer overrun

2012-05-30 Thread Jim Meyering
From: Jim Meyering meyer...@redhat.com os_set_proc_name: Use pstrcpy, in place of strncpy and the ineffectual preceding assignment: name[sizeof(name) - 1] = 0; Signed-off-by: Jim Meyering meyer...@redhat.com --- os-posix.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

[Qemu-devel] frame reordering in qemu_net_queue_send() ?

2012-05-30 Thread Luigi Rizzo
Hi, while investigating rx performance for emulated network devices (i am looking at the userspace version, relying on net=tap or similar approaches) i noticed the code in net/queue.c :: qemu_net_queue_send() which look strange to me (same goes for the iov version). The whole function is below,

Re: [Qemu-devel] [PATCH qom-next 57/59] cpu: Introduce mandatory tlb_flush callback

2012-05-30 Thread Alexander Graf
On 30.05.2012, at 10:48, 陳韋任 (Wei-Ren Chen) wrote: On Wed, May 30, 2012 at 09:53:20AM +0200, Alexander Graf wrote: Mind to elaborate (in the patch description maybe) why we need a CPU specific TLB flush callback that merely calls the globally visible tlb_flush? :) For future extension?

[Qemu-devel] [RFC PATCH 1/4] notifiers: add support for async notifiers handlers

2012-05-30 Thread Yonit Halperin
Signed-off-by: Yonit Halperin yhalp...@redhat.com --- input.c |2 +- migration.c |2 +- notify.c | 79 +++--- notify.h | 55 --- qemu-timer.c |2 +- vl.c |2 +- 6

[Qemu-devel] [RFC PATCH 2/4] migration: moving migration start code to a separated routine

2012-05-30 Thread Yonit Halperin
Preparation for asynchronous migration state change notifiers. Signed-off-by: Yonit Halperin yhalp...@redhat.com --- migration.c | 73 +- migration.h |2 + 2 files changed, 58 insertions(+), 17 deletions(-) diff --git a/migration.c

[Qemu-devel] [PATCHv2 15/22] target-i386: use pstrcpy, not strncpy

2012-05-30 Thread Jim Meyering
From: Jim Meyering meyer...@redhat.com Use pstrcpy rather than strncpy in one more case (in cpudef_setfield). This makes our handling of -model_id consistent with another pstrcpy-vs-model_id use below. Signed-off-by: Jim Meyering meyer...@redhat.com --- target-i386/cpu.c | 2 +- 1 file changed,

[Qemu-devel] [PATCHv2 11/22] ui/vnc: simplify and avoid strncpy

2012-05-30 Thread Jim Meyering
From: Jim Meyering meyer...@redhat.com Don't bother with strncpy. There's no need for its zero-fill. Use g_strndup in place of g_malloc+strncpy+NUL-terminate. Signed-off-by: Jim Meyering meyer...@redhat.com --- ui/vnc-auth-sasl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff

[Qemu-devel] [PATCHv2 21/22] scsi: mark an strncpy use as valid

2012-05-30 Thread Jim Meyering
From: Jim Meyering meyer...@redhat.com Signed-off-by: Jim Meyering meyer...@redhat.com --- hw/scsi-bus.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/scsi-bus.c b/hw/scsi-bus.c index 3edda28..98170c3 100644 --- a/hw/scsi-bus.c +++ b/hw/scsi-bus.c @@ -406,6 +406,7 @@ static bool

[Qemu-devel] [PATCHv2 18/22] acpi: remove strzcpy (strncpy-identical) function; just use strncpy

2012-05-30 Thread Jim Meyering
From: Jim Meyering meyer...@redhat.com Adjust all uses s/strzcpy/strncpy/ and mark these uses of strncpy as ok. Signed-off-by: Jim Meyering meyer...@redhat.com --- hw/acpi.c | 24 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/hw/acpi.c b/hw/acpi.c index

Re: [Qemu-devel] [PATCH qom-next 57/59] cpu: Introduce mandatory tlb_flush callback

2012-05-30 Thread Alexander Graf
Mind to elaborate (in the patch description maybe) why we need a CPU specific TLB flush callback that merely calls the globally visible tlb_flush? :) Alex On 23.05.2012, at 05:08, Andreas Färber wrote: Signed-off-by: Andreas Färber afaer...@suse.de

[Qemu-devel] [RFC PATCH 3/4] migration: moving migration completion code to a separated routine

2012-05-30 Thread Yonit Halperin
Preparation for asynchronous migration state change notifiers. Signed-off-by: Yonit Halperin yhalp...@redhat.com --- migration.c | 31 --- migration.h |1 + 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/migration.c b/migration.c index

Re: [Qemu-devel] [Spice-devel] [RFC PATCH 1/4] notifiers: add support for async notifiers handlers

2012-05-30 Thread Alon Levy
On Wed, May 30, 2012 at 12:02:36PM +0300, Yonit Halperin wrote: Signed-off-by: Yonit Halperin yhalp...@redhat.com One empty line that snuck in below. --- input.c |2 +- migration.c |2 +- notify.c | 79 +++---

Re: [Qemu-devel] [PATCH qom-next 57/59] cpu: Introduce mandatory tlb_flush callback

2012-05-30 Thread Peter Maydell
On 23 May 2012 04:08, Andreas Färber afaer...@suse.de wrote: +void cpu_tlb_flush(CPUState *cpu, bool flush_global) +{ +    CPUClass *cc = CPU_GET_CLASS(cpu); + +    g_assert(cc-tlb_flush != NULL); + +    cc-tlb_flush(cpu, flush_global); +} This needs to be able to call tlb_flush() itself

[Qemu-devel] [PATCHv2 10/22] linux-user: remove two unchecked uses of strdup

2012-05-30 Thread Jim Meyering
From: Jim Meyering meyer...@redhat.com Remove two uses of strdup (use g_path_get_basename instead), and add a comment that this strncpy use is ok. Reviewed-by: Peter Maydell peter.mayd...@linaro.org Signed-off-by: Jim Meyering meyer...@redhat.com --- linux-user/elfload.c | 12 +++- 1

[Qemu-devel] What target could be a QOM example?

2012-05-30 Thread Jia Liu
Hi all, I'm working on target-or32, i.e., OpenRISC, for QEMU. Perhaps you already saw the patchset I sent to mailing list. Since target-or32 is a new target, I would like to implement it in QOM way. Is there a good QOM example I can refer to? Regards, Jia.

[Qemu-devel] [PATCH 3/4] vfio: Type1 IOMMU implementation

2012-05-30 Thread Alex Williamson
This VFIO IOMMU backend is designed primarily for AMD-Vi and Intel VT-d hardware, but is potentially usable by anything supporting similar mapping functionality. We arbitrarily call this a Type1 backend for lack of a better name. This backend has no IOVA or host memory mapping restrictions for

[Qemu-devel] [PATCH 2/4] vfio: Add documentation

2012-05-30 Thread Alex Williamson
Signed-off-by: Alex Williamson alex.william...@redhat.com --- Documentation/vfio.txt | 315 1 file changed, 315 insertions(+) create mode 100644 Documentation/vfio.txt diff --git a/Documentation/vfio.txt b/Documentation/vfio.txt new file mode

[Qemu-devel] [PATCHv2 17/22] libcacard/vcard_emul_nss: use pstrcpy in place of strncpy

2012-05-30 Thread Jim Meyering
From: Jim Meyering meyer...@redhat.com Replace strncpy+NUL-terminate use with use of pstrcpy. This requires linking with cutils.o (or else vssclient doesn't link), so add that in the Makefile. Acked-by: Alon Levy al...@redhat.com Signed-off-by: Jim Meyering meyer...@redhat.com ---

[Qemu-devel] Low shared memory throughput at VM when using PCI mapping

2012-05-30 Thread William Tu
Hi Folks, I'm using PCI device pass-through to pass a network device to a VM. Since one of my additional requirements is to share a memory between VM and host, I pre-allocate a memory at host (say physaddr: 0x100) and put this address into the BAR2 of the network device's pci configuration space.

Re: [Qemu-devel] Virtio-pci issue

2012-05-30 Thread Evgeny Voevodin
On 30.05.2012 11:56, Stefan Hajnoczi wrote: On Tue, May 29, 2012 at 4:48 AM, Evgeny Voevodine.voevo...@samsung.com wrote: On 28.05.2012 16:37, Stefan Hajnoczi wrote: On Thu, May 24, 2012 at 4:18 AM, Evgeny Voevodine.voevo...@samsung.com wrote: And also there is another problem that I've

[Qemu-devel] [PATCHv2 05/22] vmdk: relative_path: use pstrcpy in place of strncpy

2012-05-30 Thread Jim Meyering
From: Jim Meyering meyer...@redhat.com Avoid strncpy+manual-NUL-terminate. Use pstrcpy instead. Acked-by: Kevin Wolf kw...@redhat.com Signed-off-by: Jim Meyering meyer...@redhat.com --- block/vmdk.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/vmdk.c

[Qemu-devel] [PATCHv2 00/22] strncpy: best avoided

2012-05-30 Thread Jim Meyering
From: Jim Meyering meyer...@redhat.com Given qemu's HACKING comments, I'm sure many here have read man strncpy, where it indicates it is often not the best function to use. However, many of the uses of strncpy in qemu mistakenly fail to ensure that the destination buffer is NUL-terminated. The

[Qemu-devel] [RFC PATCH 4/4] migration: replace migration state change notifier with async notifiers

2012-05-30 Thread Yonit Halperin
Note that this patch leaves the current notifier handlers synchronous, i.e., they call the notifier completion callback immediately. Signed-off-by: Yonit Halperin yhalp...@redhat.com --- migration.c | 84 +- migration.h |8 -

[Qemu-devel] [PATCH 1.1] intel-hda: Fix reset of MSI function

2012-05-30 Thread Jan Kiszka
Call msi_reset on device reset as still required by the core. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- hw/intel-hda.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/hw/intel-hda.c b/hw/intel-hda.c index bb11af2..e38861e 100644 --- a/hw/intel-hda.c +++

[Qemu-devel] [PATCHv2 07/22] lm32: avoid buffer overrun

2012-05-30 Thread Jim Meyering
From: Jim Meyering meyer...@redhat.com Actually do what the comment says, using pstrcpy NUL-terminate: strncpy does not always do that. Signed-off-by: Jim Meyering meyer...@redhat.com --- hw/lm32_hwsetup.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/lm32_hwsetup.h

Re: [Qemu-devel] [PATCH qom-next 57/59] cpu: Introduce mandatory tlb_flush callback

2012-05-30 Thread Andreas Färber
Am 30.05.2012 11:28, schrieb Peter Maydell: On 23 May 2012 04:08, Andreas Färber afaer...@suse.de wrote: +void cpu_tlb_flush(CPUState *cpu, bool flush_global) +{ +CPUClass *cc = CPU_GET_CLASS(cpu); + +g_assert(cc-tlb_flush != NULL); + +cc-tlb_flush(cpu, flush_global); +}

[Qemu-devel] [PATCH 2/2] qmp: revert add set_echo implementation for qemu_chr_stdio

2012-05-30 Thread Pavel Hrdina
This reverts commit bb002513a9bd2bff169c3d431a8f00c5b2e3aa99 because this code is not used in order that we use readline mode for '-qmp stdio'. Conflicts: qemu-char.c Signed-off-by: Pavel Hrdina phrd...@redhat.com --- qemu-char.c | 26 ++ 1 files changed, 10

[Qemu-devel] [PATCH 1/2] qmp: use readline mode for stdio

2012-05-30 Thread Pavel Hrdina
Instead of using an echo for '-qmp stdio' we use a readline mode. The readline mode adds a history for users which is useful. Signed-off-by: Pavel Hrdina phrd...@redhat.com --- monitor.c | 83 +--- vl.c |3 ++ 2 files changed,

[Qemu-devel] [PATCH 0/2] qmp: implement readline handlig for stdio

2012-05-30 Thread Pavel Hrdina
For debug it would be nice to have a same functionality for the qmp monitor on stdio as the hmp monitor on stdio has. For this purpose we also use readline mode for qmp monitor on stdio. Because we don't need anymore an echo function for stdio, there is also revert of a commit, which added this

Re: [Qemu-devel] [PATCH 3/3] qapi: convert sendkey

2012-05-30 Thread Amos Kong
On 29/05/12 21:24, Luiz Capitulino wrote: On Tue, 29 May 2012 20:17:53 +0800 Amos Kongak...@redhat.com wrote: On 05/29/2012 07:57 PM, Amos Kong wrote: On 05/25/2012 09:14 PM, Anthony Liguori wrote: On 05/24/2012 10:51 PM, Eric Blake wrote: On 05/24/2012 09:32 PM, Amos Kong wrote: Convert

Re: [Qemu-devel] [PATCH qom-next 11/12] target-i386: initialize APIC at CPU level

2012-05-30 Thread Jan Kiszka
On 2012-05-30 00:10, Igor Mammedov wrote: (L)APIC is a part of cpu [1] so move APIC initialization inside of x86_cpu object. Since cpu_model and override flags currently specify whether APIC should be created or not, APIC creation is moved into cpu_model property setter. And APIC

Re: [Qemu-devel] [PATCH qom-next 01/12] store prev_debug_excp_handler globaly and not per target

2012-05-30 Thread Jan Kiszka
On 2012-05-30 00:10, Igor Mammedov wrote: current callers all do the same thing, storing in prev_debug_excp_handler previous handler and then calling it in breakpoint_handler. Move prev_debug_excp_handler from local scope to global and make cpu_set_debug_excp_handler() always to store previous

[Qemu-devel] [PATCH 19/25] PPC: e500: dt: create pci node dynamically

2012-05-30 Thread Alexander Graf
Signed-off-by: Alexander Graf ag...@suse.de --- hw/ppce500_mpc8544ds.c | 50 pc-bios/mpc8544ds.dtb | Bin 1810 - 72 bytes pc-bios/mpc8544ds.dts | 46 3 files changed, 50 insertions(+), 46

[Qemu-devel] [PATCH 13/25] PPC: e500: dt: create / node dynamically

2012-05-30 Thread Alexander Graf
Signed-off-by: Alexander Graf ag...@suse.de --- hw/ppce500_mpc8544ds.c |8 pc-bios/mpc8544ds.dtb | Bin 1904 - 1810 bytes pc-bios/mpc8544ds.dts |5 - 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/hw/ppce500_mpc8544ds.c b/hw/ppce500_mpc8544ds.c index

Re: [Qemu-devel] [PATCH] Avoid segfault in cpu_dump_state

2012-05-30 Thread Andreas Färber
Am 30.05.2012 09:58, schrieb Alexander Graf: On 23.05.2012, at 17:43, Fabien Chouteau wrote: On 05/16/2012 03:39 PM, Fabien Chouteau wrote: On 05/16/2012 10:29 AM, Fabien Chouteau wrote: On 05/16/2012 05:50 AM, Andreas Färber wrote: Am 15.05.2012 18:08, schrieb Fabien Chouteau: On

Re: [Qemu-devel] [PATCH V2] booke_206_tlbwe: Discard invalid bits in MAS2

2012-05-30 Thread Andreas Färber
Am 30.05.2012 10:13, schrieb Alexander Graf: On 21.05.2012, at 18:11, Fabien Chouteau wrote: The size of EPN field in MAS2 depends on page size. This patch adds a mask to discard invalid bits in EPN field. Definition of EPN field from e500v2 RM: EPN Effective page number: Depending on

[Qemu-devel] [PATCH 10/25] PPC: e500: dt: create memory node dynamically

2012-05-30 Thread Alexander Graf
Signed-off-by: Alexander Graf ag...@suse.de --- hw/ppce500_mpc8544ds.c |8 pc-bios/mpc8544ds.dtb | Bin 2028 - 1972 bytes pc-bios/mpc8544ds.dts |5 - 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/hw/ppce500_mpc8544ds.c b/hw/ppce500_mpc8544ds.c index

Re: [Qemu-devel] [PATCH V2] booke_206_tlbwe: Discard invalid bits in MAS2

2012-05-30 Thread Alexander Graf
On 30.05.2012, at 13:22, Andreas Färber wrote: Am 30.05.2012 10:13, schrieb Alexander Graf: On 21.05.2012, at 18:11, Fabien Chouteau wrote: The size of EPN field in MAS2 depends on page size. This patch adds a mask to discard invalid bits in EPN field. Definition of EPN field from

Re: [Qemu-devel] Android Goldfish on QEMU

2012-05-30 Thread Andreas Färber
Am 30.05.2012 00:30, schrieb Peter Maydell: On 28 May 2012 13:28, Stefan Hajnoczi stefa...@gmail.com wrote: Is goldfish still a relevant Android dev platform? In other words - would goldfish be useful to Android developers or just cool for QEMU hackers and old-school Android enthusiasts? I

[Qemu-devel] [PATCH 11/25] PPC: e500: dt: create /cpus node dynamically

2012-05-30 Thread Alexander Graf
Signed-off-by: Alexander Graf ag...@suse.de --- hw/ppce500_mpc8544ds.c |5 + pc-bios/mpc8544ds.dtb | Bin 1972 - 1924 bytes pc-bios/mpc8544ds.dts |5 - 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/hw/ppce500_mpc8544ds.c b/hw/ppce500_mpc8544ds.c index

Re: [Qemu-devel] [PATCH 0/3][v17] megasas: LSI Megaraid SAS HBA emulation

2012-05-30 Thread Alexander Graf
On 29.05.2012, at 13:51, Hannes Reinecke wrote: This is an updated patchset for megasas. Upon popular demand I've split it into three parts, the header file, the emulation itself, and a patch adding trace events to the emulation. Paolo, can you merge it via your tree? Or should I ask

[Qemu-devel] [PATCH 00/25] PPC: mpc8544ds: Create device tree dynamically

2012-05-30 Thread Alexander Graf
Today we have two separate places where we keep information which device is where: - hw/ppce500_mpc8544ds.c to instantiate all devices - pc-bios/mpc8544ds.dtb as device tree to tell the guest about devices Every time we split crucial information, things can go terribly wrong. If you update

Re: [Qemu-devel] [PATCH V2] booke_206_tlbwe: Discard invalid bits in MAS2

2012-05-30 Thread Andreas Färber
Am 30.05.2012 13:29, schrieb Alexander Graf: On 30.05.2012, at 13:22, Andreas Färber wrote: Am 30.05.2012 10:13, schrieb Alexander Graf: On 21.05.2012, at 18:11, Fabien Chouteau wrote: The size of EPN field in MAS2 depends on page size. This patch adds a mask to discard invalid bits in

[Qemu-devel] [PATCH 23/25] PPC: e500: dt: use target_phys_addr_t for ramsize

2012-05-30 Thread Alexander Graf
We're passing the ram size as uint32_t, capping it to 32 bits atm. Change to target_phys_addr_t (uint64_t) to make sure we have all the bits. Signed-off-by: Alexander Graf ag...@suse.de --- hw/ppce500_mpc8544ds.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git

Re: [Qemu-devel] [PATCH qom-next 02/12] target-xtensa: use global prev_debug_excp_handler instead of local one

2012-05-30 Thread Andreas Färber
Am 30.05.2012 00:10, schrieb Igor Mammedov: Signed-off-by: Igor Mammedov imamm...@redhat.com --- target-xtensa/helper.c |5 + 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/target-xtensa/helper.c b/target-xtensa/helper.c index 5e7e72e..e2ab83c 100644 ---

Re: [Qemu-devel] [PATCH qom-next 03/12] target-i386: use global prev_debug_excp_handler instead of local one

2012-05-30 Thread Andreas Färber
Am 30.05.2012 00:10, schrieb Igor Mammedov: Signed-off-by: Igor Mammedov imamm...@redhat.com --- target-i386/helper.c |5 + 1 files changed, 1 insertions(+), 4 deletions(-) diff --git a/target-i386/helper.c b/target-i386/helper.c index 2cc8097..da6f850 100644 ---

[Qemu-devel] Can we improve virtio data structures with QOM?

2012-05-30 Thread Markus Armbruster
Ordinary device models have a single state struct. The first member is a DeviceState or a specialization of DeviceState, e.g. a PCIDevice. Simple enough. Virtio device models are different. Their state struct is really a proxy object that contains (a suitable specialization of) DeviceState,

Re: [Qemu-devel] [PATCH qom-next 04/12] target-i386: move tcg initialization into x86_cpu_initfn()

2012-05-30 Thread Andreas Färber
Am 30.05.2012 00:10, schrieb Igor Mammedov: In order to make cpu object not depended on external ad-hoc initialization routines, move tcg initialization from cpu_x86_init inside cpu object x86_cpu_initfn(). Signed-off-by: Igor Mammedov imamm...@redhat.com Modulo the

Re: [Qemu-devel] [PATCH qom-next 07/12] target-i386: move cpu halted decision into x86_cpu_reset

2012-05-30 Thread Andreas Färber
Am 30.05.2012 00:10, schrieb Igor Mammedov: From: Igor Mammedov niall...@gmail.com MP initialization protocol differs between cpu families, and for P6 and onward models it is up to CPU to decide if it will be BSP using this protocol, so try to model this. However there is no point in

Re: [Qemu-devel] [PATCH 1/2] pci: Add pci_device_get_host_irq

2012-05-30 Thread Jan Kiszka
On 2012-05-21 23:03, Michael S. Tsirkin wrote: On Mon, May 21, 2012 at 05:35:34PM -0300, Jan Kiszka wrote: On 2012-05-21 16:05, Michael S. Tsirkin wrote: On Mon, May 21, 2012 at 10:13:47AM -0300, Jan Kiszka wrote: @@ -386,6 +387,14 @@ static void piix3_set_irq(void *opaque, int pirq, int

  1   2   3   >