Re: [Qemu-devel] [PULL 07/12] qapi: Simplify error cleanup in test-qmp-*

2015-11-09 Thread Markus Armbruster
Eric Blake writes: > On 11/09/2015 10:46 AM, Markus Armbruster wrote: >> From: Eric Blake >> >> We have several tests that perform multiple sub-actions that are >> expected to fail. Asserting that an error occurred, then clearing >> it up to prepare for the next action, turned into enough >> b

Re: [Qemu-devel] [PATCH v10 12/30] qapi-introspect: Document lack of sorting

2015-11-09 Thread Markus Armbruster
Eric Blake writes: > On 11/06/2015 08:52 AM, Markus Armbruster wrote: >> Eric Blake writes: >> >>> 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 >>> colli

Re: [Qemu-devel] [POC]colo-proxy in qemu

2015-11-09 Thread Jason Wang
On 11/10/2015 01:26 PM, Tkid wrote: > Hi,all > > We are planning to reimplement colo proxy in userspace (Here is in > qemu) to > cache and compare net packets.This module is one of the important > components > of COLO project and now it is still in early stage, so any comments and > feedback are

Re: [Qemu-devel] [PATCH v6 3/4] qmp: add monitor command to add/remove a child

2015-11-09 Thread Wen Congyang
On 11/09/2015 10:42 PM, Alberto Garcia wrote: > Sorry again for the late review, here are my comments: > > On Fri 16 Oct 2015 10:57:45 AM CEST, Wen Congyang wrote: >> +void qmp_x_blockdev_change(ChangeOperation op, const char *parent, >> + bool has_child, const char *chil

[Qemu-devel] [PULL v2 00/12] QAPI patches

2015-11-09 Thread Markus Armbruster
v2: * PATCH 07: fix a comment typo [Eric] * PATCH 12: tweak commit message [Eric] The following changes since commit 9d5c1dc117d1ad881bbc76f6990ee1f9e9f8ef7f: Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into staging (2015-11-09 11:20:51 +) are available in the

Re: [Qemu-devel] [PATCH v2 1/1] target-ppc: Implement rtas_get_sysparm(PROCESSOR_MODULE_INFO)

2015-11-09 Thread Alexey Kardashevskiy
On 11/10/2015 03:46 PM, Sukadev Bhattiprolu wrote: Alexey Kardashevskiy [a...@ozlabs.ru] wrote: | >| When exactly does a socket become a module? The SPAPR spec uses "sockets" here. | > | >I am trying to get the terminology too :-) Is socket a slot where a | >module is attached? | | Sorry, no i

[Qemu-devel] [POC]colo-proxy in qemu

2015-11-09 Thread Tkid
Hi,all We are planning to reimplement colo proxy in userspace (Here is in qemu) to cache and compare net packets.This module is one of the important components of COLO project and now it is still in early stage, so any comments and feedback are warmly welcomed,thanks in advance. ## Background CO

Re: [Qemu-devel] [PATCH v3] virtio-blk: trivial code optimization

2015-11-09 Thread Gonglei
On 2015/11/9 21:57, Stefan Hajnoczi wrote: > On Mon, Nov 09, 2015 at 05:03:30PM +0800, arei.gong...@huawei.com wrote: >> From: Gonglei >> >> 1. avoid possible superflous checking >> 2. make code more robustness >> >> Signed-off-by: Gonglei >> Reviewed-by: Fam Zheng >> --- >> v3: change the third

Re: [Qemu-devel] [PATCH v5 0/8] e1000: Various fixes and registers' implementation

2015-11-09 Thread Jason Wang
On 11/09/2015 10:59 PM, Leonid Bloch wrote: > This series fixes issues with packet/octet counting in e1000's Statistic > registers, fixes a bug in the packet address filtering procedure, and > implements many MAC registers that were absent before, some Statistic > counters among them. > > Besides

Re: [Qemu-devel] [PATCH] mirror: Improve zero-write and discard with fragmented image

2015-11-09 Thread Fam Zheng
On Mon, 11/09 17:29, Kevin Wolf wrote: > Am 09.11.2015 um 17:18 hat Paolo Bonzini geschrieben: > > > > > > On 09/11/2015 17:04, Kevin Wolf wrote: > > > Am 06.11.2015 um 11:22 hat Fam Zheng geschrieben: > > >> The "pnum < nb_sectors" condition in deciding whether to actually copy > > >> data is un

Re: [Qemu-devel] [v2 0/2] add avx2 instruction optimization

2015-11-09 Thread Li, Liang Z
> Rather than trying to cater to multiple assembly instruction implementations > ourselves, have you tried taking the ideas in this earlier thread? > https://lists.gnu.org/archive/html/qemu-devel/2015-10/msg05298.html > > Ideally, libc's memcmp() will already be using the most efficient assembly >

Re: [Qemu-devel] [PATCH v5 3/8] e1000: Introduced an array to control the access to the MAC registers

2015-11-09 Thread Jason Wang
On 11/09/2015 10:59 PM, Leonid Bloch wrote: > The array of uint8_t's which is introduced here, contains useful metadata > about the MAC registers: if a register should be always accessible, or if > it is accessible, but partly implemented, or if the register requires a > certain compatibility fla

Re: [Qemu-devel] [PATCH v10 25/30] qapi: Hoist tag collision check to Variants.check()

2015-11-09 Thread Eric Blake
On 11/09/2015 06:07 AM, Markus Armbruster wrote: > Eric Blake writes: > >> Checking that a given QAPISchemaObjectTypeVariant.name is a >> member of the corresponding QAPISchemaEnumType of the owning >> QAPISchemaObjectTypeVariants.tag_member ensures that there are >> no collisions in the generate

Re: [Qemu-devel] [PATCH v10 24/30] qapi: Factor out QAPISchemaObjectType.check_clash()

2015-11-09 Thread Eric Blake
On 11/09/2015 07:49 AM, Markus Armbruster wrote: > Eric Blake writes: > >> 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 >> >> @@ -980,11 +980,7 @@ class QAPI

Re: [Qemu-devel] [PATCH] ppc: Add/Re-introduce MMU model definitions needed by PR KVM

2015-11-09 Thread Bharata B Rao
On Tue, Nov 10, 2015 at 12:13:50PM +1100, Alexey Kardashevskiy wrote: > On 11/07/2015 08:12 AM, Benjamin Herrenschmidt wrote: > >On Fri, 2015-11-06 at 13:12 +0530, Bharata B Rao wrote: > >>Commit aa4bb5875231 (ppc: Add mmu_model defines for arch 2.03 and > >>2.07) > >>removed the mmu_model definiti

[Qemu-devel] [PATCH v1 2/2] spapr: Handle failure of KVM_PPC_ALLOCATE_HTAB ioctl

2015-11-09 Thread Bharata B Rao
KVM_PPC_ALLOCATE_HTAB ioctl can return -ENOMEM for KVM guests and QEMU never handled this correctly. But this didn't cause any problems till now as KVM_PPC_ALLOCATE_HTAB ioctl returned with smaller than requested HTAB when enough contiguous memory wasn't available in the host. After the proposed ke

[Qemu-devel] [PATCH v1 0/2] Handle KVM_PPC_ALLOCATE_HTAB ioctl failure

2015-11-09 Thread Bharata B Rao
KVM_PPC_ALLOCATE_HTAB ioctl can now return errors and handle that correctly in QEMU. Also fix !CONFIG_KVM implementation of kvmppc_reset_htab() to return 0 instead of -1. Changes in v1 - Add a patch to fix !CONFIG_KVM implementation of kvmppc_reset_htab() so that make check passes fo

[Qemu-devel] [PATCH v1 1/2] ppc: Let kvmppc_reset_htab() return 0 for !CONFIG_KVM

2015-11-09 Thread Bharata B Rao
The !CONFIG_KVM implementation of kvmppc_reset_htab() returns -1 by default. Change this to return 0 so that we fall back to user space HTAB allocation for emulated guests. This fixes the make check failures for ppc64 emulated target. Signed-off-by: Bharata B Rao --- target-ppc/kvm_ppc.h | 2 +-

Re: [Qemu-devel] [PATCH v10 24/30] qapi: Factor out QAPISchemaObjectType.check_clash()

2015-11-09 Thread Eric Blake
On 11/09/2015 12:11 PM, Markus Armbruster wrote: > Eric Blake writes: > >> On 11/09/2015 06:00 AM, Markus Armbruster wrote: >>> Eric Blake writes: >>> Consolidate two common sequences of clash detection into a new QAPISchemaObjectType.check_clash() helper method. No change to

Re: [Qemu-devel] [PATCH v10 23/30] qapi: Check for qapi collisions of flat union branches

2015-11-09 Thread Eric Blake
On 11/09/2015 08:13 AM, Markus Armbruster wrote: > Markus Armbruster writes: > >> Eric Blake writes: >> >>> 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 >>

Re: [Qemu-devel] [PATCH v10 23/30] qapi: Check for qapi collisions of flat union branches

2015-11-09 Thread Eric Blake
On 11/09/2015 05:56 AM, Markus Armbruster wrote: > Eric Blake writes: > >> 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 fla

Re: [Qemu-devel] [PATCH v10 22/30] qapi: Simplify QAPISchemaObjectTypeVariants.check()

2015-11-09 Thread Eric Blake
On 11/09/2015 05:38 AM, Markus Armbruster wrote: > Eric Blake writes: > >> From: Markus Armbruster >> >> Reduce the ugly flat union / simple union conditional by doing just >> the essential work here, namely setting self.tag_member. >> Move the rest to callers. >> >> @@ -1052,8 +1053,6 @@ class

Re: [Qemu-devel] [PATCH v2 1/1] target-ppc: Implement rtas_get_sysparm(PROCESSOR_MODULE_INFO)

2015-11-09 Thread Sukadev Bhattiprolu
Alexey Kardashevskiy [a...@ozlabs.ru] wrote: | >| When exactly does a socket become a module? The SPAPR spec uses "sockets" here. | > | >I am trying to get the terminology too :-) Is socket a slot where a | >module is attached? | | Sorry, no idea. Ok. | | | > | >I will change the variable n

Re: [Qemu-devel] [PATCH v2 1/1] target-ppc: Implement rtas_get_sysparm(PROCESSOR_MODULE_INFO)

2015-11-09 Thread Alexey Kardashevskiy
On 11/10/2015 02:57 PM, Sukadev Bhattiprolu wrote: Alexey Kardashevskiy [a...@ozlabs.ru] wrote: | On 11/05/2015 10:06 AM, Sukadev Bhattiprolu wrote: | >Implement RTAS_SYSPARM_PROCESSOR_MODULE_INFO parameter to rtas_get_sysparm() | >call in qemu. This call returns the processor module (socket), ch

Re: [Qemu-devel] [PATCH v2 1/1] target-ppc: Implement rtas_get_sysparm(PROCESSOR_MODULE_INFO)

2015-11-09 Thread Sukadev Bhattiprolu
David Gibson [da...@gibson.dropbear.id.au] wrote: | On Wed, Nov 04, 2015 at 03:06:05PM -0800, Sukadev Bhattiprolu wrote: | > Implement RTAS_SYSPARM_PROCESSOR_MODULE_INFO parameter to rtas_get_sysparm() | > call in qemu. This call returns the processor module (socket), chip and core | > information

Re: [Qemu-devel] [PATCH v2 1/1] target-ppc: Implement rtas_get_sysparm(PROCESSOR_MODULE_INFO)

2015-11-09 Thread Sukadev Bhattiprolu
Alexey Kardashevskiy [a...@ozlabs.ru] wrote: | On 11/05/2015 10:06 AM, Sukadev Bhattiprolu wrote: | >Implement RTAS_SYSPARM_PROCESSOR_MODULE_INFO parameter to rtas_get_sysparm() | >call in qemu. This call returns the processor module (socket), chip and core | >information as specified in section 7.

Re: [Qemu-devel] [PATCH 1/8] qapi: Drop QERR_UNKNOWN_BLOCK_FORMAT_FEATURE

2015-11-09 Thread Eric Blake
On 11/09/2015 08:44 PM, Max Reitz wrote: > Just specifying a custom string is simpler in basically all places that > used it, and in addition, specifying the BB or node name is something we > generally do not do in other error messages when opening a BDS, so we > should not do it here. > > This ch

Re: [Qemu-devel] [PATCH v2 0/8] blockdev: Further BlockBackend work

2015-11-09 Thread Jeff Cody
On Tue, Nov 10, 2015 at 04:49:12AM +0100, Max Reitz wrote: > On 10.11.2015 04:45, Eric Blake wrote: > > [side question] > > > > On 11/09/2015 08:27 PM, Max Reitz wrote: > >> Overall, this series adds more uses for BlockBackends and makes the code > >> follow the "reference theory" more closely, in

Re: [Qemu-devel] [PATCH v2 0/8] blockdev: Further BlockBackend work

2015-11-09 Thread Max Reitz
On 10.11.2015 04:45, Eric Blake wrote: > [side question] > > On 11/09/2015 08:27 PM, Max Reitz wrote: >> Overall, this series adds more uses for BlockBackends and makes the code >> follow the "reference theory" more closely, in that any BlockBackend >> created (through -drive or blockdev-add) has

[Qemu-devel] [PATCH 6/8] block: Drop bdrv_new_root()

2015-11-09 Thread Max Reitz
It is unused now, so we may just as well drop it. Signed-off-by: Max Reitz --- block.c | 5 - include/block/block.h | 1 - 2 files changed, 6 deletions(-) diff --git a/block.c b/block.c index 395b7b0..0531992 100644 --- a/block.c +++ b/block.c @@ -243,11 +243,6 @@ void bdrv_re

Re: [Qemu-devel] [PATCH v2 0/8] blockdev: Further BlockBackend work

2015-11-09 Thread Eric Blake
[side question] On 11/09/2015 08:27 PM, Max Reitz wrote: > Overall, this series adds more uses for BlockBackends and makes the code > follow the "reference theory" more closely, in that any BlockBackend > created (through -drive or blockdev-add) has a reference count of 1, and > that reference sho

[Qemu-devel] [PATCH 5/8] block: Drop blk_new_with_bs()

2015-11-09 Thread Max Reitz
Its only caller is blk_new_open(), so we can just inline it there. Since bdrv_new_root() is only a wrapper around bdrv_new(), we can just use bdrv_new() instead. Signed-off-by: Max Reitz --- block/block-backend.c | 29 +++-- 1 file changed, 7 insertions(+), 22 deletions(-

[Qemu-devel] [PATCH 7/8] block: Make bdrv_open() return a BDS

2015-11-09 Thread Max Reitz
There are no callers to bdrv_open() or bdrv_open_inherit() left that pass a pointer to a non-NULL BDS pointer as the first argument of these functions, so we can finally drop that parameter and just make them return the new BDS. Generally, the following pattern is applied: bs = NULL; ret

[Qemu-devel] [PATCH 3/8] block: Let bdrv_open_inherit() return the snapshot

2015-11-09 Thread Max Reitz
If bdrv_open_inherit() creates a snapshot BDS and *pbs is NULL, that snapshot BDS should be returned instead of the BDS under it. To this end, bdrv_append_temp_snapshot() now returns the snapshot BDS instead of just appending it on top of the snapshotted BDS, and that function is made static since

[Qemu-devel] [PATCH 1/8] qapi: Drop QERR_UNKNOWN_BLOCK_FORMAT_FEATURE

2015-11-09 Thread Max Reitz
Just specifying a custom string is simpler in basically all places that used it, and in addition, specifying the BB or node name is something we generally do not do in other error messages when opening a BDS, so we should not do it here. This changes the output for iotest 036 (to the better, in my

[Qemu-devel] [PATCH 8/8] block: Assert !bs->refcnt in bdrv_close()

2015-11-09 Thread Max Reitz
The only caller of bdrv_close() left is bdrv_delete(). We may as well assert that, in a way (there are some things in bdrv_close() that make more sense under that assumption, such as the call to bdrv_release_all_dirty_bitmaps() which in turn assumes that no frozen bitmaps are attached to the BDS).

[Qemu-devel] [PATCH 0/8] blockdev: (Nearly) free clean-up work

2015-11-09 Thread Max Reitz
After a lot has been restructed in the block layer in the past, we can now reap at least one of the fruits: Make bdrv_open() return a BDS! I tried to squeeze patch 8 of this series into my bdrv_close_all() series but noticed that won't work because bdrv_open_inherit() still has one instance of bdr

[Qemu-devel] [PATCH 4/8] block: Drop BB name from bad option error

2015-11-09 Thread Max Reitz
The information which BB is concerned does not seem useful enough to justify its existence in most other place (which may be related to qemu printing the -drive parameter in question anyway, and for blockdev-add the attribution is naturally unambiguous). Furthermore, as of a future patch, bdrv_get_

[Qemu-devel] [PATCH 2/8] block: Drop useless bdrv_new() calls

2015-11-09 Thread Max Reitz
bdrv_append_temp_snapshot() uses bdrv_new() to create an empty BDS before invoking bdrv_open() on that BDS. This is probably a relict from when it used to do some modifications on that empty BDS, but now that is unnecessary, so we can just set bs_snapshot to NULL and let bdrv_open() do the rest. T

Re: [Qemu-devel] [v2 0/2] add avx2 instruction optimization

2015-11-09 Thread Eric Blake
On 11/09/2015 07:51 PM, Liang Li wrote: > buffer_find_nonzero_offset() is a hot function during live migration. > Now it use SSE2 intructions for optimization. For platform supports > AVX2 instructions, use the AVX2 instructions for optimization can help > to improve the performance about 30% compa

[Qemu-devel] [v2 RESEND 1/2] cutils: add avx2 instruction optimization

2015-11-09 Thread Liang Li
buffer_find_nonzero_offset() is a hot function during live migration. Now it use SSE2 intructions for optimization. For platform supports AVX2 instructions, use the AVX2 instructions for optimization can help to improve the performance about 30% comparing to SSE2. Zero page check can be faster with

[Qemu-devel] [v2 RESEND 2/2] configure: add options to config avx2

2015-11-09 Thread Liang Li
Add the '--enable-avx2' & '--disable-avx2' option so as to config the AVX2 instruction optimization. By default, avx2 optimization is enabled, if '--disable-avx2' is not set, configure will detect if the compiler can support AVX2 option, if yes, AVX2 optimization is eabled, else disabled. Signed-

[Qemu-devel] [v2 RESEND 0/2] add avx2 instruction optimization

2015-11-09 Thread Liang Li
buffer_find_nonzero_offset() is a hot function during live migration. Now it use SSE2 intructions for optimization. For platform supports AVX2 instructions, use the AVX2 instructions for optimization can help to improve the performance about 30% comparing to SSE2. Zero page check can be faster with

[Qemu-devel] [PATCH v2 6/8] blockdev: Remove blk_hide_on_behalf_of_hmp_drive_del()

2015-11-09 Thread Max Reitz
This function first removed the BlockBackend from the blk_backends list and cleared its name so it would no longer be found by blk_name(); since blk_next() now iterates through monitor_block_backends (which the BB is removed from in hmp_drive_del()), this is no longer necessary. Second, bdrv_make_

[Qemu-devel] [PATCH v2 8/8] block: Remove bdrv_states

2015-11-09 Thread Max Reitz
Every entry in this list should be a root BDS and as such either be anchored to a BlockBackend or be owned by the monitor. Signed-off-by: Max Reitz --- block.c | 30 +- blockdev.c| 8 include/block/block.h | 1 - includ

[Qemu-devel] [PATCH v2 4/8] block: Use BlockBackend more

2015-11-09 Thread Max Reitz
Replace bdrv_drain_all(), bdrv_commmit_all(), bdrv_flush_all(), bdrv_invalidate_cache_all(), bdrv_next() and occurrences of bdrv_states by their BlockBackend equivalents. Signed-off-by: Max Reitz --- block.c | 10 block/block-backend.c | 8 +++ block/qapi.c |

[Qemu-devel] [PATCH v2 7/8] block: Move some bdrv_*_all() functions to BB

2015-11-09 Thread Max Reitz
Move bdrv_drain_all(), bdrv_commit_all(), bdrv_flush_all() and bdrv_invalidate_cache_all() to BB. The only operation left is bdrv_close_all(), which cannot be moved to the BB because it should not only close all BBs, but also all monitor-owned BDSs. Signed-off-by: Max Reitz --- block.c

[Qemu-devel] [PATCH v2 0/8] blockdev: Further BlockBackend work

2015-11-09 Thread Max Reitz
Overall, this series adds more uses for BlockBackends and makes the code follow the "reference theory" more closely, in that any BlockBackend created (through -drive or blockdev-add) has a reference count of 1, and that reference should be held by the monitor. This is reflected here by introducing

[Qemu-devel] [PATCH v2 5/8] blockdev: Add list of monitor-owned BlockBackends

2015-11-09 Thread Max Reitz
The monitor does hold references to some BlockBackends so it should have a list of those BBs; blk_backends is a different list, as it contains references to all BBs (after a follow-up patch, that is), and that should not be changed because we do need such a list. monitor_remove_blk() is idempotent

[Qemu-devel] [PATCH v2 2/8] block: Add blk_next_inserted()

2015-11-09 Thread Max Reitz
This function skips to the next BlockBackend for which blk_is_inserted() is true. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block/block-backend.c | 15 +++ include/sysemu/block-backend.h | 1 + 2 files changed, 16 insertions(+) diff --git a/block/block-backend.

[Qemu-devel] [PATCH v2 1/8] block: Add blk_name_taken()

2015-11-09 Thread Max Reitz
There may be BlockBackends which are not returned by blk_by_name(), but do exist and have a name. blk_name_taken() allows testing whether a specific name is in use already, independent of whether the BlockBackend with that name is accessible through blk_by_name(). Signed-off-by: Max Reitz Reviewe

[Qemu-devel] [PATCH v2 3/8] block: Add blk_commit_all() and blk_invalidate_cache_all()

2015-11-09 Thread Max Reitz
These functions will be changed to iterate through the BDS trees as defined by the BlockBackends instead of the list of root BDS, therefore prepare moving their code to the BlockBackend level. Signed-off-by: Max Reitz Reviewed-by: Eric Blake --- block/block-backend.c | 10 ++ i

[Qemu-devel] [v2 1/2] cutils: add avx2 instruction optimization

2015-11-09 Thread Liang Li
buffer_find_nonzero_offset() is a hot function during live migration. Now it use SSE2 intructions for optimization. For platform supports AVX2 instructions, use the AVX2 instructions for optimization can help to improve the performance about 30% comparing to SSE2. Zero page check can be faster with

[Qemu-devel] [v2 2/2] configure: add options to config avx2

2015-11-09 Thread Liang Li
Add the '--enable-avx2' & '--disable-avx2' option so as to config the AVX2 instruction optimization. By default, avx2 optimization is enabled, if '--disable-avx2' is not set, configure will detect if the compiler can support AVX2 option, if yes, AVX2 optimization is eabled, else disabled. Signed-

[Qemu-devel] [v2 0/2] add avx2 instruction optimization

2015-11-09 Thread Liang Li
buffer_find_nonzero_offset() is a hot function during live migration. Now it use SSE2 intructions for optimization. For platform supports AVX2 instructions, use the AVX2 instructions for optimization can help to improve the performance about 30% comparing to SSE2. Zero page check can be faster with

Re: [Qemu-devel] [PATCH V3 6/6] virtio-pci: unbreak queue_enable read

2015-11-09 Thread Jason Wang
On 11/09/2015 09:14 PM, Cornelia Huck wrote: > On Fri, 6 Nov 2015 16:02:49 +0800 > Jason Wang wrote: > >> Guest always get zero when reading queue_enable. This violates >> spec. Fixing this by setting the queue_enable to true during any guest >> writing and setting it to zero during reset. >> >

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

2015-11-09 Thread Fam Zheng
On Mon, 11/09 08:09, Peter Lieven wrote: > recent libnfs versions support logging debug messages. Add > support for it in qemu through an URL parameter. > > Example: > qemu -cdrom nfs://127.0.0.1/iso/my.iso?debug=2 > > Signed-off-by: Peter Lieven > --- > v4->v5: add a comment in the code why we

Re: [Qemu-devel] [PATCH V3 1/6] virtio-pci: fix 1.0 virtqueue migration

2015-11-09 Thread Jason Wang
On 11/09/2015 08:56 PM, Cornelia Huck wrote: > On Fri, 6 Nov 2015 16:02:44 +0800 > Jason Wang wrote: > >> We don't migrate the followings fields for virtio-pci: >> >> uint32_t dfselect; >> uint32_t gfselect; >> uint32_t guest_features[2]; >> struct { >> uint16_t num; >> bool enabled; >>

Re: [Qemu-devel] [PATCH v6 3/4] qmp: add monitor command to add/remove a child

2015-11-09 Thread Wen Congyang
On 11/10/2015 12:04 AM, Kevin Wolf wrote: > Am 16.10.2015 um 10:57 hat Wen Congyang geschrieben: >> +## >> +# @ChangeOperation: >> +# >> +# An enumeration of block device change operation. >> +# >> +# @add: Add a new block driver state to a existed block driver state. >> +# >> +# @delete: Delete a

Re: [Qemu-devel] [PATCH v7 20/24] blockdev: Keep track of monitor-owned BDS

2015-11-09 Thread Max Reitz
On 09.11.2015 23:39, Max Reitz wrote: > Signed-off-by: Max Reitz > Reviewed-by: Kevin Wolf > --- > blockdev.c | 25 + > include/block/block_int.h | 4 > stubs/Makefile.objs| 1 + > stubs/blockdev-close-al

Re: [Qemu-devel] [PATCH] ppc: Add/Re-introduce MMU model definitions needed by PR KVM

2015-11-09 Thread Alexey Kardashevskiy
On 11/07/2015 08:12 AM, Benjamin Herrenschmidt wrote: On Fri, 2015-11-06 at 13:12 +0530, Bharata B Rao wrote: Commit aa4bb5875231 (ppc: Add mmu_model defines for arch 2.03 and 2.07) removed the mmu_model definition POWERPC_MMU_2_06a which is needed by PR KVM. Reintroduce it and also add POWERPC_

Re: [Qemu-devel] [PATCH v3 2/3] target-i386: calculate vcpu's TSC rate to be migrated

2015-11-09 Thread Haozhong Zhang
On 11/09/15 14:01, Eduardo Habkost wrote: > On Mon, Nov 09, 2015 at 08:33:55AM +0800, haozhong.zh...@intel.com wrote: > > On 11/06/15 13:12, Eduardo Habkost wrote: > > > On Fri, Nov 06, 2015 at 10:32:24AM +0800, haozhong.zh...@intel.com wrote: > > > > On 11/05/15 14:05, Eduardo Habkost wrote: > > >

[Qemu-devel] [PATCH] kvm-all: PAGE_SIZE should be real host page size

2015-11-09 Thread Andrew Jones
Just noticed this while grepping TARGET_PAGE_SIZE for an unrelated reason. I didn't use qemu_real_host_page_size as kvm_set_phys_mem() does, because we'd need to make sure page_size_init() has run first. Signed-off-by: Andrew Jones --- kvm-all.c | 6 -- 1 file changed, 4 insertions(+), 2 del

Re: [Qemu-devel] [PATCH v12 3/3] block/gluster: add support for multiple gluster servers

2015-11-09 Thread Jeff Cody
Hi, For future revisions, could you send all patches in the series (even if unchanged)? It makes it much easier to know which patches are the latest. Also, if you can rebase each release on the qemu master branch, that would be preferred (or on a submaintainers tree, just mention that in the cov

[Qemu-devel] [PATCH 9/9] libqos/ahci: organize header

2015-11-09 Thread John Snow
Organize the prototypes into nice little sections. Signed-off-by: John Snow --- tests/libqos/ahci.h | 36 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/tests/libqos/ahci.h b/tests/libqos/ahci.h index 2c2d2fc..69dc4d7 100644 --- a/tests/libqo

[Qemu-devel] [PATCH 5/9] libqos: allow zero-size allocations

2015-11-09 Thread John Snow
As part of streamlining the AHCI tests interface, it'd be nice if specying a size of zero could be handled without special branches and the allocator could handle this special case gracefully. This lets me use the "ahci_io" macros for non-data commands, too, which moves me forward towards shepherd

[Qemu-devel] [PATCH 8/9] qtest/ahci: ATAPI data tests

2015-11-09 Thread John Snow
Simple I/O tests for DMA and PIO pathways in the AHCI HBA. I believe at this point in time all of the common, major IO pathways in BMDMA and AHCI are covered by qtests now. Signed-off-by: John Snow --- tests/ahci-test.c | 97 +++ 1 file change

Re: [Qemu-devel] [PATCH V3 1/6] ide/atapi: make PIO read requests async

2015-11-09 Thread John Snow
On 11/06/2015 03:42 AM, Peter Lieven wrote: > PIO read requests on the ATAPI interface used to be sync blk requests. > This has two significant drawbacks. First the main loop hangs util an > I/O request is completed and secondly if the I/O request does not > complete (e.g. due to an unresponsive

[Qemu-devel] [PATCH 6/9] libqos/ahci: allow nondata commands for ahci_io variants

2015-11-09 Thread John Snow
These variants try to set a data offset, even if you don't specify one. In the cases where the offset is zero and it's a nondata command, just ignore the instruction. Signed-off-by: John Snow --- tests/ahci-test.c | 14 ++ tests/libqos/ahci.c | 3 +++ 2 files changed, 5 insertions

[Qemu-devel] [PATCH 7/9] libqos/ahci: add ahci_exec

2015-11-09 Thread John Snow
add ahci_exec, which is a standard purpose flexible command dispatcher and tester for the AHCI device. The intent is to eventually cut down on the absurd amount of boilerplate inside of the AHCI qtest. Signed-off-by: John Snow --- tests/libqos/ahci.c | 76

[Qemu-devel] [PATCH 2/9] libqos/ahci: ATAPI support

2015-11-09 Thread John Snow
Add pathways to tolerate ATAPI commands. Notably, unlike ATA, each SCSI command's layout is a little different, so support will have to be patched in for each command as we want to test them in e.g. ahci_command_set_sizes and ahci_command_set_offset. For now, I'm adding support for 0x28, READ (10

[Qemu-devel] [PATCH 0/9] ahci: atapi qtests

2015-11-09 Thread John Snow
Add ATAPI support into libqos/ahci, and write a few tests for it. I intend this for 2.5, as it's just a test and might help unearth some bugs during release candidate testing. This is the last "batch" of planned qtests for s/ata -- basic i/o testing of HDDs and CDROMs on both PCI and AHCI should b

[Qemu-devel] [PATCH 1/9] ahci-test: fix memory leak

2015-11-09 Thread John Snow
Use the proper free command to detroy an AHCICommand. Signed-off-by: John Snow --- tests/ahci-test.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ahci-test.c b/tests/ahci-test.c index 59d387c..8370fa3 100644 --- a/tests/ahci-test.c +++ b/tests/ahci-test.c @@ -103

[Qemu-devel] [PATCH 3/9] libqos/ahci: ATAPI identify

2015-11-09 Thread John Snow
We need to say "hello!" to our ATAPI friends in a slightly different manner. Signed-off-by: John Snow --- tests/ahci-test.c | 8 +++- tests/libqos/ahci.c | 5 + tests/libqos/ahci.h | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/tests/ahci-test.c b/tests/ahci-test

[Qemu-devel] [PATCH 4/9] libqos/ahci: Switch to mutable properties

2015-11-09 Thread John Snow
ATAPI commands are, unfortunately, weird in that they can be either DMA or PIO depending on a header bit. In order to accommodate them, I'll need to make AHCI command properties mutable so we can toggle between which "flavor" of ATAPI command we want to test. The default ATAPI transfer mechanism i

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

2015-11-09 Thread Bandan Das
Bandan Das writes: > Gerd Hoffmann writes: > >> On Di, 2015-11-03 at 19:00 -0500, Bandan Das wrote: >>> +/* Add a new watch asap so as to not lose events >>> */ >> >> This comment sounds like there is a race ("asap"). There isn't one, >> correct ordering (adding the watch be

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

2015-11-09 Thread Bandan Das
Gerd Hoffmann writes: > On Di, 2015-11-03 at 19:00 -0500, Bandan Das wrote: >> +case IN_DELETE: >> +/* >> + * The kernel issues a IN_IGNORED event >> + * when a dir containing a watchpoint is >> + * deleted >> +

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

2015-11-09 Thread Bandan Das
Gerd Hoffmann writes: > On Di, 2015-11-03 at 19:00 -0500, Bandan Das wrote: >> +/* Add a new watch asap so as to not lose events >> */ > > This comment sounds like there is a race ("asap"). There isn't one, > correct ordering (adding the watch before reading the directory) is

[Qemu-devel] [PATCH v7 22/24] block: Rewrite bdrv_close_all()

2015-11-09 Thread Max Reitz
This patch rewrites bdrv_close_all(): Until now, all root BDSs have been force-closed. This is bad because it can lead to cached data not being flushed to disk. Instead, try to make all reference holders relinquish their reference voluntarily: 1. All BlockBackend users are handled by making all B

[Qemu-devel] [PATCH v7 19/24] block: Add list of all BlockDriverStates

2015-11-09 Thread Max Reitz
We need this list so that bdrv_close_all() can keep track of which BDSs are still open after having removed the BDSs from all of the BBs and having released all monitor BDS references. Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf --- block.c | 7 +++ include/block/bloc

[Qemu-devel] [PATCH v7 24/24] iotests: Add test for block jobs and BDS ejection

2015-11-09 Thread Max Reitz
Suggested-by: Paolo Bonzini Signed-off-by: Max Reitz --- tests/qemu-iotests/141 | 166 + tests/qemu-iotests/141.out | 47 + tests/qemu-iotests/group | 1 + 3 files changed, 214 insertions(+) create mode 100755 tests/qemu-iotests/1

[Qemu-devel] [PATCH v7 18/24] block: Make bdrv_close() static

2015-11-09 Thread Max Reitz
There are no users of bdrv_close() left, except for one of bdrv_open()'s failure paths, bdrv_close_all() and bdrv_delete(), and that is good. Make bdrv_close() static so nobody makes the mistake of directly using bdrv_close() again. Signed-off-by: Max Reitz Reviewed-by: Eric Blake Reviewed-by: A

[Qemu-devel] [PATCH v7 16/24] block: Use blk_remove_bs() in blk_delete()

2015-11-09 Thread Max Reitz
Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf --- block/block-backend.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/block/block-backend.c b/block/block-backend.c index a00486c..4523387 100644 --- a/block/block-backend.c +++ b/block/block-backend.c @@ -165,10 +16

[Qemu-devel] [PATCH v7 14/24] nbd: Switch from close to eject notifier

2015-11-09 Thread Max Reitz
The NBD code uses the BDS close notifier to determine when a medium is ejected. However, now it should use the BB's BDS removal notifier for that instead of the BDS's close notifier. Signed-off-by: Max Reitz --- blockdev-nbd.c | 37 + nbd.c | 13 +

[Qemu-devel] [PATCH v7 23/24] iotests: Add test for multiple BB on BDS tree

2015-11-09 Thread Max Reitz
This adds a test for having multiple BlockBackends in one BDS tree. In this case, there is one BB for the protocol BDS and one BB for the format BDS in a simple two-BDS tree (with the protocol BDS and BB added first). When bdrv_close_all() is executed, no cached data from any BDS should be lost; t

[Qemu-devel] [PATCH v7 15/24] block: Remove BDS close notifier

2015-11-09 Thread Max Reitz
It is unused now, so we can remove it. Signed-off-by: Max Reitz --- block.c| 7 --- block/block-backend.c | 7 --- include/block/block.h | 1 - include/block/block_int.h | 2 -- include/sysemu/block-backend.h | 1 - 5 files changed, 18 delet

[Qemu-devel] [PATCH v7 11/24] block: Add BB-BDS remove/insert notifiers

2015-11-09 Thread Max Reitz
bdrv_close() no longer signifies ejection of a medium, this is now done by removing the BDS from the BB. Therefore, we want to have a notifier for that in the BB instead of a close notifier in the BDS. The former is added now, the latter is removed later. Symmetrically, another notifier list is ad

[Qemu-devel] [PATCH v7 20/24] blockdev: Keep track of monitor-owned BDS

2015-11-09 Thread Max Reitz
Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf --- blockdev.c | 25 + include/block/block_int.h | 4 stubs/Makefile.objs| 1 + stubs/blockdev-close-all-bdrv-states.c | 5 + 4 files changed, 35 inse

[Qemu-devel] [PATCH v7 09/24] iotests: Make redirecting qemu's stderr optional

2015-11-09 Thread Max Reitz
Redirecting qemu's stderr to stdout makes working with the stderr output difficult due to the other file descriptor magic performed in _launch_qemu ("ambiguous redirect"). Add an option which specifies whether stderr should be redirected to stdout or not (allowing for other modes to be added in th

[Qemu-devel] [PATCH v7 05/24] iotests: Change coding style of _filter_nbd in 083

2015-11-09 Thread Max Reitz
In order to be able to move _filter_nbd to common.filter in the next patch, its coding style needs to be adapted to that of common.filter. That means, we have to convert tabs to four spaces, adjust the alignment of the last line (done with spaces already, assuming one tab equals eight spaces), fix

[Qemu-devel] [PATCH v7 17/24] blockdev: Use blk_remove_bs() in do_drive_del()

2015-11-09 Thread Max Reitz
Signed-off-by: Max Reitz Reviewed-by: Kevin Wolf --- blockdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blockdev.c b/blockdev.c index 3185808..a70a684 100644 --- a/blockdev.c +++ b/blockdev.c @@ -2509,7 +2509,7 @@ void hmp_drive_del(Monitor *mon, const QDict *qdict)

[Qemu-devel] [PATCH v7 21/24] block: Add blk_remove_all_bs()

2015-11-09 Thread Max Reitz
When bdrv_close_all() is called, instead of force-closing all root BlockDriverStates, it is better to just drop the reference from all BlockBackends and let them be closed automatically. This prevents BDS from getting closed that are still referenced by other BDS, which may result in loss of cached

[Qemu-devel] [PATCH v7 08/24] iotests: Make _filter_nbd support more URL types

2015-11-09 Thread Max Reitz
This function should support URLs of the "nbd://" format (without swallowing the export name), and for "nbd:///" URLs it should replace "?socket=$TEST_DIR" by "?socket=TEST_DIR" because putting the Unix socket files into the test directory makes sense. Signed-off-by: Max Reitz --- tests/qemu-iot

[Qemu-devel] [PATCH v7 10/24] iotests: Add test for eject under NBD server

2015-11-09 Thread Max Reitz
This patch adds a test for ejecting the BlockBackend an NBD server is connected to (the NBD server is supposed to stop). Signed-off-by: Max Reitz --- tests/qemu-iotests/140 | 92 ++ tests/qemu-iotests/140.out | 16 tests/qemu-iotests/group

[Qemu-devel] [PATCH v7 04/24] iotests: Rename filter_nbd to _filter_nbd in 083

2015-11-09 Thread Max Reitz
In the patch after the next, this function is moved to common.filter. Therefore, its name should be preceded by an underscore to signify its global availability. To keep the code motion patch clean, we cannot rename it in the same patch, so we need to choose some order of renaming vs. motion. It i

[Qemu-devel] [PATCH v7 13/24] virtio-scsi: Catch BDS-BB removal/insertion

2015-11-09 Thread Max Reitz
Make use of the BDS-BB removal and insertion notifiers to remove or set up, respectively, virtio-scsi's op blockers. Signed-off-by: Max Reitz --- hw/scsi/virtio-scsi.c | 59 + include/hw/virtio/virtio-scsi.h | 10 +++ 2 files changed, 69 inse

[Qemu-devel] [PATCH v7 02/24] blockjob: Call bdrv_unref() on creation error

2015-11-09 Thread Max Reitz
If block_job_create() fails, it should release its reference to the job's BDS. Normally, this is done in the callback provided by the caller, but that callback will not be invoked if the block job failed to be created. Signed-off-by: Max Reitz Reviewed-by: Alberto Garcia Reviewed-by: Kevin Wolf

[Qemu-devel] [PATCH v7 07/24] iotests: Make _filter_nbd drop log lines

2015-11-09 Thread Max Reitz
The NBD log lines ("/your/source/dir/nbd.c:function():line: error") should not be converted to empty lines but removed altogether. Signed-off-by: Max Reitz --- tests/qemu-iotests/083.out | 10 -- tests/qemu-iotests/common.filter | 2 +- 2 files changed, 1 insertion(+), 11 deletion

[Qemu-devel] [PATCH v7 06/24] iotests: Move _filter_nbd into common.filter

2015-11-09 Thread Max Reitz
_filter_nbd can be useful for other NBD tests, too, therefore it should reside in common.filter. Signed-off-by: Max Reitz --- tests/qemu-iotests/083 | 12 tests/qemu-iotests/common.filter | 12 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/t

[Qemu-devel] [PATCH v7 12/24] virtio-blk: Functions for op blocker management

2015-11-09 Thread Max Reitz
Put the code for setting up and removing op blockers into an own function, respectively. Then, we can invoke those functions whenever a BDS is removed from an virtio-blk BB or inserted into it. Signed-off-by: Max Reitz --- hw/block/dataplane/virtio-blk.c | 77 +++-

  1   2   3   4   5   >