Re: [Qemu-devel] [PATCH v3 09/10] migration: fix calculating xbzrle_counters.cache_miss_rate

2018-08-08 Thread Peter Xu
On Wed, Aug 08, 2018 at 02:36:51PM +0800, Xiao Guangrong wrote: > > > On 08/08/2018 02:05 PM, Peter Xu wrote: > > On Tue, Aug 07, 2018 at 05:12:08PM +0800, guangrong.x...@gmail.com wrote: > > > From: Xiao Guangrong > > > > > > As Peter pointed out: > > > | - xbzrle_counters.cache_miss is done i

[Qemu-devel] [Bug 1785972] [NEW] v3.0.0-rc4: VM fails to start after vcpuhotunplug, managedsave sequence

2018-08-08 Thread Satheesh Rajendran
Public bug reported: VM fails to start after vcpu hot un-plug, managedsave sequence Host info: Kernel: 4.18.0-rc8-2-g1236568ee3cb qemu: commit 6ad90805383e6d04b3ff49681b8519a48c9f4410 (HEAD -> master, tag: v3.0.0-rc4) QEMU emulator version 2.12.94 (v3.0.0-rc4-dirty) libvirt: commit 087de2f

[Qemu-devel] [PATCH v3 0/5] qcow2: Make the L2 cache cover the whole image by default

2018-08-08 Thread Leonid Bloch
This series makes the qcow2 L2 cache cover the entire image by default. The importance of this change is in noticeable performance improvement, especially with heavy random I/O. The memory overhead is not big in most cases, as only 1 MB of cache for every 8 GB of image size is used. For cases with

[Qemu-devel] [PATCH v3 2/5] qcow2: Make the default L2 cache sufficient to cover the entire image

2018-08-08 Thread Leonid Bloch
Sufficient L2 cache can noticeably improve the performance when using large images with frequent I/O. The memory overhead is not significant in most cases, as the cache size is only 1 MB for each 8 GB of virtual image size (with the default cluster size of 64 KB). For cases with very large images a

[Qemu-devel] [PATCH v3 1/5] qcow2: Options' documentation fixes

2018-08-08 Thread Leonid Bloch
Signed-off-by: Leonid Bloch --- docs/qcow2-cache.txt | 3 +++ qemu-options.hx | 9 ++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/qcow2-cache.txt b/docs/qcow2-cache.txt index 8a09a5cc5f..5bf2a8ad29 100644 --- a/docs/qcow2-cache.txt +++ b/docs/qcow2-cache.txt @@

[Qemu-devel] [PATCH v3 5/5] qcow2: Explicit number replaced by a constant

2018-08-08 Thread Leonid Bloch
Signed-off-by: Leonid Bloch --- block/qcow2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 453a6377ac..a54e20402b 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1321,7 +1321,7 @@ static int coroutine_fn qcow2_do_open(BlockDriverSt

[Qemu-devel] [PATCH v3 3/5] qcow2: Resize the cache upon image resizing

2018-08-08 Thread Leonid Bloch
The caches are now recalculated upon image resizing. This is done because the new default behavior of assigning a sufficient L2 cache to cover the entire image implies that the cache will still be sufficient after an image resizing. Signed-off-by: Leonid Bloch --- block/qcow2.c | 8 1 f

[Qemu-devel] [PATCH v3 4/5] qcow2: Set the default cache-clean-interval to 30 seconds

2018-08-08 Thread Leonid Bloch
The default cache-clean-interval is set to 30 seconds, in order to lower the overhead of the qcow2 caches (before the default was 0, i.e. disabled). Signed-off-by: Leonid Bloch --- block/qcow2.c| 2 +- block/qcow2.h| 1 + docs/qcow2-cache.txt | 4 ++-- qapi/block-core.json | 3 ++

Re: [Qemu-devel] [PATCH v3 08/10] migration: handle the error condition properly

2018-08-08 Thread Xiao Guangrong
On 08/08/2018 02:56 PM, Peter Xu wrote: On Wed, Aug 08, 2018 at 02:29:52PM +0800, Xiao Guangrong wrote: On 08/08/2018 01:08 PM, Peter Xu wrote: On Tue, Aug 07, 2018 at 05:12:07PM +0800, guangrong.x...@gmail.com wrote: From: Xiao Guangrong ram_find_and_save_block() can return negative if

Re: [Qemu-devel] [PATCH] migration: Correctly handle subsections with no 'needed' function

2018-08-08 Thread Juan Quintela
Peter Maydell wrote: D> On 7 August 2018 at 16:05, Juan Quintela wrote: >> Peter Maydell wrote: >>> So it's better to use a needed-always subsection, which will give >>> the desired behaviour: >>> * new QEMU -> new QEMU: state is always migrated >>> * old QEMU -> new QEMU: migration doesn't fa

Re: [Qemu-devel] [PATCH v6 0/5] s390x: vfio-ap: guest dedicated crypto adapters

2018-08-08 Thread Cornelia Huck
On Tue, 7 Aug 2018 18:41:29 -0400 Tony Krowiak wrote: > Ping Maybe send a new version when the kernel part is sent again? I don't think I had any further comments. > > On 06/29/2018 06:47 PM, Tony Krowiak wrote: > > From: Tony Krowiak > > > > This patch series is the QEMU counterpart to the K

Re: [Qemu-devel] Question: How to integrate simple tests for a new platform so that they fit in well within QEMU

2018-08-08 Thread Thomas Huth
On 08/07/2018 02:34 PM, Aleksandar Markovic wrote: > Hello, folks. > > We are introducing a new MIPS platform - called nanoMIPS - to the QEMU. > > Besides providing new functionality, we would like to integrate into QEMU > some basic testing capabilities for that new platform. Something like thi

Re: [Qemu-devel] [PATCH v7 79/80] qemu-doc: Amend MIPS-related items

2018-08-08 Thread Thomas Huth
On 08/06/2018 07:00 PM, Aleksandar Markovic wrote: > From: Aleksandar Markovic > > Amend MIPS-related items in qemu-doc.texi > > Signed-off-by: Aleksandar Markovic > Signed-off-by: Stefan Markovic As far as I've understood the SoB process, your SoB should go last if you're the last person who

Re: [Qemu-devel] [PATCH v7 80/80] qemu-doc: Add nanoMIPS-related items

2018-08-08 Thread Thomas Huth
On 08/06/2018 07:00 PM, Aleksandar Markovic wrote: > From: Aleksandar Markovic > > Add nanoMIPS-related items in qemu-doc.texi > > Signed-off-by: Aleksandar Markovic > Signed-off-by: Stefan Markovic > --- > qemu-doc.texi | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/qemu-doc.tex

[Qemu-devel] [Bug 1785972] Re: v3.0.0-rc4: VM fails to start after vcpuhotunplug, managedsave sequence

2018-08-08 Thread Satheesh Rajendran
Bisect result: v3.0.0-rc0: vcpu hotplug crashes the domain - https://bugs.launchpad.net/qemu/+bug/1780928, this commit fixes that issue, b585395b655a6c1f9d9ebf1f0890e76d0708eed6 ppc/xics: fix ICP reset path v3.0.0-rc1- v3.0.0-rc4: hotplug crash bug fixed, but now we are hitting this one. -- Y

Re: [Qemu-devel] [PATCH v2] bitmap: fix BITMAP_LAST_WORD_MASK

2018-08-08 Thread Dr. David Alan Gilbert
* Wei Wang (wei.w.w...@intel.com) wrote: > On 08/07/2018 05:53 PM, Dr. David Alan Gilbert wrote: > > * Wei Wang (wei.w.w...@intel.com) wrote: > > > On 08/07/2018 03:39 PM, Peter Xu wrote: > > > > On Tue, Jul 31, 2018 at 06:01:18PM +0800, Wei Wang wrote: > > > > > When "nbits = 0", which means no bi

Re: [Qemu-devel] [PATCH] docs/migration: Clarify pre_load in subsections

2018-08-08 Thread Juan Quintela
"Dr. David Alan Gilbert (git)" wrote: > From: "Dr. David Alan Gilbert" > > Clarify that the pre_load function in a subsection is only called if > the subsection is found; to handle a missing subsection you may > set values in the pre_load of the parent vmsd. > > Signed-off-by: Dr. David Alan Gilb

Re: [Qemu-devel] [PATCH v3 08/10] migration: handle the error condition properly

2018-08-08 Thread Peter Xu
On Wed, Aug 08, 2018 at 03:23:22PM +0800, Xiao Guangrong wrote: > > > On 08/08/2018 02:56 PM, Peter Xu wrote: > > On Wed, Aug 08, 2018 at 02:29:52PM +0800, Xiao Guangrong wrote: > > > > > > > > > On 08/08/2018 01:08 PM, Peter Xu wrote: > > > > On Tue, Aug 07, 2018 at 05:12:07PM +0800, guangrong

Re: [Qemu-devel] valgrind problem in sun4u_load_kernel()

2018-08-08 Thread Thomas Huth
On 06/19/2018 10:03 AM, Artyom Tarasenko wrote: > On Sun, Jun 17, 2018 at 12:22 PM, Mark Cave-Ayland > wrote: >> On 15/06/18 11:37, Thomas Huth wrote: >> >>> Hi Mark, hi Artyom, >>> >>> while using valgrind to fix some issues with the rom_ptr() function >>> today, I noticed that there is one mor

Re: [Qemu-devel] [PATCH 3/7] tests: Add bbc:microbit / nRF51 test suite

2018-08-08 Thread Stefan Hajnoczi
On Mon, Aug 6, 2018 at 11:01 AM, Steffen Görtz wrote: > +#define PAGE_SIZE 1024 > +#define FLASH_SIZE (256 * PAGE_SIZE) > +#define FLASH_BASE 0x > +#define UICR_BASE 0x10001000 > +#define UICR_SIZE 0x100 > +#define NVMC_BASE 0x4001E

Re: [Qemu-devel] [PATCH 4/7] hw/gpio/nrf51_gpio: Add nRF51 GPIO peripheral

2018-08-08 Thread Stefan Hajnoczi
On Mon, Aug 6, 2018 at 11:01 AM, Steffen Görtz wrote: > This adds a model of the nRF51 GPIO peripheral. > > Reference Manual: http://infocenter.nordicsemi.com/pdf/nRF51_RM_v3.0.pdf > > The nRF51 series microcontrollers support up to 32 GPIO pins in various > configurations. > The pins can be used

Re: [Qemu-devel] Question: How to integrate simple tests for a new platform so that they fit in well within QEMU

2018-08-08 Thread Alex Bennée
Aleksandar Markovic writes: > Hello, folks. > > We are introducing a new MIPS platform - called nanoMIPS - to the QEMU. > > Besides providing new functionality, we would like to integrate into QEMU > some basic testing capabilities for that new platform. Something like this: > > Enable use

Re: [Qemu-devel] [RFC v3 06/15] hw/arm/virt: Allocate device_memory

2018-08-08 Thread Auger Eric
Hi Igor, On 07/18/2018 03:00 PM, Igor Mammedov wrote: [...] >>> >>> I think Igor wants one contiguous region for RAM, where additional >>> space can be reserved for hotplugging. >> This is not compliant with 2012 ARM white paper, although I don't really >> know if this document truly is a refere

Re: [Qemu-devel] [PULL 21/35] block: fix QEMU crash with scsi-hd and drive_del

2018-08-08 Thread Vladimir Sementsov-Ogievskiy
07.08.2018 22:57, Eric Blake wrote: On 08/06/2018 05:04 PM, Eric Blake wrote: On 06/18/2018 11:44 AM, Kevin Wolf wrote: From: Greg Kurz Removing a drive with drive_del while it is being used to run an I/O intensive workload can cause QEMU to crash. ... Test 83 sets up a client that inte

Re: [Qemu-devel] [RFC v3 06/15] hw/arm/virt: Allocate device_memory

2018-08-08 Thread Auger Eric
Hi Igor, On 07/18/2018 03:05 PM, Igor Mammedov wrote: > On Tue, 3 Jul 2018 09:19:49 +0200 > Eric Auger wrote: > >> We define a new hotpluggable RAM region (aka. device memory). >> Its base is 2TB GPA. This obviously requires 42b IPA support >> in KVM/ARM, FW and guest kernel. At the moment the d

Re: [Qemu-devel] [RFC v3 08/15] hw/arm/boot: introduce fdt_add_memory_node helper

2018-08-08 Thread Auger Eric
Hi Igor, On 07/18/2018 04:04 PM, Igor Mammedov wrote: > On Tue, 3 Jul 2018 09:19:51 +0200 > Eric Auger wrote: > >> From: Shameer Kolothum >> >> We introduce an helper to create a memory node. >> >> Signed-off-by: Eric Auger >> Signed-off-by: Shameer Kolothum >> >> --- >> >> v1 -> v2: >> - no

[Qemu-devel] [PATCH for-3.1] ui/sdl2: Remove the obsolete SDL_INIT_NOPARACHUTE flag

2018-08-08 Thread Thomas Huth
SDL_INIT_NOPARACHUTE is not used in SDL2 anymore, and the define is just a dummy (see https://wiki.libsdl.org/MigrationGuide#Some_general_truths for example). So we can remove it and get rid of the "flags" variable nowadays. Signed-off-by: Thomas Huth --- ui/sdl2.c | 4 +--- 1 file changed, 1 in

Re: [Qemu-devel] [PATCH 3/7] tests: Add bbc:microbit / nRF51 test suite

2018-08-08 Thread Julia Suvorova via Qemu-devel
On 08.08.2018 12:09, Stefan Hajnoczi wrote: On Mon, Aug 6, 2018 at 11:01 AM, Steffen Görtz wrote: +#define PAGE_SIZE 1024 +#define FLASH_SIZE (256 * PAGE_SIZE) +#define FLASH_BASE 0x +#define UICR_BASE 0x10001000 +#define UICR_SIZE 0x100 +

Re: [Qemu-devel] [PATCH 2/7] hw/nvram/nrf51_nvm: Add nRF51 non-volatile memories

2018-08-08 Thread Steffen Görtz
Hi Stefan, thank you for your review! > > There is asymmetry here: uicr_read() doesn't check offset before > indexing the array but uicr_write() does. Either the check is > necessary or it's not. > > I think this check isn't necessary since the memory region is sized > appropriately: > > me

Re: [Qemu-devel] [PATCH v3 1/5] qcow2: Options' documentation fixes

2018-08-08 Thread Alberto Garcia
On Wed 08 Aug 2018 09:10:47 AM CEST, Leonid Bloch wrote: > Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia Berto

[Qemu-devel] [PATCH 1/3] ui: remove support for GTK2 in favour of GTK3

2018-08-08 Thread Daniel P . Berrangé
GTK2 was deprecated in the 2.12.0 release with: commit b7715af2b31f47060cc5b4be930d16c13be93fa9 Author: Daniel P. Berrange Date: Tue Dec 12 11:34:40 2017 + ui: deprecate use of GTK 2.x in favour of 3.x series The GTK 3.0 release was made in Feb, 2011: https://blog.gtk

[Qemu-devel] [PATCH 0/3] ui: remove deprecated UI frontends

2018-08-08 Thread Daniel P . Berrangé
We deprecated GTK2 and SDL1.2 in the 2.12.0 release, so they are able to be removed entirely in the 3.1.0 release. The min GTK3 version can also be bumped up based the distros we aim to support. Daniel P. Berrangé (3): ui: remove support for GTK2 in favour of GTK3 ui: increase min required GTK

[Qemu-devel] [PATCH 2/3] ui: increase min required GTK3 version to 3.14.0

2018-08-08 Thread Daniel P . Berrangé
Per supported platforms doc[1], the various min GTK3 on relevant distros is: RHEL-7.0: 3.8.8 RHEL-7.2: 3.14.13 RHEL-7.4: 3.22.10 RHEL-7.5: 3.22.26 Debian (Stretch): 3.22.11 Debian (Jessie): 3.14.5 OpenBSD (Ports): 3.22.30 FreeBSD (Ports): 3.22.29 OpenSUSE Leap 15: 3.22.30 SLE12

[Qemu-devel] [PATCH 3/3] ui: remove support for SDL1.2 in favour of SDL2

2018-08-08 Thread Daniel P . Berrangé
SDL1.2 was deprecated in the 2.12.0 release with: commit e52c6ba34149b4f39c3fd60e59ee32b809db2bfa Author: Daniel P. Berrange Date: Mon Jan 15 14:25:33 2018 + ui: deprecate use of SDL 1.2 in favour of 2.0 series The SDL 2.0 release was made in Aug, 2013: https://www.li

Re: [Qemu-devel] [PATCH v3 5/5] qcow2: Explicit number replaced by a constant

2018-08-08 Thread Alberto Garcia
On Wed 08 Aug 2018 09:10:51 AM CEST, Leonid Bloch wrote: > Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [PATCH 0/3] ui: remove deprecated UI frontends

2018-08-08 Thread Gerd Hoffmann
On Wed, Aug 08, 2018 at 11:49:27AM +0100, Daniel P. Berrangé wrote: > We deprecated GTK2 and SDL1.2 in the 2.12.0 release, so they are able to > be removed entirely in the 3.1.0 release. The min GTK3 version can also > be bumped up based the distros we aim to support. Yes for gtk2, finally the #if

Re: [Qemu-devel] [PULL 21/35] block: fix QEMU crash with scsi-hd and drive_del

2018-08-08 Thread Vladimir Sementsov-Ogievskiy
07.08.2018 22:57, Eric Blake wrote: On 08/06/2018 05:04 PM, Eric Blake wrote: On 06/18/2018 11:44 AM, Kevin Wolf wrote: From: Greg Kurz Removing a drive with drive_del while it is being used to run an I/O intensive workload can cause QEMU to crash. ... Test 83 sets up a client that inte

Re: [Qemu-devel] [PATCH v3 4/5] qcow2: Set the default cache-clean-interval to 30 seconds

2018-08-08 Thread Alberto Garcia
On Wed 08 Aug 2018 09:10:50 AM CEST, Leonid Bloch wrote: > The default cache-clean-interval is set to 30 seconds, in order to lower > the overhead of the qcow2 caches (before the default was 0, i.e. > disabled). > > Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia > +#define DEFAULT_CACH

[Qemu-devel] [RFC PATCH v2 00/22] More patches to disable stuff

2018-08-08 Thread Juan Quintela
Hi First the things I didn'~t touch: - CONFIG_FOO in source files (scsi mainly) Paolo said that there are people working on that - usb: it is a mess how things are entangled there - acpi options (like hotplug etc); another entanglement So, what is there? - the bits that didn't got reviewed on p

[Qemu-devel] [PATCH v2 11/22] virtio: split host bits from virtio-pci

2018-08-08 Thread Juan Quintela
Signed-off-by: Juan Quintela --- default-configs/virtio.mak| 3 +++ hw/virtio/Makefile.objs | 1 + hw/virtio/virtio-input-host-pci.c | 42 +++ hw/virtio/virtio-pci.c| 20 --- 4 files changed, 46 insertions(+), 20 deletions(-)

[Qemu-devel] [PATCH v2 04/22] check: Only test isa-testdev when it is compiled in

2018-08-08 Thread Juan Quintela
Once there, untangle endianness-test and boot-serial-test. Signed-off-by: Juan Quintela -- boot-serial-test don't depend on isa-testdev. Thanks Thomas. Signed-off-by: Juan Quintela --- tests/Makefile.include | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) dif

[Qemu-devel] [PATCH v2 01/22] configure: We don't want to clean configuration files

2018-08-08 Thread Juan Quintela
If you don't want to compile everything, you configure config-devices.mak. And then make clean remove it, and make will create a default one without your configuration. Fix it by not removing it on clean target. Remove it instead on distclean. Signed-off-by: Juan Quintela -- Remove it instea

[Qemu-devel] [PATCH v2 05/22] check: Only test usb-xhci-nec when it is compiled in

2018-08-08 Thread Juan Quintela
Signed-off-by: Juan Quintela --- tests/Makefile.include | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 4e5f47aac0..1105469daa 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -290,8 +290,9 @@ en

[Qemu-devel] [PATCH v2 08/22] check: Only test tpm devices when they are compiled in

2018-08-08 Thread Juan Quintela
Signed-off-by: Juan Quintela --- tests/Makefile.include | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index eae89b0fc0..47a5b66cde 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -299,10 +299,10 @@ c

[Qemu-devel] [PATCH v2 12/22] virtio: split input bits from virtio-pci

2018-08-08 Thread Juan Quintela
Signed-off-by: Juan Quintela --- hw/virtio/Makefile.objs | 1 + hw/virtio/virtio-input-pci.c | 136 +++ hw/virtio/virtio-pci.c | 112 - 3 files changed, 137 insertions(+), 112 deletions(-) create mode 100644 hw/virtio/virti

[Qemu-devel] [PATCH v2 02/22] config: CONFIG_SERIAL* is already in pci.mak

2018-08-08 Thread Juan Quintela
Signed-off-by: Juan Quintela --- default-configs/alpha-softmmu.mak | 2 -- default-configs/arm-softmmu.mak | 2 -- default-configs/hppa-softmmu.mak| 3 --- default-configs/i386-softmmu.mak| 2 -- default-configs/mips-softmmu-common.mak | 2 -- default-configs/ppc-sof

[Qemu-devel] [PATCH v2 10/22] virtio: split vsock bits from virtio-pci

2018-08-08 Thread Juan Quintela
Signed-off-by: Juan Quintela --- hw/virtio/Makefile.objs | 2 +- hw/virtio/vhost-vsock-pci.c | 71 + hw/virtio/virtio-pci.c | 51 -- 3 files changed, 72 insertions(+), 52 deletions(-) create mode 100644 hw/virtio/vhost-vsock-p

[Qemu-devel] [PATCH v2 06/22] i386-softmmu: Configuration is identical to x86_64-softmmu

2018-08-08 Thread Juan Quintela
If we ever changed that, just make the things that are different explicit. Signed-off-by: Juan Quintela --- default-configs/i386-softmmu.mak | 65 +--- 1 file changed, 1 insertion(+), 64 deletions(-) diff --git a/default-configs/i386-softmmu.mak b/default-configs/i38

[Qemu-devel] [PATCH v2 15/22] virtio: split 9p bits from virtio-pci

2018-08-08 Thread Juan Quintela
Signed-off-by: Juan Quintela --- hw/virtio/Makefile.objs | 1 + hw/virtio/virtio-9p-pci.c | 74 +++ hw/virtio/virtio-pci.c| 52 --- 3 files changed, 75 insertions(+), 52 deletions(-) create mode 100644 hw/virtio/virtio-9p-pci.c

[Qemu-devel] [PATCH v2 03/22] check: Use land/lor when possible

2018-08-08 Thread Juan Quintela
So everythig is (a bit) more consistent Signed-off-by: Juan Quintela --- tests/Makefile.include | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index d6f5cc9ccc..2016c353e3 100644 --- a/tests/Makefile.include +++ b/

[Qemu-devel] [PATCH v2 18/22] virtio: split vhost-scsi bits from virtio-pci

2018-08-08 Thread Juan Quintela
Signed-off-by: Juan Quintela --- hw/virtio/Makefile.objs| 1 + hw/virtio/vhost-scsi-pci.c | 94 ++ hw/virtio/virtio-pci.c | 59 3 files changed, 95 insertions(+), 59 deletions(-) create mode 100644 hw/virtio/vhost-scsi-pci.c

[Qemu-devel] [PATCH v2 21/22] virtio: split virtio-net bits rom virtio-pci

2018-08-08 Thread Juan Quintela
Signed-off-by: Juan Quintela --- hw/virtio/Makefile.objs| 1 + hw/virtio/virtio-net-pci.c | 81 ++ hw/virtio/virtio-pci.c | 56 -- tests/Makefile.include | 4 +- 4 files changed, 84 insertions(+), 58 deletions(-) create mo

[Qemu-devel] [PATCH v2 07/22] check: Only test ivshm when it is compiled in

2018-08-08 Thread Juan Quintela
Signed-off-by: Juan Quintela --- tests/Makefile.include | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 1105469daa..eae89b0fc0 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -243,8 +243,8 @@ gcov-

[Qemu-devel] [PATCH v2 09/22] virtio: Remove unneeded includes

2018-08-08 Thread Juan Quintela
They are all already included in virtio_pci.h. Signed-off-by: Juan Quintela --- hw/virtio/virtio-pci.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 3a01fe90f0..cb2ddd3f41 100644 --- a/hw/virtio/virtio-pc

[Qemu-devel] [PATCH v2 14/22] virtio: split balloon bits from virtio-pci

2018-08-08 Thread Juan Quintela
Signed-off-by: Juan Quintela --- hw/virtio/Makefile.objs| 1 + hw/virtio/virtio-balloon-pci.c | 82 ++ hw/virtio/virtio-pci.c | 57 --- tests/Makefile.include | 4 +- 4 files changed, 85 insertions(+), 59 deletions(-)

Re: [Qemu-devel] [PATCH v3 4/5] qcow2: Set the default cache-clean-interval to 30 seconds

2018-08-08 Thread Leonid Bloch
On 08/08/2018 02:47 PM, Alberto Garcia wrote: On Wed 08 Aug 2018 09:10:50 AM CEST, Leonid Bloch wrote: The default cache-clean-interval is set to 30 seconds, in order to lower the overhead of the qcow2 caches (before the default was 0, i.e. disabled). Signed-off-by: Leonid Bloch Reviewed-by:

[Qemu-devel] [PATCH v2 22/22] virtio: split virtio-serial bits rom virtio-pci

2018-08-08 Thread Juan Quintela
Signed-off-by: Juan Quintela --- hw/virtio/Makefile.objs | 1 + hw/virtio/virtio-pci.c| 74 -- hw/virtio/virtio-serial-pci.c | 97 +++ tests/Makefile.include| 12 ++--- 4 files changed, 104 insertions(+), 80 deletions(

[Qemu-devel] [PATCH v2 16/22] virtio: split vhost-user-blk bits from virtio-pci

2018-08-08 Thread Juan Quintela
Signed-off-by: Juan Quintela --- hw/virtio/Makefile.objs| 1 + hw/virtio/vhost-user-blk-pci.c | 88 ++ hw/virtio/virtio-pci.c | 60 --- 3 files changed, 89 insertions(+), 60 deletions(-) create mode 100644 hw/virtio/vhost-user-

[Qemu-devel] [PATCH v2 13/22] virtio: split rng bits from virtio-pci

2018-08-08 Thread Juan Quintela
Signed-off-by: Juan Quintela --- hw/virtio/Makefile.objs| 1 + hw/virtio/virtio-pci.c | 52 - hw/virtio/virtio-rng-pci.c | 77 ++ tests/Makefile.include | 4 +- 4 files changed, 80 insertions(+), 54 deletions(-) create mod

Re: [Qemu-devel] [PATCH v2 02/22] config: CONFIG_SERIAL* is already in pci.mak

2018-08-08 Thread Thomas Huth
On 08/08/2018 01:48 PM, Juan Quintela wrote: > Signed-off-by: Juan Quintela > --- > default-configs/alpha-softmmu.mak | 2 -- > default-configs/arm-softmmu.mak | 2 -- > default-configs/hppa-softmmu.mak| 3 --- > default-configs/i386-softmmu.mak| 2 -- > default-conf

Re: [Qemu-devel] [PATCH v2 04/22] check: Only test isa-testdev when it is compiled in

2018-08-08 Thread Thomas Huth
On 08/08/2018 01:48 PM, Juan Quintela wrote: > Once there, untangle endianness-test and boot-serial-test. > > Signed-off-by: Juan Quintela > > -- > > boot-serial-test don't depend on isa-testdev. Thanks Thomas. So remove it from the patch description, too? > Signed-off-by: Juan Quintela > -

[Qemu-devel] [PATCH v2 19/22] virtio: split virtio-scsi bits from virtio-pci

2018-08-08 Thread Juan Quintela
Notice that we can't still run tests with it disabled. Both cdrom-test and drive_del-test use virtio-scsi without checking if it is enabled. Signed-off-by: Juan Quintela --- hw/virtio/Makefile.objs | 1 + hw/virtio/virtio-pci.c | 68 --- hw/virtio/virtio-scsi-p

[Qemu-devel] [PATCH 01/56] check-qjson: Cover multiple JSON objects in same string

2018-08-08 Thread Markus Armbruster
qobject_from_json() & friends misbehave when the JSON text has more than one JSON value. Add test coverage to demonstrate the bugs. Signed-off-by: Markus Armbruster --- tests/check-qjson.c | 20 1 file changed, 20 insertions(+) diff --git a/tests/check-qjson.c b/tests/chec

[Qemu-devel] [PATCH v2 17/22] virtio: split vhost-user-scsi bits from virtio-pci

2018-08-08 Thread Juan Quintela
Signed-off-by: Juan Quintela --- hw/virtio/Makefile.objs | 1 + hw/virtio/vhost-user-scsi-pci.c | 89 + hw/virtio/virtio-pci.c | 58 - 3 files changed, 90 insertions(+), 58 deletions(-) create mode 100644 hw/virtio/vhost-user-

[Qemu-devel] [PATCH v2 20/22] virtio: split virtio-blk bits rom virtio-pci

2018-08-08 Thread Juan Quintela
Signed-off-by: Juan Quintela --- hw/virtio/Makefile.objs| 1 + hw/virtio/virtio-blk-pci.c | 82 ++ hw/virtio/virtio-pci.c | 58 --- tests/Makefile.include | 4 +- 4 files changed, 85 insertions(+), 60 deletions(-) create m

[Qemu-devel] [PATCH 15/56] check-qjson: Cover interpolation more thoroughly

2018-08-08 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- tests/check-qjson.c | 141 1 file changed, 77 insertions(+), 64 deletions(-) diff --git a/tests/check-qjson.c b/tests/check-qjson.c index 33bd5854fc..fda2b014a3 100644 --- a/tests/check-qjson.c +++ b/tests/check-qj

[Qemu-devel] [PATCH 07/56] check-qjson: Cover escaped characters more thoroughly, part 1

2018-08-08 Thread Markus Armbruster
escaped_string() first tests double quoted strings, then repeats a few tests with single quotes. Repeat all of them: store the strings to test without quotes, and wrap them in either kind of quote for testing. Signed-off-by: Markus Armbruster --- tests/check-qjson.c | 94 +++

[Qemu-devel] [PATCH 35/56] json: Don't create JSON_ERROR tokens that won't be used

2018-08-08 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- qobject/json-streamer.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/qobject/json-streamer.c b/qobject/json-streamer.c index 0c33186e8e..fa595a8761 100644 --- a/qobject/json-streamer.c +++ b/qobject/json-streamer.c @@ -56,6 +56,8 @

[Qemu-devel] [PATCH 23/56] json: Leave rejecting invalid UTF-8 to parser

2018-08-08 Thread Markus Armbruster
Both the lexer and the parser (attempt to) validate UTF-8 in JSON strings. The lexer rejects bytes that can't occur in valid UTF-8: \xC0..\xC1, \xF5..\xFF. This rejects some, but not all invalid UTF-8. It also rejects ASCII control characters \x00..\x1F, in accordance with RFC 7159 (see recent c

[Qemu-devel] [PATCH 06/56] test-qga: Clean up how we test QGA synchronization

2018-08-08 Thread Markus Armbruster
To permit recovering from arbitrary JSON parse errors, the JSON parser resets itself on lexical errors. We recommend sending a 0xff byte for that purpose, and test-qga covers this usage since commit 5229564b832. That commit had to add an ugly hack to qmp_fd_vsend() to make capable of sending this

[Qemu-devel] [PATCH 22/56] json: Report first rather than last parse error

2018-08-08 Thread Markus Armbruster
Quiz time! When a parser reports multiple errors, but the user gets to see just one, which one is (on average) the least useful one? Yes, you're right, it's the last one! You're clearly familiar with compilers. Which one does QEMU report? Right again, the last one! You're clearly familiar wit

Re: [Qemu-devel] [PATCH v3 4/5] qcow2: Set the default cache-clean-interval to 30 seconds

2018-08-08 Thread Alberto Garcia
On Wed 08 Aug 2018 01:49:08 PM CEST, Leonid Bloch wrote: > On 08/08/2018 02:47 PM, Alberto Garcia wrote: >> On Wed 08 Aug 2018 09:10:50 AM CEST, Leonid Bloch wrote: >>> The default cache-clean-interval is set to 30 seconds, in order to lower >>> the overhead of the qcow2 caches (before the default

[Qemu-devel] [PATCH 39/56] json: Leave rejecting invalid interpolation to parser

2018-08-08 Thread Markus Armbruster
Both lexer and parser reject invalid interpolation specifications. The parser's check is useless. The lexer ends the token right after the first bad character. This tends to lead to suboptimal error reporting. For instance, input [ %11d ] produces the tokens JSON_LSQUARE [ JSON_E

[Qemu-devel] [PATCH 16/56] json: Fix lexer to include the bad character in JSON_ERROR token

2018-08-08 Thread Markus Armbruster
json_lexer[] maps (lexer state, input character) to the new lexer state. The input character is consumed unless the new state is terminal and the input character doesn't belong to this token, i.e. the state transition uses look-ahead. When this is the case, input character '\0' would result in th

[Qemu-devel] [PATCH 43/56] qjson: Fix qobject_from_json() & friends for multiple values

2018-08-08 Thread Markus Armbruster
qobject_from_json() & friends use the consume_json() callback to receive either a value or an error from the parser. When they are fed a string that contains more than either one JSON value or one JSON syntax error, consume_json() gets called multiple times. When the last call receives a value, q

[Qemu-devel] [PATCH 14/56] check-qjson qmp-test: Cover control characters more thoroughly

2018-08-08 Thread Markus Armbruster
RFC 7159 requires control characters in strings to be escaped. Demonstrate the JSON parser accepts U+0001 .. U+001F unescaped. Signed-off-by: Markus Armbruster --- tests/check-qjson.c | 36 ++-- tests/qmp-test.c| 14 ++ 2 files changed, 44 insertio

[Qemu-devel] [PATCH 09/56] check-qjson: Cover escaped characters more thoroughly, part 2

2018-08-08 Thread Markus Armbruster
Cover surrogates, invalid escapes, and noncharacters. This demonstrates that valid surrogate pairs are misinterpreted, and invalid surrogates and noncharacters aren't rejected. Signed-off-by: Markus Armbruster --- tests/check-qjson.c | 53 ++--- 1 file ch

[Qemu-devel] [PATCH 05/56] qmp-test: Cover syntax and lexical errors

2018-08-08 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- tests/libqtest.c | 17 + tests/libqtest.h | 11 +++ tests/qmp-test.c | 39 +++ 3 files changed, 67 insertions(+) diff --git a/tests/libqtest.c b/tests/libqtest.c index 3706f30aa2..c02fc91b37 100644 -

[Qemu-devel] [PATCH 24/56] json: Accept overlong \xC0\x80 as U+0000 ("modified UTF-8")

2018-08-08 Thread Markus Armbruster
This is consistent with qobject_to_json(). See commit e2ec3f97680. Signed-off-by: Markus Armbruster --- qobject/json-lexer.c | 2 +- qobject/json-parser.c | 2 +- tests/check-qjson.c | 8 +--- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/qobject/json-lexer.c b/qobject/j

[Qemu-devel] [PATCH 46/56] json: Assert json_parser_parse() consumes all tokens on success

2018-08-08 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- qobject/json-parser.c | 1 + 1 file changed, 1 insertion(+) diff --git a/qobject/json-parser.c b/qobject/json-parser.c index c2974d46b3..208dffc96c 100644 --- a/qobject/json-parser.c +++ b/qobject/json-parser.c @@ -539,6 +539,7 @@ QObject *json_parser_parse(G

[Qemu-devel] [PATCH 03/56] check-qjson: Cover whitespace more thoroughly

2018-08-08 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- tests/check-qjson.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/check-qjson.c b/tests/check-qjson.c index 81b92d6b0c..0a9a054c7b 100644 --- a/tests/check-qjson.c +++ b/tests/check-qjson.c @@ -1236,7 +1236,7 @@ static void simple_w

[Qemu-devel] [PATCH 18/56] json: Revamp lexer documentation

2018-08-08 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- qobject/json-lexer.c | 80 +++- 1 file changed, 71 insertions(+), 9 deletions(-) diff --git a/qobject/json-lexer.c b/qobject/json-lexer.c index e85e9a78ff..109a7d8bb8 100644 --- a/qobject/json-lexer.c +++ b/qobject/json

[Qemu-devel] [PATCH 02/56] check-qjson: Cover blank and lexically erroneous input

2018-08-08 Thread Markus Armbruster
qobject_from_json() can return null without setting an error on lexical errors. I call that a bug. Add test coverage to demonstrate it. Signed-off-by: Markus Armbruster --- tests/check-qjson.c | 36 +--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --g

[Qemu-devel] [PATCH 20/56] check-qjson: Document we expect invalid UTF-8 to be rejected

2018-08-08 Thread Markus Armbruster
The JSON parser rejects some invalid sequences, but accepts others without correcting the problem. We should either reject all invalid sequences, or minimize overlong sequences and replace all other invalid sequences by a suitable replacement character. A common choice for replacement is U+FFFD.

[Qemu-devel] [PATCH 27/56] json: Reject invalid \uXXXX, fix \u0000

2018-08-08 Thread Markus Armbruster
The JSON parser translates invalid \u to garbage instead of rejecting it, and swallows \u. Fix by using mod_utf8_encode() instead of flawed wchar_to_utf8(). Valid surrogate pairs are now differently broken: they're rejected instead of translated to garbage. The next commit will fix them.

[Qemu-devel] [PATCH 13/56] check-qjson: Fix utf8_string() to test all invalid sequences

2018-08-08 Thread Markus Armbruster
Some of utf8_string()'s test_cases[] contain multiple invalid sequences. Testing that qobject_from_json() fails only tests we reject at least one invalid sequence. That's incomplete. Additionally test each non-space sequence in isolation. This demonstrates that the JSON parser accepts invalid s

[Qemu-devel] [PATCH 00/56] json: Fixes, error reporting improvements, cleanups

2018-08-08 Thread Markus Armbruster
JSON is such a simple language, so writing a parser should be easy, shouldn't it? Well, the evidence is in, and it's a lot of patches. Summary of fixes: * Reject ASCII control characters in strings as RFC 7159 specifies * Reject all invalid UTF-8 sequences, not just some * Reject invalid \u

[Qemu-devel] [PATCH 30/56] json: remove useless return value from lexer/parser

2018-08-08 Thread Markus Armbruster
From: Marc-André Lureau The lexer always returns 0 when char feeding. Furthermore, none of the caller care about the return value. Signed-off-by: Marc-André Lureau Message-Id: <20180326150916.9602-10-marcandre.lur...@redhat.com> Reviewed-by: Markus Armbruster Reviewed-by: Thomas Huth Signed-o

[Qemu-devel] [PATCH 54/56] qobject: Drop superfluous includes of qemu-common.h

2018-08-08 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- include/qapi/qmp/json-parser.h | 1 - qobject/json-lexer.c | 1 - qobject/json-streamer.c| 1 - qobject/qbool.c| 1 - qobject/qlist.c| 1 - qobject/qnull.c| 1 - qobject/qnum.c |

[Qemu-devel] [PATCH 10/56] check-qjson: Drop redundant string tests

2018-08-08 Thread Markus Armbruster
simple_string() and single_quote_string() add nothing to escaped_string() anymore. Drop them. Signed-off-by: Markus Armbruster --- tests/check-qjson.c | 59 - 1 file changed, 59 deletions(-) diff --git a/tests/check-qjson.c b/tests/check-qjson.c inde

[Qemu-devel] [PATCH 04/56] qmp-cmd-test: Split off qmp-test

2018-08-08 Thread Markus Armbruster
qmp-test is for QMP protocol tests. Commit e4a426e75ef added generic, basic tests of query commands to it. Move them to their own test program qmp-cmd-test, to keep qmp-test focused on the protocol. Signed-off-by: Markus Armbruster --- MAINTAINERS| 1 + tests/Makefile.include |

[Qemu-devel] [PATCH 44/56] json: Fix latent parser aborts at end of input

2018-08-08 Thread Markus Armbruster
json-parser.c carefully reports end of input like this: token = parser_context_pop_token(ctxt); if (token == NULL) { parse_error(ctxt, NULL, "premature EOI"); goto out; } Except parser_context_pop_token() can't return null, it fails its assertion instead. Same for par

[Qemu-devel] [PATCH 53/56] json: Make JSONToken opaque outside json-parser.c

2018-08-08 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- include/qapi/qmp/json-parser.h | 4 include/qapi/qmp/json-streamer.h | 7 --- qobject/json-parser.c| 19 +++ qobject/json-streamer.c | 8 +--- 4 files changed, 24 insertions(+), 14 deletions(-) diff --git

[Qemu-devel] [PATCH 08/56] check-qjson: Streamline escaped_string()'s test strings

2018-08-08 Thread Markus Armbruster
Merge a few closely related test strings, and drop a few redundant ones. Signed-off-by: Markus Armbruster --- tests/check-qjson.c | 14 ++ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/tests/check-qjson.c b/tests/check-qjson.c index 1c7f24bc4d..8f51f57af9 100644 ---

[Qemu-devel] [PATCH 26/56] json: Simplify parse_string()

2018-08-08 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- qobject/json-parser.c | 42 +++--- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/qobject/json-parser.c b/qobject/json-parser.c index d469004616..f26e5b7511 100644 --- a/qobject/json-parser.c +++ b/qobject/j

[Qemu-devel] [PATCH 51/56] json: Eliminate lexer state IN_ERROR and pseudo-token JSON_MIN

2018-08-08 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- include/qapi/qmp/json-lexer.h | 10 -- qobject/json-lexer.c | 18 -- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/include/qapi/qmp/json-lexer.h b/include/qapi/qmp/json-lexer.h index 8058695e40..f3524de07a 10

[Qemu-devel] [PATCH 12/56] check-qjson: Simplify utf8_string()

2018-08-08 Thread Markus Armbruster
The previous commit made utf8_string()'s test_cases[].utf8_in superfluous: we can use .json_in instead. Except for the case testing U+. \x00 doesn't work in C strings, so it tests \\u instead. But testing \\u is escaped_string()'s job. It's covered there. Test U+0001 here, and drop .

[Qemu-devel] [PATCH 17/56] json: Reject unescaped control characters

2018-08-08 Thread Markus Armbruster
Fix the lexer to reject unescaped control characters in JSON strings, in accordance with RFC 7159. Bonus: we now recover more nicely from unclosed strings. E.g. {"one: 1}\n{"two": 2} now recovers cleanly after the newline, where before the lexer remained confused until the next unpaired dou

[Qemu-devel] [PATCH 31/56] json-parser: simplify and avoid JSONParserContext allocation

2018-08-08 Thread Markus Armbruster
From: Marc-André Lureau parser_context_new/free() are only used from json_parser_parse(). We can fold the code there and avoid an allocation altogether. Signed-off-by: Marc-André Lureau Message-Id: <20180719184111.5129-9-marcandre.lur...@redhat.com> Reviewed-by: Markus Armbruster --- qobject/

[Qemu-devel] [PATCH 36/56] json: Rename token JSON_ESCAPE & friends to JSON_INTERPOL

2018-08-08 Thread Markus Armbruster
The JSON parser optionally supports interpolation. The code calls it "escape". Awkward, because it uses the same term for escape sequences within strings. The latter usage is consistent with RFC 7159 "The JavaScript Object Notation (JSON) Data Interchange Format" and ISO C. Call the former "inte

  1   2   3   >