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 Meyering wrote: From 402100deb7e27b1d7ac619ebac963f861fae91b0 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 7 May 2012 18:34:26 +0200 Subject: [PATCH] linux-user: remove two unchecked uses of st

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 Meyering wrote: From 402100deb7e27b1d7ac619ebac963f861fae91b0 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 7 May 2012 18:34:26 +0200 Subject: [PA

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 Meyering wrote: From 402100deb7e27b1d7ac619ebac963f861fae91b0 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 7 May 2012 18:

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 part

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 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 consistent. I'd love t

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 Wolf >> CC: Stefan Hajnoczi >> Signed-off-by: Dong Xu Wang > > You should split out the spec to

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 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 close it when you'r

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 wrote: > Signed-off-by: MORITA Kazutaka > --- > > Changes from v1: >  - use spaces for indentation > >  block/sheepdog.c |    9 + >  1 files changed, 5 insertions(+), 4 deletions(-) It's worth mentioning that this does not affect the binar

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 wrote: > On 30 May 2012 08:33, Stefan Hajnoczi 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

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 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 sty

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

2012-05-30 Thread Jim Meyering
From: Jim Meyering 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 Signed-off-by: Jim Meyering --- block.c | 5 +++-- 1 file changed, 3 insert

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

2012-05-30 Thread Jim Meyering
From: Jim Meyering Signed-off-by: Jim Meyering --- 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, } if (kernel_cmdline) { +

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 Meyering 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 > wrote: >> Signed-off-by: MORITA Kazutaka >> --- >> >> Changes from v1: >> - use spaces for indentation >> >> block/sheepdog.c |9 + >> 1 files changed, 5 insertions(+), 4 deletions(-)

Re: [Qemu-devel] Virtio-pci issue

2012-05-30 Thread Stefan Hajnoczi
On Tue, May 29, 2012 at 4:48 AM, Evgeny Voevodin wrote: > On 28.05.2012 16:37, Stefan Hajnoczi wrote: >> >> On Thu, May 24, 2012 at 4:18 AM, Evgeny Voevodin >>  wrote: >>> >>> And also there is another problem that I've faced with. It is the ability >>> to >>> plug as many pci back-ends as board w

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

2012-05-30 Thread Jim Meyering
From: Jim Meyering 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 --- target-ppc/kvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(

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 wrot

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 > --- > Changes from v1 > - return an error for short reads/writes > - fix a coding style problem Thanks,

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

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

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 Cho

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

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 wrote: > On Tue, May 29, 2012 at 11:50 PM, Stefan Hajnoczi wrote: I thought a bit more about locking. Because the metadata is simple not much locking is necessary except when fetching new bitmap clusters from the image file into the cache and when p

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

2012-05-30 Thread Jim Meyering
From: Jim Meyering 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: strlen(slave->lmp_name) is g

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 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 that refcou

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

2012-05-30 Thread Jim Meyering
From: Jim Meyering 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 Signed-off-by: Jim Meyering --- hw/spapr_vscs

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

2012-05-30 Thread Jim Meyering
From: Jim Meyering 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 Signed-off-by: Jim Meyering --- hw/9pfs/virtio-9p-

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

2012-05-30 Thread Jim Meyering
From: Jim Meyering 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 ifr_name consistent w

[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 Signed-off-by: Jan Kiszka --- 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 560ae37..242254e 100644 --- a/hw/ide/ich.c +++

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 mean

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

2012-05-30 Thread Jim Meyering
From: Jim Meyering * 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. * sd_snapshot_create: Add a

[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: http://m

[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 the

[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, ju

[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, ju

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 Sy

[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 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 g_strdup. In one case,

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 c

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

2012-05-30 Thread Jim Meyering
From: Jim Meyering Acked-by: Kevin Wolf Signed-off-by: Jim Meyering --- 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 @@ -994,6 +994,7 @@ int qcow2_update_header(BlockDriverS

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 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 wrote: > > > > > > > Hi, > > > > > > >

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

2012-05-30 Thread Jim Meyering
From: Jim Meyering 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 Signed-off-by: Jim Meyering --- hw/9pfs/virtio-9p-synth.c | 4 ++-

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 q

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

[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. Curr

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

2012-05-30 Thread Jim Meyering
From: Jim Meyering 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 --- HACKING | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/HACKING b/HACKING index 471cf1d..dd

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

2012-05-30 Thread Jim Meyering
From: Jim Meyering 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 --- os-posix.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/os-posix.c b/os-posix.c index daf3d6f..2a

[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, ju

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 ex

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

2012-05-30 Thread Yonit Halperin
Signed-off-by: Yonit Halperin --- input.c |2 +- migration.c |2 +- notify.c | 79 +++--- notify.h | 55 --- qemu-timer.c |2 +- vl.c |2 +- 6 files changed, 129 inser

[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 --- migration.c | 73 +- migration.h |2 + 2 files changed, 58 insertions(+), 17 deletions(-) diff --git a/migration.c b/migration.c index a

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

2012-05-30 Thread Jim Meyering
From: Jim Meyering 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 --- target-i386/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -

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

2012-05-30 Thread Jim Meyering
From: Jim Meyering 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 --- ui/vnc-auth-sasl.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ui/vnc-auth-sasl.c b/ui/vnc-auth

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

2012-05-30 Thread Jim Meyering
From: Jim Meyering Signed-off-by: Jim Meyering --- 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 scsi_target_emulate_inquiry(SCSITargetReq *r)

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

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

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

[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 --- migration.c | 31 --- migration.h |1 + 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/migration.c b/migration.c index 91c807d..c86611d 100644 ---

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 One empty line that snuck in below. > --- > input.c |2 +- > migration.c |2 +- > notify.c | 79 > +++--- > notify.h | 5

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 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 rather

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

2012-05-30 Thread Jim Meyering
From: Jim Meyering 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 Signed-off-by: Jim Meyering --- linux-user/elfload.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/linux

[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 th

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

2012-05-30 Thread Alex Williamson
Signed-off-by: Alex Williamson --- 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 100644 index 000..124087

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

2012-05-30 Thread Jim Meyering
From: Jim Meyering 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 Signed-off-by: Jim Meyering --- libcacard/Makefile | 2 +- libcacard/vcard_emul_nss.c | 3 +-

[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 Voevodin wrote: On 28.05.2012 16:37, Stefan Hajnoczi wrote: On Thu, May 24, 2012 at 4:18 AM, Evgeny Voevodin wrote: And also there is another problem that I've faced with. It is the ability to plug as many p

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

2012-05-30 Thread Jim Meyering
From: Jim Meyering Avoid strncpy+manual-NUL-terminate. Use pstrcpy instead. Acked-by: Kevin Wolf Signed-off-by: Jim Meyering --- block/vmdk.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index 18e9b4c..bfd7357 100644 --- a/block/vmdk.c +++

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

2012-05-30 Thread Jim Meyering
From: Jim Meyering 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 first 7 c-sets fix

[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 --- migration.c | 84 +- migration.h |8 - ui/spice-core.c |

[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 --- 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 +++ b/hw/intel-hda.c @@ -1107,6

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

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

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 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 --- qemu-char.c | 26 ++ 1 files changed, 10 insertions(+), 16 d

[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 --- monitor.c | 83 +--- vl.c |3 ++ 2 files changed, 81 insertions(+), 5

[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 f

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 Kong 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 'sendkey' to use.

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 initializa

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 previ

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

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

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

2012-05-30 Thread Alexander Graf
Signed-off-by: Alexander Graf --- 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 6ad2897..39b221d 10

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 Chou

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: Dep

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

2012-05-30 Thread Alexander Graf
Signed-off-by: Alexander Graf --- 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 f162cd3..650c910 10

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

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 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 would s

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

2012-05-30 Thread Alexander Graf
Signed-off-by: Alexander Graf --- 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 650c910..106251e 10064

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 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 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 dis

[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 --- hw/ppce500_mpc8544ds.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/ppce500_mpc8544ds.c

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 > --- > 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 > --- a/target-xtensa/helper

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 > --- > 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 > --- a/target-i386/helper.c > +++

[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, co

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 Modulo the cpu_set_debug_excp_handler() issue th

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 > > 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 implementing > MP ini

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,

[Qemu-devel] [PATCH 24/25] PPC: e500: enable manual loading of dtb blob

2012-05-30 Thread Alexander Graf
We want to be able to override the automatically created device tree by using the -dtb option. Implement this for the mpc8544ds machine. Signed-off-by: Alexander Graf --- hw/ppce500_mpc8544ds.c | 26 ++ 1 files changed, 22 insertions(+), 4 deletions(-) diff --git a/hw/

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:54, Andreas Färber wrote: > 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

[Qemu-devel] [PATCH 21/25] dt: Add -machine dumpdtb option to dump the current dtb

2012-05-30 Thread Alexander Graf
Now that we are dynamically creating the dtb, it's really useful to be able to dump the created blob for debugging. This patch implements a -machine dumpdtb= option for e500 that dumps the dtb exactly in the form the guest would get it to disk. It can then be analyzed by dtc to get information abo

[Qemu-devel] [PATCH 07/25] dt: add helper for phandle allocation

2012-05-30 Thread Alexander Graf
Phandle references work by having 2 pieces: - a "phandle" 1-cell property in the device tree node - a reference to the same value in a property we want to point to the other node To generate the 1-cell property, we need an allocation mechanism that gives us a unique number space. This pat

[Qemu-devel] [PATCH 16/25] PPC: e500: dt: create serial nodes dynamically

2012-05-30 Thread Alexander Graf
Signed-off-by: Alexander Graf --- hw/ppce500_mpc8544ds.c | 35 +++ pc-bios/mpc8544ds.dts | 26 -- 2 files changed, 35 insertions(+), 26 deletions(-) diff --git a/hw/ppce500_mpc8544ds.c b/hw/ppce500_mpc8544ds.c index 5ff2d24..493ad6e 10

  1   2   3   >