[Qemu-devel] [PULL 07/10] vmxnet3: Do not fill stats if device is inactive

2015-10-26 Thread Jason Wang
From: Shmulik Ladkani Guest OS may issue VMXNET3_CMD_GET_STATS even before device was activated (for example in linux, after insmod but prior net-dev open). Accessing shared descriptors prior device activation is illegal as the VMXNET3State structures have not been fully initialized. As a resul

[Qemu-devel] [PULL 03/10] net/dump: Rework net-dump init functions

2015-10-26 Thread Jason Wang
From: Thomas Huth Move the creation of the dump client from net_dump_init() into net_init_dump(), so we can later use the former function for dump via netfilter, too. Also rename net_dump_init() to net_dump_state_init() to make it easier distinguishable from net_init_dump(). Reviewed-by: Yang Ho

[Qemu-devel] [PULL 08/10] net: Remove duplicate data from query-rx-filter on multiqueue net devices

2015-10-26 Thread Jason Wang
From: Vladislav Yasevich When responding to a query-rx-filter command on a multiqueue netdev, qemu reports the data for each queue. The data, however, is not per-queue, but per device and the same data is reported multiple times. This causes confusion and may also cause extra unnecessary proces

[Qemu-devel] [PULL 09/10] net: make iov_to_buf take right size argument in nc_sendv_compat()

2015-10-26 Thread Jason Wang
From: Yang Hongyang We want "buf, sizeof(buf)" here. sizeof(buffer) is the size of a pointer, which is wrong. Thanks to Paolo for pointing it out. Signed-off-by: Yang Hongyang Cc: Jason Wang Cc: Paolo Bonzini Signed-off-by: Jason Wang --- net/net.c | 2 +- 1 file changed, 1 insertion(+), 1

[Qemu-devel] [PULL 05/10] net/dump: Provide the dumping facility as a net-filter

2015-10-26 Thread Jason Wang
From: Thomas Huth Use the net-filter infrastructure to provide the dumping functions for netdev devices, too. Reviewed-by: Yang Hongyang Signed-off-by: Thomas Huth Signed-off-by: Jason Wang --- net/dump.c | 129 - vl.c | 7 +

[Qemu-devel] [PULL 02/10] net/dump: Add support for receive_iov function

2015-10-26 Thread Jason Wang
From: Thomas Huth Adding a proper receive_iov function to the net dump module. This will make it easier to support the dump filter feature for the -netdev option in later patches. Reviewed-by: Yang Hongyang Signed-off-by: Thomas Huth Signed-off-by: Jason Wang --- net/dump.c | 24

[Qemu-devel] [PULL 10/10] net: free the string returned by object_get_canonical_path_component

2015-10-26 Thread Jason Wang
From: Yang Hongyang The value returned from object_get_canonical_path_component must be freed. Signed-off-by: Yang Hongyang Cc: Jason Wang Cc: Paolo Bonzini Signed-off-by: Jason Wang --- net/net.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/net.c b/net/net.c

[Qemu-devel] [PULL 06/10] options: Add documentation for filter-dump

2015-10-26 Thread Jason Wang
From: Thomas Huth Add a short description for the filter-dump command line options. Signed-off-by: Thomas Huth Signed-off-by: Jason Wang --- qemu-options.hx | 8 1 file changed, 8 insertions(+) diff --git a/qemu-options.hx b/qemu-options.hx index edee5f4..949db7f 100644 --- a/qemu-o

[Qemu-devel] [PULL 04/10] net/dump: Separate the NetClientState from the DumpState

2015-10-26 Thread Jason Wang
From: Thomas Huth With the upcoming dumping-via-netfilter patch, the DumpState should not be related to NetClientState anymore, so move the related information to a new struct called DumpNetClient. Reviewed-by: Yang Hongyang Signed-off-by: Thomas Huth Signed-off-by: Jason Wang --- net/dump.c

[Qemu-devel] [PULL 00/10] Net patches

2015-10-26 Thread Jason Wang
The following changes since commit 9666248a85fd889bfb6118f769e9c73039b998ed: Merge remote-tracking branch 'remotes/sstabellini/tags/xen-2015-10-26' into staging (2015-10-26 13:13:38 +) are available in the git repository at: https://github.com/jasowang/qemu.git tags/net-pull-request fo

[Qemu-devel] [PULL 01/10] net: cadence_gem: Set initial MAC address

2015-10-26 Thread Jason Wang
From: Sebastian Huber Set initial MAC address to the one specified by the command line. Signed-off-by: Sebastian Huber Reviewed-by: Jason Wang Reviewed-by: Peter Crosthwaite Signed-off-by: Jason Wang --- hw/net/cadence_gem.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/hw/net/c

[Qemu-devel] [PATCH v1 0/4] AHCI patches + Allwinner SATA

2015-10-26 Thread Peter Crosthwaite
This patch series adds bare-minimum Allwinner SATA support. P1 is a trivial to help debug AHCI. Changed since RFC: Addressed Beniamino review. Rebased to avoid bad deps (John Snow review) Regards, Peter Peter Crosthwaite (4): ahci: Add some MMIO debug printfs ahci: split realize and init

[Qemu-devel] [PATCH v1 1/4] ahci: Add some MMIO debug printfs

2015-10-26 Thread Peter Crosthwaite
These are useful for bringup of AHCI. Signed-off-by: Peter Crosthwaite --- hw/ide/ahci.c | 21 +++-- 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c index 21f76ed..ed74253 100644 --- a/hw/ide/ahci.c +++ b/hw/ide/ahci.c @@ -378,17 +378

[Qemu-devel] [PATCH v1 2/4] ahci: split realize and init

2015-10-26 Thread Peter Crosthwaite
Do the init level tasks asap and the realize later (mainly when num_ports is available). This allows sub-class realize routines to work with the device post-init. Signed-off-by: Peter Crosthwaite --- hw/ide/ahci.c | 36 +++- hw/ide/ahci.h | 3 ++- hw/ide/ich.c

[Qemu-devel] [PATCH v1 3/4] ahci: Add allwinner AHCI

2015-10-26 Thread Peter Crosthwaite
Add a Sysbus AHCI subclass for the Allwinner AHCI. It has a few extra vendor specific registers which are used for phy and power init. Signed-off-by: Peter Crosthwaite --- Changed since RFC: Dropped un-needed macros (Beniamino) Fixed VMSD section name (Beniamino) Fixed commit message grammar. Mov

[Qemu-devel] [PATCH v1 4/4] arm: allwinner-a10: Add SATA

2015-10-26 Thread Peter Crosthwaite
Add the Allwinner A10 AHCI controller module to the SoC. Signed-off-by: Peter Crosthwaite --- hw/arm/allwinner-a10.c | 11 +++ include/hw/arm/allwinner-a10.h | 4 2 files changed, 15 insertions(+) diff --git a/hw/arm/allwinner-a10.c b/hw/arm/allwinner-a10.c index 43dc0a1.

Re: [Qemu-devel] [PATCH] linux-user: manage SOCK_PACKET socket type.

2015-10-26 Thread Laurent Vivier
Le 26/10/2015 15:40, Peter Maydell a écrit : > On 6 October 2015 at 18:11, Laurent Vivier wrote: >> This is obsolete, but if we want to use dhcp with some distros (like debian >> ppc 8.2 jessie), we need it. >> >> At the bind level, we are not able to know the socket type so we try to >> guess i

Re: [Qemu-devel] [Qemu-block] [PATCH v10 08/10] Implement new driver for block replication

2015-10-26 Thread Wen Congyang
On 10/16/2015 07:37 PM, Stefan Hajnoczi wrote: > On Fri, Oct 16, 2015 at 10:22:05AM +0800, Wen Congyang wrote: >> On 10/15/2015 10:55 PM, Stefan Hajnoczi wrote: >>> On Thu, Oct 15, 2015 at 10:19:17AM +0800, Wen Congyang wrote: On 10/14/2015 10:27 PM, Stefan Hajnoczi wrote: > On Tue, Oct 13

Re: [Qemu-devel] [PATCH v2 3/3] qemu-io: Correct error messages

2015-10-26 Thread Eric Blake
On 10/26/2015 05:45 PM, John Snow wrote: > Reported-by: Max Reitz > Signed-off-by: John Snow > Reviewed-by: Eric Blake > --- > qemu-io-cmds.c | 53 ++--- > 1 file changed, 34 insertions(+), 19 deletions(-) > > diff --git a/qemu-io-cmds.c b/qemu-i

Re: [Qemu-devel] 4k seq read splitting for virtio-blk - possible workarounds?

2015-10-26 Thread Fam Zheng
On Mon, 10/26 18:32, Paolo Bonzini wrote: > Having a "real" multiqueue model in the host (real = one I/O thread and > one AIO context per guest queue, with each I/O thread able to service > multiple disks; rather than a "fake" multiqueue where you still have one > I/O thread and AIO context per gue

Re: [Qemu-devel] [PATCH v2 0/3] target-i386: save/restore vcpu's TSC rate during migration

2015-10-26 Thread haozhong . zhang
On Mon, Oct 26, 2015 at 04:41:22PM -0200, Eduardo Habkost wrote: > On Mon, Oct 26, 2015 at 10:09:13AM +0800, haozhong.zh...@intel.com wrote: > > On Fri, Oct 23, 2015 at 12:45:13PM -0200, Eduardo Habkost wrote: > > > On Fri, Oct 23, 2015 at 10:27:27AM +0800, Haozhong Zhang wrote: > > > > On Thu, Oct

Re: [Qemu-devel] [PATCH v2 5/5] xlnx-ep108: Connect the SPI Flash

2015-10-26 Thread Alistair Francis
On Wed, Oct 14, 2015 at 12:25 PM, Peter Crosthwaite wrote: > On Thu, Oct 8, 2015 at 4:30 PM, Alistair Francis > wrote: >> On Wed, Oct 7, 2015 at 5:01 PM, Peter Crosthwaite >> wrote: >>> On Wed, Oct 7, 2015 at 2:34 PM, Alistair Francis >>> wrote: Connect the sst25wf080 SPI flash to the EP10

[Qemu-devel] [PATCH v2 0/3] qemu-io: clean up cvtnum usage

2015-10-26 Thread John Snow
cvtnum returns an int64_t, not an int, so correct the lvalue types wherever it is used. While we're at it, make the error messages more meaningful and hopefully less confusing. v2: - Squashed NSIG error-checking from patch 3 into patch 1 - Reported-by credits for Max and Reviewed-by from Eric ad

[Qemu-devel] [PATCH v2 2/3] qemu-io: Check for trailing chars

2015-10-26 Thread John Snow
Make sure there's not trailing garbage, e.g. "64k-whatever-i-want-here" Reported-by: Max Reitz Signed-off-by: John Snow Reviewed-by: Eric Blake --- qemu-io-cmds.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c index 704db89..44d24e8

[Qemu-devel] [PATCH v2 3/3] qemu-io: Correct error messages

2015-10-26 Thread John Snow
Reported-by: Max Reitz Signed-off-by: John Snow Reviewed-by: Eric Blake --- qemu-io-cmds.c | 53 ++--- 1 file changed, 34 insertions(+), 19 deletions(-) diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c index 44d24e8..92c6b87 100644 --- a/qemu-io-cmds

[Qemu-devel] [PATCH v2 1/3] qemu-io: fix cvtnum lval types

2015-10-26 Thread John Snow
cvtnum() returns int64_t: we should not be storing this result inside of an int. In a few cases, we need an extra sprinkling of error handling where we expect to pass this number on towards a function that expects something smaller than int64_t. Reported-by: Max Reitz Signed-off-by: John Snow R

[Qemu-devel] [PATCH] ide: remove hardcoded 2GiB transactional limit

2015-10-26 Thread John Snow
Not that you can request a >2GiB transaction, but that's why checking for it makes no sense anymore. With the newer 'limit' parameter to prepare_buf, we no longer need a static limit. The maximum limit is still 2GiB, but the limit parameter is set to the current transaction size, which cannot surp

Re: [Qemu-devel] [PATCH 3/3] qemu-io: Correct error messages

2015-10-26 Thread Eric Blake
On 10/26/2015 04:06 PM, John Snow wrote: > Signed-off-by: John Snow > --- > qemu-io-cmds.c | 58 > +- > 1 file changed, 37 insertions(+), 21 deletions(-) > > diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c > index e2477fc..92c6b87 100644 > --

Re: [Qemu-devel] [PATCH 3/3] qemu-io: Correct error messages

2015-10-26 Thread John Snow
On 10/26/2015 06:54 PM, Eric Blake wrote: > On 10/26/2015 04:06 PM, John Snow wrote: >> Signed-off-by: John Snow >> --- >> qemu-io-cmds.c | 58 >> +- >> 1 file changed, 37 insertions(+), 21 deletions(-) >> >> diff --git a/qemu-io-cmds.c b

Re: [Qemu-devel] [PATCH 1/3] qemu-io: fix cvtnum lval types

2015-10-26 Thread Eric Blake
On 10/26/2015 04:40 PM, Eric Blake wrote: > On 10/26/2015 04:06 PM, John Snow wrote: >> cvtnum() returns int64_t: we should not be storing this >> result inside of an int. >> >> In a few cases, we need an extra sprinkling of error handling >> where we expect to pass this number on towards a functio

Re: [Qemu-devel] [PATCH 2/3] qemu-io: Check for trailing chars

2015-10-26 Thread Eric Blake
On 10/26/2015 04:06 PM, John Snow wrote: > Make sure there's not trailing garbage, e.g. > "64k-whatever-i-want-here" > > Reported-by: Max Reitz > Signed-off-by: John Snow > --- > qemu-io-cmds.c | 9 - > 1 file changed, 8 insertions(+), 1 deletion(-) > > diff --git a/qemu-io-cmds.c b/q

Re: [Qemu-devel] [Qemu-block] [PATCH 2/3] qemu-io: Check for trailing chars

2015-10-26 Thread Eric Blake
On 10/26/2015 04:44 PM, Eric Blake wrote: > On 10/26/2015 04:06 PM, John Snow wrote: >> Make sure there's not trailing garbage, e.g. >> "64k-whatever-i-want-here" >> >> Reported-by: Max Reitz >> Signed-off-by: John Snow >> --- >> qemu-io-cmds.c | 9 - >> 1 file changed, 8 insertions(+),

Re: [Qemu-devel] [PATCH 1/3] qemu-io: fix cvtnum lval types

2015-10-26 Thread Eric Blake
On 10/26/2015 04:06 PM, John Snow wrote: > cvtnum() returns int64_t: we should not be storing this > result inside of an int. > > In a few cases, we need an extra sprinkling of error handling > where we expect to pass this number on towards a function that > expects something smaller than int64_t.

[Qemu-devel] [PATCH v11 22/24] qapi: Finish converting to new qapi union layout

2015-10-26 Thread Eric Blake
We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-variant members. This le

[Qemu-devel] [PATCH v11 18/24] char: Convert to new qapi union layout

2015-10-26 Thread Eric Blake
We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-variant members. This le

[Qemu-devel] [PATCH v11 15/24] block: Convert to new qapi union layout

2015-10-26 Thread Eric Blake
We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-variant members. This le

[Qemu-devel] [PATCH v11 24/24] qapi: Simplify gen_struct_field()

2015-10-26 Thread Eric Blake
Rather than having all callers pass a name, type, and optional flag, have them instead pass a QAPISchemaObjectTypeMember which already has all that information. No change to generated code. Signed-off-by: Eric Blake --- v11: rebase to earlier changes v10: no change v9: rebase after kind/base cl

[Qemu-devel] [PATCH v11 17/24] net: Convert to new qapi union layout

2015-10-26 Thread Eric Blake
We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-variant members. This le

[Qemu-devel] [PATCH v11 19/24] input: Convert to new qapi union layout

2015-10-26 Thread Eric Blake
We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-variant members. This le

[Qemu-devel] [PATCH v11 10/24] qapi: Unbox base members

2015-10-26 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 directly cast to its parent. This gives less malloc overhead, less pointer dereferencing, and even less generated code. Compare to the earlier commit 1

[Qemu-devel] [PATCH v11 05/24] qapi: Reserve 'q_*' and 'has_*' member names

2015-10-26 Thread Eric Blake
c_name() produces names starting with 'q_' when protecting a QMP member name that would fail to directly compile, but in doing so can cause clashes with any QMP name already beginning with 'q-' or 'q_'. Likewise, we create a C name 'has_' for any optional member, that can clash with any QMP name b

[Qemu-devel] [PATCH v11 16/24] sockets: Convert to new qapi union layout

2015-10-26 Thread Eric Blake
We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-variant members. This le

[Qemu-devel] [PATCH v11 21/24] tpm: Convert to new qapi union layout

2015-10-26 Thread Eric Blake
We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-variant members. This le

[Qemu-devel] [PATCH v11 11/24] qapi-visit: Remove redundant functions for flat union base

2015-10-26 Thread Eric Blake
The code for visiting the base class of a child struct created visit_type_Base_fields() which covers all fields of Base; while the code for visiting the base class of a flat union created visit_type_Union_fields() covering all fields of the base except the discriminator. But since the base class i

[Qemu-devel] [PATCH v11 09/24] qapi: Prefer typesafe upcasts to qapi base classes

2015-10-26 Thread Eric Blake
A previous patch (commit 1e6c1616) made it possible to directly cast from a qapi flat union type to its base type. However, it requires the use of a C cast, which turns off compiler type-safety checks. Add inline type-safe wrappers named qapi_FOO_base() for any union type FOO that has a base, whic

[Qemu-devel] [PATCH v11 23/24] qapi: Reserve 'u' member name

2015-10-26 Thread Eric Blake
Now that we have separated union tag values from colliding with non-variant C names, by naming the union 'u', we should reserve this name for our use. Note that we want to forbid 'u' even in a struct with no variants, because it is possible for a future qemu release to extend QMP in a backwards-co

[Qemu-devel] [PATCH v11 14/24] tests: Convert to new qapi union layout

2015-10-26 Thread Eric Blake
We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-variant members. This le

[Qemu-devel] [PATCH v11 20/24] memory: Convert to new qapi union layout

2015-10-26 Thread Eric Blake
We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-variant members. This le

[Qemu-devel] [PATCH v11 07/24] qapi-visit: Split off visit_type_FOO_fields forward decl

2015-10-26 Thread Eric Blake
We generate a static visit_type_FOO_fields() for every type FOO. However, sometimes we need a forward declaration. Split the code to generate the forward declaration out of gen_visit_implicit_struct() into a new gen_visit_fields_decl(), and also prepare for a forward declaration to be emitted duri

[Qemu-devel] [PATCH v11 01/24] tests/qapi-schema: Test for reserved names, empty struct

2015-10-26 Thread Eric Blake
Add some testsuite coverage to ensure future patches are on the right track: Our current C representation of qapi arrays is done by appending 'List' to the element name; but we are not preventing the creation of an object type with the same name. Add reserved-type-list.json to test this. Then re

[Qemu-devel] [PATCH v11 00/24] qapi collision reduction (post-introspection subset B')

2015-10-26 Thread Eric Blake
No pending prerequisites (applies to current master) Also available as a tag at this location: git fetch git://repo.or.cz/qemu/ericb.git qapi-cleanupv11b and I plan to eventually forcefully update my branch with the rest of the v5 series, at: http://repo.or.cz/qemu/ericb.git/shortlog/refs/heads/q

[Qemu-devel] [PATCH v11 03/24] qapi: More robust conditions for when labels are needed

2015-10-26 Thread Eric Blake
We were using regular expressions to see if ret included any earlier text that emitted a 'goto out;' line, to decide whether we needed to output an 'out:' label. But this is fragile, if the ret text can possibly combine more than one generated function body, where the first function used a goto bu

[Qemu-devel] [PATCH v11 13/24] qapi-visit: Convert to new qapi union layout

2015-10-26 Thread Eric Blake
We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-variant members. This le

[Qemu-devel] [PATCH v11 02/24] qapi: More idiomatic string operations

2015-10-26 Thread Eric Blake
Rather than slicing the end of a string, we can use python's endswith(). And rather than creating a set of characters, we can search for a character within a string. Signed-off-by: Eric Blake --- v11: no change v10: new patch --- scripts/qapi.py | 6 +++--- 1 file changed, 3 insertions(+), 3 d

[Qemu-devel] [PATCH v11 12/24] qapi: Start converting to new qapi union layout

2015-10-26 Thread Eric Blake
We have two issues with our qapi union layout: 1) Even though the QMP wire format spells the tag 'type', the C code spells it 'kind', requiring some hacks in the generator. 2) The C struct uses an anonymous union, which places all tag values in the same namespace as all non-variant members. This le

[Qemu-devel] [PATCH v11 04/24] qapi: Reserve '*List' type names for list types

2015-10-26 Thread Eric Blake
Type names ending in 'List' can clash with qapi list types in generated C. We don't currently use such names. It is easier to outlaw them now than to worry about how to resolve such a clash in the future. For precedence, see commit 4dc2e69, which did the same for names ending in 'Kind' versus impl

[Qemu-devel] [PATCH v11 08/24] qapi-types: Refactor base fields output

2015-10-26 Thread Eric Blake
Move code from gen_union() into gen_struct_fields() in order for a later patch to share code when enumerating inherited fields for struct types. No change to generated code. Signed-off-by: Eric Blake --- v11: rename variable and open-code loop rather than recurse, for clarity v10: new patch, sp

[Qemu-devel] [PATCH v11 06/24] vnc: Hoist allocation of VncBasicInfo to callers

2015-10-26 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 (renaming vnc_basic_info_get* to vnc_init_basic_i

Re: [Qemu-devel] [PATCH] block: allow best-effort query

2015-10-26 Thread Max Reitz
On 26.10.2015 22:34, John Snow wrote: > > > On 10/26/2015 05:18 PM, Max Reitz wrote: >> On 26.10.2015 19:12, John Snow wrote: >>> For more complex BDS trees that can be created under normal circumstances, >>> we lose the ability to issue query commands because of our inability to >>> re-construct

[Qemu-devel] [PATCH 3/3] qemu-io: Correct error messages

2015-10-26 Thread John Snow
Signed-off-by: John Snow --- qemu-io-cmds.c | 58 +- 1 file changed, 37 insertions(+), 21 deletions(-) diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c index e2477fc..92c6b87 100644 --- a/qemu-io-cmds.c +++ b/qemu-io-cmds.c @@ -146,6 +146,21 @@

[Qemu-devel] [PATCH 1/3] qemu-io: fix cvtnum lval types

2015-10-26 Thread John Snow
cvtnum() returns int64_t: we should not be storing this result inside of an int. In a few cases, we need an extra sprinkling of error handling where we expect to pass this number on towards a function that expects something smaller than int64_t. Signed-off-by: John Snow --- qemu-io-cmds.c | 30

[Qemu-devel] [PATCH 2/3] qemu-io: Check for trailing chars

2015-10-26 Thread John Snow
Make sure there's not trailing garbage, e.g. "64k-whatever-i-want-here" Reported-by: Max Reitz Signed-off-by: John Snow --- qemu-io-cmds.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/qemu-io-cmds.c b/qemu-io-cmds.c index 07c5681..e2477fc 100644 --- a/qemu-io-cmds

[Qemu-devel] [PATCH 0/3] qemu-io: clean up cvtnum usage

2015-10-26 Thread John Snow
cvtnum returns an int64_t, not an int, so correct the lvalue types wherever it is used. While we're at it, make the error messages more meaningful and hopefully less confusing. For convenience, this branch is availab

Re: [Qemu-devel] [PATCH] block: allow best-effort query

2015-10-26 Thread John Snow
On 10/26/2015 05:18 PM, Max Reitz wrote: > On 26.10.2015 19:12, John Snow wrote: >> For more complex BDS trees that can be created under normal circumstances, >> we lose the ability to issue query commands because of our inability to >> re-construct the absolute filename. >> >> Instead, omit this

Re: [Qemu-devel] [PATCH] block: allow best-effort query

2015-10-26 Thread Max Reitz
On 26.10.2015 19:12, John Snow wrote: > For more complex BDS trees that can be created under normal circumstances, > we lose the ability to issue query commands because of our inability to > re-construct the absolute filename. > > Instead, omit this field when it is a problem and present as much i

Re: [Qemu-devel] [PATCH v10 09/25] qapi: Prefer typesafe upcasts to qapi base classes

2015-10-26 Thread Eric Blake
On 10/26/2015 11:54 AM, Markus Armbruster wrote: >> It sounds like I have two options for v11: >> >> 1. Keep 9/25 introducing gen_upcast(), just for union types, and >> including testsuite coverage. In 10/25, make use of the upcast functions >> to struct as part of making structs sane. >> >> 2. Sw

[Qemu-devel] [PATCH v8 12/15] hmp: Use blockdev-change-medium for change command

2015-10-26 Thread Max Reitz
Use separate code paths for the two overloaded functions of the 'change' HMP command, and invoke the 'blockdev-change-medium' QMP command if used on a block device (by calling qmp_blockdev_change_medium()). Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: Kevin Wolf --- hmp.c | 27

[Qemu-devel] [PATCH v8 13/15] blockdev: read-only-mode for blockdev-change-medium

2015-10-26 Thread Max Reitz
Add an option to qmp_blockdev_change_medium() which allows changing the read-only status of the block device whose medium is changed. Some drives do not have a inherently fixed read-only status; for instance, floppy disks can be set read-only or writable independently of the drive. Some users may

[Qemu-devel] [PATCH v8 07/15] blockdev: Add blockdev-insert-medium

2015-10-26 Thread Max Reitz
And a helper function for that, which directly takes a pointer to the BDS to be inserted instead of its node-name (which will be used for implementing 'change' using blockdev-insert-medium). Signed-off-by: Max Reitz --- blockdev.c | 56 ++

[Qemu-devel] [PATCH v8 15/15] iotests: Add test for change-related QMP commands

2015-10-26 Thread Max Reitz
Signed-off-by: Max Reitz --- tests/qemu-iotests/118 | 720 + tests/qemu-iotests/118.out | 5 + tests/qemu-iotests/group | 1 + 3 files changed, 726 insertions(+) create mode 100755 tests/qemu-iotests/118 create mode 100644 tests/qemu-iotests

[Qemu-devel] [PATCH v8 09/15] blockdev: Implement change with basic operations

2015-10-26 Thread Max Reitz
Implement 'change' on block devices by calling blockdev-open-tray, blockdev-remove-medium, blockdev-insert-medium (a variation of that which does not need a node-name) and blockdev-close-tray. Signed-off-by: Max Reitz --- blockdev.c | 178 +++--

[Qemu-devel] [PATCH v8 04/15] blockdev: Add blockdev-open-tray

2015-10-26 Thread Max Reitz
Signed-off-by: Max Reitz --- blockdev.c | 36 qapi/block-core.json | 32 qmp-commands.hx | 48 3 files changed, 116 insertions(+) diff --git a/blockdev.c b/blockd

[Qemu-devel] [PATCH v8 14/15] hmp: Add read-only-mode option to change command

2015-10-26 Thread Max Reitz
Expose the new read-only-mode option of 'blockdev-change-medium' for the 'change' HMP command. Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf --- hmp-commands.hx | 20 +--- hmp.c | 22 +- 2 files changed, 38 insertions(+), 4 deletions(-) diff --g

[Qemu-devel] [PATCH v8 08/15] blockdev: Implement eject with basic operations

2015-10-26 Thread Max Reitz
Implement 'eject' by calling blockdev-open-tray and blockdev-remove-medium. Signed-off-by: Max Reitz --- blockdev.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/blockdev.c b/blockdev.c index 328843b..2fa2d3e 100644 --- a/blockdev.c +++ b/blockdev.c @@ -1969,16

[Qemu-devel] [PATCH v8 03/15] block: Add functions for inheriting a BBRS

2015-10-26 Thread Max Reitz
In order to open a BDS which inherits a BB's root state, blk_get_open_flags_from_root_state() is used to inquire the flags to be passed to bdrv_open(), and blk_apply_root_state() is used to apply the remaining state after the BDS has been opened. Signed-off-by: Max Reitz --- block/block-backend.

[Qemu-devel] [PATCH v8 02/15] block: Make bdrv_states public

2015-10-26 Thread Max Reitz
When inserting a BDS tree into a BB, we will need to add the root BDS to this list. Since we will want to do that in the blockdev-insert-medium implementation in blockdev.c, we will need access to it there. This patch is not exactly elegant, but bdrv_states will be removed in the future anyway bec

Re: [Qemu-devel] [PATCH v10 13/25] qapi-visit: Convert to new qapi union layout

2015-10-26 Thread Eric Blake
On 10/26/2015 11:07 AM, Markus Armbruster wrote: > Eric Blake writes: > >> We have two issues with our qapi union layout: >> 1) Even though the QMP wire format spells the tag 'type', the >> C code spells it 'kind', requiring some hacks in the generator. >> 2) The C struct uses an anonymous union,

[Qemu-devel] [PATCH v8 11/15] qmp: Introduce blockdev-change-medium

2015-10-26 Thread Max Reitz
Introduce a new QMP command 'blockdev-change-medium' which is intended to replace the 'change' command for block devices. The existing function qmp_change_blockdev() is accordingly renamed to qmp_blockdev_change_medium(). Signed-off-by: Max Reitz --- blockdev.c| 7 --- inclu

[Qemu-devel] [PATCH v8 05/15] blockdev: Add blockdev-close-tray

2015-10-26 Thread Max Reitz
Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf --- blockdev.c | 23 +++ qapi/block-core.json | 16 qmp-commands.hx | 35 +++ 3 files changed, 74 insertions(+) diff --git a/blockdev.c b/blockdev.c index 1119368

[Qemu-devel] [PATCH v8 10/15] block: Inquire tray state before tray-moved events

2015-10-26 Thread Max Reitz
blk_dev_change_media_cb() is called for all potential tray movements; however, it is possible to request closing the tray but nothing actually happening (on a floppy disk drive without a medium). Thus, the actual tray status should be inquired before sending a tray-moved event (and an event should

[Qemu-devel] [PATCH v8 06/15] blockdev: Add blockdev-remove-medium

2015-10-26 Thread Max Reitz
Signed-off-by: Max Reitz --- blockdev.c | 51 +++ qapi/block-core.json | 16 qmp-commands.hx | 45 + 3 files changed, 112 insertions(+) diff --git a/blockdev.c b/blockdev.c

[Qemu-devel] [PATCH v8 00/15] blockdev: BlockBackend and media

2015-10-26 Thread Max Reitz
Now that the main rework part of this series is merged, these remaining patches here implement atomic tray/medium operations and add the read-only-mode parameter to change and blockdev-change-medium (which was the original purpose of this series!). Once again, I'd like to thank all the reviewers f

[Qemu-devel] [PATCH v8 01/15] block: Add blk_remove_bs()

2015-10-26 Thread Max Reitz
This function removes the BlockDriverState associated with the given BlockBackend from that BB and sets the BDS pointer in the BB to NULL. Signed-off-by: Max Reitz --- block/block-backend.c | 12 include/sysemu/block-backend.h | 1 + 2 files changed, 13 insertions(+) diff

[Qemu-devel] [PATCH] maint: Ignore ivshmem binaries

2015-10-26 Thread Eric Blake
Commit a75eb03b added ivshmem-client and ivshmem-server binaries, but did not mark them for exclusion in .gitignore. Signed-off-by: Eric Blake --- Yes, I know that these only show up in 'git status' as dirty if you do an in-tree build, and that we prefer VPATH builds. But we might as well be co

Re: [Qemu-devel] [PATCH 01/11] trace: fix documentation

2015-10-26 Thread Christian Borntraeger
Am 26.10.2015 um 18:10 schrieb Denis V. Lunev: > From: Paolo Bonzini > > Mention the ftrace backend too. > > Signed-off-by: Paolo Bonzini > Signed-off-by: Denis V. Lunev > Reviewed-by: Christian Borntraeger Can you make that Acked-by: Christian Borntraeger ? I agree with the series, but h

Re: [Qemu-devel] [PATCH 11/11] log: add "-d trace:PATTERN"

2015-10-26 Thread Lluís Vilanova
Eric Blake writes: > On 10/26/2015 07:12 AM, Lluís Vilanova wrote: >> Denis V Lunev writes: >> >>> From: Paolo Bonzini >>> This is a bit easier to use than "-trace" if you are also enabling >>> other kinds of logging. It is also more discoverable for experienced >>> QEMU users, and accessible

Re: [Qemu-devel] [PATCH] vl.c: Replace fprintf(stderr) with error_report()

2015-10-26 Thread Eric Blake
On 10/26/2015 11:13 AM, Eduardo Habkost wrote: > This replaces most fprintf(stderr) calls on vl.c with error_report(). > > The trailing newlines, "qemu:" and "error:" message prefixes were > removed. > > The only remaining fprintf(stderr) calls are the ones at > qemu_kill_report(), because the er

Re: [Qemu-devel] [PATCH] block: allow best-effort query

2015-10-26 Thread Eric Blake
On 10/26/2015 12:12 PM, John Snow wrote: > For more complex BDS trees that can be created under normal circumstances, > we lose the ability to issue query commands because of our inability to > re-construct the absolute filename. > > Instead, omit this field when it is a problem and present as muc

Re: [Qemu-devel] [PATCH v2] pc: memhp: enforce minimal 128Mb alignment for pc-dimm

2015-10-26 Thread Andrey Korolyov
> How about following comment: > /* Linux guests expect 512/64/128Mb alignment for PAE/x32/x64 arch > * respectively. Windows works fine with 2Mb. To make sure that > * memory hotplug would work with above flavors of Linux set > * minimal alignment to 512Mb (i.e. PAE arch). > * Enforcing minima

Re: [Qemu-devel] [PATCH v2 0/3] target-i386: save/restore vcpu's TSC rate during migration

2015-10-26 Thread Eduardo Habkost
On Mon, Oct 26, 2015 at 10:09:13AM +0800, haozhong.zh...@intel.com wrote: > On Fri, Oct 23, 2015 at 12:45:13PM -0200, Eduardo Habkost wrote: > > On Fri, Oct 23, 2015 at 10:27:27AM +0800, Haozhong Zhang wrote: > > > On Thu, Oct 22, 2015 at 04:45:21PM -0200, Eduardo Habkost wrote: > > > > On Tue, Oct

Re: [Qemu-devel] [PATCH] pc: memhp: enforce minimal 128Mb alignment for pc-dimm

2015-10-26 Thread Eduardo Habkost
On Mon, Oct 26, 2015 at 09:42:05AM +0100, Igor Mammedov wrote: > commit aa8580cd "pc: memhp: force gaps between DIMM's GPA" > regressed memory hot-unplug for linux guests triggering > following BUGON > = > kernel BUG at mm/memory_hotplug.c:703! > ... > [] acpi_memory_device_remove+0x79/0xa5

Re: [Qemu-devel] 4k seq read splitting for virtio-blk - possible workarounds?

2015-10-26 Thread Andrey Korolyov
On Mon, Oct 26, 2015 at 8:32 PM, Paolo Bonzini wrote: > > > On 26/10/2015 18:18, Andrey Korolyov wrote: >> Yes, both cases are positive, thanks for very detailed explanation and >> for tips. Does this also mean that most current distros which are >> using 'broken' >=3.13 <4.2 driver would bring se

Re: [Qemu-devel] [PATCH v5 1/6] block: Change bdrv_get_encrypted_filename()

2015-10-26 Thread Kevin Wolf
Am 19.10.2015 um 20:49 hat Max Reitz geschrieben: > Instead of returning a pointer to the filename, g_strdup() it. This will > become necessary once we do not have BlockDriverState.filename anymore. > > Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf

Re: [Qemu-devel] [PATCH 08/11] log: move qemu-log.c into util/ directory

2015-10-26 Thread Denis V. Lunev
On 10/26/2015 08:20 PM, Paolo Bonzini wrote: On 26/10/2015 10:10, Denis V. Lunev wrote: log will become common facility with tracepoints support in next step. Signed-off-by: Denis V. Lunev --- Makefile.objs| 1 - util/Makefile.objs | 1 + qemu-log.c => util/log.c | 0 3

Re: [Qemu-devel] [PATCH v5 4/6] qemu-img: Use bdrv_filename() for map

2015-10-26 Thread Kevin Wolf
Am 19.10.2015 um 20:49 hat Max Reitz geschrieben: > Replaces bs->filename by the result of bdrv_filename() in the > qemu-img map subcommand. Since that value is queried relatively often, > however, it should be cached. > > Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf

Re: [Qemu-devel] [PATCH v5 3/6] block: Add bdrv_filename()

2015-10-26 Thread Kevin Wolf
Am 19.10.2015 um 20:49 hat Max Reitz geschrieben: > Split the part which actually refreshes the BlockDriverState.filename > field off of bdrv_refresh_filename() into a more generic function > bdrv_filename(), which first calls bdrv_refresh_filename() and then > stores a qemu-usable filename in the

Re: [Qemu-devel] [PATCH] vl.c: Replace fprintf(stderr) with error_report()

2015-10-26 Thread Eduardo Habkost
On Mon, Oct 26, 2015 at 06:43:43PM +0100, Markus Armbruster wrote: > Eduardo Habkost writes: [...] > > Not sure if this is appropriate post soft-freeze, but if we are going to > > apply > > the max-cpus patch from Drew before 2.5.0, we could simply change all the > > fprintf() calls in a single s

[Qemu-devel] [PATCH for-2.5 0/2] target-arm: improve debug log display of PSTATE/PSR

2015-10-26 Thread Peter Maydell
These are two small patches which I put together while working on support for TZ in ARM, which improve the display of the PSTATE and PSR in the -d cpu debug logging. The first one brings the handling of PSTATE in AArch64 into line with the handling of PSR in AArch32, by putting it on its own line

[Qemu-devel] [PATCH for-2.5 2/2] target-arm: Report S/NS status in the CPU debug logs

2015-10-26 Thread Peter Maydell
If this CPU supports EL3, enhance the printing of the current CPU mode in debug logging to distinguish S from NS modes as appropriate. Signed-off-by: Peter Maydell --- target-arm/translate-a64.c | 11 ++- target-arm/translate.c | 12 +++- 2 files changed, 21 insertions(+), 2

[Qemu-devel] [PATCH for-2.5 1/2] target-arm: Bring AArch64 debug CPU display of PSTATE into line with AArch32

2015-10-26 Thread Peter Maydell
The AArch64 debug CPU display of PSTATE as "PSTATE=23c5 (flags --C-)" on the end of the same line as the last of the general purpose registers is unnecessarily different from the AArch32 display of PSR as "PSR=21d3 --C- A svc32" on its own line. Update the AArch64 code to put PSTATE in its

  1   2   3   4   >