[Qemu-devel] [RFC PATCH 1/1] dataplane: alternative approach to locking

2015-11-03 Thread Denis V. Lunev
What about this? Is it simple enough for you keeping lock around qemu_fopen_bdrv/qemu_fclose as suggested in patch 1? This is not tested at all, just sent as an idea for a discussion. Signed-off-by: Denis V. Lunev CC: Stefan Hajnoczi CC: Juan Quintela --- block.c | 17 ++

Re: [Qemu-devel] [PATCH v8 10/17] qapi: Simplify visiting of alternate types

2015-11-03 Thread Markus Armbruster
Eric Blake writes: > On 11/03/2015 11:30 AM, Markus Armbruster wrote: >> Eric Blake writes: >> >>> 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 >> >> m

[Qemu-devel] [PATCH v9 23/27] qapi: Simplify visiting of alternate types

2015-11-03 Thread Eric Blake
Previously, working with alternates required two lookup arrays and some indirection: for type Foo, we created Foo_qtypes[] which maps each qtype to a value of the generated FooKind enum, then look up that value in FooKind_lookup[] like we do for other union types. This has a couple of subtle bugs.

[Qemu-devel] [PATCH v9 26/27] qapi: Remove dead visitor code

2015-11-03 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 v9 24/27] qapi: Fix alternates that accept 'number' but not 'int'

2015-11-03 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 v9 17/27] qapi: Clean up after previous commit

2015-11-03 Thread Eric Blake
From: Markus Armbruster QAPISchemaObjectTypeVariants.check() parameter members is no longer used, drop it. Signed-off-by: Markus Armbruster Message-Id: <1446559499-26984-3-git-send-email-arm...@redhat.com> [Variant.check(seen) is used after all, so reword and reduce scope of this patch; rearran

[Qemu-devel] [PATCH v9 22/27] qapi: Remove outdated tests related to QMP/branch collisions

2015-11-03 Thread Eric Blake
Now that branches are in a separate C namespace, we can remove the restrictions in the parser that claim a branch name would collide with QMP, and delete the negative tests that are no longer problematic. A separate patch can then add positive tests to qapi-schema-test to test that any corner case

[Qemu-devel] [PATCH v9 21/27] qapi: Factor out QAPISchemaObjectType.check_clash()

2015-11-03 Thread Eric Blake
Consolidate two common sequences of clash detection into a new QAPISchemaObjectType.check_clash() helper method. No change to generated code. Signed-off-by: Eric Blake --- v9: new patch, split off from v8 7/17 --- scripts/qapi.py | 18 -- 1 file changed, 8 insertions(+), 10 del

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

2015-11-03 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 v9 04/27] qapi: Simplify error testing in test-qmp-*

2015-11-03 Thread Eric Blake
By using &error_abort, we can avoid a local err variable in situations where we expect success. By moving err into data, we can let test teardown take care of cleaning up any collected error; it also gives us fewer lines of code between repeated tests where init runs teardown on our behalf. Signe

[Qemu-devel] [PATCH v9 25/27] qapi: Add positive tests to qapi-schema-test

2015-11-03 Thread Eric Blake
Add positive tests to qapi-schema-test for things that were made possible by recent patches but which caused compile errors due to collisions prior to that point. The focus is mainly on collisions due to names we have reserved for qapi, even though it is unlikely that anyone will want to abuse the

[Qemu-devel] [PATCH v9 15/27] qapi: Simplify QAPISchemaObjectTypeMember.check()

2015-11-03 Thread Eric Blake
From: Markus Armbruster QAPISchemaObjectTypeMember.check() currently does four things: 1. Compute self.type 2. Accumulate members in all_members Only one caller cares: QAPISchemaObjectType.check() uses it to compute self.members. The other callers pass a throw-away accumulator. 3. A

[Qemu-devel] [PATCH v9 16/27] qapi: Eliminate QAPISchemaObjectType.check() variable members

2015-11-03 Thread Eric Blake
From: Markus Armbruster We can use seen.values() instead if we make it an OrderedDict. Signed-off-by: Markus Armbruster Message-Id: <1446559499-26984-5-git-send-email-arm...@redhat.com> [reorder series] Signed-off-by: Eric Blake --- v9: new patch --- scripts/qapi.py | 16 ++-- 1

[Qemu-devel] [PATCH v9 19/27] qapi: Check for qapi collisions of flat union branches

2015-11-03 Thread Eric Blake
Right now, our ad hoc parser ensures that we cannot have a flat union that introduces any qapi member names that would conflict with the non-variant qapi members already present from the union's base type (see flat-union-clash-member.json). We want QAPISchema*.check() to make the same check, so we

[Qemu-devel] [PATCH v9 13/27] qapi: Drop obsolete tag value collision assertions

2015-11-03 Thread Eric Blake
From: Markus Armbruster Union tag values can't clash with member names in generated C anymore since commit e4ba22b, but QAPISchemaObjectTypeVariant.check() still asserts they don't. Drop it. Signed-off-by: Markus Armbruster Message-Id: <1446559499-26984-1-git-send-email-arm...@redhat.com> [A l

[Qemu-devel] [PATCH v9 03/27] qapi: Plug leaks in test-qmp-*

2015-11-03 Thread Eric Blake
Make valgrind happy with the current state of the tests, so that it is easier to see if future patches introduce new memory problems without being drowned in noise. Many of the leaks were due to calling a second init without tearing down the data from an earlier visit. But since teardown is alrea

[Qemu-devel] [PATCH v9 18/27] qapi: Factor out QAPISchemaObjectTypeMember.check_clash()

2015-11-03 Thread Eric Blake
From: Markus Armbruster While there, stick in a TODO change key of seen from QAPI name to C name. Can't do it right away, because it would fail the assertion for tests/qapi-schema/args-has-clash.json. Signed-off-by: Markus Armbruster Message-Id: <1446559499-26984-6-git-send-email-arm...@redhat

[Qemu-devel] [PATCH v9 20/27] qapi: Simplify QAPISchemaObjectTypeVariants.check()

2015-11-03 Thread Eric Blake
From: Markus Armbruster Avoid the 'if seen' conditional by doing just the essential work here, namely setting self.tag_member for flat unions. Move the rest to callers. Signed-off-by: Markus Armbruster Message-Id: <1446559499-26984-7-git-send-email-arm...@redhat.com> [reword commit, rebase to e

[Qemu-devel] [PATCH v9 11/27] qapi-types: Consolidate gen_struct() and gen_union()

2015-11-03 Thread Eric Blake
These two methods are now close enough that we can finally merge them, relying on the fact that simple unions now provide a reasonable local_members. Change gen_struct() to gen_object() that handles all forms of QAPISchemaObjectType, and rename and shrink gen_union() to gen_variants() to handle th

[Qemu-devel] [PATCH v9 01/27] qapi: Use generated TestStruct machinery in tests

2015-11-03 Thread Eric Blake
Commit d88f5fd and friends first introduced the various test-qmp-* tests in 2011, with duplicated hand-rolled TestStruct machinery, to make sure the qapi visitor interface was tested. Later, commit 4f193e3 in 2013 added a .json file for further testing use by the files, but without consolidating a

[Qemu-devel] [PATCH v9 14/27] qapi: Fix up commit 7618b91's clash sanity checking change

2015-11-03 Thread Eric Blake
From: Markus Armbruster This hunk @@ -964,6 +965,7 @@ class QAPISchemaObjectType(QAPISchemaType): members = [] seen = {} for m in members: +assert c_name(m.name) not in seen seen[m.name] = m for m in sel

[Qemu-devel] [PATCH v9 12/27] qapi-types: Simplify gen_struct_field[s]

2015-11-03 Thread Eric Blake
Simplify gen_struct_fields() back to a single iteration over a list of fields (like it was prior to commit f87ab7f9), by moving the generated comments to gen_object(). Then, inline gen_struct_field() into its only caller. Signed-off-by: Eric Blake --- v9: new patch --- scripts/qapi-types.py |

[Qemu-devel] [PATCH v9 09/27] qapi-introspect: Document lack of sorting

2015-11-03 Thread Eric Blake
qapi-code-gen.txt already claims that types, commands, and events share a common namespace; set this in stone by further documenting that our introspection output will never have collisions with the same name tied to more than one meta-type. Our largest QMP enum currently has 125 values, our large

[Qemu-devel] [PATCH v9 02/27] qapi: Strengthen test of TestStructList

2015-11-03 Thread Eric Blake
Make each list element different, to ensure that order is preserved, and use the generated free function instead of hand-rolling our own to ensure (under valgrind) that the list is properly cleaned. Suggested-by: Markus Armbruster Signed-off-by: Eric Blake --- v9: no change v8: no change v7: ne

[Qemu-devel] [PATCH v9 10/27] qapi: Track simple union tag in object.local_members

2015-11-03 Thread Eric Blake
We were previously creating all unions with an empty list for local_members. However, it will make it easier to unify struct and union generation if we include the generated tag member in local_members. That way, we can have a common code pattern: visit the base (if any), visit the local members

[Qemu-devel] [PATCH v9 07/27] qapi: More tests of input arrays

2015-11-03 Thread Eric Blake
Our testsuite had no coverage of empty arrays, nor of what happens when the input does not match the expected type. Useful to have, especially if we start changing the visitor contracts. Signed-off-by: Eric Blake --- v9: move earlier in series (was 16/17) v8: no change v7: no change v6: new patc

[Qemu-devel] [PATCH v9 08/27] qapi: Provide nicer array names in introspection

2015-11-03 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 v9 06/27] qapi: Test failure in middle of array parse

2015-11-03 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 v9 05/27] qapi: More tests of alternate output

2015-11-03 Thread Eric Blake
The testsuite was only covering that we could output a built-in branch of an alternate; make sure that things still work even when a branch involves allocation, to ensure that we don't leak when run under valgrind. Update to modern style of g_new0() over g_malloc0() while touching it. Signed-off-

[Qemu-devel] [PATCH v9 00/27] alternate layout (post-introspection cleanups, subset C)

2015-11-03 Thread Eric Blake
No pending prerequisites; based on qemu.git master Also available as a tag at this location: git fetch git://repo.or.cz/qemu/ericb.git qapi-cleanupv9c and will soon be part of my branch with the rest of the v5 series, at: http://repo.or.cz/qemu/ericb.git/shortlog/refs/heads/qapi v9 notes: More p

Re: [Qemu-devel] [PATCH 09/13] cuda.c: add defines for CUDA registers

2015-11-03 Thread David Gibson
On Fri, Oct 23, 2015 at 02:56:34PM +0100, Mark Cave-Ayland wrote: > Signed-off-by: Mark Cave-Ayland Reviewed-by: David Gibson > --- > hw/misc/macio/cuda.c | 87 > ++ > 1 file changed, 53 insertions(+), 34 deletions(-) > > diff --git a/hw/mis

Re: [Qemu-devel] [PATCH 11/13] cuda.c: rename get_counter() state variable from s to ti for consistency

2015-11-03 Thread David Gibson
On Fri, Oct 23, 2015 at 02:56:36PM +0100, Mark Cave-Ayland wrote: > Signed-off-by: Mark Cave-Ayland There are some other functions that also use 's' instead of 'ti', but I don't think that's a reason not to improve consistency in one place. Reviewed-by: David Gibson > --- > hw/misc/macio/cuda

Re: [Qemu-devel] [PATCH 12/13] cuda.c: fix T2 timer and enable its interrupt

2015-11-03 Thread David Gibson
On Fri, Oct 23, 2015 at 02:56:37PM +0100, Mark Cave-Ayland wrote: > Fix the counter loading logic and enable the T2 interrupt when the timer > expires. A mention of what uses T2, and therefore why this is useful would be good. > > Signed-off-by: Mark Cave-Ayland > --- > hw/misc/macio/cuda.c |

Re: [Qemu-devel] [PATCH 13/13] cuda.c: add delay to setting of SR_INT bit

2015-11-03 Thread David Gibson
On Fri, Oct 23, 2015 at 02:56:38PM +0100, Mark Cave-Ayland wrote: > MacOS 9 is racy when it comes to accessing the shift register. Fix this by > introducing a small delay between data accesses and raising the SR_INT > interrupt bit. > > Signed-off-by: Mark Cave-Ayland Reviewed-by: David Gibson

Re: [Qemu-devel] [PATCH 01/13] PPC: Allow Rc bit to be set on mtspr

2015-11-03 Thread David Gibson
On Fri, Oct 23, 2015 at 02:56:26PM +0100, Mark Cave-Ayland wrote: > From: Alexander Graf > > According to the ISA setting the Rc bit on mtspr is undefined behavior. > Real 750 hardware simply ignores the bit and doesn't touch cr0 though. > > Unfortunately, Mac OS 9 relies on this fact and execu

Re: [Qemu-devel] [PATCH 10/13] cuda.c: refactor get_tb() so that the time can be passed in

2015-11-03 Thread David Gibson
On Fri, Oct 23, 2015 at 02:56:35PM +0100, Mark Cave-Ayland wrote: > This is in preparation for sharing the code between timers. > > Signed-off-by: Mark Cave-Ayland Reviewed-by: David Gibson > --- > hw/misc/macio/cuda.c | 11 ++- > 1 file changed, 6 insertions(+), 5 deletions(-) > >

Re: [Qemu-devel] [PATCH 02/13] PPC: Fix lsxw bounds checks

2015-11-03 Thread David Gibson
On Tue, Nov 03, 2015 at 10:03:21PM +0100, Thomas Huth wrote: > On 03/11/15 20:21, Mark Cave-Ayland wrote: > > On 03/11/15 15:23, Thomas Huth wrote: > > > >> On 23/10/15 15:56, Mark Cave-Ayland wrote: > >>> From: Alexander Graf > >>> > >>> The lsxw instruction checks whether the desired string act

Re: [Qemu-devel] [PATCH 03/13] PPC: mac99: Always add USB controller

2015-11-03 Thread David Gibson
On Tue, Nov 03, 2015 at 04:30:57PM +0100, Thomas Huth wrote: > On 23/10/15 15:56, Mark Cave-Ayland wrote: > > From: Alexander Graf > > > > The mac99 machines always have a USB controller. Usually not having one > > around > > doesn't hurt quite as much, but Mac OS 9 really really wants one or it

Re: [Qemu-devel] [PATCH 04/13] cuda.c: fix CUDA ADB error packet format

2015-11-03 Thread David Gibson
On Fri, Oct 23, 2015 at 02:56:29PM +0100, Mark Cave-Ayland wrote: > ADB error packets should be of the form (type, status, cmd) rather than just > (type, status). This fixes ADB device detection under MacOS 9. Hmm.. are there any public doc on these ADB / CUDA things that we can look up to compare

Re: [Qemu-devel] [PATCH 07/13] cuda.c: implement dummy IIC access commands

2015-11-03 Thread David Gibson
On Fri, Oct 23, 2015 at 02:56:32PM +0100, Mark Cave-Ayland wrote: > These are used by MacOS 9 on boot. Here we return an error except for 4-byte > commands which write to the IIC bus. A bit of rationale about why some of these give errors and some don't would be nice. > > Signed-off-by: Mark Cav

Re: [Qemu-devel] [PATCH 05/13] cuda.c: fix CUDA_PACKET response packet format

2015-11-03 Thread David Gibson
On Fri, Oct 23, 2015 at 02:56:30PM +0100, Mark Cave-Ayland wrote: > According to comments in MOL, the response to a CUDA_PACKET should be one of > the following: > > Reply: CUDA_PACKET, status, cmd > Error: ERROR_PACKET, status, CUDA_PACKET, cmd > > Update cuda_receive_packet() accordingly to ref

Re: [Qemu-devel] [PATCH 00/13] Mac OS 9 compatibility improvements (upstream rework)

2015-11-03 Thread David Gibson
On Fri, Oct 30, 2015 at 04:48:12PM +, Mark Cave-Ayland wrote: > On 23/10/15 14:56, Mark Cave-Ayland wrote: > > > This is a rework of Cormac O'Brien's GSoC project to try and boot MacOS 9 > > under > > QEMU, the original version of which was posted to the qemu-devel list at the > > end of Augu

Re: [Qemu-devel] [PATCH 06/13] cuda.c: implement simple CUDA_GET_6805_ADDR command

2015-11-03 Thread David Gibson
On Fri, Oct 23, 2015 at 02:56:31PM +0100, Mark Cave-Ayland wrote: > This simply returns an empty response with no error status. > > Signed-off-by: Mark Cave-Ayland Assuming the previous changes are correct, Reviewed-by: David Gibson > --- > hw/misc/macio/cuda.c |3 +++ > 1 file changed,

Re: [Qemu-devel] [PATCH] eepro100: prevent an infinite loop over same command block

2015-11-03 Thread Jason Wang
On 11/04/2015 02:49 AM, P J P wrote: > +-- On Tue, 20 Oct 2015, Jason Wang wrote --+ > | Can this survive if we had a chain like? > | A->B->A > > No, current patch wouldn't cope with it. Though I wonder if such a loop is > possible? Just wondering. Tx.link is unit32_t, but any chance s->cu

Re: [Qemu-devel] [PATCH v7 11/35] util: introduce qemu_file_getlength()

2015-11-03 Thread Xiao Guangrong
On 11/04/2015 07:21 AM, Eduardo Habkost wrote: On Mon, Nov 02, 2015 at 05:13:13PM +0800, Xiao Guangrong wrote: [...] +size_t qemu_file_getlength(const char *file, Error **errp) +{ +int64_t size; [...] +return size; Can you guarantee that SIZE_MAX >= INT64_MAX on all platforms suppo

Re: [Qemu-devel] [vhost-user BUG ?] QEMU process segfault when shutdown or reboot with vhost-user

2015-11-03 Thread Jason Wang
On 11/04/2015 10:24 AM, zhanghailiang wrote: > On 2015/11/3 22:54, Marc-André Lureau wrote: >> Hi >> >> On Tue, Nov 3, 2015 at 2:01 PM, zhanghailiang >> wrote: >>> The corresponding codes where gdb reports error are: (We have added >>> some >>> codes in net.c) >> >> Can you reproduce with unmodi

Re: [Qemu-devel] [PATCH v7 08/35] exec: allow memory to be allocated from any kind of path

2015-11-03 Thread Xiao Guangrong
On 11/04/2015 07:00 AM, Eduardo Habkost wrote: On Mon, Nov 02, 2015 at 05:13:10PM +0800, Xiao Guangrong wrote: Currently file_ram_alloc() is designed for hugetlbfs, however, the memory of nvdimm can come from either raw pmem device eg, /dev/pmem, or the file locates at DAX enabled filesystem

Re: [Qemu-devel] safety of migration_bitmap_extend

2015-11-03 Thread Wen Congyang
On 11/03/2015 09:47 PM, Dr. David Alan Gilbert wrote: > * Juan Quintela (quint...@redhat.com) wrote: >> "Dr. David Alan Gilbert" wrote: >>> Hi, >>> I'm trying to understand why migration_bitmap_extend is correct/safe; >>> If I understand correctly, you're arguing that: >>> >>> 1) the migration

Re: [Qemu-devel] [PATCH COLO-Frame v10 33/38] netfilter: Introduce an API to delete the timer of all buffer-filters

2015-11-03 Thread zhanghailiang
On 2015/11/4 10:51, Jason Wang wrote: On 11/03/2015 09:07 PM, zhanghailiang wrote: Hi, On 2015/11/3 20:41, Yang Hongyang wrote: Can you explain why this is needed? Seems that this api hasn't been used in this series. We will call it in colo_init_filter_buffers() which is introduced in pat

Re: [Qemu-devel] [PATCH COLO-Frame v10 35/38] netfilter: Introduce a API to automatically add filter-buffer for each netdev

2015-11-03 Thread zhanghailiang
On 2015/11/4 10:56, Jason Wang wrote: On 11/03/2015 07:56 PM, zhanghailiang wrote: Signed-off-by: zhanghailiang Cc: Jason Wang Commit log please. --- v10: new patch --- include/net/filter.h | 1 + include/net/net.h| 3 ++ net/filter-buffer.c | 84 ++

Re: [Qemu-devel] [PATCH COLO-Frame v10 35/38] netfilter: Introduce a API to automatically add filter-buffer for each netdev

2015-11-03 Thread Jason Wang
On 11/03/2015 07:56 PM, zhanghailiang wrote: > Signed-off-by: zhanghailiang > Cc: Jason Wang Commit log please. > --- > v10: new patch > --- > include/net/filter.h | 1 + > include/net/net.h| 3 ++ > net/filter-buffer.c | 84 > > n

Re: [Qemu-devel] [PATCH COLO-Frame v10 34/38] filter-buffer: Accept zero interval

2015-11-03 Thread Jason Wang
On 11/03/2015 08:43 PM, Yang Hongyang wrote: > Some commit message would be better. +1 > > On 2015年11月03日 19:56, zhanghailiang wrote: >> Signed-off-by: zhanghailiang >> Cc: Jason Wang > > Reviewed-by: Yang Hongyang > >> --- >> v10: new patch >> --- >> net/filter-buffer.c | 10 -- >>

Re: [Qemu-devel] [PATCH COLO-Frame v10 33/38] netfilter: Introduce an API to delete the timer of all buffer-filters

2015-11-03 Thread Jason Wang
On 11/03/2015 09:07 PM, zhanghailiang wrote: > Hi, > > On 2015/11/3 20:41, Yang Hongyang wrote: >> Can you explain why this is needed? Seems that this api hasn't >> been used in this series. >> > > We will call it in colo_init_filter_buffers() which is introduced in > patch 37, > We should remove

Re: [Qemu-devel] [PATCH v4 7/7] e1000: Implementing various counters

2015-11-03 Thread Jason Wang
On 11/03/2015 07:14 PM, Leonid Bloch wrote: > This implements the following Statistic registers (various counters) > according to Intel's specs: > > TSCTC GOTCL GOTCH GORCL GORCH MPRC BPRC RUCROC > BPTC MPTC PTC... PRC... > > Signed-off-by: Leonid Bloch > Signed-off-by: Dmitry F

Re: [Qemu-devel] [PATCH v4 3/7] e1000: Trivial implementation of various MAC registers

2015-11-03 Thread Jason Wang
On 11/03/2015 07:14 PM, Leonid Bloch wrote: > These registers appear in Intel's specs, but were not implemented. > These registers are now implemented trivially, i.e. they are initiated > with zero values, and if they are RW, they can be written or read by the > driver, or read only if they are R

Re: [Qemu-devel] [PATCH v4 2/7] e1000: Add support for migrating the entire MAC registers' array

2015-11-03 Thread Jason Wang
On 11/03/2015 07:14 PM, Leonid Bloch wrote: > This patch enables the migration of the entire array of MAC registers > during live migration. The entire array is just 128 KB long, so > practically no penalty should be felt when transmitting it, over the > individual registers. But the advantages a

[Qemu-devel] [PATCH v2 2/4] qemu-iotests: s390x: fix test 051

2015-11-03 Thread Bo Tu
The tests for device type "ide_cd" should only be tested for the pc platform. The default device id of hard disk on the s390 platform differs to that of the x86 platform. A new variable device_id is defined and "virtio0" set for the s390 platform. A x86 platform specific output file is also needed.

[Qemu-devel] [PATCH v2 3/4] qemu-iotests: s390x: fix test 068

2015-11-03 Thread Bo Tu
Now, s390-virtio-ccw is default machine and s390-ccw.img is default boot loader. If the s390-virtio-ccw machine finds no device to load from and errors out, then emits a panic and exits the vm. This breaks test cases 068 for s390x. Adding the parameter of "-no-shutdown" for s390-ccw-virtio will pau

[Qemu-devel] [PATCH v2 4/4] qemu-iotests: disable VNC server for test 120

2015-11-03 Thread Bo Tu
Ever since qemu-iotest 120 was introduced, its expected output didn't include the output from the built-in VNC server: QA output created by 120 Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 QMP_VERSION +VNC server running on `::1:5900' {"return": {}} wrote 65536/65536 bytes at offs

[Qemu-devel] [PATCH v2 0/4] Update tests/qemu-iotests failing cases for the s390 platform

2015-11-03 Thread Bo Tu
v2: 1. Refine common.config via changing the definition of default_alias_machine and default_machine 2. Add Reviewed-by of Eric Blake for common.config v1: 1. Refine common.config 2. Update the output file for test 051 based on its current output for s390 platform, add a pc specific output file

[Qemu-devel] [PATCH v2 1/4] qemu-iotests: refine common.config

2015-11-03 Thread Bo Tu
Replacing sed with awk, then it's easier to read. Replacing "[ ! -z "$default_alias_machine" ]" with "[[ $default_alias_machine ]]", then it's slightly shorter. Suggested-By: Sascha Silbe Reviewed-by: Sascha Silbe Reviewed-by: Eric Blake Signed-off-by: Bo Tu --- tests/qemu-iotests/common.co

Re: [Qemu-devel] [vhost-user BUG ?] QEMU process segfault when shutdown or reboot with vhost-user

2015-11-03 Thread zhanghailiang
On 2015/11/3 22:54, Marc-André Lureau wrote: Hi On Tue, Nov 3, 2015 at 2:01 PM, zhanghailiang wrote: The corresponding codes where gdb reports error are: (We have added some codes in net.c) Can you reproduce with unmodified qemu? Could you give instructions to do so? OK, i will try to do

[Qemu-devel] [PATCH v2] iscsi: Translate scsi sense into error code

2015-11-03 Thread Fam Zheng
Previously we return -EIO blindly when anything goes wrong. Add a helper function to parse sense fields and try to make the return code more meaningful. This also fixes the default werror configuration (enospc) when we're using qcow2 on an iscsi lun. The old -EIO not being treated as out of space

Re: [Qemu-devel] [PATCH] SeaBios: Fix reset procedure reentrancy problem on qemu-kvm platform

2015-11-03 Thread Gonglei
Ccing Seabios community. On 2015/11/3 14:58, Xulei (Stone, Euler) wrote: > On qemu-kvm platform, when I reset a VM through "virsh reset", and > coincidently > the VM is in process of internal rebooting at the same time. Then the VM will > not be successfully reseted any more due to the reset reen

Re: [Qemu-devel] [PATCH] configure: add missing --disable-modules option

2015-11-03 Thread Fam Zheng
On Tue, 11/03 11:56, Peter Maydell wrote: > On 3 November 2015 at 11:22, Stefan Hajnoczi wrote: > > On Tue, Nov 03, 2015 at 08:24:47AM +0800, Fam Zheng wrote: > >> On Mon, 11/02 14:06, Stefan Hajnoczi wrote: > >> Actually the document is wrong about module support, the default is off: > > > > Thes

[Qemu-devel] [PATCH] SeaBios: Fix reset procedure reentrancy problem on qemu-kvm platform

2015-11-03 Thread Xulei (Stone, Euler)
On qemu-kvm platform, when I reset a VM through "virsh reset", and coincidently the VM is in process of internal rebooting at the same time. Then the VM will not be successfully reseted any more due to the reset reentrancy. I found: (1)SeaBios try to shutdown the VM after reseting it failed by apm_

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

2015-11-03 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 -

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

2015-11-03 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 Reviewed-by: Kevin Wolf --- qemu-io-cmds.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/qemu-io-cmds.c b/qemu-io-cmds.

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

2015-11-03 Thread John Snow
Reported-by: Max Reitz Signed-off-by: John Snow Reviewed-by: Eric Blake Reviewed-by: Kevin Wolf --- 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 2c38ae7..29091f7

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

2015-11-03 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. v3: - pulled a lot of loose yarn, now missing my sweater (Updated patch 1 even further, reported-by Kevin) v2: - Sq

[Qemu-devel] [PATCH 3/3] usb-mtp: add support for basic mtp events

2015-11-03 Thread Bandan Das
When the host polls for events, we check our events qlist and send one event at a time. Also, note that the event packet needs to be sent in one go, so I increased the max packet size to 64. Tested with a linux guest. Signed-off-by: Bandan Das --- hw/usb/dev-mtp.c | 44 +

[Qemu-devel] [PATCH 2/3] usb-mtp: Add support for inotify based file monitoring

2015-11-03 Thread Bandan Das
For now, we use inotify watches to track only a small number of events, namely, add, delete and modify. Note that for delete, the kernel already deactivates the watch for us and we just need to take care of modifying our internal state. Suggested-by: Gerd Hoffman Signed-off-by: Bandan Das --- h

[Qemu-devel] [PATCH 1/3] usb-mtp: use a list for keeping track of children

2015-11-03 Thread Bandan Das
To support adding/removal of objects, we will need to update the object cache hierarchy we have built internally. Convert to using a Qlist for easier management. Signed-off-by: Bandan Das --- hw/usb/dev-mtp.c | 67 +--- trace-events | 1 +

[Qemu-devel] [PATCH 0/3] usb-mtp events support

2015-11-03 Thread Bandan Das
This series adds support for mtp events that are piggybacked on top of the Linux provided inotify mechanism. It performs well with some light unit testing in a linux guest. The mtp share is still read only, but now the guest will notice updates to the share as long as the mtp client being used supp

[Qemu-devel] [ANNOUNCE] QEMU 2.4.1 Stable released

2015-11-03 Thread Michael Roth
Hi everyone, I am pleased to announce that the QEMU v2.4.1 stable release is now available at: http://wiki.qemu.org/download/qemu-2.4.1.tar.bz2 v2.4.1 is now tagged in the official qemu.git repository, and the stable-2.4 branch has been updated accordingly: http://git.qemu.org/?p=qemu.git;a

Re: [Qemu-devel] [PATCH v7 11/35] util: introduce qemu_file_getlength()

2015-11-03 Thread Eduardo Habkost
On Mon, Nov 02, 2015 at 05:13:13PM +0800, Xiao Guangrong wrote: [...] > +size_t qemu_file_getlength(const char *file, Error **errp) > +{ > +int64_t size; [...] > +return size; Can you guarantee that SIZE_MAX >= INT64_MAX on all platforms supported by QEMU? -- Eduardo

Re: [Qemu-devel] [PATCH v7 08/35] exec: allow memory to be allocated from any kind of path

2015-11-03 Thread Eduardo Habkost
On Mon, Nov 02, 2015 at 05:13:10PM +0800, Xiao Guangrong wrote: > Currently file_ram_alloc() is designed for hugetlbfs, however, the memory > of nvdimm can come from either raw pmem device eg, /dev/pmem, or the file > locates at DAX enabled filesystem > > So this patch let it work on any kind of p

Re: [Qemu-devel] [PATCH v2 0/3] target-i386: Don't trigger CPUID warnings by default in KVM mode (in most hosts)

2015-11-03 Thread Eduardo Habkost
On Tue, Nov 03, 2015 at 09:22:30PM +0100, Paolo Bonzini wrote: > On 03/11/2015 20:58, Eduardo Habkost wrote: > > The x86 change to make "check" mode be enabled by default made QEMU print > > warnings in the default case if running in an Intel host: > > > > $ qemu-system-x86_64 -machine pc,accel=

Re: [Qemu-devel] [PATCH for-2.5 v3 1/1] hw/misc: Add support for ADC controller in Xilinx Zynq 7000

2015-11-03 Thread Alistair Francis
On Tue, Nov 3, 2015 at 2:23 PM, Peter Crosthwaite wrote: > On Tue, Nov 3, 2015 at 1:24 PM, Alistair Francis > wrote: >> On Mon, Nov 2, 2015 at 8:25 PM, Peter Crosthwaite >> wrote: >>> From: Guenter Roeck >>> >>> Add support for the Xilinx XADC core used in Zynq 7000. >>> >>> References: >>> - Z

Re: [Qemu-devel] [PATCH for-2.5 v3 1/1] hw/misc: Add support for ADC controller in Xilinx Zynq 7000

2015-11-03 Thread Peter Crosthwaite
On Tue, Nov 3, 2015 at 1:24 PM, Alistair Francis wrote: > On Mon, Nov 2, 2015 at 8:25 PM, Peter Crosthwaite > wrote: >> From: Guenter Roeck >> >> Add support for the Xilinx XADC core used in Zynq 7000. >> >> References: >> - Zynq-7000 All Programmable SoC Technical Reference Manual >> - 7 Series

Re: [Qemu-devel] [PATCH 02/13] PPC: Fix lsxw bounds checks

2015-11-03 Thread Mark Cave-Ayland
On 03/11/15 21:03, Thomas Huth wrote: > On 03/11/15 20:21, Mark Cave-Ayland wrote: >> On 03/11/15 15:23, Thomas Huth wrote: >> >>> On 23/10/15 15:56, Mark Cave-Ayland wrote: From: Alexander Graf The lsxw instruction checks whether the desired string actually fits into all defi

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

2015-11-03 Thread John Snow
On 11/03/2015 12:46 PM, John Snow wrote: > > > On 11/03/2015 10:22 AM, Stefan Hajnoczi wrote: >> On Fri, Oct 23, 2015 at 07:56:38PM -0400, John Snow wrote: >>> Welcome to V10! >>> >>> Where'd 8 and 9 go? Private off-list missives from Fam. >>> Now you, I, and everyone on qemu-devel are staring

Re: [Qemu-devel] [PATCH v3 4/5] fw_cfg: add generic non-DMA read method

2015-11-03 Thread Gabriel L. Somlo
On Tue, Nov 03, 2015 at 10:35:36PM +0100, Laszlo Ersek wrote: > On 11/03/15 18:55, Gabriel L. Somlo wrote: > > On Tue, Nov 03, 2015 at 11:53:55AM +0100, Laszlo Ersek wrote: > >> Thank you for splitting out this patch; it makes it easier to review. > >> However, > >> > >> On 11/03/15 01:35, Gabriel

Re: [Qemu-devel] [PATCH v3 4/5] fw_cfg: add generic non-DMA read method

2015-11-03 Thread Gabriel L. Somlo
On Tue, Nov 03, 2015 at 10:35:36PM +0100, Laszlo Ersek wrote: > On 11/03/15 18:55, Gabriel L. Somlo wrote: > > On Tue, Nov 03, 2015 at 11:53:55AM +0100, Laszlo Ersek wrote: > >> Thank you for splitting out this patch; it makes it easier to review. > >> However, > >> > >> On 11/03/15 01:35, Gabriel

[Qemu-devel] [PATCH v4 2/6] fw_cfg: amend callback behavior spec to once per select

2015-11-03 Thread Gabriel L. Somlo
Currently, the fw_cfg internal API specifies that if an item was set up with a read callback, the callback must be run each time a byte is read from the item. This behavior is both wasteful (most items do not have a read callback set), and impractical for bulk transfers (e.g., DMA read). At the ti

[Qemu-devel] [PATCH v4 1/6] fw_cfg: move internal function call docs to header file

2015-11-03 Thread Gabriel L. Somlo
Move documentation for fw_cfg functions internal to qemu from docs/specs/fw_cfg.txt to the fw_cfg.h header file, next to their prototype declarations, formatted as doc-comments. NOTE: Documentation for fw_cfg_add_callback() is completely dropped by this patch, as that function has been eliminated b

[Qemu-devel] [PATCH v4 6/6] fw_cfg: replace ioport data read with generic method

2015-11-03 Thread Gabriel L. Somlo
IOPort read access is limited to one byte at a time by fw_cfg_comb_valid(). As such, fw_cfg_comb_read() may safely ignore its size argument (which will always be 1), and simply call its fw_cfg_read() helper function once, returning 8 bits via the least significant byte of a 64-bit return value. Th

[Qemu-devel] [PATCH v4 0/6] fw_cfg: spec update, misc. cleanup, optimize read

2015-11-03 Thread Gabriel L. Somlo
New since v3: - Patches 1..3 unchanged - Inserted new patch at position #4: avoid calculating an entry pointer for the current item when s->cur_entry is FW_CFG_INVALID - Patch 5 (formerly #4) now has the generic read method correctly shift-left (adding

[Qemu-devel] [PATCH v4 3/6] fw_cfg: remove offset argument from callback prototype

2015-11-03 Thread Gabriel L. Somlo
Read callbacks are now only invoked at item selection, before any data is read. As such, the value of the offset argument passed to the callback will always be 0. Also, the two callback instances currently in use both leave their offset argument unused. This patch removes the offset argument from

[Qemu-devel] [PATCH v4 5/6] fw_cfg: add generic non-DMA read method

2015-11-03 Thread Gabriel L. Somlo
Introduce fw_cfg_data_read(), a generic read method which works on all access widths (1 through 8 bytes, inclusive), and can be used during both IOPort and MMIO read accesses. To maintain legibility, only fw_cfg_data_mem_read() (the MMIO data read method) is replaced by this patch. The new method

[Qemu-devel] [PATCH v4 4/6] fw_cfg: avoid calculating invalid current entry pointer

2015-11-03 Thread Gabriel L. Somlo
When calculating a pointer to the currently selected fw_cfg item, the following is used: FWCfgEntry *e = &s->entries[arch][s->cur_entry & FW_CFG_ENTRY_MASK]; When s->cur_entry is FW_CFG_INVALID, we are calculating the address of a non-existent element in s->entries[arch][...], which is undefine

Re: [Qemu-devel] [PATCH v3 4/5] fw_cfg: add generic non-DMA read method

2015-11-03 Thread Laszlo Ersek
On 11/03/15 18:55, Gabriel L. Somlo wrote: > On Tue, Nov 03, 2015 at 11:53:55AM +0100, Laszlo Ersek wrote: >> Thank you for splitting out this patch; it makes it easier to review. >> However, >> >> On 11/03/15 01:35, Gabriel L. Somlo wrote: >>> Introduce fw_cfg_data_read(), a generic read method wh

Re: [Qemu-devel] [PATCH for-2.5 v3 1/1] hw/misc: Add support for ADC controller in Xilinx Zynq 7000

2015-11-03 Thread Alistair Francis
On Mon, Nov 2, 2015 at 8:25 PM, Peter Crosthwaite wrote: > From: Guenter Roeck > > Add support for the Xilinx XADC core used in Zynq 7000. > > References: > - Zynq-7000 All Programmable SoC Technical Reference Manual > - 7 Series FPGAs and Zynq-7000 All Programmable SoC XADC > Dual 12-Bit 1 MSP

Re: [Qemu-devel] [PATCH 02/13] PPC: Fix lsxw bounds checks

2015-11-03 Thread Thomas Huth
On 03/11/15 20:21, Mark Cave-Ayland wrote: > On 03/11/15 15:23, Thomas Huth wrote: > >> On 23/10/15 15:56, Mark Cave-Ayland wrote: >>> From: Alexander Graf >>> >>> The lsxw instruction checks whether the desired string actually fits >>> into all defined registers. Unfortunately it does the calcul

[Qemu-devel] [PATCH v2] configure: disable FORTIFY_SOURCE under clang

2015-11-03 Thread John Snow
Some versions of clang may have difficulty compiling glibc headers when -D_FORTIFY_SOURCE is used. For example, Clang++ 3.5.0-9.fc22 cannot compile glibc's stdio headers when -D_FORTIFY_SOURCE=2 is used. This manifests currently as build failures with clang and any arm target. According to LLVM de

Re: [Qemu-devel] [PATCH v2 0/3] target-i386: Don't trigger CPUID warnings by default in KVM mode (in most hosts)

2015-11-03 Thread Paolo Bonzini
On 03/11/2015 20:58, Eduardo Habkost wrote: > The x86 change to make "check" mode be enabled by default made QEMU print > warnings in the default case if running in an Intel host: > > $ qemu-system-x86_64 -machine pc,accel=kvm > warning: host doesn't support requested feature: CPUID.8001

[Qemu-devel] [PATCH v2 0/3] target-i386: Don't trigger CPUID warnings by default in KVM mode (in most hosts)

2015-11-03 Thread Eduardo Habkost
The x86 change to make "check" mode be enabled by default made QEMU print warnings in the default case if running in an Intel host: $ qemu-system-x86_64 -machine pc,accel=kvm warning: host doesn't support requested feature: CPUID.8001H:ECX.sse4a [bit 6] There's also a warning when about

[Qemu-devel] [PATCH v2 1/3] target-i386: Set "check=off" by default on pc-*-2.4 and older

2015-11-03 Thread Eduardo Habkost
The default CPU model (qemu64) have some issues today: it enables some features (ABM and SSE4a) that are not present in many host CPUs. That means many hosts (but not all of them) had those features silently disabled in the default configuration in QEMU 2.4 and older. With the new "check=on" defau

[Qemu-devel] [PATCH v2 3/3] target-i386: Remove ABM from qemu64 CPU model

2015-11-03 Thread Eduardo Habkost
ABM is not available on Sandy Bridge and older, and we want to make the default CPU runnable in most hosts, so it won't be enabled by default in KVM mode. We should eventually have all features supported by TCG enabled by default in TCG mode, but as we don't have a good mechanism today to ensure w

[Qemu-devel] [PATCH v2 2/3] target-i386: Remove SSE4a from qemu64 CPU model

2015-11-03 Thread Eduardo Habkost
SSE4a is not available in any Intel CPU, and we want to make the default CPU runnable in most hosts, so it doesn't make sense to enable it by default in KVM mode. We should eventually have all features supported by TCG enabled by default in TCG mode, but as we don't have a good mechanism today to

  1   2   3   4   >