Re: [Qemu-devel] [Bug] cirrus_vga: qemu abort at booting when configure vgamem_mb <= 2

2014-05-08 Thread Gerd Hoffmann
On Fr, 2014-05-09 at 03:47 +, Gonglei (Arei) wrote: > Hi, Gerd > > The issue consequentially occur, I have tested various qemu versions, > including the current qemu.git. Missing sanity check. It's not valid. We mimic existing hardware here, and the cirrus card emulated has 4 MB video mem

[Qemu-devel] [Bug 1316115] Re: linux-user qemu-arm NEON support

2014-05-08 Thread Christopher Horler
I didn't test it on real hardware yet - but I resolved the issue and found the root cause last night: This perhaps should have been more obvious to me in the beginning, but "readelf -l" shows a program header similar to this: INTERP 0x00394600 0x00394600 0x003946

Re: [Qemu-devel] [PATCH] preallocate memory after NUMA policy configuration

2014-05-08 Thread Hu Tao
On Fri, May 09, 2014 at 03:24:52AM -0300, Marcelo Tosatti wrote: > > (note: applies on top of patchset of current thread) > > Preallocate memory after the NUMA policy has been instantiated. > This is necessary to guarantee memory is allocated with > specified NUMA policy in place. > > Signed-of

[Qemu-devel] [PATCH] preallocate memory after NUMA policy configuration

2014-05-08 Thread Marcelo Tosatti
(note: applies on top of patchset of current thread) Preallocate memory after the NUMA policy has been instantiated. This is necessary to guarantee memory is allocated with specified NUMA policy in place. Signed-off-by: Marcelo Tosatti diff --git a/backends/hostmem.c b/backends/hostmem.c inde

Re: [Qemu-devel] [PATCH] qapi: Make the include directive idempotent.

2014-05-08 Thread Markus Armbruster
Benoît Canet writes: > The Thursday 08 May 2014 à 20:30:33 (+0200), Markus Armbruster wrote : [...] >> There are two reasons to detect cycles. The technical one is preventing >> infinite expansion. No longer applies with idempotent include. The >> other, more abstract one is rejecting nonsensi

Re: [Qemu-devel] [PATCH] rdma: Fix block during rdma migration

2014-05-08 Thread Gonglei (Arei)
Hi, > -Original Message- > From: Michael R. Hines [mailto:mrhi...@linux.vnet.ibm.com] > Sent: Tuesday, April 01, 2014 8:42 AM > To: Gonglei (Arei); qemu-devel@nongnu.org > Cc: Huangweidong (C); quint...@redhat.com; dgilb...@redhat.com; > owass...@redhat.com; mrhi...@us.ibm.com; Moyuxiang;

[Qemu-devel] [Bug] cirrus_vga: qemu abort at booting when configure vgamem_mb <= 2

2014-05-08 Thread Gonglei (Arei)
Hi, Gerd The issue consequentially occur, I have tested various qemu versions, including the current qemu.git. Any ideas? Thanks. The command line: ./x86_64-softmmu/qemu-system-x86_64 -enable-kvm -m 4096 -smp 4 -name sles \ -boot c -drive file=/mnt/sdb/gonglei/image/sles.img -vnc 0.0.0.0:10

Re: [Qemu-devel] virtio-serial-pci very expensive during live migration

2014-05-08 Thread Chris Friesen
On 05/08/2014 07:44 PM, ChenLiang wrote: > Hi, > I have test the patch at the qemu.git, qemu crashed when vm is booting. > > the backtrace is: > > Program received signal SIGABRT, Aborted. > [Switching to Thread 0x7f6bf67f9700 (LWP 9740)] > 0x7f6bfacb2b55 in raise () from /lib64/libc.so.6 >

Re: [Qemu-devel] My OS hangup in KVM for some reasons, how can I debug?

2014-05-08 Thread Jun Koi
On Thu, May 8, 2014 at 4:28 PM, Jun Koi wrote: > Hi, > > I have an weird OS that I am trying to boot in KVM. however, it just hang > in the middle, without a good reason. > > The same OS boots fine in physical machine, and this OS comes with no > source code. > > There must be a bug somewhere in

Re: [Qemu-devel] [PATCH 1/6] xics: add flags for interrupts

2014-05-08 Thread Alexey Kardashevskiy
On 05/07/2014 11:09 PM, Mike Day wrote: > >> >> for (i = 0; i < ics->nr_irqs; i++) { >> /* FIXME: filter by server#? */ >> -if (ics->islsi[i]) { >> +if (ics->irqs[i].flags & XICS_FLAGS_LSI) { >> resend_lsi(ics, i); > > Not part of your patch, but I'm c

Re: [Qemu-devel] [PATCH v3.1 00/31] NUMA series, and hostmem improvements

2014-05-08 Thread Hu Tao
On Thu, May 08, 2014 at 04:51:56PM +0200, Paolo Bonzini wrote: > Il 06/05/2014 11:27, Hu Tao ha scritto: > > This series includes work on QOMifying the memory backends. > > the idea is to delegate all properties of the memory backend to > > a new QOM class hierarchy, in which the concrete classes >

Re: [Qemu-devel] Question about RAM migration flags

2014-05-08 Thread ChenLiang
On 2014/5/9 7:08, Peter Lieven wrote: > Hi, > > while working on ram migration and reading through the code I realized that > qemu does not stop loading a saved VM or rejecting an incoming migration > if there is a flag in the stream that it does not understand. An unknown flag > is simply ignore

Re: [Qemu-devel] [PATCH v3 3/4] target-ppc: ppc can be either endian

2014-05-08 Thread Rusty Russell
Alexander Graf writes: > On 05/07/2014 12:19 PM, Greg Kurz wrote: > The uglyness about the current_cpu bit is that devices are usually not > supposed to know about the cpu accesses come from usually. But then > again devices shouldn't know about the endianness of a cpu either so I > guess it's

Re: [Qemu-devel] [PATCH] kvmclock: Ensure time in migration never goes backward

2014-05-08 Thread Marcelo Tosatti
On Thu, May 08, 2014 at 09:21:29AM +0200, Alexander Graf wrote: > > On 08.05.14 03:33, Marcelo Tosatti wrote: > >On Mon, May 05, 2014 at 03:51:22PM +0200, Alexander Graf wrote: > >>When we migrate we ask the kernel about its current belief on what the guest > >>time would be. However, I've seen ca

Re: [Qemu-devel] [PATCH 6/6] xics: implement xics_ics_free()

2014-05-08 Thread Alexey Kardashevskiy
On 05/08/2014 10:07 PM, Alexander Graf wrote: > On 05/07/2014 08:01 AM, Alexey Kardashevskiy wrote: >> Signed-off-by: Alexey Kardashevskiy >> --- >> hw/intc/xics.c| 24 >> include/hw/ppc/xics.h | 1 + >> trace-events | 2 ++ >> 3 files changed, 27 i

[Qemu-devel] [RFC] vhost: Can we change synchronize_rcu to call_rcu in vhost_set_memory() in vhost kernel module?

2014-05-08 Thread Gonglei (Arei)
Hi, Vhost devices need to do VHOST_SET_MEM_TABLE ioctl in vhost_dev_start() to tell vhost kernel modules GPA to HVA memory mappings, which consume is expensively. The reason is same as KVM_SET_GSI_ROUTING ioctl. That is, in ioctl processing, kmod and vhost calls synchronize_rcu() to wait for gr

Re: [Qemu-devel] virtio-serial-pci very expensive during live migration

2014-05-08 Thread ChenLiang
On 2014/5/8 22:34, Paolo Bonzini wrote: > Il 08/05/2014 16:31, Chris Friesen ha scritto: >> >> >> The fact remains that qemu crashes when I apply the patch. I also tried >> patching it as below in virtio_pci_vmstate_change(). That would allow >> the VM to boot, but it would crash when I tried to

Re: [Qemu-devel] [PATCH 1/4] kvm: Add set_one_reg/get_one_reg helpers

2014-05-08 Thread Alexey Kardashevskiy
On 05/08/2014 10:27 PM, Alexander Graf wrote: > On 04/03/2014 03:14 PM, Alexey Kardashevskiy wrote: >> This adds QEMU wrappers for KVM_SET_ONE_REG/KVM_GET_ONE_REG ioctls. >> >> Signed-off-by: Alexey Kardashevskiy > > Please merge with the s390 variant of this. How? Why? I posted mine 19 septem

Re: [Qemu-devel] QEMU 2.1 release schedule?

2014-05-08 Thread Michael Roth
Quoting Peter Maydell (2014-05-08 08:48:01) > On 28 April 2014 16:38, Peter Maydell wrote: > > Thanks to everybody who helped with getting QEMU 2.0 released. > > The traditional reward for a job well done is another job, which > > means we should probably work out what the release schedule for > >

Re: [Qemu-devel] virtio-serial-pci very expensive during live migration

2014-05-08 Thread Chris Friesen
On 05/08/2014 09:40 AM, Chris Friesen wrote: On 05/08/2014 07:47 AM, Amit Shah wrote: Chris, I just tried a simple test this way: ./x86_64-softmmu/qemu-system-x86_64 -device virtio-serial-pci -device virtserialport -S -monitor stdio -nographic and it didn't crash for me. This was with qemu.g

Re: [Qemu-devel] [PATCH v3 18/25] rbd: use BlockDriverState's AioContext

2014-05-08 Thread Josh Durgin
On 05/08/2014 07:34 AM, Stefan Hajnoczi wrote: Drop the assumption that we're using the main AioContext. Convert qemu_bh_new() to aio_bh_new() and qemu_aio_wait() to aio_poll(). The .bdrv_detach_aio_context() and .bdrv_attach_aio_context() interfaces are not needed since no fd handlers, timers,

[Qemu-devel] [RFC PATCH] migration: reintroduce skipped zero pages

2014-05-08 Thread Peter Lieven
commit f1c72795a introduced skipping of all zero pages during bulk phase of ram migration. In theory this should have worked, however the underlying assumption that the memory of target VM is totally empty (zeroed) was wrong. Altough qemu accepts an incoming migration BIOS, ROMs or tables are set u

[Qemu-devel] Question about RAM migration flags

2014-05-08 Thread Peter Lieven
Hi, while working on ram migration and reading through the code I realized that qemu does not stop loading a saved VM or rejecting an incoming migration if there is a flag in the stream that it does not understand. An unknown flag is simply ignored. In the block migration code there is a catch at

Re: [Qemu-devel] [SeaBIOS] seabios release?

2014-05-08 Thread Kevin O'Connor
On Wed, May 07, 2014 at 12:33:35PM +0200, Gerd Hoffmann wrote: > On Mi, 2014-04-23 at 16:41 +0200, Gerd Hoffmann wrote: > > Hi, > > > > I think it's time to start planning the next seabios release. First, > > because a bunch of changes have piled up in master. And second, because > > of the sm

[Qemu-devel] [PULL 04/38] qapi: Add a primitive to include other files from a QAPI schema file

2014-05-08 Thread Luiz Capitulino
From: Lluís Vilanova The primitive uses JSON syntax, and include paths are relative to the file using the directive: { 'include': 'path/to/file.json' } Signed-off-by: Lluís Vilanova Reviewed-by: Eric Blake Reviewed-by: Markus Armbruster Signed-off-by: Luiz Capitulino --- docs/qapi-code-

[Qemu-devel] [PULL 02/38] qapi: [trivial] Do not catch unknown exceptions in "test-qapi.py"

2014-05-08 Thread Luiz Capitulino
From: Lluís Vilanova Signed-off-by: Lluís Vilanova Reviewed-by: Eric Blake Reviewed-by: Markus Armbruster Signed-off-by: Luiz Capitulino --- tests/qapi-schema/test-qapi.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tests/qapi-schema/test-qapi.py b/tests/qapi-schema/test-qapi.py in

[Qemu-devel] [PATCH 1/8] hw/intc/allwinner-a10-pic: Add missing 'break'

2014-05-08 Thread Peter Maydell
Add missing 'break' after handling of AW_A10_PIC_BASE_ADDR write. Signed-off-by: Peter Maydell --- hw/intc/allwinner-a10-pic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/intc/allwinner-a10-pic.c b/hw/intc/allwinner-a10-pic.c index 0924d98..7b3e085 100644 --- a/hw/intc/allwinner-a10-p

Re: [Qemu-devel] virtio-serial-pci very expensive during live migration

2014-05-08 Thread Chris Friesen
On 05/08/2014 10:02 AM, Paolo Bonzini wrote: Il 08/05/2014 17:57, Chris Friesen ha scritto: The fact remains that qemu crashes when I apply the patch. I also tried patching it as below in virtio_pci_vmstate_change(). That would allow the VM to boot, but it would crash when I tried to do a liv

[Qemu-devel] [PULL 35/38] qmp: Don't use error_is_set() to suppress additional errors

2014-05-08 Thread Luiz Capitulino
From: Markus Armbruster Using error_is_set(errp) that way can sweep programming errors under the carpet when we get called incorrectly with an error set. encrypted_bdrv_it() does it, because there's no way to make bdrv_iterate() break its loop. Actually safe, because qmp_cont() clears the error

[Qemu-devel] [PULL 08/38] pci-assign: accept Error from monitor_handle_fd_param2()

2014-05-08 Thread Luiz Capitulino
From: Laszlo Ersek Propagate any errors in monitor fd handling up to get_real_device(), and report them there. We'll continue the propagation upwards when get_real_device() becomes a leaf itself (when none of its callees will report errors internally any longer when detecting and returning an err

[Qemu-devel] [PATCH v7 00/14] qemu-img: Implement commit like QMP

2014-05-08 Thread Max Reitz
qemu-img should use QMP commands whenever possible in order to ensure feature completeness of both online and offline image operations. For the "commit" command, this is relatively easy, so implement it first (in the hope that indeed others will follow). As qemu-img does not have access to QMP (du

[Qemu-devel] [PATCH v7 02/14] qcow2: Implement bdrv_make_empty()

2014-05-08 Thread Max Reitz
Implement this function by making all clusters in the image file fall through to the backing file (by using the recently extended discard). Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block/qcow2.c | 27 +++ 1 file changed, 27 insertions(+) diff --git a/block/q

[Qemu-devel] [PATCH 7/8] hw/arm/stellaris: Correct handling of GPTM TAR register

2014-05-08 Thread Peter Maydell
We don't implement very much of the GPTM TAR register, and what we do is wrong. The "are we in RT mode?" field is in s->config, not s->control. Correct this, use LOG_UNIMP rather than hw_error() for the cases we don't support, and avoid an unlabelled fallthrough that makes Coverity complain. Signe

[Qemu-devel] [PATCH v7 06/14] block/mirror: Improve progress report

2014-05-08 Thread Max Reitz
Instead of taking the total length of the block device as the block job's length, use the number of dirty sectors. The progress is now the number of sectors mirrored to the target block device. Note that this may result in the job's length increasing during operation, which is however in fact desir

[Qemu-devel] [PULL 11/38] pci-assign: propagate Error from check_irqchip_in_kernel()

2014-05-08 Thread Luiz Capitulino
From: Laszlo Ersek Rename check_irqchip_in_kernel() to verify_irqchip_in_kernel(), so that the name reflects our expectation better. Rather than returning a bool, make it do nothing or set an Error. Signed-off-by: Laszlo Ersek Reviewed-by: Eric Blake Signed-off-by: Luiz Capitulino --- hw/i38

[Qemu-devel] [PATCH v7 09/14] qemu-img: Enable progress output for commit

2014-05-08 Thread Max Reitz
Implement progress output for the commit command by querying the progress of the block job. Signed-off-by: Max Reitz --- qemu-img-cmds.hx | 4 ++-- qemu-img.c | 24 ++-- qemu-img.texi| 2 +- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/qemu-img-

[Qemu-devel] [PATCH v7 04/14] blockjob: Introduce block_job_complete_sync()

2014-05-08 Thread Max Reitz
Implement block_job_complete_sync() by doing the exact same thing as block_job_cancel_sync() does, only with calling block_job_complete() instead of block_job_cancel(). Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf --- blockjob.c | 39 --- in

[Qemu-devel] [PULL 19/38] pci-assign: propagate errors from assign_device()

2014-05-08 Thread Luiz Capitulino
From: Laszlo Ersek Also, change the return type to "void"; the function is static (with a sole caller) and the negative errno values are not distinguished from each other. Signed-off-by: Laszlo Ersek Reviewed-by: Eric Blake Signed-off-by: Luiz Capitulino --- hw/i386/kvm/pci-assign.c | 29 +++

[Qemu-devel] [PATCH v7 14/14] iotests: Omit length/offset test in 040 and 041

2014-05-08 Thread Max Reitz
As the length of a mirror block job no longer directly depends on the size of the block device, drop those checks from this test. Instead, just check whether the final offset equals the block job length. As 041 uses the wait_until_completed function from iotests.py, the same applies there as well

Re: [Qemu-devel] [Bug 1316115] Re: linux-user qemu-arm NEON support

2014-05-08 Thread Peter Maydell
On 8 May 2014 20:54, Christopher Horler wrote: > I built Qt5 myself, and tested and it crashed again. > > I think the entry point getting set in the ELF header is probably > invalid and leading to the crash - I'm going to try and fix that - but > it's almost certainly not a qemu bug. Does the sam

[Qemu-devel] [PULL 12/38] pci: add Error-propagating pci_add_capability2()

2014-05-08 Thread Luiz Capitulino
From: Laszlo Ersek ... and rebase pci_add_capability() to it. Signed-off-by: Laszlo Ersek Reviewed-by: Eric Blake Signed-off-by: Luiz Capitulino --- hw/pci/pci.c | 32 ++-- include/hw/pci/pci.h | 4 2 files changed, 30 insertions(+), 6 deletions(-)

[Qemu-devel] [PULL 00/38] QMP queue

2014-05-08 Thread Luiz Capitulino
The following changes since commit 6b342cc9c872e82620fdd32730cd92affa8a19b3: Merge remote-tracking branch 'remotes/spice/tags/pull-spice-7' into staging (2014-05-08 10:57:25 +0100) are available in the git repository at: git://repo.or.cz/qemu/qmp-unstable.git queue/qmp for you to fetch ch

Re: [Qemu-devel] [PATCH] qapi: Make the include directive idempotent.

2014-05-08 Thread Benoît Canet
The Thursday 08 May 2014 à 20:30:33 (+0200), Markus Armbruster wrote : > Humor me: no period at end of subject. > > Benoît Canet writes: > > > The purpose of this change is to help create a json file containing > > common definitions. > > Please describe the new semantics of the include directi

[Qemu-devel] [PATCH v2] vl.c: Unify MAX_CPUMASK_BITS and machine->max_cpus checks

2014-05-08 Thread Eduardo Habkost
If a given machine have max_cpus set, not just smp_cpus needs to be limited, but the total number of CPUs (considering CPU hotplug) for the machine. We also had yet another max_cpus limit check at smp_parse(), ensuring that max_cpus < MAX_CPUMASK_BITS. This patch unifies the machine->max_cpus and

[Qemu-devel] [PULL 25/38] error: Consistently name Error ** objects errp, and not err

2014-05-08 Thread Luiz Capitulino
From: Markus Armbruster Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Signed-off-by: Luiz Capitulino --- include/qapi/error.h | 27 --- util/error.c | 8 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/include/qapi/error.h

[Qemu-devel] [Bug 1316115] Re: linux-user qemu-arm NEON support

2014-05-08 Thread Christopher Horler
I built Qt5 myself, and tested and it crashed again. I think the entry point getting set in the ELF header is probably invalid and leading to the crash - I'm going to try and fix that - but it's almost certainly not a qemu bug. I suggest closing the bug report. -- You received this bug notifica

Re: [Qemu-devel] [RFC] dataplane: IOThreads and writing dataplane-capable code

2014-05-08 Thread Dr. David Alan Gilbert
* Stefan Hajnoczi (stefa...@gmail.com) wrote: > On Thu, May 8, 2014 at 3:44 PM, Dr. David Alan Gilbert > wrote: > > * Stefan Hajnoczi (stefa...@redhat.com) wrote: > > > > > > > >> How to synchronize with an IOThread > >> --- > >> AioContext is not thread-safe so so

[Qemu-devel] [PATCH 8/8] hw/arm/omap_gpmc: Avoid buffer overrun filling prefetch FIFO

2014-05-08 Thread Peter Maydell
In fill_prefetch_fifo(), if the device we are reading from is 16 bit, then we must not try to transfer an odd number of bytes into the FIFO. This could otherwise have resulted in our overrunning the prefetch.fifo array by one byte. Signed-off-by: Peter Maydell --- Spotted by Coverity. I suspect C

[Qemu-devel] [Bug 1312561] Re: libstdc++-6.dll is missing from your computer

2014-05-08 Thread Rupert Russell
So the answer to my basic question, how to make this work is Download the mingw windows installer from here. http://cznic.dl.sourceforge.net/project/mingwbuilds/mingw-builds-install/mingw-builds-install.exe Install for W 64 posix or win32 and VERSION 4.6.3 (later one doesn't work with qemu-w64

[Qemu-devel] [PULL 03/38] qapi: Use an explicit input file

2014-05-08 Thread Luiz Capitulino
From: Lluís Vilanova Use an explicit input file on the command-line instead of reading from standard input. It also outputs the proper file name when there's an error. Signed-off-by: Lluís Vilanova Reviewed-by: Eric Blake Reviewed-by: Markus Armbruster Signed-off-by: Luiz Capitulino --- Ma

[Qemu-devel] [PATCH v7 01/14] qcow2: Allow "full" discard

2014-05-08 Thread Max Reitz
Normally, discarded sectors should read back as zero. However, there are cases in which a sector (or rather cluster) should be discarded as if they were never written in the first place, that is, reading them should fall through to the backing file again. Signed-off-by: Max Reitz Reviewed-by: Eri

[Qemu-devel] [PULL 37/38] qapi: Document optional arguments' backwards compatibility

2014-05-08 Thread Luiz Capitulino
From: Eric Blake Signed-off-by: Eric Blake Signed-off-by: Fam Zheng Signed-off-by: Luiz Capitulino --- docs/qapi-code-gen.txt | 32 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/docs/qapi-code-gen.txt b/docs/qapi-code-gen.txt index 051d109..26

[Qemu-devel] [PULL 23/38] qga: Consistently name Error ** objects errp, and not err

2014-05-08 Thread Luiz Capitulino
From: Markus Armbruster Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Signed-off-by: Luiz Capitulino --- qga/commands-posix.c | 199 ++- qga/commands-win32.c | 105 ++- qga/commands.c | 4 +- qga/vss-wi

[Qemu-devel] [PATCH v7 13/14] iotests: Add test for qcow2's bdrv_make_empty

2014-05-08 Thread Max Reitz
Add a test for qcow2's fast bdrv_make_empty implementation on images without internal snapshots. Signed-off-by: Max Reitz --- tests/qemu-iotests/093 | 72 ++ tests/qemu-iotests/093.out | 26 + tests/qemu-iotests/group | 1 + 3 fi

[Qemu-devel] [PATCH v7 12/14] iotests: Add test for backing-chain commits

2014-05-08 Thread Max Reitz
Add a test for qemu-img commit on backing chains with more than two images. This test also checks whether the top image is emptied (unless this is prevented by specifying either -d or -b) emptied and does therefore not work for qed and vmdk which requires it to be separate from 020. Signed-off-by

[Qemu-devel] [PULL 38/38] Revert "qapi: Clean up superfluous null check in qapi_dealloc_type_str()"

2014-05-08 Thread Luiz Capitulino
From: Peter Lieven This reverts commit 25a7017555f1b4aeb543b5d323ff4afb8f9c5437. Turns out the argument *can* be null: QEMU now segfaults if it receives an invalid parameter via a qmp command instead of throwing an error. For example: { "execute": "blockdev-add", "arguments": { "options" :

[Qemu-devel] [PATCH v7 08/14] qemu-img: Empty image after commit

2014-05-08 Thread Max Reitz
After the top image has been committed, it should be emptied unless specified otherwise. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- qemu-img-cmds.hx | 4 ++-- qemu-img.c | 34 +++--- qemu-img.texi| 6 +- 3 files changed, 38 insertions(+), 6

[Qemu-devel] [PATCH v7 07/14] qemu-img: Implement commit like QMP

2014-05-08 Thread Max Reitz
qemu-img should use QMP commands whenever possible in order to ensure feature completeness of both online and offline image operations. As qemu-img itself has no access to QMP (since this would basically require just everything being linked into qemu-img), imitate QMP's implementation of block-comm

[Qemu-devel] [PATCH v7 11/14] iotests: Add _filter_qemu_img_map

2014-05-08 Thread Max Reitz
As different image formats most probably map guest addresses to different host addresses, add a filter to filter the host addresses out; also, the image filename should be filtered. Signed-off-by: Max Reitz --- tests/qemu-iotests/common.filter | 7 +++ 1 file changed, 7 insertions(+) diff -

[Qemu-devel] [PATCH v7 10/14] qemu-img: Specify backing file for commit

2014-05-08 Thread Max Reitz
Introduce a new parameter for qemu-img commit which may be used to explicitly specify the backing file into which an image should be committed if the backing chain has more than a single layer. Signed-off-by: Max Reitz --- qemu-img-cmds.hx | 4 ++-- qemu-img.c | 24 +--

[Qemu-devel] [PATCH v7 05/14] blockjob: Add "ready" field

2014-05-08 Thread Max Reitz
When a block job signals readiness, this is currently reported only through QMP. If qemu wants to use block jobs for internal tasks, there needs to be another way to correctly detect when a block job may be completed. For this reason, introduce a bool "ready" which is set when the block job may be

[Qemu-devel] [PATCH v7 03/14] qcow2: Optimize bdrv_make_empty()

2014-05-08 Thread Max Reitz
bdrv_make_empty() is currently only called if the current image represents an external snapshot that has been committed to its base image; it is therefore unlikely to have internal snapshots. In this case, bdrv_make_empty() can be greatly sped up by creating an empty L1 table and dropping all data

[Qemu-devel] [PULL 13/38] pci-assign: accept Error from pci_add_capability2()

2014-05-08 Thread Luiz Capitulino
From: Laszlo Ersek Propagate any errors while adding PCI capabilities to assigned_device_pci_cap_init(). We'll continue the propagation upwards when assigned_device_pci_cap_init() becomes a leaf itself (when none of its callees will report errors internally any longer when detecting and returning

[Qemu-devel] [PATCH 4] block/raw-posix: Try both FIEMAP and SEEK_HOLE

2014-05-08 Thread Max Reitz
The current version of raw-posix always uses ioctl(FS_IOC_FIEMAP) if FIEMAP is available; lseek with SEEK_HOLE/SEEK_DATA are not even compiled in in this case. However, there may be implementations which support the latter but not the former (e.g., NFSv4.2) as well as vice versa. To cover both cas

[Qemu-devel] [PULL 36/38] qmp: use valid JSON in transaction example

2014-05-08 Thread Luiz Capitulino
From: Eric Blake Our example should use the correct quotes to match what someone could actually pass over the wire. * qmp-commands.hx: Use correct JSON quotes. Signed-off-by: Eric Blake Signed-off-by: Luiz Capitulino --- qmp-commands.hx | 8 1 file changed, 4 insertions(+), 4 deleti

[Qemu-devel] [PULL 34/38] dump: Drop pointless error_is_set(), DumpState member errp

2014-05-08 Thread Luiz Capitulino
From: Markus Armbruster In qmp_dump_guest_memory(), the error must be clear on entry, and we always bail out after setting it, directly or via dump_init(). Therefore, both error_is_set() are always false. Drop them. DumpState member errp is now write-only. Drop it, too. Signed-off-by: Markus

[Qemu-devel] [PULL 30/38] qapi: Clean up fragile use of error_is_set()

2014-05-08 Thread Luiz Capitulino
From: Markus Armbruster Using error_is_set(ERRP) to find out whether a function failed is either wrong, fragile, or unnecessarily opaque. It's wrong when ERRP may be null, because errors go undetected when it is. It's fragile when proving ERRP non-null involves a non-local argument. Else, it's

[Qemu-devel] [PULL 28/38] qapi: Drop redundant, unclean error_is_set()

2014-05-08 Thread Luiz Capitulino
From: Markus Armbruster do_qmp_dispatch()'s test for qmp_dispatch_check_obj() failure examines both the return value and the error object. The latter part is unclean; it works only when do_qmp_dispatch()'s caller passes a non-null errp argument. That's the case, but it's not locally obvious. U

[Qemu-devel] [PULL 26/38] qga: Use return values instead of error_is_set(errp)

2014-05-08 Thread Luiz Capitulino
From: Markus Armbruster Using error_is_set(errp) to check whether a function call failed is fragile: it breaks when errp is null. ga_get_fd_handle() and guest_file_handle_add() don't return a useful value when they fail, but that's just stupid. Fix that, and check them instead. As far as I can

[Qemu-devel] [PULL 27/38] hmp: Guard against misuse of hmp_handle_error()

2014-05-08 Thread Luiz Capitulino
From: Markus Armbruster Null errp argument makes no sense. Assert it's not null, to make this explicit, and guard against misuse. All current callers pass non-null errp. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Signed-off-by: Luiz Capitulino --- hmp.c | 3 ++- 1 file change

[Qemu-devel] [PULL 24/38] qmp: Consistently name Error ** objects errp, and not err

2014-05-08 Thread Luiz Capitulino
From: Markus Armbruster Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Signed-off-by: Luiz Capitulino --- qmp.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/qmp.c b/qmp.c index 233325d..82acb89 100644 --- a/qmp.c +++ b/qmp.c @@ -41,7 +41,7 @@

[Qemu-devel] [PULL 22/38] qmp hmp: Consistently name Error * objects err, and not errp

2014-05-08 Thread Luiz Capitulino
From: Markus Armbruster Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Signed-off-by: Luiz Capitulino --- docs/writing-qmp-commands.txt | 28 hmp.c | 138 ++--- include/qapi/qmp/dispatch.h| 2 +- q

Re: [Qemu-devel] [PATCH 4] block/raw-posix: Try both FIEMAP and SEEK_HOLE

2014-05-08 Thread Max Reitz
Oops, somehow dropped the “v” from “v4” in the subject. I hope you're able to infer the meaning anyway. ;-) Max

[Qemu-devel] [PULL 17/38] pci-assign: propagate errors from assigned_dev_register_msix_mmio()

2014-05-08 Thread Luiz Capitulino
From: Laszlo Ersek The return type is also changed from "int" to "void", because it was used in a success vs. failure sense only (the caller didn't distinguish error codes from each other, and even assigned_dev_register_msix_mmio() masked mmap()'s errno values with a common -EFAULT). Signed-off-

[Qemu-devel] [PULL 32/38] qga: Drop superfluous error_is_set()

2014-05-08 Thread Luiz Capitulino
From: Markus Armbruster acquire_privilege(), execute_async() and check_suspend_mode() do nothing when called with an error set. Callers shouldn't do that, and no caller does. Drop the superfluous tests. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Michael Roth Signe

[Qemu-devel] [PULL 20/38] pci-assign: propagate errors from assign_intx()

2014-05-08 Thread Luiz Capitulino
From: Laszlo Ersek Among the callers, only assigned_initfn() should set the monitor's stored error. Other callers may run in contexts where the monitor's stored error makes no sense. For example: assigned_dev_pci_write_config() assigned_dev_update_msix() assign_intx() Signed-off-by: Lasz

[Qemu-devel] [PULL 16/38] pci-assign: propagate errors from assigned_device_pci_cap_init()

2014-05-08 Thread Luiz Capitulino
From: Laszlo Ersek Signed-off-by: Laszlo Ersek Reviewed-by: Eric Blake Signed-off-by: Luiz Capitulino --- hw/i386/kvm/pci-assign.c | 45 +++-- 1 file changed, 19 insertions(+), 26 deletions(-) diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-ass

[Qemu-devel] [PATCH 4/8] hw/arm/omap1: Avoid unintended sign extension writing omap_rtc YEARS_REG

2014-05-08 Thread Peter Maydell
When writing to the YEARS_REG register, if the year value is 99 then the multiplication by 31536000 will overflow into the sign bit of a 32 bit value and then be erroneously sign-extended if time_t is 64 bits. Add a cast to avoid this. Signed-off-by: Peter Maydell --- hw/arm/omap1.c | 4 ++-- 1

[Qemu-devel] [PULL 29/38] tests/qapi-schema: Drop superfluous error_is_set()

2014-05-08 Thread Luiz Capitulino
From: Markus Armbruster visit_type_TestStruct() does nothing when called with an error set. Callers shouldn't do that, and no caller does. Drop the superfluous test. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Michael Roth Signed-off-by: Luiz Capitulino --- tests/

[Qemu-devel] [PULL 31/38] qga: Clean up fragile use of error_is_set()

2014-05-08 Thread Luiz Capitulino
From: Markus Armbruster Using error_is_set(ERRP) to find out whether a function failed is either wrong, fragile, or unnecessarily opaque. It's wrong when ERRP may be null, because errors go undetected when it is. It's fragile when proving ERRP non-null involves a non-local argument. Else, it's

[Qemu-devel] [PULL 33/38] qemu-option: Clean up fragile use of error_is_set()

2014-05-08 Thread Luiz Capitulino
From: Markus Armbruster Using error_is_set(ERRP) to find out whether to bail out due to previous error is either wrong, fragile, or unnecessarily opaque. It's wrong when ERRP may be null, because errors go undetected when it is. It's fragile when proving ERRP non-null involves a non-local argume

[Qemu-devel] [PULL 05/38] qapi: treat all negative return of strtosz_suffix() as error

2014-05-08 Thread Luiz Capitulino
From: Amos Kong strtosz_suffix() might return negative error, this patch fixes the error handling. This patch also changes to handle error in the if statement rather than handle success specially, this will make this use of strtosz_suffix consistent with all other uses. Signed-off-by: Amos Kong

[Qemu-devel] [PULL 21/38] pci-assign: assigned_initfn(): set monitor error in common error handler

2014-05-08 Thread Luiz Capitulino
From: Laszlo Ersek Signed-off-by: Laszlo Ersek Reviewed-by: Eric Blake Signed-off-by: Luiz Capitulino --- hw/i386/kvm/pci-assign.c | 26 ++ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c index 6891729

[Qemu-devel] [PULL 14/38] pci-assign: assignment should fail if we can't read config space

2014-05-08 Thread Luiz Capitulino
From: Laszlo Ersek assigned_initfn() get_real_device() read() Signed-off-by: Laszlo Ersek Reviewed-by: Eric Blake Signed-off-by: Luiz Capitulino --- hw/i386/kvm/pci-assign.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c index f9

[Qemu-devel] [PULL 15/38] pci-assign: propagate errors from get_real_device()

2014-05-08 Thread Luiz Capitulino
From: Laszlo Ersek Signed-off-by: Laszlo Ersek Reviewed-by: Eric Blake Signed-off-by: Luiz Capitulino --- hw/i386/kvm/pci-assign.c | 40 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c

[Qemu-devel] [PULL 06/38] cutils: tighten qemu_parse_fd()

2014-05-08 Thread Luiz Capitulino
From: Laszlo Ersek qemu_parse_fd() used to handle at least the following strings incorrectly: o "-2": simply let through o "2147483648": returned as LONG_MAX==INT_MAX on ILP32 (with ERANGE ignored); implementation-defined behavior on LP64 Signed-off-by: Laszlo Ersek Revi

[Qemu-devel] [PULL 18/38] pci-assign: propagate errors from assigned_dev_register_regions()

2014-05-08 Thread Luiz Capitulino
From: Laszlo Ersek Signed-off-by: Laszlo Ersek Reviewed-by: Eric Blake Signed-off-by: Luiz Capitulino --- hw/i386/kvm/pci-assign.c | 23 +-- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/hw/i386/kvm/pci-assign.c b/hw/i386/kvm/pci-assign.c index 3a904e8..9

[Qemu-devel] [PULL 07/38] monitor: add Error-propagating monitor_handle_fd_param2()

2014-05-08 Thread Luiz Capitulino
From: Laszlo Ersek and rebase monitor_handle_fd_param() to it. (Note that this will slightly change the behavior when the qemu_parse_fd() branch is selected and it fails: we now report (and in case of QMP, set) the error immediately, rather than allowing the caller to set its own error message (i

[Qemu-devel] [PULL 10/38] pci-assign: propagate errors from get_real_id()

2014-05-08 Thread Luiz Capitulino
From: Laszlo Ersek get_real_id() has two thin wrappers (and no other callers), get_real_vendor_id() and get_real_device_id(); it's easiest to convert them in one fell swoop. Signed-off-by: Laszlo Ersek Reviewed-by: Eric Blake Signed-off-by: Luiz Capitulino --- hw/i386/kvm/pci-assign.c | 45 +

[Qemu-devel] [PULL 09/38] pci-assign: make assign_failed_examine() just format the cause

2014-05-08 Thread Luiz Capitulino
From: Laszlo Ersek This allows us to report the entire error with one error_report() call, easing future error propagation. Signed-off-by: Laszlo Ersek Reviewed-by: Eric Blake Signed-off-by: Luiz Capitulino --- hw/i386/kvm/pci-assign.c | 30 +++--- 1 file changed, 19

[Qemu-devel] [PULL 01/38] qapi: [trivial] Break long command lines

2014-05-08 Thread Luiz Capitulino
From: Lluís Vilanova Signed-off-by: Lluís Vilanova Reviewed-by: Eric Blake Reviewed-by: Markus Armbruster Signed-off-by: Luiz Capitulino --- Makefile | 24 ++-- tests/Makefile | 18 ++ 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/

[Qemu-devel] [PATCH 5/8] hw/dma/omap_dma: Add (uint32_t) casts when shifting uint16_t by 16

2014-05-08 Thread Peter Maydell
Add missing (uint32_t) casts in cases where we're trying to put a uint16_t value into the top half of a 32-bit field. These were already present in some but not all places. Signed-off-by: Peter Maydell --- For new code or code I cared about I'd use deposit32(); but omap is pretty ancient and unlo

Re: [Qemu-devel] [PATCH] Revert "qapi: Clean up superfluous null check in qapi_dealloc_type_str()"

2014-05-08 Thread Luiz Capitulino
On Thu, 8 May 2014 18:03:15 +0200 Peter Lieven wrote: > This reverts commit 25a7017555f1b4aeb543b5d323ff4afb8f9c5437. > > Turns out the argument *can* be null: QEMU now segfaults if it > receives an invalid parameter via a qmp command instead of throwing an > error. > > For example: > { "execu

[Qemu-devel] [PATCH 6/8] hw/timer/exynos4210_mct: Avoid overflow in exynos4210_ltick_recalc_count

2014-05-08 Thread Peter Maydell
Add casts to avoid potentially overflowing the multiplications of 32 bit quantities in exynos4210_ltick_recalc_count(). Signed-off-by: Peter Maydell --- hw/timer/exynos4210_mct.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/timer/exynos4210_mct.c b/hw/timer/exynos42

[Qemu-devel] [PATCH 2/8] hw/net/cadence_gem: Remove dead code

2014-05-08 Thread Peter Maydell
Commit 191946c moved the code to handle padding to minimum length from after the handling of the CRC to before it. This means that the CRC code doesn't need to cope with the possibility that the size is less than 60; remove this dead code. Signed-off-by: Peter Maydell --- hw/net/cadence_gem.c |

[Qemu-devel] [PATCH 0/8] misc fixes for coverity warnings in ARM devices

2014-05-08 Thread Peter Maydell
This patchset is a mixed bag of minor fixes for various Coverity warnings in ARM devices. Peter Maydell (8): hw/intc/allwinner-a10-pic: Add missing 'break' hw/net/cadence_gem: Remove dead code hw/display/pxa2xx_lcd: Fix 16bpp+alpha and 18bpp+alpha palette formats hw/arm/omap1: Avoid uninte

[Qemu-devel] [PATCH 3/8] hw/display/pxa2xx_lcd: Fix 16bpp+alpha and 18bpp+alpha palette formats

2014-05-08 Thread Peter Maydell
The pxa2xx palette entry "16bpp plus transparency" format is xxxTR000GG00B000, and "18bpp plus transparency" is xxxTRR00GG00BB00. Correct errors in the code for reading these and converting them to the internal format. In particular, the buggy code was attempting to

Re: [Qemu-devel] [PATCH] vl.c: Check max_cpus limit instead of smp_cpus

2014-05-08 Thread Eduardo Habkost
On Thu, May 08, 2014 at 04:07:54PM +0100, Peter Maydell wrote: > On 8 May 2014 16:00, Eduardo Habkost wrote: > > On Thu, May 08, 2014 at 09:26:36AM +0100, Peter Maydell wrote: > >> On 7 May 2014 23:20, Andreas Färber wrote: > >> > Am 07.05.2014 23:48, schrieb Peter Maydell: > >> >> This is confus

Re: [Qemu-devel] [PATCH v2] block/raw-posix: Try both FIEMAP and SEEK_HOLE

2014-05-08 Thread Max Reitz
On 07.05.2014 07:56, Markus Armbruster wrote: Eric Blake writes: On 05/06/2014 03:18 PM, Eric Blake wrote: ...if you are on a file system where SEEK_HOLE triggers the kernel fallback of "entire file is allocated", but where FIEMAP is wired up for that file system, would it make sense to have

Re: [Qemu-devel] [PATCH] qapi: Make the include directive idempotent.

2014-05-08 Thread Markus Armbruster
Humor me: no period at end of subject. Benoît Canet writes: > The purpose of this change is to help create a json file containing > common definitions. Please describe the new semantics of the include directive here, so mathematically challenged readers don't have to loop up "idempotent" in the

  1   2   3   4   >