[Qemu-devel] [PATCH 1/1] parallels: wrong call to bdrv_truncate

2017-03-27 Thread Denis V. Lunev
Parallels driver should not call bdrv_truncate if the image was opened in the read-only mode. Without the patch qemu-img check harddisk.hds asserts with bdrv_truncate: Assertion `child->perm & BLK_PERM_RESIZE' failed. Parameters used on the write path are not needed if the image is opened

Re: [Qemu-devel] [PATCH] spapr: fix memory hot-unplugging

2017-03-27 Thread Laurent Vivier
Adding cc: Bharata. On 27/03/2017 15:22, Laurent Vivier wrote: > If, once the kernel has booted, we try to remove a memory > hotplugged while the kernel was not started, QEMU crashes on > an assert: > > qemu-system-ppc64: hw/virtio/vhost.c:651: >vhost_commit: Assertion

Re: [Qemu-devel] [PATCH] slirp: fix compilation errors with DEBUG set

2017-03-27 Thread Philippe Mathieu-Daudé
On 03/27/2017 05:46 AM, Laurent Vivier wrote: slirp/slirp.c: In function 'get_dns_addr_resolv_conf': slirp/slirp.c:202:29: error: initialization discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers] char *res = inet_ntop(af, tmp_addr, s, sizeof(s));

[Qemu-devel] [PATCH for-2.9 v2 0/2] i386: Don't override -cpu options on -cpu host/max

2017-03-27 Thread Eduardo Habkost
The existing code for "host" and "max" CPU models overrides every single feature in the CPU object at realize time, even the ones that were explicitly enabled or disabled by the user using "feat=on" or "feat=off", while features set using +feat/-feat are kept. This means "-cpu host,+invtsc" works

[Qemu-devel] [PATCH for-2.9 v2 2/2] i386: Don't override -cpu options on -cpu host/max

2017-03-27 Thread Eduardo Habkost
The existing code for "host" and "max" CPU models overrides every single feature in the CPU object at realize time, even the ones that were explicitly enabled or disabled by the user using "feat=on" or "feat=off", while features set using +feat/-feat are kept. This means "-cpu host,+invtsc" works

Re: [Qemu-devel] [PATCH 1/2] slirp: Make RA build more flexible

2017-03-27 Thread Philippe Mathieu-Daudé
On 03/26/2017 03:46 PM, Samuel Thibault wrote: Do not hardcode the RA size at all, use a pl_size variable which accounts the accumulated size, and fill rip->ip_pl at the end. This will allow to make some blocks optional. Signed-off-by: Samuel Thibault Reviewed-by: Philippe Mathieu-Daudé -

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

2017-03-27 Thread Gerd Hoffmann
On Do, 2017-03-23 at 11:31 +, Alex Bennée wrote: > Peter Maydell writes: > > > On 23 March 2017 at 11:13, Alex Bennée wrote: > >> Technically its not a random thread its the vCPU context (which ensures > >> the vCPU isn't updating while the display is being updated). But I guess > >> the Coc

Re: [Qemu-devel] [Qemu-block] [PATCH for-2.9?] file-posix: Make bdrv_flush() failure permanent without O_DIRECT

2017-03-27 Thread Max Reitz
On 22.03.2017 22:00, Kevin Wolf wrote: > Success for bdrv_flush() means that all previously written data is safe > on disk. For fdatasync(), the best semantics we can hope for on Linux > (without O_DIRECT) is that all data that was written since the last call > was successfully written back. Theref

[Qemu-devel] [PATCH for-2.9 v2 1/2] i386: Replace uint32_t* with FeatureWord on feature getter/setter

2017-03-27 Thread Eduardo Habkost
Instead of passing a pointer to the feature property getter and setter functions, pass a FeatureWord enum so they can perform other actions related to the feature flag. This will be used to add a new "user_features" field to keep track of features that were explicitly set by the user. Signed-off-

Re: [Qemu-devel] [PATCH] virtio-blk: add DISCARD support to virtio-blk driver

2017-03-27 Thread Christoph Hellwig
On Tue, Mar 28, 2017 at 04:39:25PM +0800, Changpeng Liu wrote: > Currently virtio-blk driver does not provide discard feature flag, so the > filesystems which built on top of the block device will not send discard > command. This is okay for HDD backend, but it will impact the performance > for SSD

Re: [Qemu-devel] [PATCH 2/2] slirp: Send RDNSS in RA only if host has an IPv6 DNS server

2017-03-27 Thread Philippe Mathieu-Daudé
Hi Samuel, On 03/26/2017 03:46 PM, Samuel Thibault wrote: Previously we would always send an RDNSS option in the RA, making the guest try to resolve DNS through IPv6, even if the host does not actually have and IPv6 DNS server available. This makes the RDNSS option enabled only when an IPv6 DNS

Re: [Qemu-devel] [PATCH v3 0/8] qemu-img: add measure sub-command

2017-03-27 Thread Maor Lipchuk
On Thu, Mar 23, 2017 at 8:01 PM, Stefan Hajnoczi wrote: > On Wed, Mar 22, 2017 at 07:29:07PM +, Nir Soffer wrote: >> On Wed, Mar 22, 2017 at 2:28 PM Stefan Hajnoczi wrote: >> >> > v3: >> > * Drop RFC, this is ready to go for QEMU 2.10 >> > * Use "required size" instead of "required bytes" i

Re: [Qemu-devel] [PATCH 2/2] slirp: Send RDNSS in RA only if host has an IPv6 DNS server

2017-03-27 Thread Samuel Thibault
Hello, Philippe Mathieu-Daudé, on lun. 27 mars 2017 11:56:00 -0300, wrote: > Why don't declare at function begining and remove this { } ? Oh, right, now I can. While working on the code I still had ifdef WIN32, so it'd lead to an unused variable warning. But now that the ifdef is gone, we can j

Re: [Qemu-devel] Deprecating the -net option

2017-03-27 Thread Paolo Bonzini
On 27/03/2017 15:09, Thomas Huth wrote: > ... and I forgot to mention: We should at least try to get rid of the > options first that only work with -net (or rather the VLAN concept), > like "-net dump", "-net channel", "-tftp", "-smb", "-bootp" and > "-redir", since these will hinder us from doin

Re: [Qemu-devel] callout to *file in bdrv_co_get_block_status

2017-03-27 Thread Paolo Bonzini
On 27/03/2017 15:21, Peter Lieven wrote: >>> >>> I stumbled across the issue with lseek on a tmpfs because in the >>> build process for our templates >>> I temporarily have vmdks on a tmpfs and it takes ages before qemu-img >>> convert starts to run (it iterates >>> over every 64kb cluster with t

[Qemu-devel] [PULL for-2.9 4/5] ui/egl-helpers: fix egl 1.5 display init

2017-03-27 Thread Gerd Hoffmann
Unfortunaly switching to getPlatformDisplayEXT isn't as easy as implemented by 0ea1523fb6703aa0dcd65e66b59e96fec028e60a. See the longish comment for the complete story. Cc: Frediano Ziglio Suggested-by: Hans de Goede Signed-off-by: Gerd Hoffmann Message-id: 1489997042-1824-1-git-send-email-kra

[Qemu-devel] [PULL for-2.9 3/5] cirrus: fix PUTPIXEL macro

2017-03-27 Thread Gerd Hoffmann
Should be "c" not "col". The macro is used with "col" as third parameter everywhere, so this tyops doesn't break something. Fixes: 026aeffcb4752054830ba203020ed6eb05bcaba8 Reported-by: Dr. David Alan Gilbert Signed-off-by: Gerd Hoffmann Reviewed-by: Dr. David Alan Gilbert Message-id: 149016830

[Qemu-devel] [PULL for-2.9 5/5] vnc: fix reverse mode

2017-03-27 Thread Gerd Hoffmann
vnc server in reverse mode (qemu -vnc localhost:$nr,reverse) interprets $nr as display number (i.e. with 5900 offset) in recent qemu versions. Historical and documented behavior is interpreting $nr as port number though. So we should bring code and documentation in line. Given that default listeni

[Qemu-devel] [PULL for-2.9 1/5] virtio-input: free event queue when finalizing

2017-03-27 Thread Gerd Hoffmann
From: Ladi Prosek VirtIOInput.queue was never freed. This commit adds an explicit g_free to virtio_input_finalize and switches the allocation function from realloc to g_realloc in virtio_input_send. Signed-off-by: Ladi Prosek Message-id: 1490365490-4854-2-git-send-email-lpro...@redhat.com Signe

[Qemu-devel] [PULL for-2.9 0/5] fixes for 2.9: vga, egl, cirrus, virtio-input.

2017-03-27 Thread Gerd Hoffmann
in the git repository at: git://git.kraxel.org/qemu tags/pull-fixes-20170327-1 for you to fetch changes up to e5766eb40453b1d22815fc5482802688ff184006: vnc: fix reverse mode (2017-03-27 12:16:02 +0200) fixes for 2.9: vga, egl, cirr

[Qemu-devel] [PULL for-2.9 2/5] virtio-input: fix eventq batching

2017-03-27 Thread Gerd Hoffmann
From: Ladi Prosek virtio_input_send buffers input events until it sees a SYNC. Then it either sends or drops the entire batch, depending on whether eventq has enough space available. The case to avoid here is partial sends where only part of the batch would get to the guest. Using virtqueue_get_

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

2017-03-27 Thread Alex Bennée
Gerd Hoffmann writes: > On Do, 2017-03-23 at 11:31 +, Alex Bennée wrote: >> Peter Maydell writes: >> >> > On 23 March 2017 at 11:13, Alex Bennée wrote: >> >> Technically its not a random thread its the vCPU context (which ensures >> >> the vCPU isn't updating while the display is being upd

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

2017-03-27 Thread Peter Maydell
On 27 March 2017 at 16:18, Alex Bennée wrote: > I've got two patches in my tree at the moment. I was holding off posting > the series to see if I could make more progress with the record/replay > bug. rc candidates are cut on Tuesdays, so it's better in general not to sit on a fix for rc bugs if

Re: [Qemu-devel] [PATCH v2 6/9] [optional] hw: misc: added testdev for smmu

2017-03-27 Thread Philippe Mathieu-Daudé
Hi Prem, On 08/22/2016 01:17 PM, Prem Mallappa wrote: A simple PCI device which does DMA from 'src' to 'dst' given src_addr, dst_addr and size, and is used by unit test. uses pci_dma_read and pci_dma_write in a crude way but serves the purpose. Signed-off-by: Prem Mallappa --- hw/misc/Makefil

Re: [Qemu-devel] [PATCH RFC v2 1/1] block: pass the right options for BlockDriver.bdrv_open

2017-03-27 Thread Max Reitz
On 27.03.2017 05:05, 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] [PATCH v2] Fix input-linux reading from device

2017-03-27 Thread Philippe Mathieu-Daudé
Hi Javier, can you add a line to explain what did you change between v1/v2? Thank, Phil. On 03/26/2017 06:53 AM, Javier Celaya wrote: The evdev devices in input-linux.c are read in blocks of one whole event. If there are not enough bytes available, they are discarded, instead of being kept fo

Re: [Qemu-devel] [PATCH qemu] pci: Add missing drop of bus master AS reference

2017-03-27 Thread Paolo Bonzini
On 27/03/2017 06:40, Alexey Kardashevskiy wrote: > The recent introduction of a bus master container added > memory_region_add_subregion() into the PCI device registering path but > missed memory_region_del_subregion() in the unregistering path leaving > a reference to the root memory region of t

Re: [Qemu-devel] [PATCH for-2.9 v2] block/file-posix.c: Fix unused variable warning on OpenBSD

2017-03-27 Thread Max Reitz
On 23.03.2017 15:36, Peter Maydell wrote: > On OpenBSD none of the ioctls probe_logical_blocksize() tries > exist, so the variable sector_size is unused. Refactor the > code to avoid this (and reduce the duplicated code). > > Signed-off-by: Peter Maydell > Reviewed-by: Philippe Mathieu-Daudé > R

[Qemu-devel] [RFC for 2.9 1/1] block: add missed aio_context_acquire into blk_unref

2017-03-27 Thread Denis V. Lunev
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 bdrv_flush () at block/io.c:2641 5 bdrv_close () at block.c

Re: [Qemu-devel] [PATCH v2] hmp: gpa2hva and gpa2hpa hostaddr command

2017-03-27 Thread Dr. David Alan Gilbert
* Paolo Bonzini (bonz...@gnu.org) wrote: > > > On 20/03/2017 18:16, Paolo Bonzini wrote: > > > > > > On 20/03/2017 18:01, Markus Armbruster wrote: > >> Peter Maydell writes: > >> > >>> On 20 March 2017 at 16:29, Markus Armbruster wrote: > Peter Maydell writes: > > I have some commen

Re: [Qemu-devel] [PATCH v2 6/9] [optional] hw: misc: added testdev for smmu

2017-03-27 Thread Andrew Jones
On Mon, Aug 22, 2016 at 09:47:37PM +0530, Prem Mallappa wrote: > A simple PCI device which does DMA from 'src' to 'dst' given > src_addr, dst_addr and size, and is used by unit test. uses > pci_dma_read and pci_dma_write in a crude way but serves the purpose. > > Signed-off-by: Prem Mallappa > --

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

2017-03-27 Thread Max Reitz
@Subject: Do you mean "PATCH for-2.9?"? Because "RFC" to me means "please do not merge". ;-) I wouldn't mind a change like this to go into 2.9. On 27.03.2017 17:35, Denis V. Lunev wrote: > Recently we expirience hang with iothreads enabled with the following > call trace: > Thread 1 (Thread 0x7fa

Re: [Qemu-devel] [PATCH] i386: Allow monitor / mwait cpuid override

2017-03-27 Thread Eduardo Habkost
On Mon, Mar 27, 2017 at 04:26:50PM +0200, Alexander Graf wrote: > KVM allows trap and emulate (read: NOP) of the MONITOR and MWAIT > instructions. There is work undergoing to enable actual execution > of these inside of KVM, but nobody really wants to expose the feature > to the guest by default, a

[Qemu-devel] [PULL 0/6] Block patches for rc2

2017-03-27 Thread Max Reitz
The following changes since commit ea2afcf5b6727a577cf561fd8fe0d8c397ecc927: Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' into staging (2017-03-24 14:14:18 +) are available in the git repository at: git://github.com/XanClic/qemu.git tags/pull-block-2017-03-2

[Qemu-devel] [PULL 5/6] file-posix: Make bdrv_flush() failure permanent without O_DIRECT

2017-03-27 Thread Max Reitz
From: Kevin Wolf Success for bdrv_flush() means that all previously written data is safe on disk. For fdatasync(), the best semantics we can hope for on Linux (without O_DIRECT) is that all data that was written since the last call was successfully written back. Therefore, and because we can't re

[Qemu-devel] [PULL 1/6] qemu-img: show help for invalid global options

2017-03-27 Thread Max Reitz
From: Stefan Hajnoczi The qemu-img sub-command executes regardless of invalid global options: $ qemu-img --foo info test.img qemu-img: unrecognized option '--foo' image: test.img ... The unrecognized option warning may be missed by the user. This can hide incorrect command-lines in scr

Re: [Qemu-devel] GSoC 2017 Proposal: TCG performance enhancements

2017-03-27 Thread Stefan Hajnoczi
On Sat, Mar 25, 2017 at 12:52:35PM -0400, Pranith Kumar wrote: > Alex Bennée, who mentored me last year, has agreed to mentor me again this > time if the proposal is accepted. Thanks, the project idea looks good for GSoC. I've talked to Alex about adding it to the wiki page. The "How to propose

[Qemu-devel] [PULL 6/6] block/file-posix.c: Fix unused variable warning on OpenBSD

2017-03-27 Thread Max Reitz
From: Peter Maydell On OpenBSD none of the ioctls probe_logical_blocksize() tries exist, so the variable sector_size is unused. Refactor the code to avoid this (and reduce the duplicated code). Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Jeff Cody Message-id:

[Qemu-devel] [PULL 4/6] nbd-client: fix handling of hungup connections

2017-03-27 Thread Max Reitz
From: Paolo Bonzini After the switch to reading replies in a coroutine, nothing is reentering pending receive coroutines if the connection hangs. Move nbd_recv_coroutines_enter_all to the reply read coroutine, which is the place where hangups are detected. nbd_teardown_connection can simply wait

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

2017-03-27 Thread Eric Blake
On 03/26/2017 09:50 PM, Ashish Mittal wrote: > Source code for the qnio library that this code loads can be downloaded from: > https://github.com/VeritasHyperScale/libqnio.git When sending a multi-patch series, please include a 0/2 cover letter ('git config format.coverletter auto' can help). >

Re: [Qemu-devel] [PATCH v10 2/2] block/vxhs.c: Add qemu-iotests for new block device type "vxhs"

2017-03-27 Thread Stefan Hajnoczi
On Sun, Mar 26, 2017 at 07:50:36PM -0700, Ashish Mittal wrote: > These changes use a vxhs test server that is a part of the following > repository: > https://github.com/VeritasHyperScale/libqnio.git > > Signed-off-by: Ashish Mittal > --- > v10 changelog: > (1) Redirect o/p of "$QEMU_VXHS -d $TES

[Qemu-devel] [PULL 2/6] qemu-img: fix switch indentation in img_amend()

2017-03-27 Thread Max Reitz
From: Stefan Hajnoczi QEMU coding style indents 'case' to the same level as the 'switch' statement: switch (foo) { case 1: Fix this coding style violation so checkpatch.pl doesn't complain about the next patch. Signed-off-by: Stefan Hajnoczi Message-id: 20170317104541.28979-3-stefa...@red

[Qemu-devel] [PULL 3/6] qemu-img: print short help on getopt failure

2017-03-27 Thread Max Reitz
From: Stefan Hajnoczi Printing the full help output obscures the error message for an invalid command-line option or missing argument. Before this patch: $ ./qemu-img --foo ...pages of output... After this patch: $ ./qemu-img --foo qemu-img: unrecognized option '--foo' Try 'qemu-img

Re: [Qemu-devel] [PATCH RFC v3 for-2.9 01/11] rbd: Reject -blockdev server.*.{numeric, to, ipv4, ipv6}

2017-03-27 Thread Max Reitz
On 27.03.2017 15:26, Markus Armbruster wrote: > We use InetSocketAddress in the QAPI schema. However, the code > doesn't use inet_connect_saddr(), but formats "host" and "port" into a > configuration string for rados_conf_set(). Thus, members "numeric", > "to", "ipv4" and "ipv6" are silently igno

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

2017-03-27 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 for-2.9 2/2] tcg/sparc: Zero extend address argument to ld/st helpers

2017-03-27 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 for-2.9 0/2] tcg/sparc: zero extend ld/st helper args

2017-03-27 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] i386: Allow monitor / mwait cpuid override

2017-03-27 Thread Alexander Graf
On 27/03/2017 17:46, Eduardo Habkost wrote: On Mon, Mar 27, 2017 at 04:26:50PM +0200, Alexander Graf wrote: KVM allows trap and emulate (read: NOP) of the MONITOR and MWAIT instructions. There is work undergoing to enable actual execution of these inside of KVM, but nobody really wants to expo

Re: [Qemu-devel] [PATCH RFC v3 for-2.9 02/11] rbd: Fix to cleanly reject -drive without pool or image

2017-03-27 Thread Max Reitz
On 27.03.2017 15:26, Markus Armbruster wrote: > qemu_rbd_open() neglects to check pool and image are present. > Reproducer: > > $ qemu-system-x86_64 -nodefaults -drive if=none,driver=rbd,pool=p > Segmentation fault (core dumped) > $ qemu-system-x86_64 -nodefaults -drive if=none,driver=

Re: [Qemu-devel] q35 and sysbus devices

2017-03-27 Thread Eduardo Habkost
On Fri, Mar 24, 2017 at 05:58:43PM +0100, Markus Armbruster wrote: > Eduardo Habkost writes: > > > On Fri, Mar 24, 2017 at 01:49:16PM +0300, Marcel Apfelbaum wrote: > >> On 03/22/2017 10:46 PM, Laszlo Ersek wrote: > >> > On 03/22/17 21:31, Eduardo Habkost wrote: > >> > > Hi, > >> > > > >> > > I

Re: [Qemu-devel] [RFC PATCH v4 06/20] core: add new security-policy object

2017-03-27 Thread Brijesh Singh
On 03/27/2017 07:04 AM, Stefan Hajnoczi wrote: On Fri, Mar 24, 2017 at 02:42:47PM -0500, Brijesh Singh wrote: On 03/24/2017 10:40 AM, Stefan Hajnoczi wrote: Having one security policy doesn't make sense to me. As mentioned, there are many different areas of QEMU that have security relevant

Re: [Qemu-devel] [PATCH RFC v3 for-2.9 02/11] rbd: Fix to cleanly reject -drive without pool or image

2017-03-27 Thread Max Reitz
On 27.03.2017 18:10, Max Reitz wrote: > On 27.03.2017 15:26, Markus Armbruster wrote: >> qemu_rbd_open() neglects to check pool and image are present. >> Reproducer: >> >> $ qemu-system-x86_64 -nodefaults -drive if=none,driver=rbd,pool=p >> Segmentation fault (core dumped) >> $ qemu-sys

[Qemu-devel] [PULL 2/9] virtio-scsi: Make virtio_scsi_acquire/release public

2017-03-27 Thread Paolo Bonzini
From: Fam Zheng They will be used in virtio-scsi-dataplane.c as well, so move them to header. Signed-off-by: Fam Zheng Message-Id: <20170317061447.16243-2-f...@redhat.com> Signed-off-by: Paolo Bonzini --- hw/scsi/virtio-scsi.c | 14 -- include/hw/virtio/virtio-scsi.h | 1

[Qemu-devel] [PULL 3/9] virtio-scsi: Fix acquire/release in dataplane handlers

2017-03-27 Thread Paolo Bonzini
From: Fam Zheng After the AioContext lock push down, there is a race between virtio_scsi_dataplane_start and those "assert(s->ctx && s->dataplane_started)", because the latter doesn't isn't wrapped in aio_context_acquire. Reproducer is simply booting a Fedora guest with an empty virtio-scsi-data

[Qemu-devel] [PULL 7/9] nbd: drop unused NBDClientSession.is_unix field

2017-03-27 Thread Paolo Bonzini
From: Stefan Hajnoczi Signed-off-by: Stefan Hajnoczi Message-Id: <20170327123223.1199-1-stefa...@redhat.com> Signed-off-by: Paolo Bonzini --- block/nbd-client.h | 2 -- block/nbd.c| 2 -- 2 files changed, 4 deletions(-) diff --git a/block/nbd-client.h b/block/nbd-client.h index 8cdfc9

[Qemu-devel] [PULL 5/9] mem-prealloc: fix sysconf(_SC_NPROCESSORS_ONLN) failure case.

2017-03-27 Thread Paolo Bonzini
From: Jitendra Kolhe This was spotted by Coverity, in case where sysconf(_SC_NPROCESSORS_ONLN) fails and returns -1. This results in memset_num_threads getting set to -1. Which we then pass to g_new0(). The patch replaces MAX_MEM_PREALLOC_THREAD_COUNT macro with a function call get_memset_num_thr

[Qemu-devel] [PULL 1/9] clear pending status before calling memory commit

2017-03-27 Thread Paolo Bonzini
From: "Xu, Anthony" clear pending status before calling memory commit. Otherwise when memory_region_finalize is called, memory_region_transaction_depth is 0 and memory_region_update_pending is true. That's wrong. Signed-off -by: Anthony Xu Message-Id: <4712d8f4b26e034e80552f30a67be0b1a2e...@o

[Qemu-devel] [PULL 4/9] tcg/i386: Check the size of instruction being translated

2017-03-27 Thread Paolo Bonzini
From: Pranith Kumar This fixes the bug: 'user-to-root privesc inside VM via bad translation caching' reported by Jann Horn here: https://bugs.chromium.org/p/project-zero/issues/detail?id=1122 Reviewed-by: Richard Henderson CC: Peter Maydell CC: Paolo Bonzini Reported-by: Jann Horn Signed-off

[Qemu-devel] [PULL 9/9] scsi-generic: Fill in opt_xfer_len in INQUIRY reply if it is zero

2017-03-27 Thread Paolo Bonzini
From: Fam Zheng When opt_xfer_len is zero, Linux ignores max_xfer_len erroneously. While that obviously should be fixed, we do older guests a favor to always filling in a value. Signed-off-by: Fam Zheng Message-Id: <20170327142625.1249-1-f...@redhat.com> Signed-off-by: Paolo Bonzini --- hw/s

[Qemu-devel] [PULL 0/9] Misc fixes for QEMU 2.9.0-rc2

2017-03-27 Thread Paolo Bonzini
The following changes since commit 08329701199449bde497570dcfdb9c86062baf20: qom: Fix regression with 'qom-type' (2017-03-23 17:59:40 +) are available in the git repository at: git://github.com/bonzini/qemu.git tags/for-upstream for you to fetch changes up to bed58b4443b001227b953dca80c

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

2017-03-27 Thread Denis V. Lunev
On 03/27/2017 06:45 PM, Max Reitz wrote: > @Subject: Do you mean "PATCH for-2.9?"? Because "RFC" to me means > "please do not merge". ;-) > > I wouldn't mind a change like this to go into 2.9. I am quite sure that problem is here but unsure about the place. Here I use term 'RFC' as 'Can we start th

[Qemu-devel] [PULL 8/9] Revert "apic: save apic_delivered flag"

2017-03-27 Thread Paolo Bonzini
This reverts commit 07bfa354772f2de67008dc66c201b627acff0106. The global variable is only read as part of a apic_reset_irq_delivered(); qemu_irq_raise(s->irq); if (!apic_get_irq_delivered()) { sequence, so the value never matters at migration time. Reported-by

[Qemu-devel] [PULL 6/9] win32: replace custom mutex and condition variable with native primitives

2017-03-27 Thread Paolo Bonzini
From: Andrey Shedel The multithreaded TCG implementation exposed deadlocks in the win32 condition variables: as implemented, qemu_cond_broadcast waited on receivers, whereas the pthreads API it was intended to emulate does not. This was causing a deadlock because broadcast was called while holdin

Re: [Qemu-devel] [PATCH] i386: Allow monitor / mwait cpuid override

2017-03-27 Thread Alexander Graf
On 27/03/2017 17:46, Eduardo Habkost wrote: On Mon, Mar 27, 2017 at 04:26:50PM +0200, Alexander Graf wrote: KVM allows trap and emulate (read: NOP) of the MONITOR and MWAIT instructions. There is work undergoing to enable actual execution of these inside of KVM, but nobody really wants to expo

Re: [Qemu-devel] [PATCH RFC v3 for-2.9 04/11] rbd: Clean up after the previous commit

2017-03-27 Thread Max Reitz
On 27.03.2017 15:26, Markus Armbruster wrote: > This code in qemu_rbd_parse_filename() > > found_str = qemu_rbd_next_tok(p, '\0', &p); > p = found_str; > > has no effect. Drop it, and simplify qemu_rbd_next_tok(). > > Signed-off-by: Markus Armbruster > Reviewed-by: Eric Blake > --- >

Re: [Qemu-devel] [PATCH] i386: Allow monitor / mwait cpuid override

2017-03-27 Thread Paolo Bonzini
On 27/03/2017 18:22, Alexander Graf wrote: >> >> If you really want something that makes QEMU ignore what the >> accel code is reporting, I would prefer a syntax that could be >> used for other features too, like "-cpu ...,monitor=force". > > Is there any QOM property that does this yet? I can't

Re: [Qemu-devel] [PATCH RFC v3 for-2.9 05/11] rbd: Don't accept -drive driver=rbd, keyvalue-pairs=...

2017-03-27 Thread Max Reitz
On 27.03.2017 15:26, Markus Armbruster wrote: > The way we communicate extra key-value pairs from > qemu_rbd_parse_filename() to qemu_rbd_open() exposes option parameter > "keyvalue-pairs" on the command line. It's not wanted there. Hack: > rename the parameter to "=keyvalue-pairs" to make it ina

Re: [Qemu-devel] [PATCH RFC v3 for-2.9 03/11] rbd: Don't limit length of parameter values

2017-03-27 Thread Max Reitz
On 27.03.2017 15:26, Markus Armbruster wrote: > We laboriously enforce parameter values are between one and some > arbitrary limit in length. Only RBD_MAX_IMAGE_NAME_SIZE comes from > librbd.h, and I'm not sure it applies. Where the other limits come > from is unclear. > > Drop the length checki

Re: [Qemu-devel] [PATCH V2] migration: expose qemu_announce_self() via qmp

2017-03-27 Thread Dr. David Alan Gilbert
* Markus Armbruster (arm...@redhat.com) wrote: > "Dr. David Alan Gilbert" writes: > > > * Germano Veit Michel (germ...@redhat.com) wrote: > >> qemu_announce_self() is triggered by qemu at the end of migrations > >> to update the network regarding the path to the guest l2addr. > >> > >> however i

Re: [Qemu-devel] Proposal for deprecating unsupported host OSes & architecutures

2017-03-27 Thread Peter Maydell
On 26 March 2017 at 10:16, Knut Omang wrote: > On Sat, 2017-03-25 at 21:15 +, Peter Maydell wrote: >> On 25 March 2017 at 20:49, Knut Omang wrote: >> > >> > Can we please keep the Sparc support in for a while still? >> >> Yes, John Paul Adrian Glaubitz and the Debian Project have >> kindly pr

Re: [Qemu-devel] [PATCH] i386: Allow monitor / mwait cpuid override

2017-03-27 Thread Eduardo Habkost
On Mon, Mar 27, 2017 at 06:10:43PM +0200, Alexander Graf wrote: > > > On 27/03/2017 17:46, Eduardo Habkost wrote: > > On Mon, Mar 27, 2017 at 04:26:50PM +0200, Alexander Graf wrote: > > > KVM allows trap and emulate (read: NOP) of the MONITOR and MWAIT > > > instructions. There is work undergoing

Re: [Qemu-devel] [PULL 0/6] Block patches for rc2

2017-03-27 Thread Peter Maydell
On 27 March 2017 at 16:52, Max Reitz wrote: > The following changes since commit ea2afcf5b6727a577cf561fd8fe0d8c397ecc927: > > Merge remote-tracking branch 'remotes/stefanha/tags/tracing-pull-request' > into staging (2017-03-24 14:14:18 +) > > are available in the git repository at: > > g

Re: [Qemu-devel] [PULL for-2.9 0/5] fixes for 2.9: vga, egl, cirrus, virtio-input.

2017-03-27 Thread Peter Maydell
/tags/tracing-pull-request' > into staging (2017-03-24 14:14:18 +) > > are available in the git repository at: > > > git://git.kraxel.org/qemu tags/pull-fixes-20170327-1 > > for you to fetch changes up to e5766eb40453b1d22815fc5482802688

Re: [Qemu-devel] [PATCH RFC v3 for-2.9 06/11] rbd: Clean up runtime_opts, fix -drive to reject filename

2017-03-27 Thread Max Reitz
On 27.03.2017 15:26, Markus Armbruster wrote: > runtime_opts is used for three different purposes: > > * qemu_rbd_open() uses it to accept options it recognizes, such as > "pool" and "image". Other .bdrv_open() methods do it similarly. > > * qemu_rbd_open() accepts additional list-valued optio

Re: [Qemu-devel] [PATCH for-2.9 4/5] rbd: Peel off redundant RbdAuthMethod wrapper struct

2017-03-27 Thread Jeff Cody
On Mon, Mar 27, 2017 at 07:58:51AM +0200, Markus Armbruster wrote: > Eric Blake writes: > > > On 03/24/2017 09:10 AM, Jeff Cody wrote: > >> On Fri, Mar 24, 2017 at 08:49:20AM -0500, Eric Blake wrote: > >>> On 03/24/2017 07:42 AM, Jeff Cody wrote: > >>> > Agree. My preference is to leave it

Re: [Qemu-devel] [PATCH RFC v3 for-2.9 07/11] rbd: Clean up qemu_rbd_create()'s detour through QemuOpts

2017-03-27 Thread Max Reitz
On 27.03.2017 15:26, Markus Armbruster wrote: > The conversion from QDict to QemuOpts is pointless. Simply get the > stuff straight from the QDict. > > Signed-off-by: Markus Armbruster > Reviewed-by: Eric Blake > Reviewed-by: Kevin Wolf > --- > block/rbd.c | 20 +--- > 1 file

Re: [Qemu-devel] [PATCH] i386: Allow monitor / mwait cpuid override

2017-03-27 Thread Alexander Graf
On 27/03/2017 18:33, Eduardo Habkost wrote: On Mon, Mar 27, 2017 at 06:10:43PM +0200, Alexander Graf wrote: On 27/03/2017 17:46, Eduardo Habkost wrote: On Mon, Mar 27, 2017 at 04:26:50PM +0200, Alexander Graf wrote: KVM allows trap and emulate (read: NOP) of the MONITOR and MWAIT instructi

[Qemu-devel] [PATCH] iscsi: drop unused IscsiAIOCB.qiov field

2017-03-27 Thread Stefan Hajnoczi
The IscsiAIOCB.qiov field has been unused since commit 063c3378a9e3c25cc0afac3c72e4823d0621e352 ("block/iscsi: introduce bdrv_co_{readv, writev, flush_to_disk}") back in 2013. Signed-off-by: Stefan Hajnoczi --- block/iscsi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/block/iscsi.c b/bloc

Re: [Qemu-devel] [PATCH RFC v3 for-2.9 08/11] rbd: Revert -blockdev and -drive parameter auth-supported

2017-03-27 Thread Max Reitz
On 27.03.2017 15:26, Markus Armbruster wrote: > This reverts half of commit 0a55679. We're having second thoughts on > the QAPI schema (and thus the external interface), and haven't reached > consensus, yet. Issues include: > > * The implementation uses deprecated rados_conf_set() key > "auth_

Re: [Qemu-devel] [PATCH RFC v3 for-2.9 09/11] rbd: Revert -blockdev parameter password-secret

2017-03-27 Thread Max Reitz
On 27.03.2017 15:26, Markus Armbruster wrote: > This reverts a part of commit 8a47e8e. We're having second thoughts > on the QAPI schema (and thus the external interface), and haven't > reached consensus, yet. Issues include: > > * BlockdevOptionsRbd member @password-secret isn't actually a >

Re: [Qemu-devel] [PATCH] iscsi: drop unused IscsiAIOCB.qiov field

2017-03-27 Thread Eric Blake
On 03/27/2017 11:50 AM, Stefan Hajnoczi wrote: > The IscsiAIOCB.qiov field has been unused since commit > 063c3378a9e3c25cc0afac3c72e4823d0621e352 ("block/iscsi: introduce > bdrv_co_{readv, writev, flush_to_disk}") back in 2013. > > Signed-off-by: Stefan Hajnoczi > --- > block/iscsi.c | 1 - > 1

Re: [Qemu-devel] [PATCH RFC v3 for-2.9 08/11] rbd: Revert -blockdev and -drive parameter auth-supported

2017-03-27 Thread Eric Blake
On 03/27/2017 08:26 AM, Markus Armbruster wrote: > This reverts half of commit 0a55679. We're having second thoughts on > the QAPI schema (and thus the external interface), and haven't reached > consensus, yet. Issues include: > > Let's avoid painting ourselves into a corner now, and revert the

Re: [Qemu-devel] [PATCH RFC v3 for-2.9 09/11] rbd: Revert -blockdev parameter password-secret

2017-03-27 Thread Eric Blake
On 03/27/2017 08:26 AM, Markus Armbruster wrote: > This reverts a part of commit 8a47e8e. We're having second thoughts > on the QAPI schema (and thus the external interface), and haven't > reached consensus, yet. Issues include: > > * BlockdevOptionsRbd member @password-secret isn't actually a >

Re: [Qemu-devel] GSoC 2017 Proposal: TCG performance enhancements

2017-03-27 Thread Pranith Kumar
Hi Stefan, On Mon, Mar 27, 2017 at 11:54 AM, Stefan Hajnoczi wrote: > On Sat, Mar 25, 2017 at 12:52:35PM -0400, Pranith Kumar wrote: >> Alex Bennée, who mentored me last year, has agreed to mentor me again this >> time if the proposal is accepted. > > Thanks, the project idea looks good for GSoC.

Re: [Qemu-devel] [PATCH RFC v3 for-2.9 10/11] Revert "rbd: add support for getting password from QCryptoSecret object"

2017-03-27 Thread Eric Blake
On 03/27/2017 08:26 AM, Markus Armbruster wrote: > This reverts commit 60390a2192e7b38aee18db6ce7fb740498709737. > > The commit's rationale > > Currently RBD passwords must be provided on the command line > via > > $QEMU -drive file=rbd:pool/image:id=myname:\ >k

Re: [Qemu-devel] [PATCH RFC v3 for-2.9 11/11] rbd: Fix bugs around -drive parameter "server"

2017-03-27 Thread Eric Blake
On 03/27/2017 08:26 AM, Markus Armbruster wrote: > qemu_rbd_open() takes option parameters as a flattened QDict, with > keys of the form server.%d.host, server.%d.port, where %d counts up > from zero. > > qemu_rbd_array_opts() extracts these values as follows. First, it > calls qdict_array_entrie

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

2017-03-27 Thread Stefan Hajnoczi
On Sun, Mar 26, 2017 at 07:50:35PM -0700, Ashish Mittal wrote: Have you tested live migration? If live migration is not supported then a migration blocker should be added using migrate_add_blocker(). > v10 changelog: > (1) Implemented accepting TLS creds per block device via the CLI > (see 3

[Qemu-devel] packed structures and unaligned accesses (sparc)

2017-03-27 Thread Peter Maydell
At the moment the 9p QEMU tests fail on SPARC. This turns out to be because the test case itself gets a SIGBUS. Looking at the code I guess it makes sense, but I don't understand why the code didn't at least generate a warning. Here's a cutdown testcase: pm215@stadler:~$ cat packed.c #include #in

[Qemu-devel] [PATCH 1/5] virtio: Error object based virtio_error()

2017-03-27 Thread Greg Kurz
This introduces an Error object based implementation of virtio_error(). It allows to implement virtio_error() wrappers in device-specific code. Signed-off-by: Greg Kurz --- hw/virtio/virtio.c | 21 - include/hw/virtio/virtio.h |1 + 2 files changed, 17 insertion

[Qemu-devel] [PATCH 0/5] 9pfs: handle transport errors

2017-03-27 Thread Greg Kurz
The 9p protocol relies on a reliable transport, but the current code treats transport errors (ie, failure to marshal or unmarshal) as if they were coming from the backend. This doesn't make sense: if the transport failed, we should notify the guest that the transport is broken and needs to be reset

Re: [Qemu-devel] [PATCH] xen: additionally restrict xenforeignmemory operations

2017-03-27 Thread Stefano Stabellini
On Mon, 27 Mar 2017, Paul Durrant wrote: > > -Original Message- > [snip] > > > > This is OK but the file is growing too entangled. What do you think of > > the following, which moves the if CONFIG_XEN_CTRL_INTERFACE_VERSION > > < > > 40701 at the top? This way we don't have to add yet anot

[Qemu-devel] [PATCH 5/5] 9pfs: handle broken transport

2017-03-27 Thread Greg Kurz
The 9p protocol is transport agnostic: if an error occurs when copying data to/from the client, this should be handled by the transport layer [1] and the 9p server should simply stop processing requests [2]. [1] can be implemented in the transport marshal/unmarshal handlers. In the case of virtio,

[Qemu-devel] [PATCH 2/5] virtio-9p: factor out virtio_9p_error_err()

2017-03-27 Thread Greg Kurz
When an unrecoverable is hit, we need to set the broken flag of the virtio device, detach the queue element and free it. This is currently open coded in handle_9p_output(). It is fine since this is the only function that can set the broken flag. But if we want to be able to do this from other place

[Qemu-devel] [PATCH 3/5] fsdev: don't allow unknown format in marshal/unmarshal

2017-03-27 Thread Greg Kurz
The code only uses well known format strings. An unknown format token is a bug. Signed-off-by: Greg Kurz --- fsdev/9p-iov-marshal.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fsdev/9p-iov-marshal.c b/fsdev/9p-iov-marshal.c index 1d16f8df4bd4..a1c9beddd2e7 100644 -

Re: [Qemu-devel] [PATCH] debug: made printf always compile in debug output

2017-03-27 Thread Eric Blake
On 03/27/2017 06:50 AM, Danil Antonov wrote: >>From cddb60744808eedbadebdc4f0258ee6db694c4a3 Mon Sep 17 00:00:00 2001 > From: Danil Antonov > Date: Mon, 27 Mar 2017 14:43:10 +0300 > Subject: [PATCH] debug: made printf always compile in debug output > > Wrapped printf calls inside debug macros (DP

[Qemu-devel] [PATCH 4/5] 9pfs: drop pdu_push_and_notify()

2017-03-27 Thread Greg Kurz
Only pdu_complete() needs to notify the client that a request has completed. Signed-off-by: Greg Kurz --- hw/9pfs/9p.c |7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index 48babce836b6..09a8c79cf781 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs

[Qemu-devel] [PATCH for-2.9] tests/virtio-9p-test: Don't call le*_to_cpus on fields of packed struct

2017-03-27 Thread Peter Maydell
For a packed struct like 'P9Hdr' the fields within it may not be aligned as much as the natural alignment for their types. This means it is not valid to pass the address of such a field to a function like le32_to_cpus() which operate on uint32_t* and assume alignment. Doing this results in a SIGBU

Re: [Qemu-devel] [PATCH] i386: Allow monitor / mwait cpuid override

2017-03-27 Thread Eduardo Habkost
On Mon, Mar 27, 2017 at 06:42:49PM +0200, Alexander Graf wrote: > > > On 27/03/2017 18:33, Eduardo Habkost wrote: > > On Mon, Mar 27, 2017 at 06:10:43PM +0200, Alexander Graf wrote: > > > > > > > > > On 27/03/2017 17:46, Eduardo Habkost wrote: > > > > On Mon, Mar 27, 2017 at 04:26:50PM +0200, A

[Qemu-devel] [PATCH for-2.9] tests/bios-tables-test: Don't pass addresses of packed struct fields

2017-03-27 Thread Peter Maydell
Passing the address of a field in a packed struct to a function that expects a pointer to normally aligned data will result in a SEGBUS on architectures like SPARC that have strict alignment requirements. Pass addresses of local variables rather than addresses of packed structure fields to glib fu

Re: [Qemu-devel] [PATCH for-2.9 4/5] rbd: Peel off redundant RbdAuthMethod wrapper struct

2017-03-27 Thread Markus Armbruster
Jeff Cody writes: > On Mon, Mar 27, 2017 at 07:58:51AM +0200, Markus Armbruster wrote: >> Eric Blake writes: >> >> > On 03/24/2017 09:10 AM, Jeff Cody wrote: >> >> On Fri, Mar 24, 2017 at 08:49:20AM -0500, Eric Blake wrote: >> >>> On 03/24/2017 07:42 AM, Jeff Cody wrote: >> >>> >> Agree.

<    1   2   3   >