[Qemu-devel] [PATCH V6 2/2] sdhci: Split sdhci.h for public and internal device usage

2015-09-21 Thread Sai Pavan Boddu
Split sdhci.h into Pubilc version (i.e include/hw/sd/sdhci.h) and Internal version (i.e hw/sd/sdhci-interna.h) based on register declarations and object declaration. Signed-off-by: Sai Pavan Boddu --- Changes for V6: Fix commit message. Chages for V5: Rename pubilc header version as sdhci

[Qemu-devel] [PATCH V6 1/2] sd.h: Move sd.h to include/hw/sd/

2015-09-21 Thread Sai Pavan Boddu
Create a sd directory under include/hw/ and move sd.h to same. Signed-off-by: Sai Pavan Boddu Reviewed-by: Alistair Francis --- Changes for V6: Fix commit message. Changes for V5: None Changes for V4: Fix commit message. Changes for V3: None. --- hw/sd/milkymist-memcard.c | 2 +-

[Qemu-devel] [PATCH V6 0/2]Move sdhci.h to include/hw/sd

2015-09-21 Thread Sai Pavan Boddu
Move sdhci.h splitting it into common and internal. Create a new directory for sd in include/hw/. Correct paths of sd.h in at every instance of #include. Sai Pavan Boddu (2): sd.h: Move sd.h to include/hw/sd/ sdhci: Split sdhci.h for public and internal device usage hw/sd/milkymist-memcard.c

[Qemu-devel] [PATCH V5 2/2] sdhci: Split sdhci.h for public and internal device usage

2015-09-21 Thread Sai Pavan Boddu
Split sdhci.h into pubilc Version (i.e include/hw/sd/sdhci.h) and internal version (i.e hw/sd/sdhci-interna.h) base on register declarations and object declaration. Signed-off-by: Sai Pavan Boddu --- Chagdes for V5: Rename pubilc header version as sdhci.h and internal version to sdhci-interna

[Qemu-devel] [PATCH V5 0/2] Move sdhci.h to include/hw/sd

2015-09-21 Thread Sai Pavan Boddu
Move sdhci.h splitting it into common and internal. Create a new directory for sd in include/hw/. Correct paths of sd.h in at every instance of #include. Sai Pavan Boddu (2): sd.h: Move sd.h to include/hw/sd/ sdhci: Split sdhci.h for public and internal device usage hw/sd/milkymist-memcard.c

[Qemu-devel] [PATCH V5 1/2] sd.h: Move sd.h to include/hw/sd/

2015-09-21 Thread Sai Pavan Boddu
Create a sd director under include/hw/ and move sd.h to same. Signed-off-by: Sai Pavan Boddu Reviewed-by: Alistair Francis --- Changes for V5: None Changes for V4: Fix commit message. Changes for V3: None. --- hw/sd/milkymist-memcard.c | 2 +- hw/sd/omap_mmc.c | 2 +- hw/sd

Re: [Qemu-devel] [Qemu-block] [PATCH] block/nfs: add support for setting debug level

2015-09-21 Thread Peter Lieven
Am 25.06.2015 um 15:18 schrieb Stefan Hajnoczi: On Tue, Jun 23, 2015 at 10:12:15AM +0200, Peter Lieven wrote: upcoming libnfs versions will support logging debug messages. Add support for it in qemu through an URL parameter. Signed-off-by: Peter Lieven --- block/nfs.c | 4 1 file chang

Re: [Qemu-devel] [PATCH] target-tilegx: Implement v*add and v*sub instructions

2015-09-21 Thread Chen Gang
On 2015年09月19日 10:34, Richard Henderson wrote: > > There's a trick for this that's more efficient for 4 or more elements > per vector (i.e. good for v2 and v1, but not v4): > >a + b = (a & 0x7f7f7f7f) + (b & 0x7f7f7f7f)) ^ ((a ^ b) & 0x80808080) > >a - b = (a | 0x80808080) - (b & 0x7f7f7

Re: [Qemu-devel] Compiling Qemu from Cygwin

2015-09-21 Thread Liviu Ionescu
> On 22 Sep 2015, at 03:00, Mike Ladouceur wrote: > > Sorry, at this point, I've moved to compiling from Ubuntu as you suggested > earlier. another option, suitable for production environments, where repeatability is important, is to use Docker images. you can take a look at how GNU ARM Ecli

Re: [Qemu-devel] [PATCH v2] target-tilegx: Implement v*add and v*sub instructions

2015-09-21 Thread Richard Henderson
On 09/21/2015 05:45 PM, Chen Gang wrote: Oh, v1sub and v2sub look incorrect, need use ^b instead of ^~b. They're incorrect, but it's not ~b. Look back and the equation I gave you. r~

[Qemu-devel] [RFC PATCH v0 1/2] spapr: Allocate HTAB from machine init

2015-09-21 Thread Bharata B Rao
Allocate HTAB from ppc_spapr_init() so that we can abort the guest if requested HTAB size is't allocated by the host. However retain the htab reset call in spapr_reset_htab() so that HTAB gets reset (and not allocated) during machine reset. Signed-off-by: Bharata B Rao --- hw/ppc/spapr.c | 13 ++

[Qemu-devel] [RFC PATCH v0 2/2] spapr: Abort when HTAB of requested size isn't allocated

2015-09-21 Thread Bharata B Rao
Terminate the guest when HTAB of requested size isn't allocated by the host. When memory hotplug is attempted on a guest that has booted with less than requested HTAB size, the guest kernel will not be able to gracefully fail the hotplug request. This patch will ensure that we never end up in a si

[Qemu-devel] [RFC PATCH v0 0/2] spapr: Abort when HTAB size requirement can't be met

2015-09-21 Thread Bharata B Rao
HTAB size is a factor of maximum memory size that is specified by maxmem= command line option. In cases where there is shortage of host memory, host will not be able to allocate contiguous memory for guest HTAB and will instead allocate a smaller HTAB. This usually is not a problem but when user st

[Qemu-devel] [PATCH v7 04/14] backup: Extract dirty bitmap handling as a separate function

2015-09-21 Thread Fam Zheng
This will be reused by the coming new transactional completion code. Signed-off-by: Fam Zheng Reviewed-by: John Snow Reviewed-by: Max Reitz --- block/backup.c | 27 +-- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/block/backup.c b/block/backup.c index

[Qemu-devel] [PATCH v7 06/14] blockjob: Add .commit and .abort block job actions

2015-09-21 Thread Fam Zheng
Reviewed-by: Max Reitz Reviewed-by: John Snow Signed-off-by: Fam Zheng --- include/block/blockjob.h | 20 1 file changed, 20 insertions(+) diff --git a/include/block/blockjob.h b/include/block/blockjob.h index 3e7ad21..aee39a4 100644 --- a/include/block/blockjob.h +++ b/in

[Qemu-devel] [PATCH v7 01/14] qapi: Add transaction support to block-dirty-bitmap operations

2015-09-21 Thread Fam Zheng
From: John Snow This adds two qmp commands to transactions. block-dirty-bitmap-add allows you to create a bitmap simultaneously alongside a new full backup to accomplish a clean synchronization point. block-dirty-bitmap-clear allows you to reset a bitmap back to as-if it were new, which can als

[Qemu-devel] [PATCH v7 13/14] qmp-commands.hx: Update the supported 'transaction' operations

2015-09-21 Thread Fam Zheng
From: Kashyap Chamarthy Although the canonical source of reference for QMP commands is qapi-schema.json, for consistency's sake, update qmp-commands.hx to state the list of supported transactionable operations, namely: drive-backup blockdev-backup blockdev-snapshot-internal-sync

[Qemu-devel] [PATCH v7 12/14] iotests: 124 - transactional failure test

2015-09-21 Thread Fam Zheng
From: John Snow Use a transaction to request an incremental backup across two drives. Coerce one of the jobs to fail, and then re-run the transaction. Verify that no bitmap data was lost due to the partial transaction failure. To support the 'transactional-cancel' QMP argument name it's necessa

[Qemu-devel] [PATCH v7 14/14] tests: add BlockJobTxn unit test

2015-09-21 Thread Fam Zheng
From: Stefan Hajnoczi The BlockJobTxn unit test verifies that both single jobs and pairs of jobs behave as a transaction group. Either all jobs complete successfully or the group is cancelled. Signed-off-by: Stefan Hajnoczi Signed-off-by: Fam Zheng Reviewed-by: Max Reitz --- tests/Makefile

[Qemu-devel] [PATCH v7 10/14] blockdev: make BlockJobTxn available to qmp 'transaction'

2015-09-21 Thread Fam Zheng
From: Stefan Hajnoczi Provide a BlockJobTxn to actions executed in a qmp 'transaction' command. This allows actions to make their block jobs either complete as a group or fail/cancel together. The next patch adds the first user. Signed-off-by: Stefan Hajnoczi Reviewed-by: Fam Zheng Reviewed-

[Qemu-devel] [PATCH v7 08/14] blockjob: Simplify block_job_finish_sync

2015-09-21 Thread Fam Zheng
With job->completed and job->ret to replace BlockFinishData. Signed-off-by: Fam Zheng Reviewed-by: Max Reitz Reviewed-by: John Snow --- blockjob.c | 27 ++- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/blockjob.c b/blockjob.c index 293b62a..36c18e0 100

[Qemu-devel] [PATCH v7 11/14] block/backup: support block job transactions

2015-09-21 Thread Fam Zheng
From: Stefan Hajnoczi Join the transaction when the 'transactional-cancel' QMP argument is true. This ensures that the sync bitmap is not thrown away if another block job in the transaction is cancelled or fails. This is critical so incremental backup with multiple disks can be retried in case

[Qemu-devel] [PATCH v7 05/14] blockjob: Introduce reference count

2015-09-21 Thread Fam Zheng
So that block_job_complete_sync can be simplified. Reviewed-by: Max Reitz Reviewed-by: John Snow Signed-off-by: Fam Zheng --- block/mirror.c | 2 +- blockjob.c | 22 ++ include/block/blockjob.h | 18 +++--- 3 files changed, 30 insertions

[Qemu-devel] [PATCH v7 07/14] blockjob: Add "completed" and "ret" in BlockJob

2015-09-21 Thread Fam Zheng
They are set when block_job_completed is called. Signed-off-by: Fam Zheng Reviewed-by: John Snow Reviewed-by: Max Reitz --- blockjob.c | 3 +++ include/block/blockjob.h | 9 + 2 files changed, 12 insertions(+) diff --git a/blockjob.c b/blockjob.c index ec12887..293b62a 1

[Qemu-devel] [PATCH v7 02/14] iotests: add transactional incremental backup test

2015-09-21 Thread Fam Zheng
From: John Snow Test simple usage cases for using transactions to create and synchronize incremental backups. Signed-off-by: John Snow Reviewed-by: Max Reitz Reviewed-by: Stefan Hajnoczi Signed-off-by: Stefan Hajnoczi Reviewed-by: Fam Zheng Signed-off-by: Fam Zheng --- tests/qemu-iotests/

[Qemu-devel] [PATCH v7 03/14] block: rename BlkTransactionState and BdrvActionOps

2015-09-21 Thread Fam Zheng
From: John Snow These structures are misnomers, somewhat. (1) BlockTransactionState is not state for a transaction, but is rather state for a single transaction action. Rename it "BlkActionState" to be more accurate. (2) The BdrvActionOps describes operations for the BlkActionState,

[Qemu-devel] [PATCH v7 00/14] block: incremental backup transactions using BlockJobTxn

2015-09-21 Thread Fam Zheng
v7: Add Eric's rev-by in 1, 11. Add Max's rev-by in 4, 5, 9, 10, 11. Add John's rev-by in 5, 6, 8. Fix wording for 6. [John] Fix comment of block_job_txn_add_job() in 9. [Max] Remove superfluous hunks, and document default value in 11. [Eric] Update Makefile dep in 14. [Max]

[Qemu-devel] [PATCH v7 09/14] block: Add block job transactions

2015-09-21 Thread Fam Zheng
Sometimes block jobs must execute as a transaction group. Finishing jobs wait until all other jobs are ready to complete successfully. Failure or cancellation of one job cancels the other jobs in the group. Signed-off-by: Stefan Hajnoczi [Rewrite the implementation which is now contained in bloc

Re: [Qemu-devel] [PATCH v6 09/14] block: Add block job transactions

2015-09-21 Thread Fam Zheng
On Mon, 09/21 19:23, John Snow wrote: > > void block_job_completed(BlockJob *job, int ret) > > { > > BlockDriverState *bs = job->bs; > > @@ -98,8 +191,13 @@ void block_job_completed(BlockJob *job, int ret) > > assert(!job->completed); > > job->completed = true; > > job->ret =

Re: [Qemu-devel] [PATCH v6 06/14] blockjob: Add .commit and .abort block job actions

2015-09-21 Thread Fam Zheng
On Mon, 09/21 18:29, John Snow wrote: > > > On 09/15/2015 02:11 AM, Fam Zheng wrote: > > Reviewed-by: Max Reitz > > Signed-off-by: Fam Zheng > > --- > > include/block/blockjob.h | 18 ++ > > 1 file changed, 18 insertions(+) > > > > diff --git a/include/block/blockjob.h b/inclu

Re: [Qemu-devel] [PATCH v4] ppc/spapr: Implement H_RANDOM hypercall in QEMU

2015-09-21 Thread David Gibson
On Mon, Sep 21, 2015 at 10:37:28AM +0200, Greg Kurz wrote: > On Mon, 21 Sep 2015 10:26:52 +0200 > Thomas Huth wrote: > > > On 21/09/15 10:01, Greg Kurz wrote: > > > On Mon, 21 Sep 2015 12:10:00 +1000 > > > David Gibson wrote: > > > > > >> On Fri, Sep 18, 2015 at 11:05:52AM +0200, Greg Kurz wrot

Re: [Qemu-devel] [PATCH v6 14/14] tests: add BlockJobTxn unit test

2015-09-21 Thread Fam Zheng
On Fri, 09/18 13:45, Max Reitz wrote: > On 15.09.2015 08:11, Fam Zheng wrote: > > From: Stefan Hajnoczi > > > > The BlockJobTxn unit test verifies that both single jobs and pairs of > > jobs behave as a transaction group. Either all jobs complete > > successfully or the group is cancelled. > >

Re: [Qemu-devel] [Bug 893208] Re: qemu on ARM hosts can't boot i386 image

2015-09-21 Thread Marina Kovalevna
Thanks for looking into it, Laszlo. I've already tried dosbox and had no idea qemu was impractical. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/893208 Title: qemu on ARM hosts can't boot i386 ima

Re: [Qemu-devel] [PATCH v2] target-tilegx: Implement v*add and v*sub instructions

2015-09-21 Thread Chen Gang
Oh, v1sub and v2sub look incorrect, need use ^b instead of ^~b. Thanks. > From: gang.chen.5...@gmail.com > To: peter.mayd...@linaro.org; r...@twiddle.net > CC: qemu-devel@nongnu.org; xili_gchen_5...@hotmail.com; > gang.chen.5...@gmail.com > Subject: [PATCH v2] target-tilegx: Implement v*add and

Re: [Qemu-devel] Compiling Qemu from Cygwin

2015-09-21 Thread Mike Ladouceur
Sorry, at this point, I've moved to compiling from Ubuntu as you suggested earlier. On Sun, Sep 20, 2015 at 9:19 PM, Mike Ladouceur wrote: > Okay, i followed the steps from the reply to my email I noticed on the > website, but never made its way to my inbox. Now, I'm stuck with the > following e

Re: [Qemu-devel] [PULL 00/26] qapi: QMP introspection

2015-09-21 Thread Peter Maydell
On 21 September 2015 at 01:03, Markus Armbruster wrote: > The following changes since commit 18640989a9f5e4d2e84b566c52ff1fccfa0dbf4a: > > Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' > into staging (2015-09-19 15:59:52 +0100) > > are available in the git repositor

Re: [Qemu-devel] [PATCH v6 09/14] block: Add block job transactions

2015-09-21 Thread John Snow
On 09/15/2015 02:11 AM, Fam Zheng wrote: > Sometimes block jobs must execute as a transaction group. Finishing > jobs wait until all other jobs are ready to complete successfully. > Failure or cancellation of one job cancels the other jobs in the group. > > Signed-off-by: Stefan Hajnoczi > [Re

Re: [Qemu-devel] [PATCH v6 08/14] blockjob: Simplify block_job_finish_sync

2015-09-21 Thread John Snow
On 09/15/2015 02:11 AM, Fam Zheng wrote: > With job->completed and job->ret to replace BlockFinishData. > > Signed-off-by: Fam Zheng > Reviewed-by: Max Reitz > --- > blockjob.c | 27 ++- > 1 file changed, 6 insertions(+), 21 deletions(-) > > diff --git a/blockjob.c b/

Re: [Qemu-devel] [PATCH v2] target-tilegx: Implement v1multu instruction

2015-09-21 Thread Chen Gang
The related code are changed, so this patch has to be reconstructed. Thanks On 9/22/15 06:26, gang.chen.5...@gmail.com wrote: > From: Chen Gang > > Only according to v1shrs implementation. > > Signed-off-by: Chen Gang > Reviewed-by: Richard Henderson > --- > target-tilegx/helper.h | 2 ++ > ta

[Qemu-devel] [PATCH v2] target-tilegx: Implement v1multu instruction

2015-09-21 Thread gang . chen . 5i5j
From: Chen Gang Only according to v1shrs implementation. Signed-off-by: Chen Gang Reviewed-by: Richard Henderson --- target-tilegx/helper.h | 2 ++ target-tilegx/simd_helper.c | 13 + target-tilegx/translate.c | 4 3 files changed, 19 insertions(+) diff --git a/targ

Re: [Qemu-devel] [PATCH v6 06/14] blockjob: Add .commit and .abort block job actions

2015-09-21 Thread John Snow
On 09/15/2015 02:11 AM, Fam Zheng wrote: > Reviewed-by: Max Reitz > Signed-off-by: Fam Zheng > --- > include/block/blockjob.h | 18 ++ > 1 file changed, 18 insertions(+) > > diff --git a/include/block/blockjob.h b/include/block/blockjob.h > index 3e7ad21..a7b497c 100644 > ---

Re: [Qemu-devel] [PATCH v6 05/14] blockjob: Introduce reference count

2015-09-21 Thread John Snow
On 09/15/2015 02:11 AM, Fam Zheng wrote: > So that block_job_complete_sync can be simplified. > > Reviewed-by: Max Reitz > Signed-off-by: Fam Zheng > --- > block/mirror.c | 2 +- > blockjob.c | 22 ++ > include/block/blockjob.h | 18 +++

Re: [Qemu-devel] [PATCH v2 10/22] target-sh4: Add flags state to insn_start

2015-09-21 Thread Aurelien Jarno
On 2015-09-17 21:55, Richard Henderson wrote: > Reviewed-by: Peter Maydell > Signed-off-by: Richard Henderson > --- > target-sh4/cpu.h | 1 + > target-sh4/translate.c | 2 +- > 2 files changed, 2 insertions(+), 1 deletion(-) Reviewed-by: Aurelien Jarno -- Aurelien Jarno

[Qemu-devel] [PATCH v5 46/46] qapi: Allow anonymous base for flat union

2015-09-21 Thread Eric Blake
Rather than requiring all flat unions to explicitly create a separate base struct, we want to allow the qapi schema to specify the common fields via an inline dictionary. This is similar to how commands can specify inline types for the arguments. Now that the feature is legal, we can drop the form

Re: [Qemu-devel] [PATCH v2 09/22] target-s390x: Add cc_op state to insn_start

2015-09-21 Thread Aurelien Jarno
On 2015-09-17 21:55, Richard Henderson wrote: > Reviewed-by: Peter Maydell > Signed-off-by: Richard Henderson > --- > target-s390x/cpu.h | 1 + > target-s390x/translate.c | 2 +- > 2 files changed, 2 insertions(+), 1 deletion(-) Reviewed-by: Aurelien Jarno -- Aurelien Jarno

Re: [Qemu-devel] [PATCH v2 07/22] target-i386: Add cc_op state to insn_start

2015-09-21 Thread Aurelien Jarno
On 2015-09-17 21:55, Richard Henderson wrote: > Reviewed-by: Peter Maydell > Signed-off-by: Richard Henderson > --- > target-i386/cpu.h | 1 + > target-i386/translate.c | 2 +- > 2 files changed, 2 insertions(+), 1 deletion(-) Reviewed-by: Aurelien Jarno -- Aurelien Jarno

Re: [Qemu-devel] [PATCH v2 08/22] target-mips: Add delayed branch state to insn_start

2015-09-21 Thread Aurelien Jarno
On 2015-09-17 21:55, Richard Henderson wrote: > Reviewed-by: Peter Maydell > Signed-off-by: Richard Henderson > --- > target-mips/cpu.h | 1 + > target-mips/translate.c | 3 ++- > 2 files changed, 3 insertions(+), 1 deletion(-) Reviewed-by: Aurelien Jarno -- Aurelien Jarno

Re: [Qemu-devel] [PATCH v2 05/22] tcg: Allow extra data to be attached to insn_start

2015-09-21 Thread Aurelien Jarno
On 2015-09-17 21:55, Richard Henderson wrote: > With an eye toward having this data replace the gen_opc_* arrays > that each target collects in order to enable restore_state_from_tb. > > Reviewed-by: Peter Maydell > Signed-off-by: Richard Henderson > --- > tcg/tcg-op.h | 52 +++

Re: [Qemu-devel] [PATCH v2 06/22] target-arm: Add condexec state to insn_start

2015-09-21 Thread Aurelien Jarno
On 2015-09-17 21:55, Richard Henderson wrote: > Reviewed-by: Peter Maydell > Signed-off-by: Richard Henderson > --- > target-arm/cpu.h | 1 + > target-arm/translate-a64.c | 2 +- > target-arm/translate.c | 3 ++- > 3 files changed, 4 insertions(+), 2 deletions(-) Reviewed-by: Aure

[Qemu-devel] [PATCH v5 39/46] qapi: Plumb in 'box' to qapi generator lower levels

2015-09-21 Thread Eric Blake
A future patch will add support for passing a qapi union type as the 'data' of a command. But to do that, the user function for implementing the command, as called by the generated marshal command, must take the corresponding C struct as a single boxed pointer, rather than a breakdown into one par

[Qemu-devel] [PATCH v5 44/46] net: Use correct type for bool flag

2015-09-21 Thread Eric Blake
is_netdev is only used as a bool, so make it one. Signed-off-by: Eric Blake --- hw/usb/dev-network.c | 2 +- include/net/net.h| 2 +- net/net.c| 12 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c index 97b

[Qemu-devel] [PATCH v2] target-tilegx: Implement v*add and v*sub instructions

2015-09-21 Thread gang . chen . 5i5j
From: Chen Gang v4* are implemented in normal code, another are implemented in helper functions. Signed-off-by: Chen Gang --- target-tilegx/helper.h | 5 + target-tilegx/simd_helper.c | 23 +++ target-tilegx/translate.c | 46 +

[Qemu-devel] [PATCH v5 41/46] qapi: Support boxed unions

2015-09-21 Thread Eric Blake
This patch completes support for boxed types, by allowing union types to be used when 'box':true is specified. It also avoids a python crash when attempting to use boxing on an anonymous type. While it was possible to support 'box':true on an empty event, it was easier to just reject missing 'dat

[Qemu-devel] [PATCH v5 33/46] vnc: hoist allocation of VncBasicInfo to callers

2015-09-21 Thread Eric Blake
A future qapi patch will rework generated structs with a base class to be unboxed. In preparation for that, change the code that allocates then populates an info struct to instead merely populate the fields of an info field passed in as a parameter. Add rudimentary Error handling for cases where t

[Qemu-devel] [PATCH v5 30/46] net: use Netdev instead of NetClientOptions in client init

2015-09-21 Thread Eric Blake
From: Kővágó, Zoltán This way we no longer need NetClientOptions and can convert Netdev into a flat union. Signed-off-by: Kővágó, Zoltán Reviewed-by: Eric Blake Message-Id: <93ffdfed7054529635e6acb935150d95dc173a12.1441627176.git.dirty.ice...@gmail.com> [rework net_client_init1() to pass Net

[Qemu-devel] [PATCH v5 38/46] qapi: Drop useless 'data' member of unions

2015-09-21 Thread Eric Blake
Now that we no longer have any clients of the 'void *data' member injected into unions, we can drop it. Update the testsuite to drop the negative test union-clash2, and replace it with a positive test in qapi-schema-test that proves that we no longer have a name collision. Signed-off-by: Eric Bla

[Qemu-devel] [PATCH v5 45/46] net: Complete qapi-fication of netdev_add

2015-09-21 Thread Eric Blake
We finally have all the required pieces for doing a type-safe representation of netdev_add as a flat union, where the discriminator 'type' now selects which additional members may appear in the "arguments" JSON object sent over QMP, while making no changes to the set of previously-valid QMP command

[Qemu-devel] [PATCH v5 25/46] qapi: Plug leaks in test-qmp-input-visitor

2015-09-21 Thread Eric Blake
Make valgrind happy with the current state of the test, so that it is easier to see if future patches introduce new memory problems without being drowned in noise. Signed-off-by: Eric Blake --- tests/test-qmp-input-visitor.c | 34 +++--- 1 file changed, 31 insertions(

[Qemu-devel] [PATCH v5 43/46] qapi: Change Netdev into a flat union

2015-09-21 Thread Eric Blake
From: Kővágó, Zoltán Except qapi-schema.json, this patch was generated by: find . -name .git -prune -o -type f \! -name '*~' -print0 | \ xargs -0 sed -i \ -e 's/NetClientOptionsKind/NetClientDriver/g' \ -e 's/NET_CLIENT_OPTIONS_KIND_/NET_CLIENT_DRIVER_/g' \ -e 's/netdev->opts/netde

[Qemu-devel] [PATCH v5 24/46] qapi: Document visitor interfaces

2015-09-21 Thread Eric Blake
The visitor interface for mapping between QObject 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 tries to add documentation, including menti

[Qemu-devel] [PATCH v5 31/46] qapi: use 'type' in generated C code to match QMP union wire form

2015-09-21 Thread Eric Blake
When dealing with simple qapi unions, the code was generating a discriminator field of 'kind' even though the discriminator is sent as 'type' over QMP. Renaming things to match gets us one step closer to reusing common generator code for both simple and flat unions, without having to special case

[Qemu-devel] [PATCH v5 42/46] qapi: support implicit structs in OptsVisitor

2015-09-21 Thread Eric Blake
From: Kővágó, Zoltán They are required for flat unions (you still have to allocate the structs). Signed-off-by: Kővágó, Zoltán Message-Id: <88451f26df139c09b56b1525f3c5afeea43dd3db.1441627175.git.dirty.ice...@gmail.com> Signed-off-by: Eric Blake --- qapi/opts-visitor.c | 15 +++

[Qemu-devel] [PATCH v5 21/46] qmp: Fix reference-counting of qnull on empty output visit

2015-09-21 Thread Eric Blake
Commit 6c2f9a15 ensured that we would not return NULL when the caller used an output visitor but had nothing to visit. But in doing so, it added a FIXME about a reference count leak that could abort qemu in the (unlikely) case of SIZE_MAX such visits (more plausible on 32-bit). This fixes things b

[Qemu-devel] [PATCH v5 23/46] qapi: Remove dead visitor code

2015-09-21 Thread Eric Blake
Commit cbc95538 removed unused start_handle() and end_handle(), but forgot got remove their declarations. Commit 4e27e819 introduced optional visitor callbacks for all sorts of int types, but except for type_uint64 and type_size, none of them have ever been supplied (the generic implementation bas

[Qemu-devel] [PATCH v5 20/46] qapi: Fix alternates that accept 'number' but not 'int'

2015-09-21 Thread Eric Blake
The QMP input visitor allows integral values to be assigned by promotion to a QTYPE_QFLOAT. However, when parsing an alternate, we did not take this into account, such that an alternate that accepts 'number' but not 'int' would reject integral values. With this patch, we now have the following de

[Qemu-devel] [PATCH v5 40/46] qapi: Implement boxed structs for commands/events

2015-09-21 Thread Eric Blake
Turn on the ability to pass command and event arguments in a single boxed parameter. This patch merely tests the use of the feature on structs. With this patch, we still reject union types, and crash on { 'command':'foo', 'data': { anonymous...}, 'box':true }; that will be addressed in the next p

[Qemu-devel] [PATCH v5 22/46] qapi: Don't abuse stack to track qmp-output root

2015-09-21 Thread Eric Blake
The previous commit documented an inconsistency in how we are using the stack of qmp-output-visitor. Normally, pushing a single top-level object puts the object on the stack twice: once as the root, and once as the current container being appended to; but popping that struct only pops once. Howev

[Qemu-devel] [PATCH v5 36/46] qapi: Avoid use of 'data' member of qapi unions

2015-09-21 Thread Eric Blake
qapi code generators currently create a 'void *data' member as part of the anonymous union embedded in the C struct corresponding to a qapi union. However, directly assigning to this member of the union feels a bit fishy, when we can directly use the rest of the struct instead. Signed-off-by: Eri

[Qemu-devel] [PATCH v5 37/46] qapi: Forbid empty unions and useless alternates

2015-09-21 Thread Eric Blake
Empty unions serve no purpose, and while we compile with gcc which permits them, strict C99 forbids them. We could inject a dummy member (and in fact, we do for empty structs), but while empty structs make sense in qapi, empty unions don't add any expressiveness to the QMP language. So prohibit t

[Qemu-devel] [PATCH v5 34/46] qapi: Unbox base members

2015-09-21 Thread Eric Blake
Rather than storing a base class as a pointer to a box, just store the fields of that base class in the same order, so that a child struct can be safely cast to its parent. This gives less malloc overhead, less pointer dereferencing, and even less generated code. Without boxing, the corner case o

[Qemu-devel] [PATCH v5 17/46] qapi: Provide nicer array names in introspection

2015-09-21 Thread Eric Blake
For the sake of humans reading introspection output, it is nice to have the name of implicit array types be recognizable as arrays of the underlying type. However, while this patch allows humans to skip from a command with return type "[123]" straight to the definition of type "123" without having

[Qemu-devel] [PATCH v5 13/46] qapi: Track owner of each object member

2015-09-21 Thread Eric Blake
Future commits will migrate semantic checking away from parsing and over to the various QAPISchema*.check() methods. But to report an error message about an incorrect semantic use of a member of an object type, we need to know which type, command, or event owns the member. Rather than making all

[Qemu-devel] [PATCH v5 12/46] qapi: Track location that created an implicit type

2015-09-21 Thread Eric Blake
A future patch will enable error detection in the various QapiSchema check() methods. But since all errors have to have an associated 'info' location, we need a location to be associated with all implicit types. Easiest is to reuse the location of the enclosing entity that includes the dictionary

[Qemu-devel] [PATCH v5 35/46] qapi-visit: Remove redundant functions for flat union base

2015-09-21 Thread Eric Blake
The code for visiting the base class of a child struct created visit_type_Base_fields(); the code for visiting the base class of a flat union created visit_type_Union_fields(). If the same type is shared between a struct and a union, the two functions differed only by whether they visited the discr

[Qemu-devel] [PATCH v5 32/46] qapi: Hide tag_name data member of variants

2015-09-21 Thread Eric Blake
Clean up the only remaining external use of the tag_name field of QAPISchemaObjectTypeVariants, by explicitly listing the generated 'type' tag for simple unions in the testsuite. Since alternate types no longer use the tag_member field, we can now mark the tag_name field as private by adding a lea

[Qemu-devel] [PATCH v5 11/46] qapi: Don't use info as witness of implicit object type

2015-09-21 Thread Eric Blake
A future patch will enable error reporting from the various check() methods. But to report an error on an implicit type, we'll need to associate a location with the type (the same location as the top-level entity that is causing the creation of the implicit type), and once we do that, keying off o

[Qemu-devel] [PATCH v5 29/46] qapi: Change visit_type_FOO() to no longer return partial objects

2015-09-21 Thread Eric Blake
Returning a partial object on error is an invitation for a careless caller to leak memory. As no one outside the testsuite was actually relying on these semantics, it is cleaner to just document and guarantee that ALL visit_type_FOO() functions do not alter *obj when an error is encountered during

[Qemu-devel] [PATCH v5 09/46] qapi: Use consistent generated code patterns

2015-09-21 Thread Eric Blake
We had some pointless differences in the generated code for visit, command marshalling, and events; unifying them makes it easier for future patches to consolidate to common helper functions. - Consistently name the error variable 'err' - Consistently use the labels 'out' and 'out_obj' - If allocat

[Qemu-devel] [PATCH v5 28/46] qapi: Rework deallocation of partial struct

2015-09-21 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 or

[Qemu-devel] [PATCH v5 10/46] qapi: Merge generation of per-member visits

2015-09-21 Thread Eric Blake
Consolidate the code between visit, command marshalling, and event generation that iterates over the members of a struct. It reduces code duplication in the generator, with no change to generated marshal code, slightly more verbose visit code: | visit_optional(v, &(*obj)->has_device, "device",

[Qemu-devel] [PATCH v5 18/46] qapi-introspect: Guarantee particular sorting

2015-09-21 Thread Eric Blake
Sorting the values of an enum makes it easier to look up whether a particular value is present by binary rather than linear search (probably most visible with QKeyCode, which has grown over several releases). Additionally, QMP clients need not know which C value is associated with an enum name, so

[Qemu-devel] [PATCH v5 08/46] qapi: Reuse code for flat union base validation

2015-09-21 Thread Eric Blake
Rather than open-code the check for a valid base type, we should reuse the common functionality. This allows for consistent error messages, and also makes it easier for a later patch to turn on support for inline anonymous base structures. Test flat-union-inline is updated to test only one feature

[Qemu-devel] [PATCH v5 05/46] qapi: Test use of 'number' within alternates

2015-09-21 Thread Eric Blake
Add some testsuite exposure for use of a 'number' as part of an alternate. The current state of the tree has a few bugs exposed by this: our input parser depends on the ordering of how the qapi schema declared the alternate, and the parser does not accept integers for a 'number' in an alternate ev

[Qemu-devel] [PATCH v5 27/46] qapi: Simplify visits of optional fields

2015-09-21 Thread Eric Blake
None of the visitor callbacks would set an error when testing if an optional field was present; make this part of the interface contract by eliminating the errp argument. Then, for less code, reflect the determined boolean value back to the caller instead of making the caller read the boolean afte

[Qemu-devel] [PATCH v5 26/46] qapi: Test failure in middle of array parse

2015-09-21 Thread Eric Blake
Our generated list visitors have the same problem as has been mentioned elsewhere (see commit 2f52e20): they allocate data even on failure. An upcoming patch will correct things to provide saner guarantees, but first we need to expose the behavior in the testsuite to ensure we aren't introducing an

[Qemu-devel] [PATCH v5 15/46] qapi: Defer duplicate member checks to schema check()

2015-09-21 Thread Eric Blake
With the previous commit, we have two different locations for detecting member name clashes - one at parse time, and another at schema check() time. Consolidate the checks into a single place, which is also in line with our TODO to eventually defer all of the parse time semantic checking into the

[Qemu-devel] [PATCH v5 00/46] post-introspection cleanups, and qapi-ify netdev_add

2015-09-21 Thread Eric Blake
No longer RFC, but depends on Markus' pull-qapi-2015-09-21 tag (https://lists.gnu.org/archive/html/qemu-devel/2015-09/msg05257.html) which had not been merged as of this email. Also available at this location (although I may rebase it): git fetch git://repo.or.cz/qemu/ericb.git qapi http://repo.or

[Qemu-devel] [PATCH v5 07/46] qapi: Don't pass pre-existing error to later call

2015-09-21 Thread Eric Blake
Due to the existing semantics of the error_set() family, generated sequences in the qapi visitors such as: visit_start_implicit_struct(m, (void **)obj, sizeof(FOO), &err); if (!err) { visit_type_FOO_fields(m, obj, errp); visit_end_implicit_struct(m, &err);

[Qemu-devel] [PATCH v5 04/46] qapi: Add tests for empty unions

2015-09-21 Thread Eric Blake
The documentation claims that alternates are useful for allowing two types, although nothing enforces this. Meanwhile, it is silent on whether empty unions are allowed. In practice, the generated code will compile, in part because we have a 'void *data' branch; but attempting to visit such a type

[Qemu-devel] [PATCH v5 14/46] qapi: Detect collisions in C member names

2015-09-21 Thread Eric Blake
Detect attempts to declare two object members that would result in the same C member name, by keying the 'seen' dictionary off of the C name rather than the qapi name. As this is the first error raised within the QapiSchema check() methods, we also have to pass 'info' around through the call stack

[Qemu-devel] [PATCH v5 19/46] qapi: Simplify visiting of alternate types

2015-09-21 Thread Eric Blake
Previously, working with alternates required two enums, and some indirection: for type Foo, we created Foo_qtypes[] which maps each qtype to a member of FooKind_lookup[], then use FooKind_lookup[] like we do for other union types. This has a subtle bug: since the values of FooKind_lookup start at

[Qemu-devel] [PATCH v5 03/46] qapi: Test for C member name collisions

2015-09-21 Thread Eric Blake
Expose some weaknesses in the generator: we don't always forbid the generation of structs that contain multiple members that map to the same C name. This has already been marked FIXME in qapi.py, but having more tests will make sure future patches produce desired behavior. Some of these tests wil

[Qemu-devel] [PATCH v5 02/46] qapi: Clean up qapi.py per pep8

2015-09-21 Thread Eric Blake
Silence pep8, and make pylint a bit happier. Just style cleanups; no semantic changes. Signed-off-by: Eric Blake --- scripts/qapi.py | 165 1 file changed, 107 insertions(+), 58 deletions(-) diff --git a/scripts/qapi.py b/scripts/qapi.py

[Qemu-devel] [PATCH v5 16/46] qapi: Detect base class loops

2015-09-21 Thread Eric Blake
It should be fairly obvious that qapi base classes need to form an acyclic graph, since QMP cannot specify the same key more than once, while base classes are included as flat members alongside other members added by the child. But prior to Markus' introspection commits (such as commit 75ebcd7f),

[Qemu-devel] [PATCH v5 01/46] qapi: Sort qapi-schema tests

2015-09-21 Thread Eric Blake
Recent changes to qapi have provided quite a bit of churn in the makefile, because we are inconsistent on what order test names appear in, and on whether to re-wrap the list of tests or just add arbitrary line lengths. Writing the list in a sorted fashion, one test per line, will make future patch

[Qemu-devel] [PATCH v5 06/46] qapi: Improve 'include' error message

2015-09-21 Thread Eric Blake
Use of '"...%s" % include' to print non-strings can lead to ugly messages, such as this (if the .json change is applied without the qapi.py change): Expected a file name (string), got: OrderedDict() Better is to just omit the actual non-string value in the message. Signed-off-by: Eric Blake ---

[Qemu-devel] [PATCH v2] target-tilegx: Implement v*shl, v*shru, and v*shrs instructions

2015-09-21 Thread gang . chen . 5i5j
From: Chen Gang v2sh* are implemented with helper fucntions, according to the v1sh* implementations. v4sh* are implmeneted in normal code. Signed-off-by: Chen Gang --- target-tilegx/helper.h | 3 +++ target-tilegx/simd_helper.c | 31 +++ target-tilegx/transla

Re: [Qemu-devel] [PATCH v4 07/22] vhost: alloc shareable log

2015-09-21 Thread Marc-André Lureau
Hi On Mon, Sep 21, 2015 at 9:29 PM, Michael S. Tsirkin wrote: >> Can this be considered a future enhancement? > > What's the big issue? Just count the devices that need a shared one, if > that count is 0 reallocate with shared == false. But then it should also VHOST_SET_LOG_BASE all the other d

Re: [Qemu-devel] [PULL 00/33] spapr-next queue 2015-09-16

2015-09-21 Thread Peter Maydell
ble in the git repository at: > > git://github.com/dgibson/qemu.git spapr-next-20150921 > > for you to fetch changes up to 5576a6644cb302ac5b715205e7b4f157f116b9de: > > ppc/spapr: Fix buffer overflow in spapr_populate

Re: [Qemu-devel] [PATCH 0/5] ide: avoid main-loop hang on CDROM/NFS failure

2015-09-21 Thread Peter Lieven
> Am 21.09.2015 um 22:58 schrieb John Snow : > > > >> On 09/21/2015 08:25 AM, Peter Lieven wrote: >> This series aims at avoiding a hanging main-loop if a vserver has a >> CDROM image mounted from a NFS share and that NFS share goes down. >> Typical situation is that users mount an CDROM ISO t

  1   2   3   >