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
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
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
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
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
@@
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
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
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 ++
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
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
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
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
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
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
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
* 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
"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
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
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
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
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
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
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
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
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
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
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
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
+
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
On Wed 08 Aug 2018 09:10:47 AM CEST, Leonid Bloch wrote:
> Signed-off-by: Leonid Bloch
Reviewed-by: Alberto Garcia
Berto
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
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
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
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
On Wed 08 Aug 2018 09:10:51 AM CEST, Leonid Bloch wrote:
> Signed-off-by: Leonid Bloch
Reviewed-by: Alberto Garcia
Berto
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
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
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
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
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(-)
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
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
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
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
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
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
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
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
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
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/
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
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
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-
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
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(-)
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:
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(
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-
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
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
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
> -
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
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
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-
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
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
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 +++
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 @
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
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
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
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
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
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
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
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
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
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
-
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
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
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
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
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
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.
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.
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
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
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
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 |
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
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 |
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
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
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
---
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
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
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 .
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
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/
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 - 100 of 281 matches
Mail list logo