Re: [Qemu-devel] [PATCH v5 10/10] hw/arm/dyn_sysbus_devtree: enable simple VFIO dynamic instantiation

2014-08-19 Thread Eric Auger
On 08/18/2014 11:54 PM, Joel Schopp wrote: > > +static void vfio_fdt_add_device_node(SysBusDevice *sbdev, void *opaque) > +{ > +PlatformDevtreeData *data = opaque; > +void *fdt = data->fdt; > +const char *parent_node = data->node; > +int compat_str_len; > +char *nodename; > +

Re: [Qemu-devel] [PATCH v2 4/4] block: Drop some superfluous casts from void *

2014-08-19 Thread Markus Armbruster
Max Reitz writes: > On 18.08.2014 18:10, Markus Armbruster wrote: >> They clutter the code. Unfortunately, I can't figure out how to make >> Coccinelle drop all of them, so I have to settle for common special >> cases: >> >> @@ >> type T; >> T *pt; >> void *pv; >> @@ >>

Re: [Qemu-devel] [PATCH v2 4/4] block: Drop some superfluous casts from void *

2014-08-19 Thread Markus Armbruster
Jeff Cody writes: > On Mon, Aug 18, 2014 at 06:10:43PM +0200, Markus Armbruster wrote: >> They clutter the code. Unfortunately, I can't figure out how to make >> Coccinelle drop all of them, so I have to settle for common special >> cases: >> >> @@ >> type T; >> T *pt; >> void *

Re: [Qemu-devel] [PATCH 1/3] docs: List all image elements currently supported by the fuzzer

2014-08-19 Thread Fam Zheng
On Mon, 08/11 15:55, Maria Kustova wrote: > Signed-off-by: Maria Kustova > --- > docs/image-fuzzer.txt | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/docs/image-fuzzer.txt b/docs/image-fuzzer.txt > index 0d0005d..f707269 100644 > --- a/docs/image-fuzzer.txt > +++ b/do

Re: [Qemu-devel] [Qemu-trivial] [PATCH v6 03/10] virtio-blk: fix reference a pointer which might be freed

2014-08-19 Thread Michael Tokarev
19.08.2014 00:17, Michael S. Tsirkin wrote: [] > By the way, could you please add Cc qemu-stable on bugfixes > you have queued? > These are likely appopriate for 2.1.1. Actually I've added Cc: qemu-stable@ in the commit message. So it will go to stable (or should) once I'll send a pull request. T

[Qemu-devel] [PATCH] pcihp: fix possible array out of bounds

2014-08-19 Thread arei.gonglei
From: Gonglei When 'bsel == ACPI_PCIHP_MAX_HOTPLUG_BUS', the s->acpi_pcihp_pci_status[bsel] array will out of bounds. Add check for this. Signed-off-by: Gonglei --- hw/acpi/pcihp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c index fae6

Re: [Qemu-devel] [PATCH] configure: no need to mkdir QMP

2014-08-19 Thread Michael Tokarev
Applied to -trivial, thank you! /mjt

Re: [Qemu-devel] [PATCH v5 10/10] hw/arm/dyn_sysbus_devtree: enable simple VFIO dynamic instantiation

2014-08-19 Thread Eric Auger
On 08/19/2014 12:11 AM, Peter Maydell wrote: > On 18 August 2014 22:54, Joel Schopp wrote: >> >> +static void vfio_fdt_add_device_node(SysBusDevice *sbdev, void *opaque) >> +{ >> +PlatformDevtreeData *data = opaque; >> +void *fdt = data->fdt; >> +const char *parent_node = data->node; >

Re: [Qemu-devel] [Qemu-trivial] [PATCH v7] slirp/misc: Use g_malloc() instead of malloc()

2014-08-19 Thread zhanghailiang
On 2014/8/18 19:32, Michael Tokarev wrote: 18.08.2014 11:51, zhanghailiang пишет: Here we don't check the return value of malloc() which may fail. Use the g_malloc() instead, which will abort the program when there is not enough memory. Signed-off-by: zhanghailiang Reviewed-by: Alex Bennée ---

Re: [Qemu-devel] [Qemu-trivial] [PATCH v7] slirp/misc: Use g_malloc() instead of malloc()

2014-08-19 Thread Michael Tokarev
19.08.2014 11:30, zhanghailiang wrote: [] > Hmm, it is a good idea to use g_new instead of g_malloc, > we have to perform type cast for g_malloc.(BTW, i found in qemu there > are several places use g_malloc but not perform appropriate type > coercions) There's no need to perform explicit type conv

Re: [Qemu-devel] [PATCH v5 10/10] hw/arm/dyn_sysbus_devtree: enable simple VFIO dynamic instantiation

2014-08-19 Thread Eric Auger
On 08/19/2014 12:26 AM, Joel Schopp wrote: > > On 08/18/2014 05:11 PM, Peter Maydell wrote: >> On 18 August 2014 22:54, Joel Schopp wrote: >>> +static void vfio_fdt_add_device_node(SysBusDevice *sbdev, void *opaque) >>> +{ >>> +PlatformDevtreeData *data = opaque; >>> +void *fdt = data->fd

Re: [Qemu-devel] [PATCH 2/3] fuzz: Add fuzzing functions for entries of refcount table and blocks

2014-08-19 Thread Fam Zheng
On Mon, 08/11 15:55, Maria Kustova wrote: > Signed-off-by: Maria Kustova > --- > tests/image-fuzzer/qcow2/fuzz.py | 16 +++- > 1 file changed, 15 insertions(+), 1 deletion(-) > > diff --git a/tests/image-fuzzer/qcow2/fuzz.py > b/tests/image-fuzzer/qcow2/fuzz.py > index 57527f9..5852

Re: [Qemu-devel] [RFC 0/4] Adding -cdrom, -hd[abcd] and -drive file=... to Q35

2014-08-19 Thread Markus Armbruster
John Snow writes: > Currently, the drive definitions created by drive_new() when using > the -drive file=...[,if=ide] or -cdrom or -hd[abcd] options are not > picked up by the Q35 initialization routine. > > To fix this, we have to add hooks to search for these drives using > something like pc_pi

Re: [Qemu-devel] [Question] Why doesn't PCIe hotplug work for Q35 machine?

2014-08-19 Thread Paolo Bonzini
Il 19/08/2014 08:25, Gonglei (Arei) ha scritto: > > 1. Does qemu support ARI Forwarding for PCIe at present? If yes, how to > enable it ? No, not yet. > 2. If not, we should add some check for PCIe root ports and downstream ports, > meanwhile add explaining document. > 3. Those check should ad

Re: [Qemu-devel] [Question] Why doesn't PCIe hotplug work for Q35 machine?

2014-08-19 Thread Gonglei (Arei)
Hi, > -Original Message- > From: Paolo Bonzini [mailto:pbonz...@redhat.com] > Sent: Tuesday, August 19, 2014 4:06 PM > To: Gonglei (Arei); Marcel Apfelbaum; Michael S. Tsirkin > Cc: qemu-devel@nongnu.org; imamm...@redhat.com; arm...@redhat.com; > Huangweidong (C) > Subject: Re: [Question]

Re: [Qemu-devel] [PATCH v5 10/10] hw/arm/dyn_sysbus_devtree: enable simple VFIO dynamic instantiation

2014-08-19 Thread Peter Maydell
On 19 August 2014 08:24, Eric Auger wrote: > Putting size=1 was the only solution I found to use an offset relative > to the parent bus instead of an absolute base address. I would explain > this because, in platform_bus_create_devtree, the function that creates > the "platform bus" node, #address

Re: [Qemu-devel] [PATCH V3] spapr: Fix stale HTAB during live migration

2014-08-19 Thread Dr. David Alan Gilbert
* Samuel Mendoza-Jonas (sam...@au1.ibm.com) wrote: > If a guest reboots during a running migration, changes to the > hash page table are not necessarily updated on the destination. > Opening a new file descriptor to the HTAB forces the migration > handler to resend the entire table. Yes I think th

[Qemu-devel] [PATCH v8] slirp/misc: Use the GLib memory allocation APIs

2014-08-19 Thread zhanghailiang
Here we don't check the return value of malloc() which may fail. Use the g_new() instead, which will abort the program when there is not enough memory. Also, use g_strdup instead of strdup and remove the unnecessary strdup function. Signed-off-by: zhanghailiang Reviewed-by: Alex Bennée --- sli

[Qemu-devel] [PATCH v3 4/4] block: Drop some superfluous casts from void *

2014-08-19 Thread Markus Armbruster
They clutter the code. Unfortunately, I can't figure out how to make Coccinelle drop all of them, so I have to settle for common special cases: @@ type T; T *pt; void *pv; @@ - pt = (T *)pv; + pt = pv; @@ type T; @@ - (T *) (\(g_malloc\|g_malloc0\

[Qemu-devel] [PATCH v3 1/4] block: Use g_new() & friends where that makes obvious sense

2014-08-19 Thread Markus Armbruster
g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, for two reasons. One, it catches multiplication overflowing size_t. Two, it returns T * rather than void *, which lets the compiler catch more type errors. Patch created with Coccinelle, with two manual changes on top: * Add c

[Qemu-devel] [PATCH v3 0/4] block: Use g_new() & friends more

2014-08-19 Thread Markus Armbruster
PATCH 1+2 convert some allocations. While preparing them, I stumbled over dead error handling and some useless casts, which led to PATCH 3+4. I posted a tree-wide version of PATCH 1 some time ago, and was told to split it up. This is the block part, redone from scratch. Other parts available on

[Qemu-devel] [PATCH v3 2/4] block: Use g_new() & friends to avoid multiplying sizes

2014-08-19 Thread Markus Armbruster
g_new(T, n) is safer than g_malloc(sizeof(*v) * n) for two reasons. One, it catches multiplication overflowing size_t. Two, it returns T * rather than void *, which lets the compiler catch more type errors. Perhaps a conversion to g_malloc_n() would be neater in places, but that's merely four yea

[Qemu-devel] [PULL v2 03/23] linux-user: Fix syscall instruction usermode emulation on X86_64

2014-08-19 Thread riku . voipio
From: Jincheng Miao Currently syscall instruction is buggy on user mode X86_64, the EIP is updated after do_syscall(), that is too late for clone(). Because clone() will create a thread at the env->EIP (the address of syscall insn), and then child thread enters do_syscall() again, that is not exp

[Qemu-devel] [PULL v2 05/23] linux-user: fix readlink handling with magic exe symlink

2014-08-19 Thread riku . voipio
From: Mike Frysinger The current code always returns the length of the path when it should be returning the number of bytes it wrote to the output string. Further, readlink is not supposed to append a NUL byte, but the current snprintf logic will always do just that. Even further, if you pass i

[Qemu-devel] [PATCH v3 3/4] qemu-io-cmds: g_renew() can't fail, bury dead error handling

2014-08-19 Thread Markus Armbruster
Signed-off-by: Markus Armbruster Reviewed-by: Max Reitz Reviewed-by: Jeff Cody --- qemu-io-cmds.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c index afd8867..b224ede 100644 --- a/qemu-io-cmds.c +++ b/qemu-io-cmds.c @@ -115,22 +1

[Qemu-devel] [PULL v2 07/23] linux-user: support ioprio_{get, set} syscalls

2014-08-19 Thread riku . voipio
From: Paul Burton Add support for the ioprio_get & ioprio_set syscalls, allowing their use by target programs. Signed-off-by: Paul Burton Signed-off-by: Riku Voipio --- linux-user/syscall.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/linux-user/syscall.c b/linux-us

[Qemu-devel] [PULL v2 11/23] linux-user: Dereference Pointer Argument to ipc/semctl Sys Call

2014-08-19 Thread riku . voipio
From: Tom Musta When the ipc system call is used to wrap a semctl system call, the ptr argument to ipc needs to be dereferenced prior to passing it to the semctl handler. This is because the fourth argument to semctl is a union and not a pointer to a union. Signed-off-by: Tom Musta Signed-off-

[Qemu-devel] [PULL v2 00/23] linux-user updates

2014-08-19 Thread riku . voipio
From: Riku Voipio The same as previous series, except the patch "make binfmt flag O require P" has been dropped. The following changes since commit 142f4ac5d5e024670ef4725e8943702b027e4218: Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-2014-08-15' into staging (2014-08-15 18

[Qemu-devel] [PULL v2 08/23] linux-user: support {name_to, open_by}_handle_at syscalls

2014-08-19 Thread riku . voipio
From: Riku Voipio Implement support for the name_to_handle_at and open_by_handle_at syscalls, allowing their use by the target program. Modified by Riku - move syscalls to functions and put behind the already existing CONFIG_OPEN_BY_HANDLE to avoid build failure with old glibc's. Signed-off-by:

[Qemu-devel] [PULL v2 01/23] linux-user: /proc/self/maps content

2014-08-19 Thread riku . voipio
From: Mikhail Ilyin Build /proc/self/maps doing a match against guest memory translation table. Output only that map records which are valid for guest memory layout. Signed-off-by: Mikhail Ilyin Signed-off-by: Riku Voipio --- include/exec/cpu-all.h | 2 ++ linux-user/syscall.c | 25 +++

[Qemu-devel] [PULL v2 02/23] linux-user: redirect openat calls

2014-08-19 Thread riku . voipio
From: Riku Voipio While Mikhail fixed /proc/self/maps, it was noticed openat calls are not redirected currently. Some archs don't have open at all, so openat needs to be redirected. Fix this by consolidating open/openat code to do_openat - open is implemented using openat(AT_FDCWD, ... ), which

[Qemu-devel] [PULL v2 12/23] linux-user: Properly Handle semun Structure In Cross-Endian Situations

2014-08-19 Thread riku . voipio
From: Tom Musta The semun union used in the semctl system call contains both an int (val) and pointers. In cross-endian situations on 64 bit targets, the value passed to semctl is an 8 byte (abi_long) value and thus does not have the 4-byte val field in the correct location. In order to rectify

[Qemu-devel] [PULL v2 09/23] linux-user: add setns and unshare

2014-08-19 Thread riku . voipio
From: Riku Voipio Add support for the setns and unshare syscalls, trivially passed through to the host. Based on patches by Paul Burton, added configure check. Signed-off-by: Paul Burton Signed-off-by: Riku Voipio --- configure | 20 linux-user/strace.list |

[Qemu-devel] [PULL v2 06/23] linux-user: support timerfd_{create, gettime, settime} syscalls

2014-08-19 Thread riku . voipio
From: Riku Voipio Adds support for the timerfd_create, timerfd_gettime & timerfd_settime syscalls, allowing use of timerfds by target programs. v2: By Riku - added configure check for timerfd and ifdefs for benefit of old distributions like RHEL5. Signed-off-by: Paul Burton Signed-off-by: Riku

[Qemu-devel] [PULL v2 13/23] linux-user: Make ipc syscall's third argument an abi_long

2014-08-19 Thread riku . voipio
From: Tom Musta For those target ABIs that use the ipc system call (e.g. POWER), the third argument is used in the shmat path as a pointer. It therefore must be declared as an abi_long (versus int) so that the address bits are not lost in truncation. In fact, all arguments to do_ipc should be d

[Qemu-devel] [PULL v2 16/23] linux-user: Handle NULL sched_param argument to sched_*

2014-08-19 Thread riku . voipio
From: Tom Musta The sched_getparam, sched_setparam and sched_setscheduler system calls take a pointer argument to a sched_param structure. When this pointer is null, errno should be set to EINVAL. Signed-off-by: Tom Musta Signed-off-by: Riku Voipio --- linux-user/syscall.c | 10 ++ 1

[Qemu-devel] [PULL v2 10/23] linux-user: PPC64 semid_ds Doesnt Include _unused1 and _unused2

2014-08-19 Thread riku . voipio
From: Tom Musta The 64 bit PowerPC platforms eliminate the _unused1 and _unused2 elements of the semid_ds structure from . So eliminate these from the target_semid_ds structure. Signed-off-by: Tom Musta Signed-off-by: Riku Voipio --- linux-user/syscall.c | 4 1 file changed, 4 insertion

[Qemu-devel] [PULL v2 15/23] linux-user: Detect Negative Message Sizes in msgsnd System Call

2014-08-19 Thread riku . voipio
From: Tom Musta The msgsnd system call takes an argument that describes the message size (msgsz) and is of type size_t. The system call should set errno to EINVAL in the event that a negative message size is passed. Signed-off-by: Tom Musta Reviewed-by: Peter Maydell Signed-off-by: Riku Voipi

[Qemu-devel] [PULL v2 20/23] linux-user: clock_nanosleep errno Handling on PPC

2014-08-19 Thread riku . voipio
From: Tom Musta The clock_nanosleep syscall is unusual in that it returns positive numbers in error handling situations, versus returning -1 and setting errno, or returning a negative errno value. On POWER, the kernel will set the SO bit of CR0 to indicate failure in a syscall. QEMU has generic

[Qemu-devel] [PULL v2 04/23] linux-user: Fix conversion of sigevent argument to timer_create

2014-08-19 Thread riku . voipio
From: Peter Maydell There were a number of bugs in the conversion of the sigevent argument to timer_create from target to host format: * signal number not converted from target to host * thread ID not copied across * sigev_value not copied across * we never unlocked the struct when we were do

[Qemu-devel] [PULL v2 23/23] linux-user: check return value of malloc()

2014-08-19 Thread riku . voipio
From: zhanghailiang Signed-off-by: zhanghailiang Acked-by: Riku Voipio Signed-off-by: Riku Voipio --- linux-user/syscall.c | 4 1 file changed, 4 insertions(+) diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 3b1beff..3aaed81 100644 --- a/linux-user/syscall.c +++ b/linux-u

[Qemu-devel] [PULL v2 22/23] linux-user: writev Partial Writes

2014-08-19 Thread riku . voipio
From: Tom Musta Although not technically not required by POSIX, the writev system call will typically write out its buffers individually. That is, if the first buffer is written successfully, but the second buffer pointer is invalid, then the first chuck will be written and its size is returned.

[Qemu-devel] [PULL v2 17/23] linux-user: Detect fault in sched_rr_get_interval

2014-08-19 Thread riku . voipio
From: Tom Musta Properly detect a fault when attempting to store into an invalid struct timespec pointer. Signed-off-by: Tom Musta Reviewed-by: Peter Maydell Signed-off-by: Riku Voipio --- linux-user/syscall.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux-user/sys

[Qemu-devel] [PULL v2 14/23] linux-user: Conditionally Pass Attribute Pointer to mq_open()

2014-08-19 Thread riku . voipio
From: Tom Musta The mq_open system call takes an optional struct mq_attr pointer argument in the fourth position. This pointer is used when O_CREAT is specified in the flags (second) argument. It may be NULL, in which case the queue is created with implementation defined attributes. Change the

[Qemu-devel] [PULL v2 18/23] linux-user: Move get_ppc64_abi

2014-08-19 Thread riku . voipio
From: Tom Musta The get_ppc64_abi is used to determine the ELF ABI (i.e. V1 or V2). This routine is currently implemented in the linux-user/elfload.c file but is useful in other scenarios. Move the routine to a more generally available location (linux-user/ppc/target_cpu.h). Signed-off-by: Tom

Re: [Qemu-devel] Microcheckpointing: Memory-VCPU / Disk State consistency

2014-08-19 Thread Walid Nouri
Hi, I have tried to find more information on how to use drive-mirror besides what is available on the wiki. This was not very satisfactory... This may sound naive but are there some code examples in "c" or any other language, documentation of any kind, blog entries (developer), presentation vid

Re: [Qemu-devel] [PATCH v2 4/4] block: Drop some superfluous casts from void *

2014-08-19 Thread Markus Armbruster
Markus Armbruster writes: > Jeff Cody writes: > >> On Mon, Aug 18, 2014 at 06:10:43PM +0200, Markus Armbruster wrote: >>> They clutter the code. Unfortunately, I can't figure out how to make >>> Coccinelle drop all of them, so I have to settle for common special >>> cases: >>> >>> @@ >>>

[Qemu-devel] [PULL v2 21/23] linux-user: Support target-to-host translation of mlockall argument

2014-08-19 Thread riku . voipio
From: Tom Musta The argument to the mlockall system call is not necessarily the same on all platforms and thus may require translation prior to passing to the host. For example, PowerPC 64 bit platforms define values for MCL_CURRENT (0x2000) and MCL_FUTURE (0x4000) which are different from Intel

[Qemu-devel] [PULL v2 19/23] linux-user: Minimum Sig Handler Stack Size for PPC64 ELF V2

2014-08-19 Thread riku . voipio
From: Tom Musta The ELF V2 ABI for PPC64 defines MINSIGSTKSZ as 4096 bytes whereas it was 2048 previously. Signed-off-by: Tom Musta Signed-off-by: Riku Voipio --- linux-user/aarch64/syscall.h| 1 + linux-user/alpha/syscall.h | 1 + linux-user/arm/syscall.h| 2 ++ linux-use

Re: [Qemu-devel] [PATCH] net: Forbid dealing with packets when VM is not running

2014-08-19 Thread Dr. David Alan Gilbert
* zhanghailiang (zhang.zhanghaili...@huawei.com) wrote: > On 2014/8/18 20:27, Dr. David Alan Gilbert wrote: > >* zhanghailiang (zhang.zhanghaili...@huawei.com) wrote: > >>For all NICs(except virtio-net) emulated by qemu, > >>Such as e1000, rtl8139, pcnet and ne2k_pci, > >>Qemu can still receive pac

Re: [Qemu-devel] Microcheckpointing: Memory-VCPU / Disk State consistency

2014-08-19 Thread Walid Nouri
Hi Paolo, thanks for your hint. I missed your mail from last sunday. I will take a look on that! Walid > Am 17.08.2014 um 11:52 schrieb Paolo Bonzini : > > Il 11/08/2014 22:15, Michael R. Hines ha scritto: >> Excellent question: QEMU does have a feature called "drive-mirror" >> in block/mirror.c

Re: [Qemu-devel] [PATCH V2 0/2] runner: Control test duration

2014-08-19 Thread Stefan Hajnoczi
On Tue, Aug 19, 2014 at 12:02:33AM +0400, Maria Kustova wrote: > The first patch adds the '--duration SECONDS' argument. After the specified > duration the runner allows to end the current test and then exits. > > The second patch adds forced termination of a program under test, if the test > exec

Re: [Qemu-devel] [PULL] virtio-serial: avoid duplicate port names

2014-08-19 Thread Peter Maydell
On 18 August 2014 18:18, Amit Shah wrote: > Hi, > > Patches have been on list for a while.. > > The following changes since commit 08ab59770da57648bfb8fc9be37f0ef7fb50b0f9: > > Merge remote-tracking branch 'remotes/mcayland/qemu-sparc' into staging > (2014-08-18 12:55:02 +0100) > > are availabl

Re: [Qemu-devel] [PATCH 3/3] layout: Add generators for refcount tbles and blocks

2014-08-19 Thread Fam Zheng
On Mon, 08/11 15:55, Maria Kustova wrote: > Refcount structures are placed in clusters randomly selected from all not > allocated host clusters. s/not allocated/unallocated/ > > Signed-off-by: Maria Kustova > --- > tests/image-fuzzer/qcow2/layout.py | 136 > +++

Re: [Qemu-devel] [PATCH] image-fuzzer: Trivial readability and formatting improvements

2014-08-19 Thread Stefan Hajnoczi
On Tue, Aug 19, 2014 at 02:00:24AM +0400, Maria Kustova wrote: > diff --git a/tests/image-fuzzer/qcow2/fuzz.py > b/tests/image-fuzzer/qcow2/fuzz.py > index 6e272c6..c652dc9 100644 > --- a/tests/image-fuzzer/qcow2/fuzz.py > +++ b/tests/image-fuzzer/qcow2/fuzz.py > @@ -123,7 +123,7 @@ def string_val

[Qemu-devel] [PATCH 3/3] pcie: using error_setg instead of impolite assert

2014-08-19 Thread arei.gonglei
From: Gonglei It's enough of reporting an error. Assert() is not acceptable because the error is not a fatal error. Signed-off-by: Gonglei --- hw/pci/pcie.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hw/pci/pcie.c b/hw/pci/pcie.c index a123c01..7b46140 100644 ---

[Qemu-devel] [PATCH 2/3] qdev: Refactor device_set_realized to avoid resource leak

2014-08-19 Thread arei.gonglei
From: Gonglei At present, the local variable local_err is reused at multi-places, Which will cause resource leak in some scenarios. Example: 1. Assuming that "dc->realize(dev, &local_err)" execute successful and local_err == NULL; 2. Executing device hotplug in hotplug_handler_plug(), but fa

[Qemu-devel] [PATCH 1/3] qdev: add missing error check

2014-08-19 Thread arei.gonglei
From: Gonglei If local_err is not null, the next code logic is useless. Signed-off-by: Gonglei --- hw/core/qdev.c | 5 + 1 file changed, 5 insertions(+) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index da1ba48..3e7085e 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -830,6 +830,11 @

[Qemu-devel] [PATCH 0/3] Refactor device_set_realized to avoid resource leak.

2014-08-19 Thread arei.gonglei
From: Gonglei after committing [PATCH v6 0/9] Refactor PCI/SHPC/PCIE hotplug to use a more generic hotplug API if devcie hotplgging failed, will casuse resource leak. This patch series include address resouce leak and two other issuses. BTW, for patch 2/3, checkpatch.py report a warning, b

Re: [Qemu-devel] [PATCH] image-fuzzer: Trivial readability and formatting improvements

2014-08-19 Thread Fam Zheng
On Tue, 08/19 02:00, Maria Kustova wrote: > Signed-off-by: Maria Kustova > --- > tests/image-fuzzer/qcow2/fuzz.py | 15 ++-- > tests/image-fuzzer/runner.py | 51 > > 2 files changed, 34 insertions(+), 32 deletions(-) > > diff --git a/tests/im

Re: [Qemu-devel] [PATCH] image-fuzzer: Trivial readability and formatting improvements

2014-08-19 Thread M.Kustova
On Tue, Aug 19, 2014 at 1:38 PM, Stefan Hajnoczi wrote: > On Tue, Aug 19, 2014 at 02:00:24AM +0400, Maria Kustova wrote: >> diff --git a/tests/image-fuzzer/qcow2/fuzz.py >> b/tests/image-fuzzer/qcow2/fuzz.py >> index 6e272c6..c652dc9 100644 >> --- a/tests/image-fuzzer/qcow2/fuzz.py >> +++ b/tests

Re: [Qemu-devel] [PATCH] image-fuzzer: Trivial readability and formatting improvements

2014-08-19 Thread M.Kustova
On Tue, Aug 19, 2014 at 1:44 PM, Fam Zheng wrote: > On Tue, 08/19 02:00, Maria Kustova wrote: >> Signed-off-by: Maria Kustova >> --- >> tests/image-fuzzer/qcow2/fuzz.py | 15 ++-- >> tests/image-fuzzer/runner.py | 51 >> >> 2 files changed, 3

Re: [Qemu-devel] [PATCH 09/11] target-arm: Implement ARMv8 single-step handling for A64 code

2014-08-19 Thread Edgar E. Iglesias
On Fri, Aug 08, 2014 at 01:18:12PM +0100, Peter Maydell wrote: > Implement ARMv8 software single-step handling for A64 code: > correctly update the single-step state machine and generate > debug exceptions when stepping A64 code. > > This patch has no behavioural change since MDSCR_EL1.SS can't >

Re: [Qemu-devel] [PATCH 3/3] layout: Add generators for refcount tbles and blocks

2014-08-19 Thread M.Kustova
On Tue, Aug 19, 2014 at 1:36 PM, Fam Zheng wrote: > On Mon, 08/11 15:55, Maria Kustova wrote: >> Refcount structures are placed in clusters randomly selected from all not >> allocated host clusters. > > s/not allocated/unallocated/ > >> >> Signed-off-by: Maria Kustova >> --- >> tests/image-fuzze

Re: [Qemu-devel] KVM call for agenda for 2014-08-19

2014-08-19 Thread Juan Quintela
Juan Quintela wrote: > Hi > > Please, send any topic that you are interested in covering. > > People have complained on the past that I don't cancel the call until > the very last minute. So, what do you think that deadline for > submitting topics is 23:00UTC on Monday? As there are no topics, c

Re: [Qemu-devel] [PATCH 09/11] target-arm: Implement ARMv8 single-step handling for A64 code

2014-08-19 Thread Peter Maydell
On 19 August 2014 10:56, Edgar E. Iglesias wrote: > On Fri, Aug 08, 2014 at 01:18:12PM +0100, Peter Maydell wrote: >> --- a/target-arm/cpu.h >> +++ b/target-arm/cpu.h >> @@ -1211,6 +1211,10 @@ static inline bool arm_singlestep_active(CPUARMState >> *env) >> #define ARM_TBFLAG_AA64_EL_MASK (0

Re: [Qemu-devel] [PATCH 0/3] image-fuzzer: Support refcount structures in the qcow2 image generator

2014-08-19 Thread Stefan Hajnoczi
On Mon, Aug 11, 2014 at 03:55:03PM +0400, Maria Kustova wrote: > This patch series adds support of refcount tables and blocks to the qcow2 > image > generator. > > This patch series was created for the 'block-next' branch and based on the > next > series: > [PATCH V3] layout: Reduce num

[Qemu-devel] [PULL 00/20] SCSI and memory changes for 2014-08-18

2014-08-19 Thread Paolo Bonzini
The following changes since commit 5a7348045091a2bc15d85bb177e5956aa6114e5a: Update version for v2.1.0-rc2 release (2014-07-15 18:55:37 +0100) are available in the git repository at: git://github.com/bonzini/qemu.git tags/for-upstream for you to fetch changes up to f54bb15f9d373877954e44db3

[Qemu-devel] [PULL 03/20] scsi-block: extract scsi_block_is_passthrough

2014-08-19 Thread Paolo Bonzini
This will be used for both scsi_block_new_request and the scsi-block implementation of parse_cdb. Reviewed-by: Fam Zheng Signed-off-by: Paolo Bonzini --- hw/scsi/scsi-disk.c | 38 ++ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/hw/scsi/scsi

[Qemu-devel] [PULL 05/20] virtio-scsi: implement parse_cdb

2014-08-19 Thread Paolo Bonzini
Enable passthrough of vendor-specific commands. Reviewed-by: Fam Zheng Signed-off-by: Paolo Bonzini --- hw/scsi/virtio-scsi.c | 25 + 1 file changed, 25 insertions(+) diff --git a/hw/scsi/virtio-scsi.c b/hw/scsi/virtio-scsi.c index 0eb069a..2dd9255 100644 --- a/hw/scsi/

[Qemu-devel] [PULL 02/20] scsi-bus: introduce parse_cdb in SCSIDeviceClass and SCSIBusInfo

2014-08-19 Thread Paolo Bonzini
These callbacks will let devices do their own request parsing, or defer it to the bus. If the bus does not provide an implementation, in turn, fall back to the default parsing routine. Swap the first two arguments to scsi_req_parse, and rename it to scsi_req_parse_cdb, for consistency. Reviewed-

[Qemu-devel] [PULL 01/20] scsi-bus: prepare scsi_req_new for introduction of parse_cdb

2014-08-19 Thread Paolo Bonzini
The per-SCSIDevice parse_cdb callback must not be called if the request will go through special SCSIReqOps, so detect the special cases early enough. Reviewed-by: Fam Zheng Signed-off-by: Paolo Bonzini --- hw/scsi/scsi-bus.c | 51 ++- 1 file chang

[Qemu-devel] [PULL 06/20] qom: object: delete properties before calling instance_finalize

2014-08-19 Thread Paolo Bonzini
This ensures that the children's unparent callback will still have a usable parent. Reviewed-by: Peter Crosthwaite Signed-off-by: Paolo Bonzini --- qom/object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qom/object.c b/qom/object.c index 0e8267b..f301bc2 100644 --- a/qo

[Qemu-devel] [PULL 04/20] scsi-block, scsi-generic: implement parse_cdb

2014-08-19 Thread Paolo Bonzini
The callback lets the bus provide the direction and transfer count for passthrough commands, enabling passthrough of vendor-specific commands. Reviewed-by: Fam Zheng Signed-off-by: Paolo Bonzini --- hw/scsi/scsi-bus.c | 3 +-- hw/scsi/scsi-disk.c| 14 ++ hw/scsi/scsi-generi

[Qemu-devel] [PULL 13/20] memory: remove memory_region_destroy

2014-08-19 Thread Paolo Bonzini
The function is empty after the previous patch, so remove it. Reviewed-by: Peter Crosthwaite Signed-off-by: Paolo Bonzini --- backends/hostmem.c | 10 -- hw/audio/ac97.c| 9 - hw/audio/es1370.c | 8 hw/audio/intel-hda.c

[Qemu-devel] [PULL 07/20] qom: object: move unparenting to the child property's release callback

2014-08-19 Thread Paolo Bonzini
This ensures that the unparent callback is called automatically when the parent object is finalized. Note that there's no need to keep a reference neither in object_unparent nor in object_finalize_child_property. The reference held by the child property itself will do. Reviewed-by: Peter Crosthw

[Qemu-devel] [PULL 11/20] ioport: split deletion and destruction

2014-08-19 Thread Paolo Bonzini
Of the two functions portio_list_del and portio_list_destroy, the latter is just freeing a memory area. However, portio_list_del is the logical equivalent of memory_region_del_subregion so destruction of memory regions does not belong there. Actually, neither of these APIs are in use; portio is m

[Qemu-devel] [PULL 10/20] nic: do not destroy memory regions in cleanup functions

2014-08-19 Thread Paolo Bonzini
The memory regions should be destroyed in the unrealize function; since these NICs are not even qdev-ified, they cannot be unplugged and they do not have to do anything to destroy their memory regions. Reviewed-by: Stefan Hajnoczi Reviewed-by: Peter Crosthwaite Signed-off-by: Paolo Bonzini ---

Re: [Qemu-devel] [PATCH 09/11] target-arm: Implement ARMv8 single-step handling for A64 code

2014-08-19 Thread Peter Maydell
On 19 August 2014 11:25, Peter Maydell wrote: > On 19 August 2014 10:56, Edgar E. Iglesias wrote: >> On Fri, Aug 08, 2014 at 01:18:12PM +0100, Peter Maydell wrote: >>> --- a/target-arm/cpu.h >>> +++ b/target-arm/cpu.h >>> @@ -1211,6 +1211,10 @@ static inline bool arm_singlestep_active(CPUARMState

[Qemu-devel] [PULL 08/20] sysbus: remove unused function sysbus_del_io

2014-08-19 Thread Paolo Bonzini
Reviewed-by: Peter Crosthwaite Signed-off-by: Paolo Bonzini --- hw/core/sysbus.c| 5 - include/hw/sysbus.h | 1 - 2 files changed, 6 deletions(-) diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c index f4e760d..414e2a1 100644 --- a/hw/core/sysbus.c +++ b/hw/core/sysbus.c @@ -242,11 +242,

[Qemu-devel] [PULL 12/20] memory: convert memory_region_destroy to object_unparent

2014-08-19 Thread Paolo Bonzini
Explicitly call object_unparent in the few places where we will re-create the memory region. If the memory region is simply being destroyed as part of device teardown, let QOM handle it. Signed-off-by: Paolo Bonzini --- docs/memory.txt | 15 ++- hw/display/vga.c | 2 +-

[Qemu-devel] [PULL 19/20] memory: Use canonical path component as the name

2014-08-19 Thread Paolo Bonzini
From: Peter Crosthwaite Rather than having the name as separate state. This prepares support for creating a MemoryRegion dynamically (i.e. without memory_region_init() and friends) and the MemoryRegion still getting a usable name. Signed-off-by: Peter Crosthwaite Signed-off-by: Paolo Bonzini -

[Qemu-devel] [PULL 20/20] mtree: remove write-only field

2014-08-19 Thread Paolo Bonzini
ml->printed is never set to true. Signed-off-by: Paolo Bonzini --- memory.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/memory.c b/memory.c index 8da29af..031ff51 100644 --- a/memory.c +++ b/memory.c @@ -1972,7 +1972,6 @@ typedef struct MemoryRegionList MemoryR

[Qemu-devel] [PULL 09/20] vga: do not dynamically allocate chain4_alias

2014-08-19 Thread Paolo Bonzini
Instead, add a boolean variable to indicate the presence of the region. This avoids a repeated malloc/free (later we can also avoid the add_child/unparent by changing the offset/size of the alias). Reviewed-by: Peter Crosthwaite Signed-off-by: Paolo Bonzini --- hw/display/vga.c | 24 +++

[Qemu-devel] [PULL 14/20] tpm_tis: remove instance_finalize callback

2014-08-19 Thread Paolo Bonzini
It is never used, since ISA device are not hot-unpluggable. Reviewed-by: Peter Crosthwaite Signed-off-by: Paolo Bonzini --- hw/tpm/tpm_tis.c | 8 1 file changed, 8 deletions(-) diff --git a/hw/tpm/tpm_tis.c b/hw/tpm/tpm_tis.c index d398c16..82747ee 100644 --- a/hw/tpm/tpm_tis.c +++ b/

[Qemu-devel] [PULL 15/20] loader: Abstract away ref to memory region names

2014-08-19 Thread Paolo Bonzini
From: Peter Crosthwaite Use the function provided rather than spying on the struct. Signed-off-by: Peter Crosthwaite Signed-off-by: Paolo Bonzini --- hw/core/loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/core/loader.c b/hw/core/loader.c index 2bf6b8f..1a53f0f

[Qemu-devel] [PULL 18/20] memory: Use memory_region_name for name access

2014-08-19 Thread Paolo Bonzini
From: Peter Crosthwaite Despite being local to memory.c, use the helper function. This prepares support for fully QOMifiying the name field of MR (which will remove this state from MR completely). Signed-off-by: Peter Crosthwaite Signed-off-by: Paolo Bonzini --- memory.c | 8 1 file

Re: [Qemu-devel] [Qemu-ppc] [PATCH V3] spapr: Fix stale HTAB during live migration

2014-08-19 Thread Alexander Graf
On 19.08.14 08:17, Samuel Mendoza-Jonas wrote: > If a guest reboots during a running migration, changes to the > hash page table are not necessarily updated on the destination. > Opening a new file descriptor to the HTAB forces the migration > handler to resend the entire table. > > Signed-off-b

[Qemu-devel] [PULL 16/20] exec: Abstract away ref to memory region names

2014-08-19 Thread Paolo Bonzini
From: Peter Crosthwaite Use the function provided rather than spying on the struct. Signed-off-by: Peter Crosthwaite Signed-off-by: Paolo Bonzini --- exec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exec.c b/exec.c index 5a2a25e..42688b6 100644 --- a/exec.c +++ b

[Qemu-devel] [PULL 17/20] memory: constify memory_region_name

2014-08-19 Thread Paolo Bonzini
From: Peter Crosthwaite It doesn't change the MR and some prospective call sites will have const MRs at hand. Signed-off-by: Peter Crosthwaite Signed-off-by: Paolo Bonzini --- include/exec/memory.h | 2 +- memory.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --

Re: [Qemu-devel] [PATCH] image-fuzzer: Trivial readability and formatting improvements

2014-08-19 Thread Markus Armbruster
"M.Kustova" writes: > On Tue, Aug 19, 2014 at 1:44 PM, Fam Zheng wrote: >> On Tue, 08/19 02:00, Maria Kustova wrote: [...] >>> diff --git a/tests/image-fuzzer/runner.py b/tests/image-fuzzer/runner.py >>> index fd97c40..b142577 100755 >>> --- a/tests/image-fuzzer/runner.py >>> +++ b/tests/image-f

Re: [Qemu-devel] [PATCH v5 10/10] hw/arm/dyn_sysbus_devtree: enable simple VFIO dynamic instantiation

2014-08-19 Thread Alexander Graf
On 19.08.14 00:26, Joel Schopp wrote: > > On 08/18/2014 05:11 PM, Peter Maydell wrote: >> On 18 August 2014 22:54, Joel Schopp wrote: >>> +static void vfio_fdt_add_device_node(SysBusDevice *sbdev, void *opaque) >>> +{ >>> +PlatformDevtreeData *data = opaque; >>> +void *fdt = data->fdt;

Re: [Qemu-devel] [PATCH v3 0/4] block: Use g_new() & friends more

2014-08-19 Thread Kevin Wolf
Am 19.08.2014 um 10:31 hat Markus Armbruster geschrieben: > PATCH 1+2 convert some allocations. While preparing them, I stumbled > over dead error handling and some useless casts, which led to PATCH > 3+4. > > I posted a tree-wide version of PATCH 1 some time ago, and was told to > split it up.

Re: [Qemu-devel] [PULL 0/3] QMP queue

2014-08-19 Thread Peter Maydell
On 18 August 2014 20:26, Luiz Capitulino wrote: > Three little birds. > > The following changes since commit 08ab59770da57648bfb8fc9be37f0ef7fb50b0f9: > > Merge remote-tracking branch 'remotes/mcayland/qemu-sparc' into staging > (2014-08-18 12:55:02 +0100) > > are available in the git repositor

Re: [Qemu-devel] [PATCH V2 0/2] runner: Control test duration

2014-08-19 Thread Kevin Wolf
Am 19.08.2014 um 11:18 hat Stefan Hajnoczi geschrieben: > On Tue, Aug 19, 2014 at 12:02:33AM +0400, Maria Kustova wrote: > > The first patch adds the '--duration SECONDS' argument. After the specified > > duration the runner allows to end the current test and then exits. > > > > The second patch a

Re: [Qemu-devel] [PATCH] block/vvfat.c: remove debugging code to reinit stderr if NULL

2014-08-19 Thread Kevin Wolf
Am 18.08.2014 um 13:41 hat Michael Tokarev geschrieben: > Just log to stderr unconditionally, like other similar code does. > > Signed-off-by: Michael Tokarev > --- > block/vvfat.c |5 - > 1 file changed, 5 deletions(-) > > diff --git a/block/vvfat.c b/block/vvfat.c > index 70176b1..ea3

Re: [Qemu-devel] [PULL v2 00/23] linux-user updates

2014-08-19 Thread Peter Maydell
On 19 August 2014 09:32, wrote: > From: Riku Voipio > > The same as previous series, except the patch "make binfmt flag O require P" > has been dropped. > > The following changes since commit 142f4ac5d5e024670ef4725e8943702b027e4218: > > Merge remote-tracking branch 'remotes/mjt/tags/trivial-p

Re: [Qemu-devel] [PATCH] block/vvfat.c: remove debugging code to reinit stderr if NULL

2014-08-19 Thread Peter Maydell
On 19 August 2014 12:58, Kevin Wolf wrote: > This specific patch isn't as trivial as it might look at the first > sight (in other words: it's wrong). The part that you probably missed is > that stderr isn't the real one when DEBUG is set: > > #undef stderr > #define stderr STDERR > FIL

Re: [Qemu-devel] [PATCH] block/vvfat.c: remove debugging code to reinit stderr if NULL

2014-08-19 Thread Eric Blake
On 08/19/2014 05:58 AM, Kevin Wolf wrote: > Am 18.08.2014 um 13:41 hat Michael Tokarev geschrieben: >> Just log to stderr unconditionally, like other similar code does. >> >> >> -DLOG(if (stderr == NULL) { >> -stderr = fopen("vvfat.log", "a"); >> -setbuf(stderr, NULL); >> -}) >> - > >

Re: [Qemu-devel] [PATCH 09/11] target-arm: Implement ARMv8 single-step handling for A64 code

2014-08-19 Thread Edgar E. Iglesias
On Tue, Aug 19, 2014 at 11:46:23AM +0100, Peter Maydell wrote: > On 19 August 2014 11:25, Peter Maydell wrote: > > On 19 August 2014 10:56, Edgar E. Iglesias wrote: > >> On Fri, Aug 08, 2014 at 01:18:12PM +0100, Peter Maydell wrote: > >>> --- a/target-arm/cpu.h > >>> +++ b/target-arm/cpu.h > >>>

  1   2   3   >