Re: [Qemu-devel] [PATCH 32/51] ram: Remove dirty_bytes_rate

2017-03-30 Thread Peter Xu
On Thu, Mar 23, 2017 at 09:45:25PM +0100, Juan Quintela wrote: > It can be recalculated from dirty_pages_rate. > > Signed-off-by: Juan Quintela > Reviewed-by: Juan Quintela Another self-review? :) Reviewed-by: Peter Xu -- peterx

Re: [Qemu-devel] [PATCH 33/51] ram: Move dirty_pages_rate to RAMState

2017-03-30 Thread Peter Xu
On Thu, Mar 23, 2017 at 09:45:26PM +0100, Juan Quintela wrote: > Treat it like the rest of ram stats counters. Export its value the > same way. As an added bonus, no more MigrationState used in > migration_bitmap_sync(); > > Signed-off-by: Juan Quintela > Reviewed-by: Juan Quintela (I strongl

Re: [Qemu-devel] [for-2.9 7/8] nbd: Tidy up blockdev-add interface

2017-03-30 Thread Markus Armbruster
Eric Blake writes: > On 03/29/2017 11:45 AM, Markus Armbruster wrote: >> SocketAddress is a simple union, and simple unions are awkward: they >> have their variant members wrapped in a "data" object on the wire, and >> require additional indirections in C. I intend to limit its use to >> existin

Re: [Qemu-devel] [PATCH 34/51] ram: Move postcopy_requests into RAMState

2017-03-30 Thread Peter Xu
On Thu, Mar 23, 2017 at 09:45:27PM +0100, Juan Quintela wrote: > Signed-off-by: Juan Quintela Reviewed-by: Peter Xu -- peterx

Re: [Qemu-devel] [for-2.9 7/8] nbd: Tidy up blockdev-add interface

2017-03-30 Thread Markus Armbruster
Max Reitz writes: > On 29.03.2017 18:45, Markus Armbruster wrote: >> SocketAddress is a simple union, and simple unions are awkward: they >> have their variant members wrapped in a "data" object on the wire, and >> require additional indirections in C. I intend to limit its use to >> existing ex

Re: [Qemu-devel] [for-2.9 8/8] sheepdog: Fix blockdev-add

2017-03-30 Thread Markus Armbruster
Max Reitz writes: > On 29.03.2017 22:32, Eric Blake wrote: >> On 03/29/2017 02:59 PM, Max Reitz wrote: >>> On 29.03.2017 18:45, Markus Armbruster wrote: Commit 831acdc "sheepdog: Implement bdrv_parse_filename()" and commit d282f34 "sheepdog: Support blockdev-add" have different ideas on

[Qemu-devel] [PATCH v2 0/3] Add a tester for HMP commands

2017-03-30 Thread Thomas Huth
We currently do not test HMP commands automatically yet, so if they break, we do not notice this until somebody runs into the problem (like the "info qtree" problem that we recently had on qemu-system-ppc64). So let's add a simple tester that runs some HMP commands to check if they can crash or abo

[Qemu-devel] [PATCH v2 3/3] tests: Add a tester for HMP commands

2017-03-30 Thread Thomas Huth
HMP commands do not get any automatic testing yet, so on certain QEMU machines, some HMP commands were causing crashes in the past. Thus we should test HMP commands in our test suite, too, to avoid that such problems creep in again in the future. Signed-off-by: Thomas Huth --- tests/Makefile.inc

[Qemu-devel] [PATCH v2 1/3] libqtest: Ignore QMP events when parsing the response for HMP commands

2017-03-30 Thread Thomas Huth
When running certain HMP commands (like "device_del") via QMP, we can sometimes get a QMP event in the response first, so that the "g_assert(ret)" statement in qtest_hmp() triggers and the test fails. Fix this by ignoring such QMP events while looking for the real return value from QMP. Signed-off

[Qemu-devel] [PATCH v2 2/3] libqtest: Add a generic function to run a callback function for every machine

2017-03-30 Thread Thomas Huth
Some tests need to run single tests for every available machine of the current QEMU binary. To avoid code duplication, let's extract this code that deals with 'query-machines' into a separate function. Signed-off-by: Thomas Huth --- tests/libqtest.c| 30 + tests/libqtest.h

[Qemu-devel] [PATCH] applesmc: add error mem region handling for MacOS 10.12.4

2017-03-30 Thread Tong Zhang
From: Zhang Tong Add error memory region handling for applesmc, which is required to boot MacOS 10.12.4, because the updated SMC driver checks that error memory region and returns it as error code to Dont_steal_macos.kext, and Dont_steal_macos.kext checks the retu

Re: [Qemu-devel] [PATCH 37/51] ram: Move compression_switch to RAMState

2017-03-30 Thread Peter Xu
On Thu, Mar 23, 2017 at 09:45:30PM +0100, Juan Quintela wrote: > Rename it to preffer_xbzrle that is a more descriptive name. s/preffer/prefer/? > > Signed-off-by: Juan Quintela > --- > migration/ram.c | 9 + > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/mi

[Qemu-devel] [PATCH] applesmc: add error mem region handling for MacOS 10.12.4

2017-03-30 Thread Tong Zhang
This patch fixes a problem in applesmc emulation which prevent recent MacOS(10.12.4) from booing. Zhang Tong (1): applesmc: add error mem region handling for MacOS 10.12.4 hw/misc/applesmc.c | 152 + 1 file changed, 130 insertions(+), 22 del

Re: [Qemu-devel] [PATCH 40/51] ram: Rename qemu_target_page_bits() to qemu_target_page_size()

2017-03-30 Thread Peter Xu
On Thu, Mar 23, 2017 at 09:45:33PM +0100, Juan Quintela wrote: > It was used as a size in all cases except one. Considering that: - qemu_target_page_bits() is only used in migration codes, in only several places below - migration codes is using TARGET_PAGE_{BITS|SIZE} a lot as well How about

Re: [Qemu-devel] Deprecating old machine types

2017-03-30 Thread Gerd Hoffmann
On Mi, 2017-03-29 at 18:58 +0200, Paolo Bonzini wrote: > > On 29/03/2017 18:46, Dr. David Alan Gilbert wrote: > >> By the way, what about old machine types like "pc-0.10" ? Do we want to > >> carry them along forever (e.g. since it is not too complicated to > >> maintain?), or shall we get rid of

Re: [Qemu-devel] [PATCH 39/51] ram: We don't need MigrationState parameter anymore

2017-03-30 Thread Peter Xu
On Thu, Mar 23, 2017 at 09:45:32PM +0100, Juan Quintela wrote: > Remove it from callers and callees. > > Signed-off-by: Juan Quintela Reviewed-by: Peter Xu -- peterx

Re: [Qemu-devel] [PATCH 38/51] migration: Remove MigrationState from migration_in_postcopy

2017-03-30 Thread Peter Xu
On Thu, Mar 23, 2017 at 09:45:31PM +0100, Juan Quintela wrote: > We need to call for the migrate_get_current() in more that half of the > uses, so call that inside. > > Signed-off-by: Juan Quintela Reviewed-by: Peter Xu -- peterx

Re: [Qemu-devel] [PATCH v3 5/8] ppc/pnv: create the ICP and ICS objects under the machine

2017-03-30 Thread Cédric Le Goater
On 03/30/2017 03:55 AM, David Gibson wrote: > On Wed, Mar 29, 2017 at 10:13:59AM +0200, Cédric Le Goater wrote: >> On 03/29/2017 07:18 AM, David Gibson wrote: >>> On Tue, Mar 28, 2017 at 09:32:29AM +0200, Cédric Le Goater wrote: Like this is done for the sPAPR machine, we use a simple array un

Re: [Qemu-devel] [PATCH] virtio-net: consolidate guest announcement with qemu_announce_self

2017-03-30 Thread Dr. David Alan Gilbert
* Vladislav Yasevich (vyase...@redhat.com) wrote: > virtio announcements seem to run on its own timer with it's own > repetition loop and are invoked separately from qemu_announce_self. > This patch consolidates announcements into a single location and > allows other nics to provide it's own announ

[Qemu-devel] [PATCH] 9pfs: fix multiple flush for same request

2017-03-30 Thread Greg Kurz
If a client tries to flush the same outstanding request several times, only the first flush completes. Subsequent ones keep waiting for the request completion in v9fs_flush() and, therefore, leak a PDU. This will cause QEMU to hang when draining active PDUs the next time the device is reset. Let h

[Qemu-devel] [PATCH v4.1 5/9] ppc/pnv: create the ICP object under PnvCore

2017-03-30 Thread Cédric Le Goater
Each thread of a core is linked to an ICP. This allocates a PnvICPState object before the PowerPCCPU object is realized and lets the XICSFabric do the store under the 'intc' backlink when xics_cpu_setup() is called. This modeling removes the need of maintaining an array of ICP objects under the Po

Re: [Qemu-devel] [PATCH 24/51] ram: Move migration_bitmap_mutex into RAMState

2017-03-30 Thread Dr. David Alan Gilbert
* Juan Quintela (quint...@redhat.com) wrote: > Signed-off-by: Juan Quintela I'm still pretty convinced that there's an existing problem with this mutex can get init'd twice with no destroy on a second migration, however you're not changing that (and it's not actually failed as far as I can tell)

Re: [Qemu-devel] [PATCH 40/51] ram: Rename qemu_target_page_bits() to qemu_target_page_size()

2017-03-30 Thread Dr. David Alan Gilbert
* Peter Xu (pet...@redhat.com) wrote: > On Thu, Mar 23, 2017 at 09:45:33PM +0100, Juan Quintela wrote: > > It was used as a size in all cases except one. > > Considering that: > > - qemu_target_page_bits() is only used in migration codes, in only > several places below > > - migration codes is

Re: [Qemu-devel] [RFC v2 0/9] qom: Make object_get_class()/*_GET_CLASS return const pointers

2017-03-30 Thread Paolo Bonzini
On 29/03/2017 21:41, Eduardo Habkost wrote: > QOM has a data model where class struct data is static: class > structs are initialized at class_init, and never changed again. Isn't that just the way class data is being used? There's no reason for class data to be static. It happens to be that w

Re: [Qemu-devel] issues of region cache and iommu reset

2017-03-30 Thread Paolo Bonzini
On 29/03/2017 23:28, Michael S. Tsirkin wrote: >> Something like this? >> >> diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c >> index 03592c5..73e69ac 100644 >> --- a/hw/virtio/virtio.c >> +++ b/hw/virtio/virtio.c >> @@ -176,6 +176,10 @@ err_used: >> address_space_cache_destroy(&new->de

Re: [Qemu-devel] [PATCH 42/51] ram: Pass RAMBlock to bitmap_sync

2017-03-30 Thread Dr. David Alan Gilbert
* Juan Quintela (quint...@redhat.com) wrote: > We change the meaning of start to be the offset from the beggining of > the block. s/beggining/beginning/ Why do this? We have: migration_bitmap_sync (all blocks) migration_bitmap_sync_range - called per block cpu_physical_memory_sync_dirty_

Re: [Qemu-devel] [PATCH 40/51] ram: Rename qemu_target_page_bits() to qemu_target_page_size()

2017-03-30 Thread Juan Quintela
Peter Xu wrote: > On Thu, Mar 23, 2017 at 09:45:33PM +0100, Juan Quintela wrote: >> It was used as a size in all cases except one. > > Considering that: > > - qemu_target_page_bits() is only used in migration codes, in only > several places below > > - migration codes is using TARGET_PAGE_{BITS|

Re: [Qemu-devel] [PATCH v3] hmp: fix "info cpu" segfault

2017-03-30 Thread Stefan Hajnoczi
On Thu, Mar 30, 2017 at 6:09 AM, Iwona Kotlarska wrote: > Running QEMU with "qemu-system-x86_64 -M none -nographic -m 256" and executing > "dump-guest-memory /dev/null 0 8192" results in segfault. > Fix by checking if we have CPU. > > Signed-off-by: Iwona Kotlarska > --- > target/i386/arch_dump.

Re: [Qemu-devel] [PATCH for-2.9] configure: Don't claim 'unsupported host OS' when better message available

2017-03-30 Thread Peter Maydell
On 28 March 2017 at 14:18, Peter Maydell wrote: > The change in commit 898be3e0415c6d which made completely > unrecognized OSes cause an error_exit "Unsupported host OS" > has some unfortunate unintended effects: > * if you run 'configure --help' on an unsupported host OS >(eg if intending to

[Qemu-devel] [PATCH] Revert "vfio/pci-quirks.c: Disable stolen memory for igd VFIO"

2017-03-30 Thread Xiong Zhang
This reverts commit c2b2e158cc7b1cb431bd6039824ec13c3184a775. The original patch intend to prevent linux i915 driver from using stolen meory. But this patch breaks windows IGD driver loading on Gen9+, as IGD HW will use stolen memory on Gen9+, once windows IGD driver see zero size stolen memory, i

Re: [Qemu-devel] [PATCH 43/51] ram: ram_discard_range() don't use the mis parameter

2017-03-30 Thread Peter Xu
On Thu, Mar 23, 2017 at 09:45:36PM +0100, Juan Quintela wrote: > Signed-off-by: Juan Quintela Reviewed-by: Peter Xu -- peterx

Re: [Qemu-devel] [PATCH v3] hmp: fix "info cpu" segfault

2017-03-30 Thread Marcel Apfelbaum
On 03/30/2017 08:09 AM, Iwona Kotlarska wrote: Running QEMU with "qemu-system-x86_64 -M none -nographic -m 256" and executing "dump-guest-memory /dev/null 0 8192" results in segfault. Fix by checking if we have CPU. Signed-off-by: Iwona Kotlarska --- Hi Iwona, Next time (this patch is OK) pl

Re: [Qemu-devel] [PATCH for-2.9] configure: Don't claim 'unsupported host OS' when better message available

2017-03-30 Thread Stefan Weil
Am 30.03.2017 um 12:17 schrieb Peter Maydell: > Oops, I just noticed I had a minor change here which I forgot > to squash in before sending: > > -error_exit "Unsupported host OS $targetos" > +error_exit "Unrecognized host OS $targetos" > > since this is the case of "we don't know what this

Re: [Qemu-devel] host stalls when qemu-system-aarch64 with kvm and pflash

2017-03-30 Thread Marc Zyngier
On 29/03/17 19:56, Christoffer Dall wrote: > On Tue, Mar 28, 2017 at 01:24:15PM -0700, Radha Mohan wrote: >> On Tue, Mar 28, 2017 at 1:16 PM, Christoffer Dall wrote: >>> Hi Radha, >>> >>> On Tue, Mar 28, 2017 at 12:58:24PM -0700, Radha Mohan wrote: Hi, I am seeing an issue with qemu-syst

[Qemu-devel] [PATCH v2 for-2.9 1/2] tcg/sparc: Zero extend data argument to store helpers

2017-03-30 Thread Peter Maydell
The C store helper functions take the data argument as a uint8_t, uint16_t, etc depending on the store size. The SPARC calling convention requires that data types smaller than the register size must be extended by the caller. We weren't doing this, which meant that if QEMU was compiled with optimiz

[Qemu-devel] [PATCH v2 for-2.9 2/2] tcg/sparc: Zero extend address argument to ld/st helpers

2017-03-30 Thread Peter Maydell
The C store helper functions take the address argument as a target_ulong type; if this is 32 bit but the host is 64 bit then the SPARC calling convention requires that the caller must zero extend the value. We weren't doing this, which meant we could pass values to the caller with high bits set and

[Qemu-devel] [PATCH v2 for-2.9 0/2] tcg/sparc: zero extend ld/st helper args

2017-03-30 Thread Peter Maydell
These patches fix problems with the SPARC TCG backend code which calls the load and store helpers. Where the argument being passed to the helper is narrower than the size of the native register, the SPARC calling convention requires that we extend it to the register size, but we weren't doing that.

Re: [Qemu-devel] [PATCH v4 2/9] spapr: move the IRQ server number mapping under the machine

2017-03-30 Thread David Gibson
On Wed, Mar 29, 2017 at 03:53:24PM +0200, Cédric Le Goater wrote: > This is the second step to abstract the IRQ 'server' number of the > XICS layer. Now that the prereq cleanups have been done in the > previous patch, we can move down the 'cpu_dt_id' to 'cpu_index' > mapping in the sPAPR machine ha

Re: [Qemu-devel] [PATCH v4 1/9] ppc/xics: introduce an 'intc' backlink under PowerPCCPU

2017-03-30 Thread David Gibson
On Wed, Mar 29, 2017 at 03:53:23PM +0200, Cédric Le Goater wrote: > Today, the ICPState array of the sPAPR machine is indexed with > 'cpu_index' of the CPUState. This numbering of CPUs is internal to > QEMU and the guest only knows about what is exposed in the device > tree, that is the 'cpu_dt_id'

Re: [Qemu-devel] [PATCH v7 14/17] memory: add MemoryRegionIOMMUOps.replay() callback

2017-03-30 Thread Liu, Yi L
> -Original Message- > From: Liu, Yi L > Sent: Monday, March 27, 2017 5:22 PM > To: Peter Xu > Cc: alex.william...@redhat.com; Lan, Tianyu ; Tian, > Kevin > ; m...@redhat.com; jan.kis...@siemens.com; > jasow...@redhat.com; bd.a...@gmail.com; David Gibson > ; qemu-devel@nongnu.org > Subjec

[Qemu-devel] [PATCH RFC] hw/pvrdma: Proposal of a new pvrdma device

2017-03-30 Thread Marcel Apfelbaum
From: Yuval Shaia Hi, General description === This is a very early RFC of a new RoCE emulated device that enables guests to use the RDMA stack without having a real hardware in the host. The current implementation supports only VM to VM communication on the same host.

Re: [Qemu-devel] [RfC PATCH 0/4] make display updates thread safe.

2017-03-30 Thread Mark Cave-Ayland
On 30/03/17 07:55, Gerd Hoffmann wrote: > Hi, > > First attempt on making display updates thread-save for real. Most > interesting patches at this point are #2 (adds helper functions to > create and use a dirty bitmap copy) and #3 (updates vga code to use > them). > > Patch #1 fixes a bug I'v

Re: [Qemu-devel] [PATCH 42/51] ram: Pass RAMBlock to bitmap_sync

2017-03-30 Thread Juan Quintela
"Dr. David Alan Gilbert" wrote: > * Juan Quintela (quint...@redhat.com) wrote: >> We change the meaning of start to be the offset from the beggining of >> the block. > > s/beggining/beginning/ > > Why do this? > We have: >migration_bitmap_sync (all blocks) >migration_bitmap_sync_range - ca

Re: [Qemu-devel] [PATCH v3 00/11] MTTCG fix-ups for 2.9

2017-03-30 Thread Pavel Dovgalyuk
> From: mttcg-requ...@listserver.greensocs.com > [mailto:mttcg-requ...@listserver.greensocs.com] > Pavel Dovgalyuk writes: > >> From: mttcg-requ...@listserver.greensocs.com [mailto:mttcg- > requ...@listserver.greensocs.com] > >> Pavel Dovgalyuk writes: > >> > >> >> From: Alex Bennée [mailto:alex

Re: [Qemu-devel] [PULL 0/2] i386: Fix for "-cpu host, invtsc=on" bug

2017-03-30 Thread Peter Maydell
On 28 March 2017 at 20:52, Eduardo Habkost wrote: > Last-minute fix for a bug found by Jiri Denemark. Unfortunately > not in time for -rc2, but I would like to get this in -rc3. > > The following changes since commit df9046363220e57d45818312759b954c033c58ab: > > Update version for v2.9.0-rc2 rel

Re: [Qemu-devel] [PATCH 13/16] migration: Create thread infrastructure for multifd recv side

2017-03-30 Thread Juan Quintela
Paolo Bonzini wrote: > On 17/03/2017 20:36, Dr. David Alan Gilbert wrote: >> * Paolo Bonzini (pbonz...@redhat.com) wrote: >>> On 17/03/2017 14:02, Dr. David Alan Gilbert wrote: >> case RAM_SAVE_FLAG_MULTIFD_PAGE: >> fd_num = qemu_get_be16(f); >> -if (f

Re: [Qemu-devel] [PATCH v7 14/17] memory: add MemoryRegionIOMMUOps.replay() callback

2017-03-30 Thread Jason Wang
On 2017年03月30日 19:06, Liu, Yi L wrote: -Original Message- From: Liu, Yi L Sent: Monday, March 27, 2017 5:22 PM To: Peter Xu Cc: alex.william...@redhat.com; Lan, Tianyu ; Tian, Kevin ; m...@redhat.com; jan.kis...@siemens.com; jasow...@redhat.com; bd.a...@gmail.com; David Gibson ; qemu-d

[Qemu-devel] [PATCH v2 0/4] fsdev: qmp interface for io throttling

2017-03-30 Thread Pradeep Jagadeesh
These patches provide the qmp interface, to query the io throttle status of the all fsdev devices that are present in a vm. also, it provides an interface to set the io throttle parameters of a fsdev to a required value. some of the patches also remove the duplicate code that was present in block

[Qemu-devel] [PATCH v2 3/4] qmp: refactor duplicate code

2017-03-30 Thread Pradeep Jagadeesh
This patchset factor out the duplicate qmp throttle interface code that was present in both block and fsdev device files. Signed-off-by: Pradeep Jagadeesh --- blockdev.c | 53 +++-- fsdev/qemu-fsdev-throttle.c | 51 +---

[Qemu-devel] [PATCH v2 1/4] Throttle: Create IOThrottle structure

2017-03-30 Thread Pradeep Jagadeesh
This patchset introduces a new io throttle structure. This will be used in both block and fsdev devices. Signed-off-by: Pradeep Jagadeesh --- qapi/block-core.json | 76 ++ qapi/iothrottle.json | 86

[Qemu-devel] [PATCH v2 2/4] fsdev: QMP interface for throttling

2017-03-30 Thread Pradeep Jagadeesh
This patchset enables qmp interfaces for the fsdev devices. This provides two interfaces one for querying info of all the fsdev devices. The second one to set the IO limits for the required fsdev device. Signed-off-by: Pradeep Jagadeesh --- Makefile| 3 ++ fsdev/qemu-fsdev-

[Qemu-devel] [PATCH v2 4/4] throttle: factor out duplicate code

2017-03-30 Thread Pradeep Jagadeesh
This patchset factor out the duplicate throttle code that was present in block and fsdev devices. Signed-off-by: Pradeep Jagadeesh --- blockdev.c | 44 +- fsdev/qemu-fsdev-throttle.c | 43 + include/

[Qemu-devel] xhci migration breakage

2017-03-30 Thread Dr. David Alan Gilbert
Hi Gerd, 2.9 seems to have an xhci migration breakage, I've bisected it down to: commit ddb603ab6c981c1d67cb42266fc700c33e5b2d8f Author: Gerd Hoffmann Date: Mon Jan 30 16:36:46 2017 +0100 xhci: don't kick in xhci_submit and xhci_fire_ctl_transfer I guess maybe there's a kick needed pre/p

Re: [Qemu-devel] [PATCH v3 1/8] block: add bdrv_measure() API

2017-03-30 Thread Alberto Garcia
On Wed 22 Mar 2017 12:16:01 PM CET, Stefan Hajnoczi wrote: > bdrv_measure() provides a conservative maximum for the size of a new > image. This information is handy if storage needs to be allocated (e.g. > a SAN or an LVM volume) ahead of time. > > Signed-off-by: Stefan Hajnoczi Reviewed-by: Alb

Re: [Qemu-devel] [PATCH v3 2/8] raw-format: add bdrv_measure() support

2017-03-30 Thread Alberto Garcia
On Wed 22 Mar 2017 12:16:02 PM CET, Stefan Hajnoczi wrote: > Maximum size calculation is trivial for the raw format: it's just the > requested image size (because there is no metadata). > > Signed-off-by: Stefan Hajnoczi Reviewed-by: Alberto Garcia Berto

[Qemu-devel] [PATCH] 9pfs: fix migration_block leak

2017-03-30 Thread Li Qiang
The guest can leave the pdu->s->migration_blocker exists by attach but not remove a fid. Then if we hot unplug the 9pfs device, the v9fs_reset() just free the fids, but not free the migration_blocker. This will leak a memory leak. This patch avoid this. Signed-off-by: Li Qiang --- hw/9pfs/9p.c |

Re: [Qemu-devel] [PATCH v3 3/8] qcow2: extract preallocation calculation function

2017-03-30 Thread Alberto Garcia
On Wed 22 Mar 2017 12:16:03 PM CET, Stefan Hajnoczi wrote: > Calculating the preallocated image size will be needed to implement > .bdrv_measure(). Extract the code out into a separate function. > > Signed-off-by: Stefan Hajnoczi Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [PATCH v3 for-2.10 0/4] block: Add errp to b{lk, drv}_truncate()

2017-03-30 Thread Stefan Hajnoczi
On Tue, Mar 28, 2017 at 10:51:25PM +0200, Max Reitz wrote: > Having an Error parameter for these functions makes sense because we > sometimes want a bit more information than just "Something failed". Some > drivers already use error_report() and the like to emit this additional > information, so it

Re: [Qemu-devel] [PATCH v3 00/11] MTTCG fix-ups for 2.9

2017-03-30 Thread Alex Bennée
Pavel Dovgalyuk writes: >> From: mttcg-requ...@listserver.greensocs.com >> [mailto:mttcg-requ...@listserver.greensocs.com] >> Pavel Dovgalyuk writes: >> >> From: mttcg-requ...@listserver.greensocs.com [mailto:mttcg- >> requ...@listserver.greensocs.com] >> >> Pavel Dovgalyuk writes: >> >> > I

[Qemu-devel] [RFC PATCH qemu 5/5] spapr/iommu: Enable in-kernel TCE acceleration via VFIO KVM device

2017-03-30 Thread Alexey Kardashevskiy
This uses new kernel KVM_CAP_SPAPR_TCE_VFIO capability to enable in-kernel acceleration of TCE update requests which will go via the VFIO KVM device. Signed-off-by: Alexey Kardashevskiy --- target/ppc/kvm_ppc.h | 6 ++ hw/ppc/spapr_iommu.c | 4 target/ppc/kvm.c | 7 ++- 3 files

[Qemu-devel] [RFC PATCH qemu 0/5] vfio-pci, spapr: Allow in-kernel acceleration

2017-03-30 Thread Alexey Kardashevskiy
This is my current working tree to support kernel's "powerpc/kvm/vfio: Enable in-kernel acceleration". Changes: v2: * QOM'fy of IOMMUMemoryRegion * fix comments from v1 review Please comment. Thanks. Alexey Kardashevskiy (5): memory/iommu: QOM'fy IOMMU MemoryRegion spapr-iommu: Subclass T

[Qemu-devel] [RFC PATCH qemu 4/5] vfio/spapr: Add a notifier for PPC64 HV/PR KVM about new group attached to LIOBN

2017-03-30 Thread Alexey Kardashevskiy
This implements a notification for a new IOMMU group attached to sPAPR's logical IO bus (LIOBN) to enable in-kernel TCE acceleration. Signed-off-by: Alexey Kardashevskiy --- include/hw/vfio/vfio-common.h | 1 + hw/vfio/common.c | 10 ++ hw/vfio/spapr.c | 32 ++

[Qemu-devel] [RFC PATCH qemu 2/5] spapr-iommu: Subclass TYPE_IOMMU_MEMORY_REGION

2017-03-30 Thread Alexey Kardashevskiy
Signed-off-by: Alexey Kardashevskiy --- include/hw/ppc/spapr.h | 22 ++ hw/ppc/spapr_iommu.c | 25 - 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index 6997ed7e98..5d5ce4dd2b 100644 ---

[Qemu-devel] [RFC PATCH qemu 3/5] vfio-pci: Reorder group-to-container attaching

2017-03-30 Thread Alexey Kardashevskiy
At the moment VFIO PCI device initialization works as follows: vfio_realize vfio_get_group vfio_connect_container register memory listeners (1) update QEMU groups lists vfio_kvm_device_add_group Then (example f

[Qemu-devel] [RFC PATCH qemu 1/5] memory/iommu: QOM'fy IOMMU MemoryRegion

2017-03-30 Thread Alexey Kardashevskiy
Signed-off-by: Alexey Kardashevskiy --- include/exec/memory.h | 50 include/hw/ppc/spapr.h| 3 +- include/hw/vfio/vfio-common.h | 2 +- include/qemu/typedefs.h | 1 + exec.c| 16 +-- hw/ppc/spapr_iommu.c | 20

Re: [Qemu-devel] [RFC PATCH qemu 2/5] spapr-iommu: Subclass TYPE_IOMMU_MEMORY_REGION

2017-03-30 Thread Paolo Bonzini
On 30/03/2017 14:47, Alexey Kardashevskiy wrote: > +static int spapr_tce_get_fd(IOMMUMemoryRegion *iommu) > +{ > +sPAPRTCETable *tcet = container_of(iommu, sPAPRTCETable, iommu); > + > +return tcet->fd; > +} > + > static int spapr_tce_table_post_load(void *opaque, int version_id) > { >

Re: [Qemu-devel] [RFC PATCH qemu 1/5] memory/iommu: QOM'fy IOMMU MemoryRegion

2017-03-30 Thread Paolo Bonzini
On 30/03/2017 14:47, Alexey Kardashevskiy wrote: > @@ -633,7 +663,7 @@ static inline bool memory_region_is_iommu(MemoryRegion > *mr) > if (mr->alias) { > return memory_region_is_iommu(mr->alias); > } > -return mr->iommu_ops; > +return object_dynamic_cast(OBJECT(mr), TY

Re: [Qemu-devel] [PATCH v3 4/8] qcow2: extract image creation option parsing

2017-03-30 Thread Alberto Garcia
On Wed 22 Mar 2017 12:16:04 PM CET, Stefan Hajnoczi wrote: > The image creation options parsed by qcow2_create() are also needed to > implement .bdrv_measure(). Extract the parsing code, including input > validation. > > Signed-off-by: Stefan Hajnoczi Reviewed-by: Alberto Garcia Berto

Re: [Qemu-devel] [PATCH v4 2/9] spapr: move the IRQ server number mapping under the machine

2017-03-30 Thread Cédric Le Goater
On 03/30/2017 08:46 AM, David Gibson wrote: > On Wed, Mar 29, 2017 at 03:53:24PM +0200, Cédric Le Goater wrote: >> This is the second step to abstract the IRQ 'server' number of the >> XICS layer. Now that the prereq cleanups have been done in the >> previous patch, we can move down the 'cpu_dt_id'

Re: [Qemu-devel] [PATCH] virtio-net: consolidate guest announcement with qemu_announce_self

2017-03-30 Thread Vlad Yasevich
On 03/30/2017 04:24 AM, Dr. David Alan Gilbert wrote: > * Vladislav Yasevich (vyase...@redhat.com) wrote: >> virtio announcements seem to run on its own timer with it's own >> repetition loop and are invoked separately from qemu_announce_self. >> This patch consolidates announcements into a single

Re: [Qemu-devel] [for-2.9 4/8] block: Document -drive problematic code and bugs

2017-03-30 Thread Eric Blake
On 03/30/2017 01:52 AM, Markus Armbruster wrote: >>> +++ b/block.c >>> @@ -1157,6 +1157,12 @@ static int bdrv_open_common(BlockDriverState *bs, >>> BlockBackend *file, >>> if (file != NULL) { >>> filename = blk_bs(file)->filename; >>> } else { >>> + /* >>> +* Caut

Re: [Qemu-devel] [for-2.9 6/8] qapi-schema: SocketAddressFlat variants 'vsock' and 'fd'

2017-03-30 Thread Eric Blake
On 03/30/2017 01:55 AM, Markus Armbruster wrote: > Eric Blake writes: > >> On 03/29/2017 11:45 AM, Markus Armbruster wrote: >>> Note that the new variants are impossible in qemu_gluster_glfs_init(), >>> because the gconf->server can only come from qemu_gluster_parse_uri() >>> or qemu_gluster_pars

[Qemu-devel] [RFC v2 for-2.9 03/10] io vnc sockets: Clean up SocketAddressKind switches

2017-03-30 Thread Markus Armbruster
We have quite a few switches over SocketAddressKind. Some have case labels for all enumeration values, others rely on a default label. Some abort when the value isn't a valid SocketAddressKind, others report an error then. Unify as follows. Always provide case labels for all enumeration values,

[Qemu-devel] [RFC v2 for-2.9 10/10] sheepdog: Fix blockdev-add

2017-03-30 Thread Markus Armbruster
Commit 831acdc "sheepdog: Implement bdrv_parse_filename()" and commit d282f34 "sheepdog: Support blockdev-add" have different ideas on how the QemuOpts parameters for the server address are named. Fix that. While there, rename BlockdevOptionsSheepdog member addr to server, for consistency with Blo

[Qemu-devel] [RFC v2 for-2.9 09/10] squash! nbd: Tidy up blockdev-add interface

2017-03-30 Thread Markus Armbruster
Drop backward -drive server.data.* compatibility gunk. On squash, replace commit message's last paragraph "Unfortunately, SocketAddress is also visible..." by: Unfortunately, SocketAddress is also visible in -drive since 2.8: -drive if=none,driver=nbd,server.type=inet,server.data.host=127.0

[Qemu-devel] [RFC v2 for-2.9 08/10] nbd: Tidy up blockdev-add interface

2017-03-30 Thread Markus Armbruster
SocketAddress is a simple union, and simple unions are awkward: they have their variant members wrapped in a "data" object on the wire, and require additional indirections in C. I intend to limit its use to existing external interfaces, and convert all internal interfaces to SocketAddressFlat. Bl

[Qemu-devel] [RFC v2 for-2.9 04/10] block: Document -drive problematic code and bugs

2017-03-30 Thread Markus Armbruster
-blockdev and blockdev_add convert their arguments via QObject to BlockdevOptions for qmp_blockdev_add(), which converts them back to QObject, then to a flattened QDict. The QDict's members are typed according to the QAPI schema. -drive converts its argument via QemuOpts to a (flat) QDict. This

[Qemu-devel] [RFC v2 for-2.9 05/10] gluster: Prepare for SocketAddressFlat extension

2017-03-30 Thread Markus Armbruster
qemu_gluster_glfs_init() and qemu_gluster_parse_json() rely on the fact that SocketAddressFlatType has only two members SOCKET_ADDRESS_FLAT_TYPE_INET and SOCKET_ADDRESS_FLAT_TYPE_UNIX. Correct, but won't stay correct. Make them more robust. Signed-off-by: Markus Armbruster Reviewed-by: Max Reitz

[Qemu-devel] [RFC v2 for-2.9 07/10] sockets: New helper socket_address_crumple()

2017-03-30 Thread Markus Armbruster
SocketAddress is a simple union, and simple unions are awkward: they have their variant members wrapped in a "data" object on the wire, and require additional indirections in C. I intend to limit its use to existing external interfaces. New ones should use SocketAddressFlat. I further intend to c

[Qemu-devel] [RFC v2 for-2.9 01/10] nbd sockets vnc: Mark problematic address family tests TODO

2017-03-30 Thread Markus Armbruster
Certain features make sense only with certain address families. For instance, passing file descriptors requires AF_UNIX. Testing SocketAddress's saddr->type == SOCKET_ADDRESS_KIND_UNIX is obvious, but problematic: it can't recognize AF_UNIX when type == SOCKET_ADDRESS_KIND_FD. Mark such tests of

[Qemu-devel] [RFC v2 for-2.9 06/10] qapi-schema: SocketAddressFlat variants 'vsock' and 'fd'

2017-03-30 Thread Markus Armbruster
Note that the new variants are impossible in qemu_gluster_glfs_init(), because the gconf->server can only come from qemu_gluster_parse_uri() or qemu_gluster_parse_json(), and neither can create anything but 'inet' or 'unix'. Signed-off-by: Markus Armbruster Reviewed-by: Max Reitz --- block/glus

[Qemu-devel] [RFC v2 for-2.9 00/10] Fixes and cleanups around SocketAddress

2017-03-30 Thread Markus Armbruster
What makes this 2.9 material is the crash bug fixed in PATCH 2 and the QAPI/QMP interface cleanups in PATCH 7+8. This is RFC because: 1. To give you one more chance to ask for undocumented -drive driver=nbd usage compatibility [PATCH 08+09]. 2. Another round of sheepdog tests is still in prog

Re: [Qemu-devel] [PATCH for-2.9?] 9pfs: fix multiple flush for same request

2017-03-30 Thread Eric Blake
On 03/30/2017 03:26 AM, Greg Kurz wrote: > If a client tries to flush the same outstanding request several times, only > the first flush completes. Subsequent ones keep waiting for the request > completion in v9fs_flush() and, therefore, leak a PDU. This will cause QEMU > to hang when draining acti

[Qemu-devel] [RFC v2 for-2.9 02/10] char: Fix socket with "type": "vsock" address

2017-03-30 Thread Markus Armbruster
Watch this: $ qemu-system-x86_64 -nodefaults -S -display none -qmp stdio {"QMP": {"version": {"qemu": {"micro": 91, "minor": 8, "major": 2}, "package": " (v2.8.0-1195-gf84141e-dirty)"}, "capabilities": []}} { "execute": "qmp_capabilities" } {"return": {}} { "execute": "chardev

Re: [Qemu-devel] [PATCH] virtio-net: consolidate guest announcement with qemu_announce_self

2017-03-30 Thread Vlad Yasevich
On 03/29/2017 04:35 PM, Michael S. Tsirkin wrote: > On Wed, Mar 29, 2017 at 04:19:50PM -0400, Vladislav Yasevich wrote: >> virtio announcements seem to run on its own timer with it's own >> repetition loop and are invoked separately from qemu_announce_self. >> This patch consolidates announcements

Re: [Qemu-devel] [PATCH for-2.9?] 9pfs: fix migration_block leak

2017-03-30 Thread Eric Blake
On 03/30/2017 07:27 AM, Li Qiang wrote: > The guest can leave the pdu->s->migration_blocker exists by attach s/exists/in place/ s/attach/attaching/ > but not remove a fid. Then if we hot unplug the 9pfs device, the s/remove/removing/ > v9fs_reset() just free the fids, but not free the migration

Re: [Qemu-devel] [RFC v2 0/9] qom: Make object_get_class()/*_GET_CLASS return const pointers

2017-03-30 Thread Eduardo Habkost
On Thu, Mar 30, 2017 at 10:59:10AM +0200, Paolo Bonzini wrote: > > > On 29/03/2017 21:41, Eduardo Habkost wrote: > > QOM has a data model where class struct data is static: class > > structs are initialized at class_init, and never changed again. > > Isn't that just the way class data is being u

[Qemu-devel] [PATCH] input: Add trace events for polled keyboard input

2017-03-30 Thread Alexander Graf
When driving QEMU from the outside, we have basically no chance to determine how quickly the guest OS picks up key events, so we usually have to limit ourselves to very slow keyboard presses to make sure the guest always has enough chance to pick them up. This patch adds trace events for when the

Re: [Qemu-devel] [RfC PATCH 0/4] make display updates thread safe.

2017-03-30 Thread Gerd Hoffmann
Hi, > Excellent! I can help out with converting and/or testing the SPARC > devices (cg3/tcx) if required. Sure, test results and patches are very welcome. I've touched dirty bitmap code for the first time, so I've sent out this rfc for early feedback at the approach taken before going out conv

[Qemu-devel] [Bug 1675549] Re: tcg softmmu i386 crashes on BE hardware

2017-03-30 Thread luigiburdo
** Changed in: qemu Status: New => Fix Released -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1675549 Title: tcg softmmu i386 crashes on BE hardware Status in QEMU: Fix Released Bug des

Re: [Qemu-devel] [PULL 0/3] virtio, pci: fixes

2017-03-30 Thread Peter Maydell
On 29 March 2017 at 02:18, Michael S. Tsirkin wrote: > The following changes since commit df9046363220e57d45818312759b954c033c58ab: > > Update version for v2.9.0-rc2 release (2017-03-28 19:11:16 +0100) > > are available in the git repository at: > > git://git.kernel.org/pub/scm/virt/kvm/mst/qe

[Qemu-devel] [Bug 1588473] Re: Qemu Mate 16.10 and Gtk dont build

2017-03-30 Thread luigiburdo
** Changed in: qemu Status: New => Fix Released -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1588473 Title: Qemu Mate 16.10 and Gtk dont build Status in QEMU: Fix Released Bug descripti

[Qemu-devel] [Bug 1603636] Re: Guest has not initialized the display yet on ubuntu 16.10 PPC

2017-03-30 Thread luigiburdo
** Changed in: qemu Status: New => Fix Released -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1603636 Title: Guest has not initialized the display yet on ubuntu 16.10 PPC Status in QEMU:

[Qemu-devel] [Bug 1571084] Re: Qemu 2.x dont build on last Gtk dev 3.0+

2017-03-30 Thread luigiburdo
** Changed in: qemu Status: New => Fix Released -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1571084 Title: Qemu 2.x dont build on last Gtk dev 3.0+ Status in QEMU: Fix Released Bug des

[Qemu-devel] [Bug 1569491] Re: qemu system i386 poor performance on e5500 core

2017-03-30 Thread luigiburdo
** Changed in: qemu Status: New => Opinion -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1569491 Title: qemu system i386 poor performance on e5500 core Status in QEMU: Opinion Bug descri

[Qemu-devel] [Bug 1399957] Re: Strange colors on PowerMac Machine OsX

2017-03-30 Thread luigiburdo
** Changed in: qemu Status: New => Fix Released -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1399957 Title: Strange colors on PowerMac Machine OsX Status in QEMU: Fix Released Bug descr

Re: [Qemu-devel] [PATCH] input: Add trace events for polled keyboard input

2017-03-30 Thread Gerd Hoffmann
On Do, 2017-03-30 at 15:35 +0200, Alexander Graf wrote: > When driving QEMU from the outside, we have basically no chance to > determine how quickly the guest OS picks up key events, so we usually > have to limit ourselves to very slow keyboard presses to make sure > the guest always has enough cha

[Qemu-devel] [Bug 1677492] [NEW] block_set_io_throttle complaints Need exactly one of 'device' and 'id'

2017-03-30 Thread dE
Public bug reported: All of sudden, after a qemu update, block_set_io_throttle does not work anymore. Full command to QEMU monitor -- (qemu) block_set_io_throttle db 0 0 0 0 0 0 Need exactly one of 'device' and 'id' The help text still point to the same old syntax, which no longer works. ** Af

Re: [Qemu-devel] [PATCH] input: Add trace events for polled keyboard input

2017-03-30 Thread Peter Maydell
On 30 March 2017 at 14:35, Alexander Graf wrote: > When driving QEMU from the outside, we have basically no chance to > determine how quickly the guest OS picks up key events, so we usually > have to limit ourselves to very slow keyboard presses to make sure > the guest always has enough chance to

Re: [Qemu-devel] xhci migration breakage

2017-03-30 Thread Gerd Hoffmann
Hi, > I guess maybe there's a kick needed pre/post migrate? Sure, but it is there already (post_load arms kick_timer for active endpoints), so it isn't *that* simple. Looking at this I have no idea offhand, guess I have to schedule some debugging for tomorrow. Keep me posted in case you conti

  1   2   3   >