Re: [Qemu-devel] [PULL for-2.5 0/6] qemu-ga patch queue for 2.5

2015-11-25 Thread Eric Blake
On 11/25/2015 03:47 PM, Michael Roth wrote: > The following changes since commit 1a4dab849d5d06191ab5e5850f6b8bfcad8ceb47: > > Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging > (2015-11-25 14:47:06 +) > > are available in the git repository at: > > >

[Qemu-devel] [PATCH v6 22/23] qapi: Split visit_end_struct() into pieces

2015-11-25 Thread Eric Blake
As mentioned in previous patches, we want to call visit_end_struct() functions unconditionally, so that visitors can release resources tied up since the matching visit_start_struct() without also having to worry about error priority if more than one error occurs. Even though error_propagate() can

[Qemu-devel] [PATCH v8] block/raw-posix.c: Make physical devices usable in QEMU under Mac OS X host

2015-11-25 Thread Programmingkid
Mac OS X can be picky when it comes to allowing the user to use physical devices in QEMU. Most mounted volumes appear to be off limits to QEMU. If an issue is detected, a message is displayed showing the user how to unmount a volume. Signed-off-by: John Arbuckle ---

[Qemu-devel] [PATCH v6 19/23] qapi-visit: Unify struct and union visit

2015-11-25 Thread Eric Blake
We are finally at the point where gen_visit_struct() and gen_visit_union() can be unified to a generic gen_visit_object(). The generated code for structs and for flat unions is unchanged. For simple unions, a new visit_type_FOO_fields() is created, wrapping the visit of the non-variant tag field:

[Qemu-devel] [PULL for-2.5 2/6] qga: gspawn() console helper to Windows guest agent msi build

2015-11-25 Thread Michael Roth
From: Yuri Pudgorodskiy This helper, gspawn-win64-helper-console.exe for 64-bit and gspawn-win32-helper-console.exe for 32-bit environment, is needed for gspawn() mingw implementation, used by guest-exec command. Without these files guest-exec command on Windows will not

[Qemu-devel] [PULL v2 for-2.5 3/6] qga: flush explicitly when needed

2015-11-25 Thread Michael Roth
From: Marc-André Lureau According to the specification: http://pubs.opengroup.org/onlinepubs/9699919799/functions/fopen.html "the application shall ensure that output is not directly followed by input without an intervening call to fflush() or to a file positioning

[Qemu-devel] [PULL v2 for-2.5 4/6] tests: add file-write-read test

2015-11-25 Thread Michael Roth
From: Marc-André Lureau This test exhibits a POSIX behaviour regarding switching between write and read. It's undefined result if the application doesn't ensure a flush between the two operations (with glibc, the flush can be implicit when the buffer size is

[Qemu-devel] [PULL v2 for-2.5 5/6] qga: Better mapping of SEEK_* in guest-file-seek

2015-11-25 Thread Michael Roth
From: Eric Blake Exposing OS-specific SEEK_ constants in our qapi was a mistake (if the host has SEEK_CUR as 1, but the guest has it as 2, then the semantics are unclear what should happen); if we had a time machine, we would instead expose only a symbolic enum. It's too late

[Qemu-devel] [PULL for-2.5 6/6] qga: added another non-interactive gspawn() helper file.

2015-11-25 Thread Michael Roth
From: Yuri Pudgorodskiy With previous commit we added gspawn-win64-helper-console.exe, required for gspawn() mingw implementation. Unfortunatly when running as a service without interactive desktop, gspawn() also requires another helper app. Added gspawn-win64-helper.exe and

[Qemu-devel] [PULL for-2.5 5/6] qga: Better mapping of SEEK_* in guest-file-seek

2015-11-25 Thread Michael Roth
From: Eric Blake Exposing OS-specific SEEK_ constants in our qapi was a mistake (if the host has SEEK_CUR as 1, but the guest has it as 2, then the semantics are unclear what should happen); if we had a time machine, we would instead expose only a symbolic enum. It's too late

[Qemu-devel] [PULL for-2.5 4/6] tests: add file-write-read test

2015-11-25 Thread Michael Roth
From: Marc-André Lureau This test exhibits a POSIX behaviour regarding switching between write and read. It's undefined result if the application doesn't ensure a flush between the two operations (with glibc, the flush can be implicit when the buffer size is

Re: [Qemu-devel] [PULL for-2.5 3/6] qga: flush explicitly when needed

2015-11-25 Thread Eric Blake
On 11/25/2015 03:47 PM, Michael Roth wrote: > From: Marc-André Lureau > > According to the specification: > http://pubs.opengroup.org/onlinepubs/9699919799/functions/fopen.html > > "the application shall ensure that output is not directly followed by > input without

[Qemu-devel] [PULL v2 for-2.5 0/6] qemu-ga patch queue for 2.5

2015-11-25 Thread Michael Roth
The following changes since commit 1a4dab849d5d06191ab5e5850f6b8bfcad8ceb47: Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging (2015-11-25 14:47:06 +) are available in the git repository at: git://github.com/mdroth/qemu.git tags/qga-pull-2015-11-25-v2-tag

[Qemu-devel] [PULL v2 for-2.5 1/6] makefile: fix qemu-ga make install for --disable-tools

2015-11-25 Thread Michael Roth
ab59e3e introduced a fix for `make install` on w32 that involved filtering out qemu-ga from $TOOLS install recipe so that we could append $(EXESUF) to it before attempting to install the binary via install-prog function. install-prog takes a list of binaries to install to a particular directory.

[Qemu-devel] [PULL v2 for-2.5 2/6] qga: gspawn() console helper to Windows guest agent msi build

2015-11-25 Thread Michael Roth
From: Yuri Pudgorodskiy This helper, gspawn-win64-helper-console.exe for 64-bit and gspawn-win32-helper-console.exe for 32-bit environment, is needed for gspawn() mingw implementation, used by guest-exec command. Without these files guest-exec command on Windows will not

[Qemu-devel] [PATCH v6 01/23] qapi: Make all visitors supply int64/uint64 callbacks

2015-11-25 Thread Eric Blake
Our qapi visitor contract supports multiple integer visitors: type_int (64-bit signed; mandatory), type_int64 (64-bit signed, optional), type_uint64 (64-bit unsigned, optional), and type_size (64-bit unsigned, optional, with the possibility of parsing differently than type_uint64 for the case of

[Qemu-devel] [PATCH v6 04/23] qapi: Don't cast Enum* to int*

2015-11-25 Thread Eric Blake
C compilers are allowed to represent enums as a smaller type than int, if all enum values fit in the smaller type. There are even compiler flags that force the use of this smaller representation, and using them changes the ABI of a binary. Therefore, our generated code for visit_type_ENUM() (for

[Qemu-devel] [PATCH v6 14/23] qapi: Fix command with named empty argument type

2015-11-25 Thread Eric Blake
The generator special-cased { 'command':'foo', 'data': {} } to avoid emitting a visitor variable, but failed to see that { 'struct':'NamedEmptyType, 'data': {} } { 'command':'foo', 'data':'NamedEmptyType' } needs the same treatment. Without a fix to the generator, the change to

[Qemu-devel] [PATCH v6 09/23] hmp: Improve use of qapi visitor

2015-11-25 Thread Eric Blake
Cache the visitor in a local variable instead of repeatedly calling the accessor. Pass NULL for the visit_start_struct() object (which matches the fact that we were already passing 0 for the size argument, because we aren't using the visit to allocate a qapi struct). Pass "object" for the struct

[Qemu-devel] [PATCH v6 08/23] qapi: Drop unused error argument for list and implicit struct

2015-11-25 Thread Eric Blake
No backend was setting an error when ending the visit of a list or implicit struct. Make the callers a bit easier to follow by making this a part of the contract, and removing the errp argument - callers can then unconditionally end an object as part of cleanup without having to think about

[Qemu-devel] [PATCH v6 07/23] qapi: Document visitor interfaces

2015-11-25 Thread Eric Blake
The visitor interface for mapping between QObject/QemuOpts/string and qapi has formerly been documented only by reading source code, making it difficult to propose changes to either scripts/qapi*.py or to clients without knowing whether those changes would be safe. This adds documentation,

[Qemu-devel] [PATCH v6 02/23] qapi: Require int64/uint64 implementation

2015-11-25 Thread Eric Blake
Now that all visitors supply both type_int64() and type_uint64() callbacks, we can drop the redundant type_int() callback (the public interface visit_type_int() remains, but calls into type_int64() under the hood). Signed-off-by: Eric Blake --- v6: new patch, but stems from

[Qemu-devel] [PATCH v6 13/23] qapi: Add type.is_empty() helper

2015-11-25 Thread Eric Blake
And use it in qapi-types and qapi-event. Down the road, we may want to lift our artificial restriction of no variants at the top level of an event, at which point, inlining our check for whether members is empty will no longer be sufficient. More immediately, the new .is_empty() helper will help

[Qemu-devel] [PATCH v6 20/23] qapi: Rework deallocation of partial struct

2015-11-25 Thread Eric Blake
Commit cee2dedb noticed that if you have a partial flat union (such as if an input parse failed due to a missing discriminator), calling the dealloc visitor could result in trying to dereference the NULL pointer. But the fix it proposed requires the use of a 'data' member in the union, which may

Re: [Qemu-devel] [RFC v1] virtio-crypto specification

2015-11-25 Thread Denis Crasta
+Rajesh, Michal, Sebastian Denis -Original Message- From: Lingli Deng [mailto:denglin...@chinamobile.com] Sent: Wednesday, November 25, 2015 6:31 PM To: Sethi Varun-B16395 ; 'Gonglei (Arei)' ; virtio-...@lists.oasis-open.org;

Re: [Qemu-devel] [RFC PATCH V2 0/3] IXGBE/VFIO: Add live migration support for SRIOV NIC

2015-11-25 Thread Alexander Duyck
On Wed, Nov 25, 2015 at 7:15 PM, Dong, Eddie wrote: >> On Wed, Nov 25, 2015 at 12:21 AM, Lan Tianyu wrote: >> > On 2015年11月25日 13:30, Alexander Duyck wrote: >> >> No, what I am getting at is that you can't go around and modify the >> >> configuration

Re: [Qemu-devel] [PATCH] error: Document how to accumulate multiple errors

2015-11-25 Thread Fam Zheng
On Tue, 11/17 17:05, Markus Armbruster wrote: > Suggested-by: Eric Blake > Signed-off-by: Markus Armbruster > Reviewed-by: Eric Blake > --- > include/qapi/error.h | 17 + > 1 file changed, 17 insertions(+) > > diff --git

[Qemu-devel] 答复: [RFC v1] virtio-crypto specification

2015-11-25 Thread Lingli Deng
Hi Varun, Thanks for the bridging. Hi Gonglei and virtio-crypto guys, As Varun said, dpacc is working on enabling the portability of data plane VNFs (leveraging software/hardware accelerators in the host) across hardware platforms, and virtio extensions for such accelerator had been

[Qemu-devel] [PATCH] Avoid memory leak

2015-11-25 Thread dongxingshui
monitor.c: Avoid memory leak When send a wrong qmp command, a memory leak occurs. Fix it. Signed-off-by: dongxingshui --- monitor.c | 1 + 1 file changed, 1 insertion(+) diff --git a/monitor.c b/monitor.c index e4cf34e..af6cfc5 100644 --- a/monitor.c +++ b/monitor.c

Re: [Qemu-devel] [PATCH for-2.5] Avoid memory leak

2015-11-25 Thread Eric Blake
On 11/25/2015 06:30 PM, dongxingshui wrote: > monitor.c: Avoid memory leak > > When send a wrong qmp command, a memory leak occurs. Fix it. Looks like the leak was introduced in 710aec9; would be worth amending the commit message to mention that. Reviewed-by: Eric Blake >

Re: [Qemu-devel] [PATCH v9] block/raw-posix.c: Make physical devices usable in QEMU under Mac OS X host

2015-11-25 Thread Eric Blake
On 11/25/2015 09:10 PM, Programmingkid wrote: > Mac OS X can be picky when it comes to allowing the user > to use physical devices in QEMU. Most mounted volumes > appear to be off limits to QEMU. If an issue is detected, > a message is displayed showing the user how to unmount a > volume. > >

[Qemu-devel] [PATCH v2] ui/cocoa.m: Prevent activation clicks from going to guest

2015-11-25 Thread Programmingkid
When QEMU is brought to the foreground, the click event that activates QEMU should not go to the guest. Accidents happen when they do go to the guest without giving the user a change to handle them. Buttons are clicked accidently. Windows are closed accidently. Volumes are unmounted accidently.

Re: [Qemu-devel] [PATCH] Revert "vhost: send SET_VRING_ENABLE at start/stop"

2015-11-25 Thread Yuanhan Liu
On Wed, Nov 25, 2015 at 02:42:05PM +0200, Michael S. Tsirkin wrote: > This reverts commit 3a12f32229a046f4d4ab0a3a52fb01d2d5a1ab76. > > In case of live migration several queues can be enabled and not only the > first one. So informing backend that only the first queue is enabled is > wrong.

Re: [Qemu-devel] [RFC PATCH V2 0/3] IXGBE/VFIO: Add live migration support for SRIOV NIC

2015-11-25 Thread Dong, Eddie
> On Wed, Nov 25, 2015 at 12:21 AM, Lan Tianyu wrote: > > On 2015年11月25日 13:30, Alexander Duyck wrote: > >> No, what I am getting at is that you can't go around and modify the > >> configuration space for every possible device out there. This > >> solution won't scale. > >

[Qemu-devel] [PATCH v9] block/raw-posix.c: Make physical devices usable in QEMU under Mac OS X host

2015-11-25 Thread Programmingkid
Mac OS X can be picky when it comes to allowing the user to use physical devices in QEMU. Most mounted volumes appear to be off limits to QEMU. If an issue is detected, a message is displayed showing the user how to unmount a volume. Signed-off-by: John Arbuckle ---

Re: [Qemu-devel] poor virtio-scsi performance (fio testing)

2015-11-25 Thread Fam Zheng
On Wed, 11/25 13:10, Vasiliy Tolstov wrote: > 2015-11-25 12:35 GMT+03:00 Stefan Hajnoczi : > > You can get better aio=native performance with qemu.git/master. Please > > see commit fc73548e444ae3239f6cef44a5200b5d2c3e85d1 ("virtio-blk: use > > blk_io_plug/unplug for Linux AIO

Re: [Qemu-devel] [Qemu-ppc] [PATCH qemu] spapr: Add /system-id

2015-11-25 Thread David Gibson
On Wed, Nov 25, 2015 at 04:15:01PM +0100, Alexander Graf wrote: > > > On 18.11.15 11:49, David Gibson wrote: > > On Wed, Nov 18, 2015 at 06:45:39PM +1100, Alexey Kardashevskiy wrote: > >> On 11/09/2015 07:47 PM, David Gibson wrote: > >>> On Mon, Nov 09, 2015 at 05:47:17PM +1100, Alexey

Re: [Qemu-devel] [PATCH for-2.5 v2] qga: Better mapping of SEEK_* in guest-file-seek

2015-11-25 Thread Michael Roth
Quoting Eric Blake (2015-11-25 11:37:15) > Exposing OS-specific SEEK_ constants in our qapi was a mistake > (if the host has SEEK_CUR as 1, but the guest has it as 2, then > the semantics are unclear what should happen); if we had a time > machine, we would instead expose only a symbolic enum.

Re: [Qemu-devel] [PATCH v2 for-2.5? 0/4] qjson: save a lot of memory

2015-11-25 Thread Paolo Bonzini
On 25/11/2015 15:47, Markus Armbruster wrote: > > This patch from 2011 (!) saves about 96% of the allocation cost (down > > from 500 MiB to 20 MiB) for check-qjson. > > Looks good to me apart from the incomplete transition to recursive > descent in PATCH 2. I do not understand whether that is

Re: [Qemu-devel] [PULL 2/9] QEMU does not care about left shifts of signed negative values

2015-11-25 Thread Peter Maydell
On 25 November 2015 at 17:50, Paolo Bonzini wrote: > On 25/11/2015 18:44, Peter Maydell wrote: >> We still haven't had any response from the LLVM/clang folks that >> this interpretation of the meaning of -fwrapv is their interpretation >> of it, have we? (I can't see any

Re: [Qemu-devel] [PULL 2/9] QEMU does not care about left shifts of signed negative values

2015-11-25 Thread Paolo Bonzini
On 25/11/2015 20:18, Peter Maydell wrote: > And LLVM is its own project and its developers don't always exactly > follow gcc behaviour. True. The patch docuuments that if LLVM will not respect 2s complement for signed shifts when passed the -fwrapv option, it will not be supported for

Re: [Qemu-devel] [PULL 2/9] QEMU does not care about left shifts of signed negative values

2015-11-25 Thread Peter Maydell
On 25 November 2015 at 19:30, Paolo Bonzini wrote: > > > On 25/11/2015 20:18, Peter Maydell wrote: >> And LLVM is its own project and its developers don't always exactly >> follow gcc behaviour. > > True. The patch documents that if LLVM will not respect 2s complement > for

[Qemu-devel] [PATCH] target-arm: Fix and improve AA32 singlestep translation completion code

2015-11-25 Thread Sergey Fedorov
The AArch32 translation completion code for singlestep enabled/active case was a way more confusing and too repetitive then it needs to be. Probably that was the cause for a bug to be introduced into it at some point. The bug was that SWI/HVC/SMC exception would be generated in condition-failed

Re: [Qemu-devel] RFC: raspberry pi / pi2 / Windows-on-ARM support

2015-11-25 Thread Andrew Baumann
> From: Peter Maydell [mailto:peter.mayd...@linaro.org] > Sent: Wednesday, 25 November 2015 01:11 > On 25 November 2015 at 06:04, Peter Crosthwaite > wrote: > > On Tue, Nov 24, 2015 at 4:00 PM, Andrew Baumann > > wrote: > >>In general,

Re: [Qemu-devel] [PATCH v2 for-2.5? 0/4] qjson: save a lot of memory

2015-11-25 Thread Markus Armbruster
Paolo Bonzini writes: > On 25/11/2015 15:47, Markus Armbruster wrote: >> > This patch from 2011 (!) saves about 96% of the allocation cost (down >> > from 500 MiB to 20 MiB) for check-qjson. >> >> Looks good to me apart from the incomplete transition to recursive >> descent

Re: [Qemu-devel] [PULL 2/9] QEMU does not care about left shifts of signed negative values

2015-11-25 Thread Paolo Bonzini
On 25/11/2015 18:44, Peter Maydell wrote: > > Ubsan also has warnings for undefined behavior of left shifts. Checks for > > left shift overflow and left shift of negative numbers, unfortunately, > > cannot be silenced without also silencing the useful ones about out-of-range > > shift amounts.

Re: [Qemu-devel] [RFC PATCH 0/9] vhost-nvme: new qemu nvme backend using nvme target

2015-11-25 Thread Paolo Bonzini
On 25/11/2015 19:51, Ming Lin wrote: > > Do you still have a blk_set_aio_context somewhere? I'm losing track of > > the changes. > > No. You'll need it. That's what causes your error. > BTW, I'm not sure about qemu upstream policy. > Do I need to first make the kernel side patch upstream? >

Re: [Qemu-devel] [PATCH v6 1/3] target-i386: fallback vcpu's TSC rate to value returned by KVM

2015-11-25 Thread Eduardo Habkost
On Tue, Nov 24, 2015 at 11:33:55AM +0800, Haozhong Zhang wrote: > If no user-specified TSC rate is present, we will try to set > env->tsc_khz to the value returned by KVM_GET_TSC_KHZ. This patch does > not change the current functionality of QEMU and just prepares for later > patches to enable

Re: [Qemu-devel] [RFC PATCH 0/9] vhost-nvme: new qemu nvme backend using nvme target

2015-11-25 Thread Ming Lin
On Wed, 2015-11-25 at 12:27 +0100, Paolo Bonzini wrote: > Do you still have a blk_set_aio_context somewhere? I'm losing track of > the changes. No. > > In any case, I think using a separate I/O thread is a bit premature, > except for benchmarking. In the meanwhile I think the best option is

Re: [Qemu-devel] [OpenBIOS] [Qemu-ppc] CUDA has problems with Mac OS 10.4

2015-11-25 Thread Mark Cave-Ayland
On 24/11/15 09:01, Alfonso Gamboa wrote: > These images are definitely helpful, however what would be really useful > to know is exactly what the modules in question do: > > - Multiprocessing (maybe uses a currently unimplemented CPU instruction > to facilitate faster

[Qemu-devel] [PATCH for-2.6] qga: Support enum names in guest-file-seek

2015-11-25 Thread Eric Blake
Magic constants are a pain to use, especially when we run the risk that our choice of '1' for QGA_SEEK_CUR might differ from the host or guest's choice of SEEK_CUR. Better is to use an enum value, via a qapi alternate type for back-compatibility. With this, {"command":"guest-file-seek",

[Qemu-devel] [PULL 0/4] Ide patches

2015-11-25 Thread John Snow
The following changes since commit 4b6eda626fdb8bf90472c6868d502a2ac09abeeb: Merge remote-tracking branch 'remotes/lalrae/tags/mips-20151124' into staging (2015-11-24 17:05:06 +) are available in the git repository at: https://github.com/jnsnow/qemu.git tags/ide-pull-request for you

[Qemu-devel] [PULL 1/4] ide-test: cdrom_pio_impl fixup

2015-11-25 Thread John Snow
Final tidying: move the interrupt wait into the loop, document that the status read clears the IRQ, and move the final interrupt check outside of the loop. This should be functionally equivalent to how it works currently, but a little less ambiguous and slightly more explicit about the state

Re: [Qemu-devel] [PULL 2/9] QEMU does not care about left shifts of signed negative values

2015-11-25 Thread Paolo Bonzini
On 25/11/2015 20:54, Peter Maydell wrote: > > > Your latest patch at > > > https://gcc.gnu.org/ml/gcc-patches/2015-11/msg03055.html > > > doesn't seem to touch the documentation of -fwrapv at all, so I > > > don't think it is sufficient to allow users of the compiler > > > to say "-fwrapv means

Re: [Qemu-devel] [PULL 2/9] QEMU does not care about left shifts of signed negative values

2015-11-25 Thread Peter Maydell
On 25 November 2015 at 21:05, Paolo Bonzini wrote: > > > On 25/11/2015 20:54, Peter Maydell wrote: >> > > Your latest patch at >> > > https://gcc.gnu.org/ml/gcc-patches/2015-11/msg03055.html >> > > doesn't seem to touch the documentation of -fwrapv at all, so I >> > > don't

Re: [Qemu-devel] [PATCH v3 for-2.5 04/12] qjson: Spell out some silent assumptions

2015-11-25 Thread Eric Blake
On 11/25/2015 02:23 PM, Markus Armbruster wrote: > Signed-off-by: Markus Armbruster > --- > include/qapi/qmp/json-lexer.h | 3 ++- > qobject/json-lexer.c | 7 ++- > 2 files changed, 8 insertions(+), 2 deletions(-) > > +QEMU_BUILD_BUG_ON((int)JSON_MIN <=

Re: [Qemu-devel] [PATCH v3 for-2.5 05/12] qjson: Give each of the six structural chars its own token type

2015-11-25 Thread Eric Blake
On 11/25/2015 02:23 PM, Markus Armbruster wrote: > Simplifies things, because we always check for a specific one. > > Signed-off-by: Markus Armbruster > --- > include/qapi/qmp/json-lexer.h | 7 ++- > qobject/json-lexer.c | 19 --- >

Re: [Qemu-devel] [PATCH v2] util/id: fully allocate names table

2015-11-25 Thread Jeff Cody
On Wed, Nov 25, 2015 at 04:03:37PM -0500, John Snow wrote: > Trivial: this array should be allocated to have ID_MAX entries always. > Otherwise if someone were to forget to expand this table, the assertion > in the id generator won't actually trigger; it will read junk data. > > v2: Fix the range

Re: [Qemu-devel] [PATCH v3 for-2.5 06/12] qjson: Inline token_is_keyword() and simplify

2015-11-25 Thread Eric Blake
On 11/25/2015 02:23 PM, Markus Armbruster wrote: > Signed-off-by: Markus Armbruster > --- > qobject/json-parser.c | 20 +++- > 1 file changed, 7 insertions(+), 13 deletions(-) > > > -if (token_is_keyword(token, "true")) { > +val =

Re: [Qemu-devel] [PATCH v3 for-2.5 07/12] qjson: Inline token_is_escape() and simplify

2015-11-25 Thread Eric Blake
On 11/25/2015 02:23 PM, Markus Armbruster wrote: > Signed-off-by: Markus Armbruster > --- > qobject/json-parser.c | 32 +++- > 1 file changed, 15 insertions(+), 17 deletions(-) > > +if (!strcmp(val, "%p")) { > obj = va_arg(*ap,

Re: [Qemu-devel] [PATCH v3 for-2.5 08/12] qjson: replace QString in JSONLexer with GString

2015-11-25 Thread Eric Blake
On 11/25/2015 02:23 PM, Markus Armbruster wrote: > From: Paolo Bonzini > > JSONLexer only needs a simple resizable buffer. json-streamer.c > can allocate memory for each token instead of relying on reference > counting of QStrings. > > Signed-off-by: Paolo Bonzini

Re: [Qemu-devel] [PATCH for 2.5 1/1] qga: added another non-interactive gspawn() helper file.

2015-11-25 Thread Michael Roth
Quoting Denis V. Lunev (2015-11-25 13:02:26) > From: Yuri Pudgorodskiy > > With previous commit we added gspawn-win64-helper-console.exe, > required for gspawn() mingw implementation. > Unfortunatly when running as a service without interactive > desktop, gspawn() also

Re: [Qemu-devel] [PATCH v3 for-2.5 09/12] qjson: Convert to parser to recursive descent

2015-11-25 Thread Eric Blake
On 11/25/2015 02:23 PM, Markus Armbruster wrote: > We backtrack in parse_value(), even though JSON is LL(1) and thus can > be parsed by straightforward recursive descent. Do exactly that. > > Based on an almost-correct patch from Paolo Bonzini. > > Signed-off-by: Markus Armbruster

[Qemu-devel] [PATCH v3 for-2.5 10/12] qjson: store tokens in a GQueue

2015-11-25 Thread Markus Armbruster
From: Paolo Bonzini Even though we still have the "streamer" concept, the tokens can now be deleted as they are read. While doing so convert from QList to GQueue, since the next step will make tokens not a QObject and we will have to do the conversion anyway.

[Qemu-devel] [PATCH v3 for-2.5 07/12] qjson: Inline token_is_escape() and simplify

2015-11-25 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- qobject/json-parser.c | 32 +++- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/qobject/json-parser.c b/qobject/json-parser.c index df76cc3..b57cac7 100644 --- a/qobject/json-parser.c +++

[Qemu-devel] [PATCH v3 for-2.5 01/12] qjson: Apply nesting limit more sanely

2015-11-25 Thread Markus Armbruster
The nesting limit from commit 29c75dd "json-streamer: limit the maximum recursion depth and maximum token count" applies separately to braces and brackets. This makes no sense. Apply it to their sum, because that's actually a measure of recursion depth. Signed-off-by: Markus Armbruster

[Qemu-devel] [PATCH v3 for-2.5 03/12] check-qjson: Add test for JSON nesting depth limit

2015-11-25 Thread Markus Armbruster
This would have prevented the regression mentioned in the previous commit. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- tests/check-qjson.c | 25 + 1 file changed, 25 insertions(+) diff --git a/tests/check-qjson.c

[Qemu-devel] [PATCH v3 for-2.5 06/12] qjson: Inline token_is_keyword() and simplify

2015-11-25 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- qobject/json-parser.c | 20 +++- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/qobject/json-parser.c b/qobject/json-parser.c index 020c6e1..df76cc3 100644 --- a/qobject/json-parser.c +++

[Qemu-devel] [PATCH v3 for-2.5 05/12] qjson: Give each of the six structural chars its own token type

2015-11-25 Thread Markus Armbruster
Simplifies things, because we always check for a specific one. Signed-off-by: Markus Armbruster --- include/qapi/qmp/json-lexer.h | 7 ++- qobject/json-lexer.c | 19 --- qobject/json-parser.c | 31 +--

[Qemu-devel] [PATCH v3 for-2.5 08/12] qjson: replace QString in JSONLexer with GString

2015-11-25 Thread Markus Armbruster
From: Paolo Bonzini JSONLexer only needs a simple resizable buffer. json-streamer.c can allocate memory for each token instead of relying on reference counting of QStrings. Signed-off-by: Paolo Bonzini Message-Id:

[Qemu-devel] [PATCH v3 for-2.5 11/12] qjson: surprise, allocating 6 QObjects per token is expensive

2015-11-25 Thread Markus Armbruster
From: Paolo Bonzini Replace the contents of the tokens GQueue with a simple struct. This cuts the amount of memory allocated by tests/check-qjson from ~500MB to ~20MB, and the execution time from 600ms to 80ms on my laptop. Still a lot (some could be saved by using an

[Qemu-devel] QEMU being able to use audio cdroms

2015-11-25 Thread Programmingkid
Is there any platform where a guest in QEMU can play an audio cd? If not, is this a feature that you would allow into QEMU?

Re: [Qemu-devel] [PATCH v2] util/id: fully allocate names table

2015-11-25 Thread Eric Blake
On 11/25/2015 02:03 PM, John Snow wrote: > Trivial: this array should be allocated to have ID_MAX entries always. > Otherwise if someone were to forget to expand this table, the assertion > in the id generator won't actually trigger; it will read junk data. > > v2: Fix the range assertion, too.

[Qemu-devel] [PATCH v3 for-2.5 00/12] qjson: Fix crash & save a lot of memory

2015-11-25 Thread Markus Armbruster
This is a fusion of my "[PATCH v2 0/4] json-streamer: Fix up code to limit nesting and size" and Paolo's "[PATCH v2 for-2.5? 0/4] qjson: save a lot of memory", with four straightforward cleanups thrown in to simplify the later patches. PATCH 01-03 are about the nesting limit. PATCH 04-07 are

[Qemu-devel] [PATCH v3 for-2.5 04/12] qjson: Spell out some silent assumptions

2015-11-25 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- include/qapi/qmp/json-lexer.h | 3 ++- qobject/json-lexer.c | 7 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/include/qapi/qmp/json-lexer.h b/include/qapi/qmp/json-lexer.h index cdff046..61a143f 100644 ---

[Qemu-devel] [PATCH v3 for-2.5 09/12] qjson: Convert to parser to recursive descent

2015-11-25 Thread Markus Armbruster
We backtrack in parse_value(), even though JSON is LL(1) and thus can be parsed by straightforward recursive descent. Do exactly that. Based on an almost-correct patch from Paolo Bonzini. Signed-off-by: Markus Armbruster --- qobject/json-parser.c | 165

[Qemu-devel] [PATCH v3 for-2.5 02/12] qjson: Don't crash when input exceeds nesting limit

2015-11-25 Thread Markus Armbruster
We limit nesting depth and input size to defend against input triggering excessive heap or stack memory use (commit 29c75dd json-streamer: limit the maximum recursion depth and maximum token count). However, when the nesting limit is exceeded, parser_context_peek_token()'s assertion fails.

[Qemu-devel] [PATCH v3 for-2.5 12/12] qjson: Limit number of tokens in addition to total size

2015-11-25 Thread Markus Armbruster
Commit 29c75dd "json-streamer: limit the maximum recursion depth and maximum token count" attempts to guard against excessive heap usage by limiting total token size (it says "token count", but that's a lie). Total token size is a rather imprecise predictor of heap usage: many small tokens use

[Qemu-devel] [PULL 2/4] atapi: Account for failed and invalid operations in cd_read_sector()

2015-11-25 Thread John Snow
From: Alberto Garcia Commit 5f81724d made PIO read requests async but didn't add the relevant block_acct_failed() and block_acct_invalid() calls. Signed-off-by: Alberto Garcia Reviewed-by: John Snow Message-id:

[Qemu-devel] [PULL 4/4] ide-test: fix timeouts

2015-11-25 Thread John Snow
Use explicit timeouts instead of trying to approximate it by counting the cumulative duration of nsleep calls. In practice, the timeout if inb() dwarfed the nsleep delays, and as a result the real timeout value became a lot larger than 5 seconds. So: change the semantics from "Not sooner than 5

[Qemu-devel] [PULL 3/4] atapi: Fix code indentation

2015-11-25 Thread John Snow
From: Alberto Garcia This was accidentally changed by commit 5f81724d Signed-off-by: Alberto Garcia Reviewed-by: John Snow Message-id: 93fb43522e3b8dddb6c709d568919347d9a5ba3f.1448367341.git.be...@igalia.com Signed-off-by: John Snow

[Qemu-devel] [PATCH v2] util/id: fully allocate names table

2015-11-25 Thread John Snow
Trivial: this array should be allocated to have ID_MAX entries always. Otherwise if someone were to forget to expand this table, the assertion in the id generator won't actually trigger; it will read junk data. v2: Fix the range assertion, too. Compare against the known actual size of the

Re: [Qemu-devel] [PATCH v3 for-2.5 10/12] qjson: store tokens in a GQueue

2015-11-25 Thread Eric Blake
On 11/25/2015 02:23 PM, Markus Armbruster wrote: > From: Paolo Bonzini > > Even though we still have the "streamer" concept, the tokens can now > be deleted as they are read. While doing so convert from QList to > GQueue, since the next step will make tokens not a QObject

Re: [Qemu-devel] [PULL 2/9] QEMU does not care about left shifts of signed negative values

2015-11-25 Thread Peter Maydell
On 25 November 2015 at 17:19, Paolo Bonzini wrote: > Ubsan also has warnings for undefined behavior of left shifts. Checks for > left shift overflow and left shift of negative numbers, unfortunately, > cannot be silenced without also silencing the useful ones about

[Qemu-devel] [PATCH v3 04/15] raw: Assign bs to file in raw_co_get_block_status

2015-11-25 Thread Fam Zheng
Reviewed-by: Eric Blake Signed-off-by: Fam Zheng --- block/raw-posix.c | 1 + block/raw_bsd.c | 1 + 2 files changed, 2 insertions(+) diff --git a/block/raw-posix.c b/block/raw-posix.c index 2cd7d68..9988aa4 100644 --- a/block/raw-posix.c +++

[Qemu-devel] [PATCH v3 00/15] qemu-img map: Allow driver to return file of the allocated block

2015-11-25 Thread Fam Zheng
v3: Add Eric's rev-by in patches 6, 7, 13, 14. 12: New, split out from the previous 13. 12->13: Refactor "entry_mergable" from imp_map(). Don't mess the merge conditions. [Paolo] Address Eric's comments: - Check has_foo before using foo. - Remove blank line

[Qemu-devel] [PATCH v3 01/15] block: Add "file" output parameter to block status query functions

2015-11-25 Thread Fam Zheng
The added parameter can be used to return the BDS pointer which the valid offset is referring to. It's value should be ignored unless BDRV_BLOCK_OFFSET_VALID in ret is set. Until block drivers fill in the right value, let's clear it explicitly right before calling .bdrv_get_block_status.

[Qemu-devel] [PATCH v3 02/15] qcow: Assign bs->file->bs to file in qcow_co_get_block_status

2015-11-25 Thread Fam Zheng
Reviewed-by: Eric Blake Signed-off-by: Fam Zheng --- block/qcow.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/qcow.c b/block/qcow.c index 558f443..b59383f 100644 --- a/block/qcow.c +++ b/block/qcow.c @@ -509,6 +509,7 @@ static int64_t

Re: [Qemu-devel] [PATCH v3 13/15] qemu-img: Make MapEntry a QAPI struct

2015-11-25 Thread Eric Blake
On 11/25/2015 10:05 PM, Fam Zheng wrote: > The "flags" bit mask is expanded to two booleans, "data" and "zero"; > "bs" is replaced with "filename" string. > > Refactor the merge conditions in img_map() into entry_mergable(). s/mergable/mergeable/ here and in the patch body > > Signed-off-by:

[Qemu-devel] [PATCH v3 12/15] qemu-img: In "map", use the returned "file" from bdrv_get_block_status

2015-11-25 Thread Fam Zheng
Now all drivers should return a correct "file", we can make use of it, even with the recursion into backing chain above. Signed-off-by: Fam Zheng --- qemu-img.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qemu-img.c b/qemu-img.c index 7954242..a7fa794

[Qemu-devel] [PATCH v3 05/15] iscsi: Assign bs to file in iscsi_co_get_block_status

2015-11-25 Thread Fam Zheng
Reviewed-by: Eric Blake Signed-off-by: Fam Zheng --- block/iscsi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/iscsi.c b/block/iscsi.c index 2d1e230..8c7f1b3 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -625,6 +625,9 @@ out: if

[Qemu-devel] [PATCH v3 03/15] qcow2: Assign bs->file->bs to file in qcow2_co_get_block_status

2015-11-25 Thread Fam Zheng
Signed-off-by: Fam Zheng --- block/qcow2.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/qcow2.c b/block/qcow2.c index 836888c..7634c42 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1302,6 +1302,7 @@ static int64_t coroutine_fn

[Qemu-devel] [PATCH v3 11/15] vmdk: Return extent's file in bdrv_get_block_status

2015-11-25 Thread Fam Zheng
Signed-off-by: Fam Zheng --- block/vmdk.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/block/vmdk.c b/block/vmdk.c index f5a56fd..b60a5af 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -1265,6 +1265,7 @@ static int64_t coroutine_fn

[Qemu-devel] [PATCH v3 06/15] parallels: Assign bs->file->bs to file in parallels_co_get_block_status

2015-11-25 Thread Fam Zheng
Reviewed-by: Eric Blake Signed-off-by: Fam Zheng --- block/parallels.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/parallels.c b/block/parallels.c index d1146f1..6552f32 100644 --- a/block/parallels.c +++ b/block/parallels.c @@ -273,6 +273,7 @@

[Qemu-devel] [PATCH v3 07/15] qed: Assign bs->file->bs to file in bdrv_qed_co_get_block_status

2015-11-25 Thread Fam Zheng
Reviewed-by: Eric Blake Signed-off-by: Fam Zheng --- block/qed.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/block/qed.c b/block/qed.c index a6bbd8b..03af9c1 100644 --- a/block/qed.c +++ b/block/qed.c @@ -692,6 +692,7 @@ typedef struct {

Re: [Qemu-devel] [PATCH v1 0/7] KVM: Hyper-V SynIC timers

2015-11-25 Thread Wanpeng Li
2015-11-25 23:20 GMT+08:00 Andrey Smetanin : > Per Hyper-V specification (and as required by Hyper-V-aware guests), > SynIC provides 4 per-vCPU timers. Each timer is programmed via a pair > of MSRs, and signals expiration by delivering a special format message > to the

Re: [Qemu-devel] [PATCH v2 01/14] block: Add "file" output parameter to block status query functions

2015-11-25 Thread Fam Zheng
On Wed, 11/25 22:03, Eric Blake wrote: > On 11/25/2015 12:39 AM, Fam Zheng wrote: > > The added parameter can be used to return the BDS pointer which the > > valid offset is referring to. It's value should be ignored unless > > s/It's/Its/ (remember, "It's" is valid only if "It is" also works in

Re: [Qemu-devel] [PATCH v3 0/4] Bitmap clean-up patches for 2.6

2015-11-25 Thread Fam Zheng
On Wed, 11/25 09:57, Vladimir Sementsov-Ogievskiy wrote: > Hmm, stop. Very bad thing (sorry, that I didn't realize it before): > > This breaks my dirty bitmap migration series with its meta bitmaps. > Meta bitmap is an additional HBitmap in BdrvDirtyBitmap, which > tracks dirtiness of this

Re: [Qemu-devel] [PATCH] Avoid memory leak

2015-11-25 Thread Markus Armbruster
dongxingshui writes: > monitor.c: Avoid memory leak > > When send a wrong qmp command, a memory leak occurs. Fix it. > > Signed-off-by: dongxingshui Functionally the same as http://lists.gnu.org/archive/html/qemu-devel/2015-10/msg06862.html

Re: [Qemu-devel] [SeaBIOS] bug: incorrect uuid in seabios output

2015-11-25 Thread Gerd Hoffmann
On Di, 2015-11-24 at 11:55 -0500, Cole Robinson wrote: > Hi, > > The UUID seabios reports in its boot output doesn't match what is passed via > qemu -uuid option. An example is reported here: > > https://bugzilla.redhat.com/show_bug.cgi?id=1284259 > > This is due to: > > commit

<    1   2   3   4   >