[Qemu-devel] [PATCH 06/17] cpus: remove ugly cast on sigbus_handler

2017-02-27 Thread Paolo Bonzini
The cast is there because sigbus_handler is invoked via sigfd_handler. But it feels just wrong to use struct qemu_signalfd_siginfo in the prototype of a function that is passed to sigaction. Instead, do a simple-minded conversion of qemu_signalfd_siginfo to siginfo_t. Signed-off-by: Paolo Bonzini

[Qemu-devel] [PATCH 05/17] update Linux headers to 4.11

2017-02-27 Thread Paolo Bonzini
virtio_mmio.h would be deleted; I am leaving it in though it was a mistake to add it. Signed-off-by: Paolo Bonzini --- include/standard-headers/asm-x86/hyperv.h | 8 + include/standard-headers/linux/input-event-codes.h | 2 +- include/standard-headers/linux/pci_regs.h | 25

[Qemu-devel] [PATCH 04/17] update-linux-headers: update for 4.11

2017-02-27 Thread Paolo Bonzini
The linux-headers/asm-arm/unistd.h file has been split in three sub-files, copy them along. However, building them requires setting ARCH rather than SRCARCH. SRCARCH defaults to $(ARCH) anyway; to avoid future occurrence of the same problem use ARCH for all architectures where SRCARCH=ARCH. Curre

[Qemu-devel] [PATCH 10/17] KVM: do not use sigtimedwait to catch SIGBUS

2017-02-27 Thread Paolo Bonzini
Call kvm_on_sigbus_vcpu asynchronously from the VCPU thread. Information for the SIGBUS can be stored in thread-local variables and processed later in kvm_cpu_exec. Signed-off-by: Paolo Bonzini --- cpus.c | 31 +-- include/sysemu/kvm.h | 5 - kvm-al

[Qemu-devel] [PATCH 17/17] qmp-events: fix GUEST_PANICKED description formatting

2017-02-27 Thread Paolo Bonzini
From: Anton Nefedov Signed-off-by: Anton Nefedov Signed-off-by: Denis V. Lunev CC: Paolo Bonzini CC: Eric Blake Message-Id: <1487614915-18710-4-git-send-email-...@openvz.org> Signed-off-by: Paolo Bonzini --- qapi/event.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --g

[Qemu-devel] [PATCH 08/17] cpus: reorganize signal handling code

2017-02-27 Thread Paolo Bonzini
Move the KVM "eat signals" code under CONFIG_LINUX, in preparation for moving it to kvm-all.c; reraise non-MCE SIGBUS immediately, without passing it to KVM. Signed-off-by: Paolo Bonzini --- cpus.c | 63 ++-- include/qemu/osdep.h | 9

[Qemu-devel] [PATCH 07/17] KVM: x86: cleanup SIGBUS handlers

2017-02-27 Thread Paolo Bonzini
This patch should have no semantic change. Signed-off-by: Paolo Bonzini --- target/i386/kvm.c | 81 --- 1 file changed, 42 insertions(+), 39 deletions(-) diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 27fd050..0c48dfd 100644 --- a/ta

[Qemu-devel] [PATCH 14/17] vmxcap: port to Python 3

2017-02-27 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- scripts/kvm/vmxcap | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/kvm/vmxcap b/scripts/kvm/vmxcap index 2220255..af8de15 100755 --- a/scripts/kvm/vmxcap +++ b/scripts/kvm/vmxcap @@ -27,9 +27,9 @@ MSR_IA32_VMX_VMFUNC = 0x

[Qemu-devel] [PATCH 12/17] kvm: use atomic_read/atomic_set to access cpu->exit_request

2017-02-27 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- kvm-all.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 5bbdc44..1c6f117 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -1931,7 +1931,7 @@ int kvm_cpu_exec(CPUState *cpu) DPRINTF("kvm_cpu_exec()\n"); i

Re: [Qemu-devel] Fail to start 2nd guest

2017-02-27 Thread Xiong Zhou
On Mon, Feb 27, 2017 at 10:11:04AM +, Stefan Hajnoczi wrote: > On Mon, Feb 27, 2017 at 05:40:50PM +0800, Xiong Zhou wrote: > > It worked fine on Linus tree commit: > > 7bb0338 Merge tag 'rodata-v4.11-rc1' of git://git.kernel.org/pub/scm/.. > > > > failed to start 2nd domain on this commit: >

[Qemu-devel] [PATCH 13/17] KVM: use KVM_CAP_IMMEDIATE_EXIT

2017-02-27 Thread Paolo Bonzini
The purpose of the KVM_SET_SIGNAL_MASK API is to let userspace "kick" a VCPU out of KVM_RUN through a POSIX signal. A signal is attached to a dummy signal handler; by blocking the signal outside KVM_RUN and unblocking it inside, this possible race is closed: VCPU thread

[Qemu-devel] [PATCH 15/17] vmxcap: update for September 2016 SDM

2017-02-27 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- scripts/kvm/vmxcap | 9 + 1 file changed, 9 insertions(+) diff --git a/scripts/kvm/vmxcap b/scripts/kvm/vmxcap index af8de15..d9a6db0 100755 --- a/scripts/kvm/vmxcap +++ b/scripts/kvm/vmxcap @@ -170,9 +170,13 @@ controls = [ 12: 'Enable INVPC

[Qemu-devel] [PATCH 11/17] KVM: move SIG_IPI handling to kvm-all.c

2017-02-27 Thread Paolo Bonzini
This lets us remove a bunch of CONFIG_LINUX defines. Signed-off-by: Paolo Bonzini --- cpus.c | 62 +--- include/sysemu/kvm.h | 5 ++--- kvm-all.c| 60 +- kvm-stub.c

Re: [Qemu-devel] [PULL 11/24] tcg: enable thread-per-vCPU

2017-02-27 Thread Laurent Vivier
Le 24/02/2017 à 12:20, Alex Bennée a écrit : > There are a couple of changes that occur at the same time here: > > - introduce a single vCPU qemu_tcg_cpu_thread_fn > > One of these is spawned per vCPU with its own Thread and Condition > variables. qemu_tcg_rr_cpu_thread_fn is the new name f

[Qemu-devel] [PATCH] option: Tweak invalid size error message and unbreak iotest 049

2017-02-27 Thread Markus Armbruster
Commit 75cdcd1 neglected to update tests/qemu-iotests/049.out, and made the error message for negative size worse. Fix that. Reported-by: Thomas Huth Signed-off-by: Markus Armbruster --- tests/qemu-iotests/049.out | 14 +- util/qemu-option.c | 2 +- 2 files changed, 10 ins

[Qemu-devel] [PATCH 16/17] qapi: flatten GuestPanicInformation union

2017-02-27 Thread Paolo Bonzini
From: Anton Nefedov Signed-off-by: Anton Nefedov Signed-off-by: Denis V. Lunev CC: Paolo Bonzini CC: Eric Blake Message-Id: <1487614915-18710-3-git-send-email-...@openvz.org> Signed-off-by: Paolo Bonzini --- qapi-schema.json | 12 target/i386/cpu.c | 15 ++- vl.c

Re: [Qemu-devel] [PATCH v16 09/22] qcow2: autoloading dirty bitmaps

2017-02-27 Thread Max Reitz
On 25.02.2017 18:07, Vladimir Sementsov-Ogievskiy wrote: > Auto loading bitmaps are bitmaps in Qcow2, with the AUTO flag set. They > are loaded when the image is opened and become BdrvDirtyBitmaps for the > corresponding drive. > > Extra data in bitmaps is not supported for now. > > Signed-off-by

Re: [Qemu-devel] [PATCH v2 07/28] 9pfs: local: lgetxattr: don't follow symlinks

2017-02-27 Thread Stefan Hajnoczi
On Sun, Feb 26, 2017 at 11:42:26PM +0100, Greg Kurz wrote: > The local_lgetxattr() callback is vulnerable to symlink attacks because > it calls lgetxattr() which follows symbolic links in all path elements but > the rightmost one. > > This patch introduces a helper to emulate the non-existing fget

Re: [Qemu-devel] [PULL 08/24] tcg: drop global lock during TCG code execution

2017-02-27 Thread Laurent Desnogues
Hello, On Fri, Feb 24, 2017 at 12:20 PM, Alex Bennée wrote: > From: Jan Kiszka > > This finally allows TCG to benefit from the iothread introduction: Drop > the global mutex while running pure TCG CPU code. Reacquire the lock > when entering MMIO or PIO emulation, or when leaving the TCG loop. >

Re: [Qemu-devel] [PATCH v2 08/28] 9pfs: local: llistxattr: don't follow symlinks

2017-02-27 Thread Stefan Hajnoczi
On Sun, Feb 26, 2017 at 11:42:34PM +0100, Greg Kurz wrote: > The local_llistxattr() callback is vulnerable to symlink attacks because > it calls llistxattr() which follows symbolic links in all path elements but > the rightmost one. > > This patch introduces a helper to emulate the non-existing fl

Re: [Qemu-devel] [PATCH v2 06/28] 9pfs: local: open/opendir: don't follow symlinks

2017-02-27 Thread Stefan Hajnoczi
On Sun, Feb 26, 2017 at 11:42:18PM +0100, Greg Kurz wrote: > @@ -48,6 +49,24 @@ typedef struct { > int mountfd; > } LocalData; > > +int local_open_nofollow(FsContext *fs_ctx, const char *path, int flags, > +mode_t mode) > +{ > +LocalData *data = fs_ctx->private;

[Qemu-devel] [PATCH V3] hw/pxb-pcie: fix PCI Express hotplug support

2017-02-27 Thread Marcel Apfelbaum
Add the missing osc method for pxb-pcie devices as APCI spec recommends, see 6.2.10.3 OSC Implementation Example for PCI Host Bridge Devices, ACPI 5.0: It is recommended that a machine with multiple host bridge devices should report the same capabilities for all host bridges, and also

Re: [Qemu-devel] [PATCH v2 22/28] 9pfs: local: chmod: don't follow symlinks

2017-02-27 Thread Stefan Hajnoczi
On Sun, Feb 26, 2017 at 11:44:28PM +0100, Greg Kurz wrote: > The local_chmod() callback is vulnerable to symlink attacks because it > calls: > > (1) chmod() which follows symbolic links for all path elements > (2) local_set_xattr()->setxattr() which follows symbolic links for all > path elemen

Re: [Qemu-devel] [PATCH v2 27/28] 9pfs: local: open2: don't follow symlinks

2017-02-27 Thread Stefan Hajnoczi
On Sun, Feb 26, 2017 at 11:45:09PM +0100, Greg Kurz wrote: > The local_open2() callback is vulnerable to symlink attacks because it > calls: > > (1) open() which follows symbolic links for all path elements but the > rightmost one > (2) local_set_xattr()->setxattr() which follows symbolic link

Re: [Qemu-devel] [PATCH v2 10/28] 9pfs: local: lremovexattr: don't follow symlinks

2017-02-27 Thread Stefan Hajnoczi
On Sun, Feb 26, 2017 at 11:42:51PM +0100, Greg Kurz wrote: > The local_lremovexattr() callback is vulnerable to symlink attacks because > it calls lremovexattr() which follows symbolic links in all path elements > but the rightmost one. > > This patch introduces a helper to emulate the non-existin

Re: [Qemu-devel] [libvirt] Question regarding Snapshots

2017-02-27 Thread Kashyap Chamarthy
On Mon, Feb 27, 2017 at 01:33:56PM +0100, Kashyap Chamarthy wrote: [...] > > > Can you make a snapshot, then go back to the base and ignore that snapshot > > > like a closed branch, make another snapshot, and then go back and forth > > > from each to each? > > If you edit the '--disk' element as

Re: [Qemu-devel] [PATCH v2 09/28] 9pfs: local: lsetxattr: don't follow symlinks

2017-02-27 Thread Stefan Hajnoczi
On Sun, Feb 26, 2017 at 11:42:43PM +0100, Greg Kurz wrote: > The local_lsetxattr() callback is vulnerable to symlink attacks because > it calls lsetxattr() which follows symbolic links in all path elements but > the rightmost one. > > This patch introduces a helper to emulate the non-existing fset

Re: [Qemu-devel] [PATCH 2/4] block/rbd: code movement

2017-02-27 Thread Jeff Cody
On Mon, Feb 27, 2017 at 09:28:56AM +, Daniel P. Berrange wrote: > > Describing this as "code movement" when the added & removed chunks are not > identical is a bit misleading. > > Can you expand the commit message to explain why the extra options are > being added Ah, sorry - yes. The lack

Re: [Qemu-devel] [PATCH v2 11/28] 9pfs: local: unlinkat: don't follow symlinks

2017-02-27 Thread Stefan Hajnoczi
On Sun, Feb 26, 2017 at 11:43:00PM +0100, Greg Kurz wrote: > The local_unlinkat() callback is vulnerable to symlink attacks because it > calls remove() which follows symbolic links in all path elements but the > rightmost one. > > This patch converts local_unlinkat() to rely on opendir_nofollow()

Re: [Qemu-devel] [PATCH] null-machine: Add support for the "-kernel" parameter

2017-02-27 Thread Marcel Apfelbaum
On 02/27/2017 01:43 PM, Thomas Huth wrote: On 25.01.2017 09:40, Thomas Huth wrote: We can have basic support for the "-kernel" parameter quite easily by using the generic loader device. This should be enough for most boards which do not need special machine-specific magic for loading a kernel (a

Re: [Qemu-devel] [PATCH] os: don't corrupt pre-existing memory-backend data with prealloc

2017-02-27 Thread Stefan Hajnoczi
On Fri, Feb 24, 2017 at 05:27:14PM +, Daniel P. Berrange wrote: > When using a memory-backend object with prealloc turned on, QEMU > will memset() the first byte in every memory page to zero. While > this might have been acceptable for memory backends associated > with RAM, this corrupts applic

Re: [Qemu-devel] [PATCH 4/4] block/rbd: Add blockdev-add support

2017-02-27 Thread Jeff Cody
On Mon, Feb 27, 2017 at 09:31:21AM +, Daniel P. Berrange wrote: > On Mon, Feb 27, 2017 at 02:36:13AM -0500, Jeff Cody wrote: > > On Mon, Feb 27, 2017 at 02:30:41AM -0500, Jeff Cody wrote: > > > Signed-off-by: Jeff Cody > > > --- > > > qapi/block-core.json | 47

Re: [Qemu-devel] [PATCH v2 25/28] 9pfs: local: mknod: don't follow symlinks

2017-02-27 Thread Stefan Hajnoczi
On Sun, Feb 26, 2017 at 11:44:54PM +0100, Greg Kurz wrote: > The local_mknod() callback is vulnerable to symlink attacks because it > calls: > > (1) mknod() which follows symbolic links for all path elements but the > rightmost one > (2) local_set_xattr()->setxattr() which follows symbolic lin

Re: [Qemu-devel] [PATCH V2] qemu-img: make convert async

2017-02-27 Thread Stefan Hajnoczi
On Mon, Feb 27, 2017 at 12:03:14PM +0100, Peter Lieven wrote: > the convert process is currently completely implemented with sync operations. > That means it reads one buffer and then writes it. No parallelism and each > sync > request takes as long as it takes until it is completed. > > This can

[Qemu-devel] [PATCH] ui: Use XkbGetMap and XkbGetNames instead of XkbGetKeyboard

2017-02-27 Thread Daniel P. Berrange
XkbGetKeyboard does not work in XWayland and even on non-Wayland X11 servers its use is discouraged: https://bugs.freedesktop.org/show_bug.cgi?id=89240 This resolves a problem whereby QEMU prints "could not lookup keycode name" on startup when running under XWayland. Keymap handling is howe

Re: [Qemu-devel] [PATCH 4/4] block/rbd: Add blockdev-add support

2017-02-27 Thread Daniel P. Berrange
On Mon, Feb 27, 2017 at 08:18:59AM -0500, Jeff Cody wrote: > On Mon, Feb 27, 2017 at 09:31:21AM +, Daniel P. Berrange wrote: > > On Mon, Feb 27, 2017 at 02:36:13AM -0500, Jeff Cody wrote: > > > On Mon, Feb 27, 2017 at 02:30:41AM -0500, Jeff Cody wrote: > > > > Signed-off-by: Jeff Cody > > > >

[Qemu-devel] [PULL v1 0/3] Merge qio 2017/02/27

2017-02-27 Thread Daniel P. Berrange
The following changes since commit d992f2f1368ceb92e6bfd8efece174110f4236ff: Merge remote-tracking branch 'remotes/artyom/tags/pull-sun4v-20170226' into staging (2017-02-26 22:40:23 +) are available in the git repository at: git://github.com/berrange/qemu tags/pull-qio-2017-02-27-1 for

Re: [Qemu-devel] [PATCH v2 00/28] Series short description

2017-02-27 Thread Stefan Hajnoczi
On Sun, Feb 26, 2017 at 11:41:32PM +0100, Greg Kurz wrote: > This series tries to fix CVE-2016-9602 reported by Jann Horn of Google > Project Zero: > > https://bugzilla.redhat.com/show_bug.cgi?id=1413929 > > This vulnerability affects all accesses to the underlying filesystem in > the "local" bac

Re: [Qemu-devel] Fail to start 2nd guest

2017-02-27 Thread Stefan Hajnoczi
On Mon, Feb 27, 2017 at 08:50:03PM +0800, Xiong Zhou wrote: > On Mon, Feb 27, 2017 at 10:11:04AM +, Stefan Hajnoczi wrote: > > On Mon, Feb 27, 2017 at 05:40:50PM +0800, Xiong Zhou wrote: > > > It worked fine on Linus tree commit: > > > 7bb0338 Merge tag 'rodata-v4.11-rc1' of git://git.kernel.

[Qemu-devel] [PULL v1 3/3] tests: fix leaks in test-io-channel-command

2017-02-27 Thread Daniel P. Berrange
From: Marc-André Lureau No need for strdup, fix leaks when socat is missing. Spotted by ASAN. Signed-off-by: Marc-André Lureau Signed-off-by: Daniel P. Berrange --- tests/test-io-channel-command.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/test-io-channel

Re: [Qemu-devel] Non-flat command line option argument syntax

2017-02-27 Thread Markus Armbruster
Kevin Wolf writes: > Am 27.02.2017 um 11:27 hat Markus Armbruster geschrieben: >> Markus Armbruster writes: >> >> [...] >> > === Dotted keys === >> > >> > One sufficiently powerful syntax extension already exists: the dotted >> > key convention. It's syntactically unambiguous only when none of

Re: [Qemu-devel] [PATCH v2 1/2] hw/arm/exynos: Fix Linux kernel division by zero for PLLs

2017-02-27 Thread Peter Maydell
On 26 February 2017 at 20:01, Krzysztof Kozlowski wrote: > Without any clock controller, the Linux kernel was hitting division by > zero during boot or with clk_summary: > [0.00] [] (unwind_backtrace) from [] > (show_stack+0x10/0x14) > [0.00] [] (show_stack) from [] > (dump_stack

Re: [Qemu-devel] [libvirt] Fail to start 2nd guest

2017-02-27 Thread Peter Krempa
On Mon, Feb 27, 2017 at 13:31:30 +, Stefan Hajnoczi wrote: > On Mon, Feb 27, 2017 at 08:50:03PM +0800, Xiong Zhou wrote: > > On Mon, Feb 27, 2017 at 10:11:04AM +, Stefan Hajnoczi wrote: > > > On Mon, Feb 27, 2017 at 05:40:50PM +0800, Xiong Zhou wrote: [...] > > > > sh-4.2# virsh start 73u

[Qemu-devel] [PATCH v2 00/21] chardev clean-ups & tests

2017-02-27 Thread Marc-André Lureau
Hi, The following series contains various patches: - replace "chardevs" list for a /chardevs container object - add a few read-only socket properties mainly useful for testing - some chardev related clean-ups - add various chardev tests This series is part of a larger refactoring series that I tr

[Qemu-devel] [PULL v1 1/2] crypto: fix leak in ivgen essiv init

2017-02-27 Thread Daniel P. Berrange
From: Li Qiang On error path, the 'salt' doesn't been freed thus leading a memory leak. This patch avoid this. Signed-off-by: Li Qiang Signed-off-by: Daniel P. Berrange --- crypto/ivgen-essiv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/crypto/ivgen-essiv.c b/crypto/ivgen-essiv.c ind

[Qemu-devel] [PULL v1 1/3] io: fix decoding when multiple websockets frames arrive at once

2017-02-27 Thread Daniel P. Berrange
The qio_channel_websock_read_wire() method will read upto 4096 bytes off the socket and then decode the websockets header and payload. The code was only decoding a single websockets frame, even if the buffered data contained multiple frames. This meant that decoding of subsequent frames was delayed

Re: [Qemu-devel] [PATCH 4/4] block/rbd: Add blockdev-add support

2017-02-27 Thread Jeff Cody
On Mon, Feb 27, 2017 at 01:30:46PM +, Daniel P. Berrange wrote: > On Mon, Feb 27, 2017 at 08:18:59AM -0500, Jeff Cody wrote: > > On Mon, Feb 27, 2017 at 09:31:21AM +, Daniel P. Berrange wrote: > > > On Mon, Feb 27, 2017 at 02:36:13AM -0500, Jeff Cody wrote: > > > > On Mon, Feb 27, 2017 at 0

[Qemu-devel] [PATCH v2 02/21] mux: simplfy muxes_realize_done

2017-02-27 Thread Marc-André Lureau
mux_chr_event() already send events to all backends, rename it, export it, and use it from muxes_realize_done. This should help abstract away mux implementation. Signed-off-by: Marc-André Lureau --- chardev/char-mux.h | 2 +- chardev/char-mux.c | 11 --- chardev/char.c | 9 ++--

Re: [Qemu-devel] [PATCH] tests-aio-multithread: use atomic_read properly

2017-02-27 Thread Peter Maydell
On 27 February 2017 at 12:01, Greg Kurz wrote: > On Mon, 27 Feb 2017 12:17:26 +0100 > Paolo Bonzini wrote: > >> nodes[id].next is written by other threads. If atomic_read is not used >> (matching atomic_set in mcs_mutex_lock!) the compiler can optimize the >> whole "if" away! >> >> Reported-by:

[Qemu-devel] [PULL v1 2/3] io: ignore case in WebSocket HTTP header

2017-02-27 Thread Daniel P. Berrange
From: Anton Nefedov According to RFC7230 Section 3.2, header field name is case-insensitive. The haystack string length is limited by 4096 bytes by qio_channel_websock_handshake_read(). Further, handshake_process() dups and NULL-terminates the string so it is safe to call non length-limited fun

[Qemu-devel] [PATCH v2 07/21] char: use /chardevs container instead of chardevs list

2017-02-27 Thread Marc-André Lureau
Use object_resolve_path_component() and object_child_foreach() on /chardevs container instead of iterating over chardevs list. Signed-off-by: Marc-André Lureau --- chardev/char.c | 66 -- 1 file changed, 36 insertions(+), 30 deletions(-) d

[Qemu-devel] [PATCH v2 06/21] vl: add todo note about root container cleanup

2017-02-27 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- vl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/vl.c b/vl.c index e10a27bdd6..63e1665bf8 100644 --- a/vl.c +++ b/vl.c @@ -4685,6 +4685,7 @@ int main(int argc, char **argv, char **envp) audio_cleanup(); monitor_cleanup(); qemu_chr_cleanu

[Qemu-devel] [PATCH v2 01/21] char: remove qemu_chr_be_generic_open

2017-02-27 Thread Marc-André Lureau
The function simply alias and hides the real event function. Signed-off-by: Marc-André Lureau --- include/sysemu/char.h | 1 - chardev/char-pty.c| 2 +- chardev/char-socket.c | 2 +- chardev/char.c| 10 ++ ui/console.c | 2 +- ui/gtk.c | 2 +- 6 fil

Re: [Qemu-devel] [PATCH v16 11/22] block: introduce persistent dirty bitmaps

2017-02-27 Thread Max Reitz
On 25.02.2017 18:07, Vladimir Sementsov-Ogievskiy wrote: > New field BdrvDirtyBitmap.persistent means, that bitmap should be saved > on bdrv_close, using format driver. Somehow this sentence stays valid, but it has a much different meaning now. bdrv_close() no longer directly takes care of saving

[Qemu-devel] [PATCH v2 10/21] char: useless NULL check

2017-02-27 Thread Marc-André Lureau
g_strdup(NULL) returns NULL already. Signed-off-by: Marc-André Lureau --- chardev/char.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chardev/char.c b/chardev/char.c index 558fd8b31c..bb20d73fcf 100644 --- a/chardev/char.c +++ b/chardev/char.c @@ -764,7 +764,7 @@ void qemu

[Qemu-devel] [PATCH v2 04/21] container: don't leak container reference

2017-02-27 Thread Marc-André Lureau
object_property_add_child() references the child, unref it after to avoid ref leaks. Signed-off-by: Marc-André Lureau --- qom/container.c | 1 + 1 file changed, 1 insertion(+) diff --git a/qom/container.c b/qom/container.c index c9eb49b01e..f6ccaf7ea7 100644 --- a/qom/container.c +++ b/qom/cont

[Qemu-devel] [PATCH v2 14/21] char-socket: add 'connected' property

2017-02-27 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- chardev/char-socket.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/chardev/char-socket.c b/chardev/char-socket.c index 393b315225..412dcef85d 100644 --- a/chardev/char-socket.c +++ b/chardev/char-socket.c @@ -1015,6 +1015,14 @@ char_socket_

[Qemu-devel] [PULL v1 0/2] Merge qcrypto 2017/02/27

2017-02-27 Thread Daniel P. Berrange
The following changes since commit d992f2f1368ceb92e6bfd8efece174110f4236ff: Merge remote-tracking branch 'remotes/artyom/tags/pull-sun4v-20170226' into staging (2017-02-26 22:40:23 +) are available in the git repository at: git://github.com/berrange/qemu tags/pull-qcrypto-2017-02-27-1

[Qemu-devel] [PATCH v2 13/21] char-socket: add 'addr' property

2017-02-27 Thread Marc-André Lureau
Add a property to lookup the connection details. Signed-off-by: Marc-André Lureau --- chardev/char-socket.c | 13 + 1 file changed, 13 insertions(+) diff --git a/chardev/char-socket.c b/chardev/char-socket.c index dbf2c54639..393b315225 100644 --- a/chardev/char-socket.c +++ b/chard

[Qemu-devel] [PATCH v2 08/21] char: remove qemu_chardev_add

2017-02-27 Thread Marc-André Lureau
qemu_chardev_new() now uses object_new_with_props() with /chardevs parent container. It will fail to insert the object if the same "id" already exists. "chardevs" list usage has been removed in previous commits. Signed-off-by: Marc-André Lureau --- chardev/char.c | 27 ---

[Qemu-devel] [PATCH v2 15/21] char-udp: flush as much buffer as possible

2017-02-27 Thread Marc-André Lureau
Instead of flushing the buffer byte by byte, call qemu_chr_be_write() with as much byte possible accepted by the front-end. Factor out buffer flushing in a common function udp_chr_flush_buffer(). Signed-off-by: Marc-André Lureau --- chardev/char-udp.c | 26 +++--- 1 file cha

[Qemu-devel] [PULL v1 2/2] crypto: assert cipher algorithm is always valid

2017-02-27 Thread Daniel P. Berrange
From: Prasad J Pandit Crypto routines 'qcrypto_cipher_get_block_len' and 'qcrypto_cipher_get_key_len' return non-zero cipher block and key lengths from static arrays 'alg_block_len[]' and 'alg_key_len[]' respectively. Returning 'zero(0)' value from either of them would likely lead to an error con

[Qemu-devel] [PATCH v2 09/21] char: remove chardevs list

2017-02-27 Thread Marc-André Lureau
The list is now empty, the chardev cleanup is taken care of by the unref of the root container. Signed-off-by: Marc-André Lureau --- include/sysemu/char.h | 1 - chardev/char.c| 6 -- 2 files changed, 7 deletions(-) diff --git a/include/sysemu/char.h b/include/sysemu/char.h index 98

[Qemu-devel] [PATCH v2 18/21] tests: add /char/file test

2017-02-27 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- tests/test-char.c | 71 +++ 1 file changed, 71 insertions(+) diff --git a/tests/test-char.c b/tests/test-char.c index 2b155ffcb7..87a4e2986d 100644 --- a/tests/test-char.c +++ b/tests/test-char.c @@ -277,6 +

[Qemu-devel] [PATCH v2 19/21] tests: add /char/socket test

2017-02-27 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- tests/test-char.c | 114 +- 1 file changed, 112 insertions(+), 2 deletions(-) diff --git a/tests/test-char.c b/tests/test-char.c index 87a4e2986d..9971498391 100644 --- a/tests/test-char.c +++ b/tests/test-c

[Qemu-devel] [PATCH v2 03/21] xen: use a better chardev type check

2017-02-27 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- xen-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xen-common.c b/xen-common.c index fd2c92847e..d46685ef4e 100644 --- a/xen-common.c +++ b/xen-common.c @@ -34,7 +34,7 @@ static int store_dev_info(int domid, Chardev *cs, const cha

[Qemu-devel] [PATCH v2 12/21] char-socket: update local address after listen

2017-02-27 Thread Marc-André Lureau
This is mainly useful to know the actual bound port when using port 0. For example, when starting qemu with socket on port 0, before: QEMU waiting for connection on: disconnected:tcp:localhost:0,server After: QEMU waiting for connection on: disconnected:tcp:localhost:32454,server Signed-off-by: M

[Qemu-devel] [PATCH v2 20/21] tests: add /char/udp test

2017-02-27 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- tests/test-char.c | 46 ++ 1 file changed, 46 insertions(+) diff --git a/tests/test-char.c b/tests/test-char.c index 9971498391..19707bfcda 100644 --- a/tests/test-char.c +++ b/tests/test-char.c @@ -385,6 +385,51 @@

Re: [Qemu-devel] [PATCH] os: don't corrupt pre-existing memory-backend data with prealloc

2017-02-27 Thread Rik van Riel
On Mon, 2017-02-27 at 11:10 +, Stefan Hajnoczi wrote: > On Thu, Feb 23, 2017 at 10:59:22AM +, Daniel P. Berrange wrote: > > When using a memory-backend object with prealloc turned on, QEMU > > will memset() the first byte in every memory page to zero. While > > this might have been acceptab

[Qemu-devel] [PATCH v2 05/21] char: add a /chardevs container

2017-02-27 Thread Marc-André Lureau
Add a /chardevs container object to hold the list of chardevs. (Note: QTAILQ chardevs is going away in the following commits) Signed-off-by: Marc-André Lureau --- include/sysemu/char.h | 8 --- chardev/char.c | 57 +++-- gdbstub.c

[Qemu-devel] [PATCH v2 17/21] tests: add /char/pipe test

2017-02-27 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- tests/test-char.c | 90 +++ 1 file changed, 90 insertions(+) diff --git a/tests/test-char.c b/tests/test-char.c index 2811644bcd..2b155ffcb7 100644 --- a/tests/test-char.c +++ b/tests/test-char.c @@ -1,4 +1,

[Qemu-devel] [PATCH v2 11/21] char-socket: introduce update_disconnected_filename()

2017-02-27 Thread Marc-André Lureau
This helper will be used in yet another place in the following patch. Signed-off-by: Marc-André Lureau --- chardev/char-socket.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/chardev/char-socket.c b/chardev/char-socket.c index d201f869f8..636a6ea5fa 100644

Re: [Qemu-devel] [PATCH v2 11/30] tests: fix hd-geo-test leaks

2017-02-27 Thread Markus Armbruster
Marc-André Lureau writes: > Spotted by ASAN. > > Signed-off-by: Marc-André Lureau > --- > tests/hd-geo-test.c | 47 +++ > 1 file changed, 31 insertions(+), 16 deletions(-) > > diff --git a/tests/hd-geo-test.c b/tests/hd-geo-test.c > index 6176e81ab2..

Re: [Qemu-devel] [PATCH 4/4] block/rbd: Add blockdev-add support

2017-02-27 Thread Daniel P. Berrange
On Mon, Feb 27, 2017 at 02:30:41AM -0500, Jeff Cody wrote: > Signed-off-by: Jeff Cody > --- > qapi/block-core.json | 47 --- > 1 file changed, 44 insertions(+), 3 deletions(-) > > diff --git a/qapi/block-core.json b/qapi/block-core.json > index 5f82d35

[Qemu-devel] [Bug 1668273] [NEW] DDoS possible on - a QEMU process using userspace SLIRP?

2017-02-27 Thread Nehal J Wani
Public bug reported: Steps to reproduce: - Launch a VM using QEMU (2.8.0): $ qemu-system-x86_64 \ -machine accel=kvm \ -hda Fedora-Cloud-Base-25-1.3.x86_64.qcow2 \ -m 2G \ -smp 2 \ -vnc :8 \ -boot dc \ -vga std \ -cpu host \ -net nic,vlan=0 \ -net user,vla

[Qemu-devel] [PATCH v2 21/21] tests: add /char/console test

2017-02-27 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- tests/test-char.c | 31 ++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/tests/test-char.c b/tests/test-char.c index 19707bfcda..773a1c36ba 100644 --- a/tests/test-char.c +++ b/tests/test-char.c @@ -57,6 +57,32 @@ s

[Qemu-devel] [PATCH v2 16/21] tests: add alias check in /char/ringbuf

2017-02-27 Thread Marc-André Lureau
Signed-off-by: Marc-André Lureau --- tests/test-char.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/tests/test-char.c b/tests/test-char.c index 71de4b35ee..2811644bcd 100644 --- a/tests/test-char.c +++ b/tests/test-char.c @@ -104,6 +104,16 @@ static void char_ringbuf_test(void)

Re: [Qemu-devel] [PATCH v2 3/5] migration/vmstate: fix array of ptr with nullptrs

2017-02-27 Thread Halil Pasic
On 02/24/2017 01:29 PM, Dr. David Alan Gilbert wrote: > * Halil Pasic (pa...@linux.vnet.ibm.com) wrote: >> Make VMS_ARRAY_OF_POINTER cope with null pointers. Previously the >> reward for trying to migrate an array with some null pointers in it was >> an illegal memory access, that is a swift and

Re: [Qemu-devel] [PATCH] os: don't corrupt pre-existing memory-backend data with prealloc

2017-02-27 Thread Daniel P. Berrange
On Mon, Feb 27, 2017 at 08:46:10AM -0500, Rik van Riel wrote: > On Mon, 2017-02-27 at 11:10 +, Stefan Hajnoczi wrote: > > On Thu, Feb 23, 2017 at 10:59:22AM +, Daniel P. Berrange wrote: > > > When using a memory-backend object with prealloc turned on, QEMU > > > will memset() the first byte

Re: [Qemu-devel] [PATCH] null-machine: Add support for the "-kernel" parameter

2017-02-27 Thread Eduardo Habkost
On Mon, Feb 27, 2017 at 12:43:23PM +0100, Thomas Huth wrote: > On 25.01.2017 09:40, Thomas Huth wrote: > > We can have basic support for the "-kernel" parameter quite easily > > by using the generic loader device. This should be enough for most > > boards which do not need special machine-specific

[Qemu-devel] [PATCH v4 02/26] ppc/xics: fix ICP and ICS reset

2017-02-27 Thread Cédric Le Goater
commit 5b17c7207938 ("xics: XICS should not be a SysBusDevice") changed the nature of the XICS object to be a descendent of TYPE_DEVICE. By doing so, the object is not on a bus and its reset handler is not called anymore. The direct consequence is that the ICP and ICS objects are not correctly init

Re: [Qemu-devel] [PULL v1 0/3] Merge qio 2017/02/27

2017-02-27 Thread no-reply
Hi, This series failed automatic build test. Please find the testing commands and their output below. If you have docker installed, you can probably reproduce it locally. Message-id: 20170227133531.31874-1-berra...@redhat.com Type: series Subject: [Qemu-devel] [PULL v1 0/3] Merge qio 2017/02/27

Re: [Qemu-devel] [PATCH] tests-aio-multithread: use atomic_read properly

2017-02-27 Thread Stefan Hajnoczi
On Mon, Feb 27, 2017 at 12:17:26PM +0100, Paolo Bonzini wrote: > nodes[id].next is written by other threads. If atomic_read is not used > (matching atomic_set in mcs_mutex_lock!) the compiler can optimize the > whole "if" away! > > Reported-by: Alex Bennée > Signed-off-by: Paolo Bonzini > --- >

[Qemu-devel] [PATCH v4 04/26] ppc/xics: remove set_nr_servers() handler from XICSStateClass

2017-02-27 Thread Cédric Le Goater
Today, the ICP (Interrupt Controller Presenter) objects are created by the 'nr_servers' property handler of the XICS object and a class handler. They are realized in the XICS object realize routine. Let's simplify the process by creating the ICP objects along with the XICS object at the machine le

Re: [Qemu-devel] [PATCH v2 12/30] tests: fix bios-tables-test leak

2017-02-27 Thread Markus Armbruster
Marc-André Lureau writes: > The inside array should be free too. > Spotted by ASAN. > > Signed-off-by: Marc-André Lureau > --- > tests/bios-tables-test.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c > index 54048050

[Qemu-devel] [PATCH v4 00/26] ppc/xics: simplify ICS and ICP creation

2017-02-27 Thread Cédric Le Goater
Hello, The goal behind this series is to simplify the XICS interface by moving back in the machine the way the ICS and ICP objects interact together. It's up to the machine to implement this "fabric" logic by providing a set of handlers of a QOM interface. These handlers are used to grab an ICS o

Re: [Qemu-devel] [PATCH v2 19/30] tests: fix i440fx-test leaks

2017-02-27 Thread Markus Armbruster
Marc-André Lureau writes: > Spotted by ASAN. > > Signed-off-by: Marc-André Lureau > --- > tests/i440fx-test.c | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/tests/i440fx-test.c b/tests/i440fx-test.c > index da2d5a53f0..e9d05c87d1 100644 > --- a/tests/i440fx-test.c > +++ b/tests/i

[Qemu-devel] [PATCH v4 06/26] ppc/xics: add an InterruptStatsProvider interface to ICS and ICP objects

2017-02-27 Thread Cédric Le Goater
This is, again, to reduce the use of the list of ICS objects. Let's make each individual ICS and ICP object an InterruptStatsProvider and remove this same interface from XICSState. The InterruptStatsProvider will be moved at the machine level after the XICS cleanups are completed. Signed-off-by:

[Qemu-devel] [PATCH v4 01/26] xics: XICS should not be a SysBusDevice

2017-02-27 Thread Cédric Le Goater
From: David Gibson Currently xics - the component of the IBM POWER interrupt controller representing the overall interrupt fabric / architecture is represented as a descendent of SysBusDevice. However, this is not really correct - the xics presents nothing in MMIO space so it should be an "unatt

Re: [Qemu-devel] [PATCH] pl190: Fix off-by-one error in priority handling when reading VECTADDR

2017-02-27 Thread Peter Maydell
On 27 February 2017 at 08:15, Marc Bommert wrote: > The "current" priority bit (1 << i) should also be set in > s->prio_mask[i], if the interrupt is enabled. This will in turn > cause the read operation of VECTADDR to return the correct vector > of the pending interrupt. > > --- > hw/intc/pl190.c

[Qemu-devel] [PATCH v1 2/2] .shippable: add s390x-cross target

2017-02-27 Thread Alex Bennée
Use the new debian-s390x-cross.docker target to cross compile for s390. Signed-off-by: Alex Bennée --- .shippable.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.shippable.yml b/.shippable.yml index 1a1fd7a91d..653bd750fe 100644 --- a/.shippable.yml +++ b/.shippable.yml @@ -5,6 +5,8 @

[Qemu-devel] [PATCH v4 05/26] ppc/xics: store the ICS object under the sPAPR machine

2017-02-27 Thread Cédric Le Goater
A list of ICS objects was introduced under the XICS object for the PowerNV machine but, for the sPAPR machine, it brings extra complexity as there is only a single ICS. To simplify the code, let's add the ICS pointer under the sPAPR machine and try to reduce the use of this list where possible. Al

Re: [Qemu-devel] [PATCH v2 2/2] virtio: add missing region cache init in virtio_load()

2017-02-27 Thread Cornelia Huck
On Wed, 22 Feb 2017 16:37:34 + Stefan Hajnoczi wrote: > Commit 97cd965c070152bc626c7507df9fb356bbe1cd81 ("virtio: use > VRingMemoryRegionCaches for avail and used rings") switched to a memory > region cache to avoid repeated map/unmap operations. > > The virtio_load() process is a little tri

[Qemu-devel] [Bug 1668273] Re: DoS possible on - a QEMU process using userspace SLIRP?

2017-02-27 Thread Nehal J Wani
** Summary changed: - DDoS possible on - a QEMU process using userspace SLIRP? + DoS possible on - a QEMU process using userspace SLIRP? -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1668273 Title:

[Qemu-devel] [PATCH v4 09/26] ppc/xics: use the QOM interface to get irqs

2017-02-27 Thread Cédric Le Goater
Signed-off-by: Cédric Le Goater Reviewed-by: David Gibson --- hw/intc/xics.c | 5 +++-- hw/ppc/spapr_events.c | 6 +++--- hw/ppc/spapr_pci.c | 2 +- include/hw/pci-host/spapr.h | 2 +- include/hw/ppc/spapr_vio.h | 2 +- include/hw/ppc/xics.h | 3 ++- 6 files ch

[Qemu-devel] [PATCH v4 17/26] ppc/xics: move the cpu_setup() handler under the ICPState class

2017-02-27 Thread Cédric Le Goater
The cpu_setup() handler is currently under the XICSState class but it really belongs under ICPState as it is setting up an individual vCPU. Signed-off-by: Cédric Le Goater --- hw/intc/xics.c| 8 +++ hw/intc/xics_kvm.c| 58 +-- incl

[Qemu-devel] [PATCH v1 0/2] s390x cross Docker target

2017-02-27 Thread Alex Bennée
Hi, A build failure on s390 was reported so to investigate I put together a cross-compile environment to debug it. As it turned out the report was a false positive but the cross target might still be useful for people who don't have big iron handy ;-) Alex Bennée (2): new: dockerfiles/debian-s3

Re: [Qemu-devel] [PATCH 18/54] block: Default .bdrv_child_perm() for format drivers

2017-02-27 Thread Kevin Wolf
Am 27.02.2017 um 13:34 hat Max Reitz geschrieben: > On 27.02.2017 13:33, Kevin Wolf wrote: > > Am 25.02.2017 um 12:57 hat Max Reitz geschrieben: > >> On 21.02.2017 15:58, Kevin Wolf wrote: > >>> Almost all format drivers have the same characteristics as far as > >>> permissions are concerned: They

Re: [Qemu-devel] [PATCH v2 20/30] tests: fix e1000e leaks

2017-02-27 Thread Markus Armbruster
Marc-André Lureau writes: > Spotted by ASAN. > > Signed-off-by: Marc-André Lureau > --- > tests/e1000e-test.c | 6 +- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/tests/e1000e-test.c b/tests/e1000e-test.c > index 8c42ca919f..c612dc64ec 100644 > --- a/tests/e1000e-test.c

[Qemu-devel] [PATCH v4 10/26] ppc/xics: use the QOM interface to resend irqs

2017-02-27 Thread Cédric Le Goater
Also change the ICPState 'xics' backlink to be a XICSFabric, this removes the need of using qdev_get_machine() to get the QOM interface in some of the routines. Signed-off-by: Cédric Le Goater --- Changes since v3: - changed ICPState 'xics' backlink to be a XICSFabric. hw/intc/xics.c

<    1   2   3   4   5   6   >