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

2017-03-29 Thread Gerd Hoffmann
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've noticed while wading through the vga code, and #4 remov

Re: [Qemu-devel] [PATCH 30/51] ram: Move src_page_req* to RAMState

2017-03-29 Thread Peter Xu
On Thu, Mar 23, 2017 at 09:45:23PM +0100, Juan Quintela wrote: > This are the last postcopy fields still at MigrationState. Once there s/This/These/ > Move MigrationSrcPageRequest to ram.c and remove MigrationState > parameters where appropiate. > > Signed-off-by: Juan Quintela Reviewed-by: P

[Qemu-devel] [RfC PATCH 4/4] [testing] console: remove do_safe_dpy_refresh

2017-03-29 Thread Gerd Hoffmann
Drop the temporary workaround for the broken display updates. TODO: before actually merging this we have to fix all the non-vga display adapters too ... Signed-off-by: Gerd Hoffmann --- ui/console.c | 25 + 1 file changed, 1 insertion(+), 24 deletions(-) diff --gi

[Qemu-devel] [RfC PATCH 1/4] vga: add vga_scanline_invalidated helper

2017-03-29 Thread Gerd Hoffmann
Add vga_scanline_invalidated helper to check whenever a scanline was invalidated. Add a sanity check to fix OOB read access for display heights larger than 2048. Only cirrus uses this, for hardware cursor rendering, so having this work properly for the first 2048 scanlines only shouldn't be a pro

[Qemu-devel] [RfC PATCH 2/4] memory: add support getting and using a dirty bitmap copy.

2017-03-29 Thread Gerd Hoffmann
This patch adds support for getting and using a local copy of the dirty bitmap. memory_region_copy_and_clear_dirty() will create a copy of the dirty bitmap for the specified range, clear the dirty bitmap and return the copy. The returned bitmap can be a bit larger than requested, the range is exp

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

2017-03-29 Thread Gerd Hoffmann
The vga code clears the dirty bits *after* reading the framebuffer memory. So if the guest framebuffer updates hits the race window between vga reading the framebuffer and vga clearing the dirty bits vga will miss that update Fix it by using the new memory_region_copy_and_clear_dirty() memory_reg

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

2017-03-29 Thread Markus Armbruster
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_parse_json(), and neither can create anything but >> 'tcp' or

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

2017-03-29 Thread Markus Armbruster
Max Reitz writes: > On 29.03.2017 18:45, 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_parse_json(), and neither can create anything but >> 'tcp' or 'un

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

2017-03-29 Thread Markus Armbruster
Max Reitz writes: > On 29.03.2017 18:45, Markus Armbruster wrote: >> -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 Q

Re: [Qemu-devel] [PATCH 29/51] ram: Move last_req_rb to RAMState

2017-03-29 Thread Peter Xu
On Thu, Mar 23, 2017 at 09:45:22PM +0100, Juan Quintela wrote: > It was on MigrationState when it is only used inside ram.c for > postcopy. Problem is that we need to access it without being able to > pass it RAMState directly. > > Signed-off-by: Juan Quintela > --- > include/migration/migratio

Re: [Qemu-devel] [for-2.9 3/8] io vnc sockets: Clean up SocketAddressKind switches

2017-03-29 Thread Markus Armbruster
Max Reitz writes: > On 29.03.2017 18:45, Markus Armbruster wrote: >> 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 t

Re: [Qemu-devel] [for-2.9 2/8] char: Fix socket with "type": "vsock" address

2017-03-29 Thread Markus Armbruster
Marc-André Lureau writes: > - Original Message - >> >> Hi >> >> - Original Message - >> > Watch this: >> > >> > $ qemu-system-x86_64 -nodefaults -S -display none -qmp stdio >> > {"QMP": {"version": {"qemu": {"micro": 91, "minor": 8, "major": 2}, >> > "package": " (v

Re: [Qemu-devel] [PATCH 26/51] ram: Move bytes_transferred into RAMState

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

Re: [Qemu-devel] [PATCH 25/51] ram: Move migration_bitmap_rcu into RAMState

2017-03-29 Thread Peter Xu
On Thu, Mar 23, 2017 at 09:45:18PM +0100, Juan Quintela wrote: > Once there, rename the type to be shorter. > > Signed-off-by: Juan Quintela > Reviewed-by: Dr. David Alan Gilbert Reviewed-by: Peter Xu -- peterx

Re: [Qemu-devel] [PATCH 27/51] ram: Use the RAMState bytes_transferred parameter

2017-03-29 Thread Peter Xu
On Thu, Mar 23, 2017 at 09:45:20PM +0100, Juan Quintela wrote: > Somewhere it was passed by reference, just use it from RAMState. > > Signed-off-by: Juan Quintela > Reviewed-by: Juan Quintela (Is this a self-review above? :-) Reviewed-by: Peter Xu -- peterx

Re: [Qemu-devel] [PATCH 22/51] ram: Move migration_dirty_pages to RAMState

2017-03-29 Thread Peter Xu
On Thu, Mar 23, 2017 at 09:45:15PM +0100, Juan Quintela wrote: > Signed-off-by: Juan Quintela Reviewed-by: Peter Xu > --- > migration/ram.c | 32 ++-- > 1 file changed, 18 insertions(+), 14 deletions(-) > > diff --git a/migration/ram.c b/migration/ram.c > index 329

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

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

Re: [Qemu-devel] [PATCH 23/51] ram: Everything was init to zero, so use memset

2017-03-29 Thread Peter Xu
On Thu, Mar 23, 2017 at 09:45:16PM +0100, Juan Quintela wrote: > And then init only things that are not zero by default. > > Signed-off-by: Juan Quintela Reviewed-by: Peter Xu -- peterx

Re: [Qemu-devel] [PATCH 28/51] ram: Remove ram_save_remaining

2017-03-29 Thread Peter Xu
On Thu, Mar 23, 2017 at 09:45:21PM +0100, Juan Quintela wrote: > Just unfold it. Move ram_bytes_remaining() with the rest of exported > functions. > > Signed-off-by: Juan Quintela > --- > migration/ram.c | 19 +++ > 1 file changed, 7 insertions(+), 12 deletions(-) > > diff --gi

Re: [Qemu-devel] [PATCH] exec: don't return int64_t in address_space_cache_init()

2017-03-29 Thread Jason Wang
On 2017年03月30日 05:26, Michael S. Tsirkin wrote: On Wed, Mar 29, 2017 at 02:12:50PM +0800, Jason Wang wrote: We return int64_t as the length of region cache but accept hwaddr as the required length. This is wrong and may confuse the caller since the it can lead comparison between signed and uns

Re: [Qemu-devel] [PATCH] hw/intc/arm_gicv3_kvm: Check KVM_DEV_ARM_VGIC_GRP_CPU_SYSREGS in reset

2017-03-29 Thread Prakash B
On Tue, Mar 28, 2017 at 7:28 PM, Eric Auger wrote: > KVM_DEV_ARM_VGIC_GRP_CPU_SYSREGS needs to be checked before > attempting to read ICC_CTLR_EL1; otherwise kernel versions not > exposing this kvm device group will be incompatible with qemu 2.9. > > Fixes: 07a5628 ("hw/intc/arm_gicv3_kvm: Reset

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

2017-03-29 Thread Iwona Kotlarska
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.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git

Re: [Qemu-devel] [PATCH v10 1/2] block/vxhs.c: Add support for a new block device type called "vxhs"

2017-03-29 Thread ashish mittal
Hi Jeff, Will incorporate all your review comments with two small dependent changes as follows: @@ -302,14 +286,14 @@ static int vxhs_open(BlockDriverState *bs, QDict *options, int bdrv_flags, Error **errp) { BDRVVXHSState *s = bs->opaque; -void *dev_handlep = NULL

Re: [Qemu-devel] [PATCH 1/1] target/ppc: Improve accuracy of guest HTM availability on P8s

2017-03-29 Thread Sam Bobroff
On Wed, Mar 29, 2017 at 07:39:25AM +0200, Thomas Huth wrote: > On 29.03.2017 07:01, Sam Bobroff wrote: > > On Power8 hosts it is currently theoretically possible for QEMU/KVM-HV > > guests > > to receive a ibm,pa-features property indicating that HTM support is > > available > > when it is not.

Re: [Qemu-devel] New iotest repros failures on virtio external snapshot with iothread

2017-03-29 Thread Eric Blake
On 03/29/2017 09:01 PM, Ed Swierk via Qemu-devel wrote: > Parts of qemu's block code have changed a lot in recent months but are > not well exercised by current tests. > > Subtle bugs have crept in causing assertion failures, hangs and other > crashes in a variety of situations: immediately on sta

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

2017-03-29 Thread Jason Wang
On 2017年03月29日 19:39, Cornelia Huck wrote: On Wed, 29 Mar 2017 17:18:00 +0800 Jason Wang wrote: On 2017年03月29日 16:45, Cornelia Huck wrote: On Wed, 29 Mar 2017 10:09:10 +0200 Paolo Bonzini wrote: On 29/03/2017 10:00, Jason Wang wrote: 1) vtd was reset first 2) during the reset of virtio

Re: [Qemu-devel] [PATCH v6 02/10] iotests: Improve image-clear tests on non-aligned image

2017-03-29 Thread Eric Blake
On 03/13/2017 05:00 PM, Max Reitz wrote: > On 08.03.2017 03:54, Eric Blake wrote: >> Tweak 097 and 176 to operate on an image that is not cluster-aligned, >> to give further coverage of clearing out an entire image. >> >> Signed-off-by: Eric Blake >> >> --- >> v6: new patch >> --- >> tests/qemu-i

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

2017-03-29 Thread David Gibson
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 under > >> the PowerNV machine to store the Inter

[Qemu-devel] New iotest repros failures on virtio external snapshot with iothread

2017-03-29 Thread Ed Swierk via Qemu-devel
Parts of qemu's block code have changed a lot in recent months but are not well exercised by current tests. Subtle bugs have crept in causing assertion failures, hangs and other crashes in a variety of situations: immediately on start, on first guest activity, on external snapshot create or commit

Re: [Qemu-devel] [RFC PATCH qemu 1/3] memory: Add get_fd() hook for IOMMU MR

2017-03-29 Thread David Gibson
On Wed, Mar 29, 2017 at 10:04:47AM +0200, Paolo Bonzini wrote: > > > On 29/03/2017 05:04, Alex Williamson wrote: > >>> What if we used this as a prototype: > >>> > >>> int (*get_fd)(IOMMUFdType type, MemoryRegion *iommu); > >>> > >>> And then we defined: > >>> > >>> typedef enum { > >>> SPAPR

Re: [Qemu-devel] [PATCH v3 1/8] ppc/xics: introduce an 'icp' backlink under PowerPCCPU

2017-03-29 Thread David Gibson
On Wed, Mar 29, 2017 at 09:14:01AM +0200, Cédric Le Goater wrote: > On 03/29/2017 06:11 AM, David Gibson wrote: > > On Tue, Mar 28, 2017 at 09:32:25AM +0200, Cédric Le Goater wrote: > >> Today, the ICPState array of the sPAPR machine is indexed with > >> 'cpu_index' of the CPUState. This numbering

Re: [Qemu-devel] [PATCH] kvm: pass the virtual SEI syndrome to guest OS

2017-03-29 Thread gengdongjiu
Hi Christoffer/Laszlo, On 2017/3/30 1:44, Christoffer Dall wrote: > On Wed, Mar 29, 2017 at 05:37:49PM +0200, Laszlo Ersek wrote: >> On 03/29/17 16:48, Christoffer Dall wrote: >>> On Wed, Mar 29, 2017 at 10:36:51PM +0800, gengdongjiu wrote: 2017-03-29 18:36 GMT+08:00, Achin Gupta : >> > Q

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

2017-03-29 Thread Eduardo Habkost
On Wed, Mar 29, 2017 at 11:04:39PM +0200, 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 > --- > v1 --> v2 > Ad

Re: [Qemu-devel] [PATCH v4 0/3] Introduce vhost-user-scsi and sample application

2017-03-29 Thread Felipe Franciosi
> On 29 Mar 2017, at 13:40, Michael S. Tsirkin wrote: > > On Thu, Mar 02, 2017 at 08:43:00AM -0800, Felipe Franciosi wrote: >> Based on various discussions on the 2016 KVM Forum, I'm sending over a >> vhost-user-scsi implementation for your consideration. >> >> This patchset introduces a new vh

Re: [Qemu-devel] [PATCH for-2.10 13/16] block/qcow2: qcow2_calc_size_usage() for truncate

2017-03-29 Thread Max Reitz
On 20.03.2017 16:14, Max Reitz wrote: > On 20.03.2017 12:26, Stefan Hajnoczi wrote: >> On Mon, Mar 13, 2017 at 10:41:14PM +0100, Max Reitz wrote: >>> This patch extends qcow2_calc_size_usage() so it can calculate the >>> additional space needed for preallocating image growth. >>> >>> Signed-off-by:

Re: [Qemu-devel] Deprecating old machine types

2017-03-29 Thread Michael S. Tsirkin
On Wed, Mar 29, 2017 at 06:58:36PM +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

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

2017-03-29 Thread Michael S. Tsirkin
On Wed, Mar 29, 2017 at 04:16:30PM +0800, Peter Xu wrote: > On Wed, Mar 29, 2017 at 04:00:37PM +0800, Jason Wang wrote: > > Hi: > > > > I meet an issue when doing reboot for a guest with two virtio-net-pci cards > > when iommu is enabled. What happens is: > > > > > > 1) vtd was reset first > >

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

2017-03-29 Thread Radha Mohan
On Wed, Mar 29, 2017 at 2:06 PM, Christoffer Dall wrote: > On Wed, Mar 29, 2017 at 01:51:19PM -0700, Radha Mohan wrote: >> On Wed, Mar 29, 2017 at 11:56 AM, 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

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

2017-03-29 Thread Michael S. Tsirkin
On Wed, Mar 29, 2017 at 05:24:18PM +0800, Jason Wang wrote: > > > On 2017年03月29日 17:11, Paolo Bonzini wrote: > > > > On 29/03/2017 11:09, Jason Wang wrote: > > > > > This looks a good fix but may not solve this issue completely. Depends > > > > > on the iova that guest uses, address_space_cache_

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

2017-03-29 Thread Michael S. Tsirkin
On Wed, Mar 29, 2017 at 10:09:10AM +0200, Paolo Bonzini wrote: > > > On 29/03/2017 10:00, Jason Wang wrote: > > > > > > 1) vtd was reset first > > > > 2) during the reset of virtio-net-pci #1, deletion of msix subregion > > will cause a commit of all memory listeners > > > > 3) virito-net-pci

Re: [Qemu-devel] [PATCH] exec: don't return int64_t in address_space_cache_init()

2017-03-29 Thread Michael S. Tsirkin
On Wed, Mar 29, 2017 at 02:12:50PM +0800, Jason Wang wrote: > We return int64_t as the length of region cache but accept hwaddr as > the required length. This is wrong and may confuse the caller since > the it can lead comparison between signed and unsigned types. The > caller can not catch the fai

Re: [Qemu-devel] [PATCH v3 1/1] block: pass the right options for BlockDriver.bdrv_open()

2017-03-29 Thread Max Reitz
On 29.03.2017 03:16, Dong Jia Shi wrote: > raw_open() expects the caller always passing in the right actual > @options parameter. But when trying to applying snapshot on a RBD > image, bdrv_snapshot_goto() calls raw_open() (by calling the > bdrv_open callback on the BlockDriver) with a NULL @option

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

2017-03-29 Thread Christoffer Dall
On Wed, Mar 29, 2017 at 01:51:19PM -0700, Radha Mohan wrote: > On Wed, Mar 29, 2017 at 11:56 AM, 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, 20

[Qemu-devel] [PATCH RESEND v2] hmp: fix "info cpu" segfault

2017-03-29 Thread Iwona Kotlarska
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 --- v1 --> v2 Added brackets around if body. Changed subject. target/i386/arch_dump.c | 8 +-

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

2017-03-29 Thread Radha Mohan
On Wed, Mar 29, 2017 at 11:56 AM, 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

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

2017-03-29 Thread Michael S. Tsirkin
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 into a single location and > allows other nics to provi

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

2017-03-29 Thread Max Reitz
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 how >>> the QemuOpts para

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

2017-03-29 Thread Eric Blake
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 how >> the QemuOpts parameters for the server address are named. Fix

Re: [Qemu-devel] [PATCH for 2.9 1/1] block: add missed aio_context_acquire into release_drive

2017-03-29 Thread Max Reitz
On 28.03.2017 18:12, Denis V. Lunev wrote: > Recently we expirience hang with iothreads enabled with the following > call trace: > Thread 1 (Thread 0x7fa95efebc80 (LWP 177117)): > 0 ppoll () from /lib64/libc.so.6 > 2 qemu_poll_ns () at qemu-timer.c:313 > 3 aio_poll () at aio-posix.c:457 > 4 bdr

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

2017-03-29 Thread Vladislav Yasevich
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 announcement capabilities, if necessary. This is also usefull i

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

2017-03-29 Thread Eric Blake
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 > existing external interfaces, and

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

2017-03-29 Thread Eduardo Habkost
On Wed, Mar 29, 2017 at 04:41:39PM -0300, Eduardo Habkost wrote: [...] > Eduardo Habkost (9): > configure: test if _Generic works as expected > Simplify code using *MACHINE_GET_CLASS > qom: QUALIFIED_CAST helper macro > qom: Make object_class_get_parent() const-aware > Make class paramete

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

2017-03-29 Thread Eduardo Habkost
On Wed, Mar 29, 2017 at 09:56:54PM +0200, Laszlo Ersek wrote: > On 03/29/17 21:41, Eduardo Habkost wrote: > > The problem > > --- > > > > QOM has a data model where class struct data is static: class > > structs are initialized at class_init, and never changed again. > > > > ...except for

Re: [Qemu-devel] [for-2.9 5/8] gluster: Prepare for SocketAddressFlat extension

2017-03-29 Thread Jeff Cody
On Wed, Mar 29, 2017 at 06:45:17PM +0200, Markus Armbruster wrote: > 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

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

2017-03-29 Thread Eric Blake
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_parse_json(), and neither can create anything but > 'tcp' or 'unix'. > > Signed-off-by

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

2017-03-29 Thread Max Reitz
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 how > the QemuOpts parameters for the server address are named. Fix that. > While there, rename BlockdevOptionsSh

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

2017-03-29 Thread Laszlo Ersek
On 03/29/17 21:41, Eduardo Habkost wrote: > The problem > --- > > QOM has a data model where class struct data is static: class > structs are initialized at class_init, and never changed again. > > ...except for a few rare cases where class data is changed > outside class_init. Those case

Re: [Qemu-devel] [for-2.9 1/8] nbd sockets vnc: Mark problematic address family tests TODO

2017-03-29 Thread Eric Blake
On 03/29/2017 11:45 AM, Markus Armbruster wrote: > 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

[Qemu-devel] [RFC v2 1/9] configure: test if _Generic works as expected

2017-03-29 Thread Eduardo Habkost
Test if _Generic works as expected, and set HAVE_C11_GENERIC config variable if it does. Signed-off-by: Eduardo Habkost --- configure | 20 1 file changed, 20 insertions(+) diff --git a/configure b/configure index d1ce33bc79..b29bce0b53 100755 --- a/configure +++ b/configur

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

2017-03-29 Thread Max Reitz
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 external interfaces, and con

[Qemu-devel] [RFC v2 6/9] Explicitly cast the *_GET_CLASS() value when we break the rules

2017-03-29 Thread Eduardo Habkost
object_get_class() and *_GET_CLASS() macros are going to be changed to return const pointers because the class structs are supposed to be initialized at class_init and not be changed later. However, there are a few places the code still break the (proposed) rules, and change class data outside cla

[Qemu-devel] [RFC v2 9/9] qom: Make object_get_class() return const pointer

2017-03-29 Thread Eduardo Habkost
To avoid having code accidentaly changing class structs outside class_init, make object_get_class() return a const pointer. This will automatically affect OBJECT_GET_CLASS, OBJECT_CLASS_CHECK, and the macros defined using them, because OBJECT_CLASS_CHECK is already const-aware. Signed-off-by: Edu

[Qemu-devel] [RFC v2 3/9] qom: QUALIFIED_CAST helper macro

2017-03-29 Thread Eduardo Habkost
The new helper will help us write macros that keep const-ness of the input arguments, using C11's _Generic keyword. If _Generic is not supported by the compiler, QUALIFIED_CAST becomes a regular non-const cast. Signed-off-by: Eduardo Habkost --- include/qom/object.h | 46 +++

[Qemu-devel] [RFC v2 4/9] qom: Make object_class_get_parent() const-aware

2017-03-29 Thread Eduardo Habkost
This makes object_class_get_parent() return a const pointer in case its class argument is a const pointer. Signed-off-by: Eduardo Habkost --- include/qom/object.h | 6 +- qom/object.c | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/qom/object.h b/includ

[Qemu-devel] [RFC v2 5/9] Make class parameter const at some functions

2017-03-29 Thread Eduardo Habkost
There are many functions that don't need a non-const class pointer argument. Change them to accept a const argument. This will allow us to change class pointer variables to const in most of the code. Signed-off-by: Eduardo Habkost --- include/qom/object.h| 7 --- gdbstub.c

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

2017-03-29 Thread Eduardo Habkost
The problem --- QOM has a data model where class struct data is static: class structs are initialized at class_init, and never changed again. ...except for a few rare cases where class data is changed outside class_init. Those cases are: qbus_realize(), code added by: commit 61de3676

[Qemu-devel] [RFC v2 8/9] qom: Make class cast macros/functions const-aware

2017-03-29 Thread Eduardo Habkost
Use the QUALIFIED_CAST macro to make OBJECT_CLASS, OBJECT_CLASS_CHECK, object_class_dynamic_cast(), and object_class_dynamic_cast_assert() return a const pointer if the class argument is already a const pointer. Signed-off-by: Eduardo Habkost --- include/qom/object.h | 31 +--

[Qemu-devel] [RFC v2 2/9] Simplify code using *MACHINE_GET_CLASS

2017-03-29 Thread Eduardo Habkost
There's no need to use MACHINE_GET_CLASS/object_get_class() followed by a *MACHINE_CLASS cast. Use *MACHINE_GET_CLASS() directly. Signed-off-by: Eduardo Habkost --- hw/core/machine.c | 3 +-- hw/pci/pci.c | 3 +-- hw/xen/xen_backend.c | 3 +-- target/i386/machine.c | 3 +-- 4 files

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

2017-03-29 Thread Max Reitz
On 29.03.2017 18:45, 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_parse_json(), and neither can create anything but > 'tcp' or 'unix'. s/tcp/inet/ > Signe

Re: [Qemu-devel] [for-2.9 5/8] gluster: Prepare for SocketAddressFlat extension

2017-03-29 Thread Max Reitz
On 29.03.2017 18:45, Markus Armbruster wrote: > 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. >

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

2017-03-29 Thread Max Reitz
On 29.03.2017 18:45, Markus Armbruster wrote: > -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 co

[Qemu-devel] [Bug 1390520] Re: virtual machine fails to start with connected audio cd

2017-03-29 Thread John Snow
There is currently no expectation that Audio CDs will work on an emulated CD drive; as long as audio CDs aren't causing QEMU to crash or anything of the sort, this is wishlist and not a bug. Still, I'll try to take a look later and see if there's an easy win here or not. I imagine we don't support

Re: [Qemu-devel] [for-2.9 3/8] io vnc sockets: Clean up SocketAddressKind switches

2017-03-29 Thread Max Reitz
On 29.03.2017 18:45, Markus Armbruster wrote: > 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

Re: [Qemu-devel] [for-2.9 2/8] char: Fix socket with "type": "vsock" address

2017-03-29 Thread Max Reitz
On 29.03.2017 18:45, Markus Armbruster wrote: > 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_ca

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

2017-03-29 Thread Christoffer Dall
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-system-aarch64 when using pflash > >> (booting ker

Re: [Qemu-devel] [for-2.9 1/8] nbd sockets vnc: Mark problematic address family tests TODO

2017-03-29 Thread Max Reitz
On 29.03.2017 18:45, Markus Armbruster wrote: > 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 wh

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

2017-03-29 Thread Dr. David Alan Gilbert
* Juan Quintela (quint...@redhat.com) wrote: > Signed-off-by: Juan Quintela Oh yeh, so it doesn't. Reviewed-by: Dr. David Alan Gilbert > --- > include/migration/migration.h | 3 +-- > migration/postcopy-ram.c | 6 ++ > migration/ram.c | 9 +++-- > migration/savevm.c

Re: [Qemu-devel] [for-2.9 2/8] char: Fix socket with "type": "vsock" address

2017-03-29 Thread Stefan Hajnoczi
On Wed, Mar 29, 2017 at 06:45:14PM +0200, Markus Armbruster wrote: > 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": []}} >

Re: [Qemu-devel] [PATCH v4 1/8] xen: import ring.h from xen

2017-03-29 Thread Stefano Stabellini
On Wed, 29 Mar 2017, Paolo Bonzini wrote: > On 29/03/2017 01:54, Stefano Stabellini wrote: > >>> I understand your point of view, and honestly it wouldn't be a problem > >>> doing it the way you suggested either. However, I think that going > >>> forward it will be less of a maintenance pain to kee

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

2017-03-29 Thread Iwona Kotlarska
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.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff

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

2017-03-29 Thread Peter Maydell
On 29 March 2017 at 19:17, Radha Mohan wrote: >> I will also try with qemu 2.8 and see. > > Same issue with 2.8.0 and 2.7.1 qemu version. Thanks for checking -- good to know it's not a regression on the QEMU side. (If you can soft-lockup the host it's clearly a host kernel bug, but it might have

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

2017-03-29 Thread Radha Mohan
On Tue, Mar 28, 2017 at 1:24 PM, 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-system-aarch64 when using pflash >>> (booting kernel via UEFI b

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

2017-03-29 Thread Dr. David Alan Gilbert
* Juan Quintela (quint...@redhat.com) wrote: > Rename it to preffer_xbzrle that is a more descriptive name. > > Signed-off-by: Juan Quintela > --- > migration/ram.c | 9 + > 1 file changed, 5 insertions(+), 4 deletions(-) > > diff --git a/migration/ram.c b/migration/ram.c > index 6a3970

[Qemu-devel] [Bug 1675108] Re: Cocoa UI always crashes on startup

2017-03-29 Thread Brendan Shanks
Fixed in -rc2, closing. ** 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/1675108 Title: Cocoa UI always crashes on startup Status in QEMU: Fi

Re: [Qemu-devel] [PATCH kernel v8 3/4] mm: add inerface to offer info about unused pages

2017-03-29 Thread Michael S. Tsirkin
On Fri, Mar 17, 2017 at 02:55:33PM +0800, Wei Wang wrote: > On 03/17/2017 05:28 AM, Andrew Morton wrote: > > On Thu, 16 Mar 2017 15:08:46 +0800 Wei Wang wrote: > > > > > From: Liang Li > > > > > > This patch adds a function to provides a snapshot of the present system > > > unused pages. An imp

Re: [Qemu-devel] [PATCH] kvm: pass the virtual SEI syndrome to guest OS

2017-03-29 Thread Christoffer Dall
On Wed, Mar 29, 2017 at 05:37:49PM +0200, Laszlo Ersek wrote: > On 03/29/17 16:48, Christoffer Dall wrote: > > On Wed, Mar 29, 2017 at 10:36:51PM +0800, gengdongjiu wrote: > >> 2017-03-29 18:36 GMT+08:00, Achin Gupta : > > >>> Qemu is essentially fulfilling the role of secure firmware at the > >>>

Re: [Qemu-devel] [PATCH 26/51] ram: Move bytes_transferred into RAMState

2017-03-29 Thread Dr. David Alan Gilbert
* Juan Quintela (quint...@redhat.com) wrote: > Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert > --- > migration/ram.c | 35 +-- > 1 file changed, 17 insertions(+), 18 deletions(-) > > diff --git a/migration/ram.c b/migration/ram.c > index 0900

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

2017-03-29 Thread Marcel Apfelbaum
On 03/29/2017 07:52 PM, Iwona Kotlarska wrote: Running "dump-guest-memory /dev/null 0 8192" results in segfault. Fix by checking if we have CPU. Hi Iwona, Thank you for contributing to the QEMU project. Please state the whole command line that causes the problem, not only the hmp command:

Re: [Qemu-devel] [PATCH] kvm: pass the virtual SEI syndrome to guest OS

2017-03-29 Thread Punit Agrawal
Laszlo Ersek writes: > On 03/29/17 14:51, Michael S. Tsirkin wrote: >> On Wed, Mar 29, 2017 at 01:58:29PM +0200, Laszlo Ersek wrote: >>> (8) When QEMU gets SIGBUS from the kernel -- I hope that's going to come >>> through a signalfd -- QEMU can format the CPER right into guest memory, >>> and the

Re: [Qemu-devel] [PATCH] kvm: pass the virtual SEI syndrome to guest OS

2017-03-29 Thread gengdongjiu
Hi Achin, Thanks for your mail and answer. 2017-03-29 18:36 GMT+08:00, Achin Gupta : > Hi gengdongjiu, > > On Wed, Mar 29, 2017 at 05:36:37PM +0800, gengdongjiu wrote: >> >> Hi Laszlo/Biesheuvel/Qemu developer, >> >>Now I encounter a issue and want to consult with you in ARM64 platform, >>

Re: [Qemu-devel] [PATCH 23/51] ram: Everything was init to zero, so use memset

2017-03-29 Thread Dr. David Alan Gilbert
* Juan Quintela (quint...@redhat.com) wrote: > And then init only things that are not zero by default. > > Signed-off-by: Juan Quintela Reviewed-by: Dr. David Alan Gilbert > --- > migration/ram.c | 25 +++-- > 1 file changed, 3 insertions(+), 22 deletions(-) > > diff --gi

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

2017-03-29 Thread Paolo Bonzini
On 29/03/2017 18:45, Markus Armbruster wrote: > Unfortunately, SocketAddress is also visible in -drive since 2.8. Add > still more gunk to nbd_process_legacy_socket_options(). You can now > shorten > > -drive > if=none,driver=nbd,server.type=inet,server.data.host=127.0.0.1,server.data.por

Re: [Qemu-devel] Deprecating old machine types

2017-03-29 Thread Paolo Bonzini
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 those one day (e.g. with QEMU 3.0), too? > It seems reasonable t

Re: [Qemu-devel] Deprecating old machine types

2017-03-29 Thread Thomas Huth
On 29.03.2017 18:46, Dr. David Alan Gilbert wrote: > * Thomas Huth (th...@redhat.com) wrote: >> On 27.03.2017 21:04, John Snow wrote: >>> >>> On 03/27/2017 04:06 AM, Thomas Huth wrote: On 24.03.2017 23:10, John Snow wrote: >> [...] > I have a list of things I want to axe... I've

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

2017-03-29 Thread Iwona Kotlarska
Running "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.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/target/i386/arch_dump.c b/target/i386/arch_dump.c index 5a2e4be5

Re: [Qemu-devel] [for-2.9 2/8] char: Fix socket with "type": "vsock" address

2017-03-29 Thread Marc-André Lureau
- Original Message - > > Hi > > - Original Message - > > 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)"}, "capabi

Re: [Qemu-devel] Deprecating old machine types

2017-03-29 Thread Dr. David Alan Gilbert
* Thomas Huth (th...@redhat.com) wrote: > On 27.03.2017 21:04, John Snow wrote: > > > > On 03/27/2017 04:06 AM, Thomas Huth wrote: > >> On 24.03.2017 23:10, John Snow wrote: > [...] > >>> I have a list of things I want to axe... > >> > >> I've started a Wiki page with such a list here: > >> > >> h

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

2017-03-29 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] [for-2.9 1/8] nbd sockets vnc: Mark problematic address family tests TODO

2017-03-29 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

Re: [Qemu-devel] [for-2.9 2/8] char: Fix socket with "type": "vsock" address

2017-03-29 Thread Marc-André Lureau
Hi - Original Message - > 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_capabilitie

  1   2   >