[Qemu-devel] [PATCH v2 0/2] sheepdog: don't sleep in coroutine context

2013-03-12 Thread MORITA Kazutaka
This patch prevents the sheepdog driver from sleeping in coroutine context long time. The first patch makes the driver use a non-blocking socket and the second one fixes a bug that yielded coroutines aren't entered. Changes from v2: - add a patch to use non-blocking fd - add explanation why it

[Qemu-devel] [PATCH v2 1/2] sheepdog: use non-blocking fd in coroutine context

2013-03-12 Thread MORITA Kazutaka
Using a blocking socket in the coroutine context reduces the chance of switching to other work. This patch makes the sheepdog driver use a non-blocking fd always. Signed-off-by: MORITA Kazutaka --- block/sheepdog.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/block/

[Qemu-devel] [PATCH v2 2/2] sheepdog: set io_flush handler in do_co_req

2013-03-12 Thread MORITA Kazutaka
If an io_flush handler is not set, qemu_aio_wait doesn't invoke callbacks. Signed-off-by: MORITA Kazutaka --- block/sheepdog.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index 27abef2..4245328 100644 --- a/block/sheepdog

[Qemu-devel] [PATCH] bitops: unroll while loop in find_next_bit().

2013-03-12 Thread Peter Lieven
this patch adopts the loop unrolling idea of bitmap_is_zero() to speed up the skipping of large areas with zeros in find_next_bit(). this routine is extensively used to find dirty pages in live migration. testing only the find_next_bit performance on a zeroed bitfield the loop onrolling decrease

Re: [Qemu-devel] [RFC] Proposal for hw/ split

2013-03-12 Thread Paolo Bonzini
Il 12/03/2013 07:48, Richard Henderson ha scritto: > On 2013-03-11 04:17, Paolo Bonzini wrote: >> == hw/pci == >> hw/alpha_typhoon.c hw/pci/host-typhoon.c > > Why wouldn't this go into hw/alpha/, really? Sure. I think the Alpha-specific interrupt delivery parts should b

Re: [Qemu-devel] [PATCH 09/18] hw: include hw header files with full paths

2013-03-12 Thread KONRAD Frédéric
On 01/03/2013 14:33, Paolo Bonzini wrote: Done with this script: cd hw for i in `find . -name '*.h' | sed 's/^..//'`; do echo '\,^#.*include.*["<]'$i'[">], s,'$i',hw/&,' done | sed -i -f - `find . -type f` This is so that paths remain valid as files are moved. Instead, files in hw/dataplane

Re: [Qemu-devel] [PATCH V2 WIP 2/2] vhost-scsi: new device supporting the tcm_vhost Linux kernel module

2013-03-12 Thread Stefan Hajnoczi
On Tue, Mar 12, 2013 at 02:29:42PM +0800, Asias He wrote: > diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c > index 39c1966..4a97ca1 100644 > --- a/hw/virtio-pci.c > +++ b/hw/virtio-pci.c These changes break the build for non-Linux hosts. Please introduce a CONFIG_VHOST_SCSI and #ifdef appropriate

Re: [Qemu-devel] [PATCH 09/18] hw: include hw header files with full paths

2013-03-12 Thread Paolo Bonzini
Il 12/03/2013 09:19, KONRAD Frédéric ha scritto: > On 01/03/2013 14:33, Paolo Bonzini wrote: >> Done with this script: >> >> cd hw >> for i in `find . -name '*.h' | sed 's/^..//'`; do >>echo '\,^#.*include.*["<]'$i'[">], s,'$i',hw/&,' >> done | sed -i -f - `find . -type f` >> >> This is so that

Re: [Qemu-devel] [PATCH 09/18] hw: include hw header files with full paths

2013-03-12 Thread KONRAD Frédéric
On 12/03/2013 09:19, KONRAD Frédéric wrote: On 01/03/2013 14:33, Paolo Bonzini wrote: Done with this script: cd hw for i in `find . -name '*.h' | sed 's/^..//'`; do echo '\,^#.*include.*["<]'$i'[">], s,'$i',hw/&,' done | sed -i -f - `find . -type f` This is so that paths remain valid as fil

Re: [Qemu-devel] [RFC] find_next_bit optimizations

2013-03-12 Thread Stefan Hajnoczi
On Mon, Mar 11, 2013 at 02:44:03PM +0100, Peter Lieven wrote: > I ever since had a few VMs which are very hard to migrate because of a lot of > memory I/O. I found that finding the next dirty bit > seemed to be one of the culprits (apart from removing locking which Paolo is > working on). > > I

[Qemu-devel] [PATCH v4] virtio: make virtio device's structures public.

2013-03-12 Thread fred . konrad
From: KONRAD Frederic These structures must be made public to avoid two memory allocations for refactored virtio devices. Signed-off-by: KONRAD Frederic Reviewed-by: Andreas Färber Changes V4 <- V3: * Rebased on current git. Changes V3 <- V2: * Style correction spotted by Andreas (vir

Re: [Qemu-devel] [PATCH V2 07/10] snapshot: qmp use new internal API for external snapshot transaction

2013-03-12 Thread Wenchao Xia
于 2013-1-15 15:03, Wenchao Xia 写道: 于 2013-1-14 18:06, Stefan Hajnoczi 写道: On Mon, Jan 14, 2013 at 10:56:30AM +0800, Wenchao Xia wrote: 于 2013-1-11 17:12, Stefan Hajnoczi 写道: On Fri, Jan 11, 2013 at 02:22:28PM +0800, Wenchao Xia wrote: 于 2013-1-10 20:41, Stefan Hajnoczi 写道: On Thu, Jan 10, 20

Re: [Qemu-devel] [RFC] find_next_bit optimizations

2013-03-12 Thread Peter Lieven
Am 12.03.2013 um 09:35 schrieb Stefan Hajnoczi : > On Mon, Mar 11, 2013 at 02:44:03PM +0100, Peter Lieven wrote: >> I ever since had a few VMs which are very hard to migrate because of a lot >> of memory I/O. I found that finding the next dirty bit >> seemed to be one of the culprits (apart from

Re: [Qemu-devel] [PATCH 0/3] *** make netlayer re-entrant ***

2013-03-12 Thread Paolo Bonzini
Il 07/03/2013 03:06, liu ping fan ha scritto: > > From what I gathered from the other thread, the path forward was to > > replace the global iohandler list that we currently use to drive > > NetClient events and replace it with a GSource and GMainContext, rather > > than relying on AioContexts. >

Re: [Qemu-devel] [PATCH v2 5/5] net: make netclient re-entrant with refcnt

2013-03-12 Thread Paolo Bonzini
Il 07/03/2013 03:53, Liu Ping Fan ha scritto: > From: Liu Ping Fan > > With refcnt, NetClientState's caller can run agaist reclaimer. > > Signed-off-by: Liu Ping Fan > --- > hw/qdev-properties-system.c | 14 + > include/net/net.h |3 ++ > net/hub.c

Re: [Qemu-devel] [PATCH v2 1/5] net: spread hub on AioContexts

2013-03-12 Thread Paolo Bonzini
Il 07/03/2013 03:53, Liu Ping Fan ha scritto: > From: Liu Ping Fan > > Forward packet to other hub ports by their AioContext. > > Signed-off-by: Liu Ping Fan > --- > hw/qdev-properties-system.c |1 + > include/block/aio.h |1 + > include/net/net.h |5 + > incl

Re: [Qemu-devel] [PATCH v2 4/5] net: introduce lock to protect NetClientState's peer's access

2013-03-12 Thread Paolo Bonzini
Il 07/03/2013 03:53, Liu Ping Fan ha scritto: > From: Liu Ping Fan > > Introduce nc->send_lock, it shield off the race of nc->peer's reader and > deleter. With it, after deleter finish, no new qemu_send_packet_xx() > can reach ->send_queue, so no new reference(packet->sender) to nc will > be appe

[Qemu-devel] [PATCH 01/19] chardev: add support for qapi-based chardev initialization

2013-03-12 Thread Gerd Hoffmann
This patch add support for a new way to initialize chardev devices. Instead of calling a initialization function with a QemuOpts we will now create a (qapi) ChardevBackend, optionally call a function to fill ChardevBackend from QemuOpts, then go create the chardev using the new qapi code path which

[Qemu-devel] [PATCH 09/19] chardev: switch parallel init to qapi

2013-03-12 Thread Gerd Hoffmann
This patch switches over the parallel chardev initialization to the new qapi code path. Signed-off-by: Gerd Hoffmann --- qemu-char.c | 37 + 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/qemu-char.c b/qemu-char.c index 8bedabb..2bc1021 1006

[Qemu-devel] [PULL v3 00/19] chardev: qapi conversion continued

2013-03-12 Thread Gerd Hoffmann
Hi, v3 of this series. Rebased to latest master, picked up a fix from Igor, fixed a tyops in the udp commit message. No changes in the actual code and in the qapi interface. The plumbing has changed quite a bit though as the chardev backend table has been replaced by a backend driver registra

[Qemu-devel] [PATCH 04/19] chardev: add msmouse support to qapi

2013-03-12 Thread Gerd Hoffmann
This patch adds 'msmouse' support to qapi and also switches over the msmouse chardev initialization to the new qapi code path. Signed-off-by: Gerd Hoffmann --- backends/msmouse.c |4 ++-- include/char/char.h |3 +++ qapi-schema.json|3 ++- qemu-char.c |3 +++ 4 files

[Qemu-devel] [PATCH 08/19] chardev: switch serial/tty init to qapi

2013-03-12 Thread Gerd Hoffmann
This patch switches over the serial chardev initialization to the new qapi code path. Signed-off-by: Gerd Hoffmann --- qemu-char.c | 37 + 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/qemu-char.c b/qemu-char.c index 10f5f57..8bedabb 100644

[Qemu-devel] [PATCH 03/19] chardev: switch null init to qapi

2013-03-12 Thread Gerd Hoffmann
This patch switches over the 'null' chardev initialization to the new qapi code path. Signed-off-by: Gerd Hoffmann --- qemu-char.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qemu-char.c b/qemu-char.c index 38890ed..2bf12cd 100644 --- a/qemu-char.c +++ b/qemu-cha

[Qemu-devel] [PATCH 02/19] chardev: add mux chardev support to qapi

2013-03-12 Thread Gerd Hoffmann
This adds mux chardev support to the qapi and also makes the qapi-based chardev creation path handle the "mux=on" option correctly. --- qapi-schema.json | 14 +- qemu-char.c | 35 --- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git

[Qemu-devel] [PATCH 06/19] chardev: switch file init to qapi

2013-03-12 Thread Gerd Hoffmann
This patch switches over the 'file' chardev initialization to the new qapi code path. Signed-off-by: Gerd Hoffmann --- qemu-char.c | 43 +++ 1 file changed, 15 insertions(+), 28 deletions(-) diff --git a/qemu-char.c b/qemu-char.c index 1991c82..66ae8aa

[Qemu-devel] [PATCH 05/19] chardev: add braille support to qapi

2013-03-12 Thread Gerd Hoffmann
This patch adds 'braille' support to qapi and also switches over the braille chardev initialization to the new qapi code path. Signed-off-by: Gerd Hoffmann --- backends/baum.c |4 ++-- include/char/char.h |3 +++ qapi-schema.json|3 ++- qemu-char.c |5 + 4 fil

Re: [Qemu-devel] [PATCH v2 2/5] net: hub use lock to protect ports list

2013-03-12 Thread Paolo Bonzini
Il 07/03/2013 03:53, Liu Ping Fan ha scritto: > From: Liu Ping Fan > > Signed-off-by: Liu Ping Fan > --- > net/hub.c | 27 ++- > 1 files changed, 26 insertions(+), 1 deletions(-) You are introducing three locks. Please document for each one how can concurrent access

[Qemu-devel] [PATCH 11/19] chardev: add console support to qapi

2013-03-12 Thread Gerd Hoffmann
This patch adds 'console' support to qapi and also switches over the console chardev initialization to the new qapi code path. Signed-off-by: Gerd Hoffmann --- qapi-schema.json |3 ++- qemu-char.c |9 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/qapi-sche

Re: [Qemu-devel] [PULL v3 00/19] chardev: qapi conversion continued

2013-03-12 Thread Gerd Hoffmann
Hi, > git://git.kraxel.org/qemu chardev.3 Pushed chardev.4 ... > chardev: add vc support to qapi > [fixup] vc ... with these two guys squashed. sorry for the trouble, Gerd

[Qemu-devel] [PATCH 1/2] qga: add windows implementation for guest-get-time

2013-03-12 Thread Lei Li
Signed-off-by: Lei Li --- qga/commands-win32.c | 32 1 file changed, 32 insertions(+) diff --git a/qga/commands-win32.c b/qga/commands-win32.c index 7e8ecb3..0a2bb34 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -22,6 +22,12 @@ #define SHTDN_RE

[Qemu-devel] [PATCH 2/2] qga: add windows implementation for guest-set-time

2013-03-12 Thread Lei Li
Signed-off-by: Lei Li --- qga/commands-win32.c | 34 ++ 1 file changed, 34 insertions(+) diff --git a/qga/commands-win32.c b/qga/commands-win32.c index 0a2bb34..e000324 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -140,6 +140,40 @@ int64_t qmp_g

[Qemu-devel] [PATCH 19/19] qemu-char.c: fix waiting for telnet connection message

2013-03-12 Thread Gerd Hoffmann
From: Igor Mitsyanko Current colon position in "waiting for telnet connection" message template produces messages like: QEMU waiting for connection on: telnet::127.0.0.1,server After moving a colon to the right, we will get a correct messages like: QEMU waiting for connection on: telnet:127.

[Qemu-devel] [PATCH 0/2 v3] Add Windows support for time resync by qemu-ga

2013-03-12 Thread Lei Li
This patch series attempts to add Windows implementation for qemu-ga commands guest-get-time and guest-set-time. The previous thread about the interfaces introduced and the POSIX-specific command implementation has already been accepted, the reference link: http://article.gmane.org/gmane.comp.em

Re: [Qemu-devel] [RFC] qcow3 format in libvirt

2013-03-12 Thread Kevin Wolf
Am 11.03.2013 um 19:03 hat Ján Tomko geschrieben: > On 03/04/2013 04:40 PM, Kevin Wolf wrote: > > Am 04.03.2013 um 16:19 hat Daniel P. Berrange geschrieben: > >> On Mon, Mar 04, 2013 at 04:05:50PM +0100, Kevin Wolf wrote: > >>> > >>> I'm not talking about the QEMU cli, but about qcow2 as the format

[Qemu-devel] [PATCH 15/19] [fixup] vc

2013-03-12 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- qemu-char.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/qemu-char.c b/qemu-char.c index ef10200..a1c668f 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -3713,6 +3713,9 @@ ChardevReturn *qmp_chardev_add(const char *id, ChardevBackend *backend,

[Qemu-devel] [PATCH 14/19] chardev: add vc support to qapi

2013-03-12 Thread Gerd Hoffmann
This patch adds 'vc' support to qapi and also switches over the vc chardev initialization to the new qapi code path. Signed-off-by: Gerd Hoffmann --- include/ui/console.h |4 ++-- qapi-schema.json | 20 - ui/console.c | 61 +

[Qemu-devel] [PATCH 07/19] chardev: add stdio support to qapi

2013-03-12 Thread Gerd Hoffmann
This patch adds 'stdio' support to qapi and also switches over the stdio chardev initialization to the new qapi code path. Signed-off-by: Gerd Hoffmann --- qapi-schema.json | 16 +++- qemu-char.c | 26 -- 2 files changed, 35 insertions(+), 7 deletions

Re: [Qemu-devel] what versions of MacOSX do we want to support in qemu?

2013-03-12 Thread Peter Maydell
On 11 March 2013 22:15, Andreas Färber wrote: > Am 11.03.2013 19:14, schrieb Peter Maydell: >> Hi; I'm currently looking at fixing the warnings that qemu generates in >> MacOSX syslog regarding CPSGetCurrentProcess and CPSEnableForegroundOperation >> being deprecated. The new API for doing this is

[Qemu-devel] [PATCH 16/19] chardev: add memory (ringbuf) support to qapi

2013-03-12 Thread Gerd Hoffmann
This patch adds 'memory' support to qapi and also switches over the memory chardev initialization to the new qapi code path. Signed-off-by: Gerd Hoffmann --- qapi-schema.json | 14 +- qemu-char.c | 30 +++--- 2 files changed, 36 insertions(+), 8 delet

[Qemu-devel] [PATCH 17/19] chardev: add udp support to qapi

2013-03-12 Thread Gerd Hoffmann
This patch adds 'udp' support to qapi. Signed-off-by: Gerd Hoffmann --- include/qemu/sockets.h |1 + qapi-schema.json | 16 +++- qemu-char.c| 44 ++-- util/qemu-sockets.c| 25 + 4 files ch

[Qemu-devel] [PATCH 18/19] Revert "hmp: Disable chardev-add and chardev-remove"

2013-03-12 Thread Gerd Hoffmann
This reverts commit 8a14952c9d2f5fa2b3caa6dc286b62ed5d26bca7. --- hmp-commands.hx | 63 +++ 1 file changed, 31 insertions(+), 32 deletions(-) diff --git a/hmp-commands.hx b/hmp-commands.hx index 69c707d..79bbcc6 100644 --- a/hmp-commands.hx ++

Re: [Qemu-devel] [RFC 0/8] block: Live backup prototype

2013-03-12 Thread Kevin Wolf
Am 10.03.2013 um 10:57 hat Dietmar Maurer geschrieben: > > The difference between this approach and Dietmar's series is that the backup > > archive format is implemented outside QEMU and runs as a separate program. > > > > This way, management tools like proxmox, oVirt, OpenStack, and others can >

[Qemu-devel] [PATCH 13/19] chardev: add spice support to qapi

2013-03-12 Thread Gerd Hoffmann
This patch adds 'spicevmc' and 'spiceport' support to qapi and also switches over the spice chardev initialization to the new qapi code path. --- include/ui/qemu-spice.h |7 -- qapi-schema.json| 26 +++- qemu-char.c |8 ++ spice-qemu-char.c

[Qemu-devel] [PATCH 10/19] chardev: switch pty init to qapi

2013-03-12 Thread Gerd Hoffmann
This patch switches over the pty chardev initialization to the new qapi code path. Bonus: Taking QemuOpts out of the loop allows some nice cleanups along the way. Signed-off-by: Gerd Hoffmann --- qemu-char.c | 35 ++- 1 file changed, 10 insertions(+), 25 deleti

[Qemu-devel] [PATCH v6 3/8] virtio-blk-pci: switch to new API.

2013-03-12 Thread fred . konrad
From: KONRAD Frederic Here the virtio-blk-pci is modified for the new API. The device virtio-blk-pci extends virtio-pci. It creates and connects a virtio-blk during the init. The properties are not changed. Signed-off-by: KONRAD Frederic --- hw/virtio-pci.c | 115 ++

[Qemu-devel] [PATCH v6 1/8] virtio-blk: don't use pointer for configuration.

2013-03-12 Thread fred . konrad
From: KONRAD Frederic The configuration field must not be a pointer as it will be used for virtio-blk properties. So *blk is replaced by blk in VirtIOBlock structure. Signed-off-by: KONRAD Frederic --- hw/virtio-blk.c | 8 hw/virtio-blk.h | 2 +- 2 files changed, 5 insertions(+), 5 de

[Qemu-devel] [PATCH v6 2/8] virtio-blk: add the virtio-blk device.

2013-03-12 Thread fred . konrad
From: KONRAD Frederic Create virtio-blk which extends virtio-device, so it can be connected on virtio-bus. Signed-off-by: KONRAD Frederic --- hw/virtio-blk.c | 98 ++--- hw/virtio-blk.h | 28 + hw/virtio-pci.c | 11 +-- 3

Re: [Qemu-devel] [PATCH v2 0/2] sheepdog: don't sleep in coroutine context

2013-03-12 Thread Stefan Hajnoczi
On Tue, Mar 12, 2013 at 04:05:41PM +0900, MORITA Kazutaka wrote: > This patch prevents the sheepdog driver from sleeping in coroutine > context long time. > > The first patch makes the driver use a non-blocking socket and the > second one fixes a bug that yielded coroutines aren't entered. > > Ch

[Qemu-devel] [PATCH v6 0/8] virtio-blk refactoring.

2013-03-12 Thread fred . konrad
From: KONRAD Frederic This is the next part of virtio-refactoring. Basically it creates virtio-blk device which extends virtio-device. Then a virtio-blk can be connected on a virtio-bus. virtio-blk-pci, virtio-blk-s390x, virtio-blk-ccw are created too, they extend respectively virtio-pci, virtio

[Qemu-devel] [PATCH v6 4/8] virtio-blk-s390: switch to the new API.

2013-03-12 Thread fred . konrad
From: KONRAD Frederic Here the virtio-blk-s390 is modified for the new API. The device virtio-blk-s390 extends virtio-s390-device as before. It creates and connects a virtio-blk during the init. The properties are not modified. Signed-off-by: KONRAD Frederic --- hw/s390x/s390-virtio-bus.c | 30

[Qemu-devel] [PATCH v6 7/8] virtio-blk: cleanup: QOM cast

2013-03-12 Thread fred . konrad
From: KONRAD Frederic Use QOM casts inside virtio-blk. Signed-off-by: KONRAD Frederic --- hw/virtio-blk.c | 33 ++--- hw/virtio-blk.h | 2 +- 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c index 935aad4..556d6d9 1

[Qemu-devel] [PATCH 12/19] chardev: add pipe support to qapi

2013-03-12 Thread Gerd Hoffmann
This patch adds 'pipe' support to qapi and also switches over the pipe chardev initialization to the new qapi code path. Signed-off-by: Gerd Hoffmann --- qapi-schema.json |3 ++- qemu-char.c | 31 ++- 2 files changed, 24 insertions(+), 10 deletions(-) diff

[Qemu-devel] [PATCH v6 8/8] virtio-blk: cleanup: remove qdev field.

2013-03-12 Thread fred . konrad
From: KONRAD Frederic The qdev field is no longer needed, just drop it. Signed-off-by: KONRAD Frederic --- hw/virtio-blk.c | 3 +-- hw/virtio-blk.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c index 556d6d9..fffeeae 100644 --- a/hw/virt

[Qemu-devel] [PATCH v6 5/8] virtio-blk-ccw switch to new API.

2013-03-12 Thread fred . konrad
From: KONRAD Frederic Here the virtio-ccw-s390 is modified for the new API. The device virtio-ccw-s390 extends virtio-ccw-device as before. It creates and connects a virtio-ccw during the init. The properties are not modified. Signed-off-by: KONRAD Frederic --- hw/s390x/virtio-ccw.c | 37 +

[Qemu-devel] [PATCH v6 6/8] virtio-blk: cleanup: init and exit functions.

2013-03-12 Thread fred . konrad
From: KONRAD Frederic As all virtio-blk-* are switched to the new API, we can remove the separate init/exit for the old API. Signed-off-by: KONRAD Frederic --- hw/virtio-blk.c | 85 ++--- hw/virtio.h | 2 -- 2 files changed, 21 insertion

Re: [Qemu-devel] [RFC V6 19/33] block: Add qcow2_dedup format and image creation code.

2013-03-12 Thread Stefan Hajnoczi
On Mon, Mar 11, 2013 at 04:20:03PM +0100, Benoît Canet wrote: > > > +if (dedup) { > > > +version = 3; > > > +} > > > > Lazy refcounts don't force the version. It would be consistent to > > refrain from forcing the version too. > > I don't understand. Aren't the incompatible featu

Re: [Qemu-devel] [PATCH V14 0/5] VMXNET3 paravirtual NIC device implementation

2013-03-12 Thread Stefan Hajnoczi
On Sat, Mar 09, 2013 at 11:21:01AM +0200, Dmitry Fleytman wrote: > This set of patches implements VMWare VMXNET3 paravirtual NIC device. > The device supports of all the device features including offload capabilties, > VLANs and etc. > The device is tested on different OSes: > Fedora 15 > U

Re: [Qemu-devel] [PATCH v2] Add option to mlock qemu and guest memory

2013-03-12 Thread Paolo Bonzini
Il 14/02/2013 21:21, Satoru Moriya ha scritto: > We have some plans to migrate legacy enterprise systems which require > low latency (10 msec order) to kvm virtualized environment. In our > usecase, the system runs with other untrusted guests and so locking > memory which is used by the system is n

Re: [Qemu-devel] [PATCH] fix qemu_get_cpu(), should return NULL if CPU not found

2013-03-12 Thread Andreas Färber
Am 07.03.2013 19:12, schrieb Igor Mammedov: > commit 55e5c2850 breaks CPU not found return value, and returns > CPU corresponding to the last non NULL env. > Fix it by returning CPU only if env is not NULL, otherwise CPU is > not found and function should return NULL. > > Signed-off-by: Igor Mamme

[Qemu-devel] [PATCH 01/17] cpu: Fix qemu_get_cpu() to return NULL if CPU not found

2013-03-12 Thread Andreas Färber
From: Igor Mammedov Commit 55e5c2850 breaks CPU not found return value, and returns CPU corresponding to the last non NULL env. Fix it by returning CPU only if env is not NULL, otherwise CPU is not found and function should return NULL. Signed-off-by: Igor Mammedov Signed-off-by: Andreas Färber

[Qemu-devel] [PATCH 03/17] cpus: Replace open-coded CPU loop in qmp_memsave() with qemu_get_cpu()

2013-03-12 Thread Andreas Färber
No functional change, just less usages of first_cpu and next_cpu fields. env is passed to cpu_memory_rw_debug(), which in turn passes it to target-specific cpu_get_phys_page_debug(). Changing both would be a larger refactoring, so defer that by using env_ptr for now. Reviewed-by: Luiz Capitulino

[Qemu-devel] [PATCH 06/17] vmstate: Make vmstate_register() static inline

2013-03-12 Thread Andreas Färber
This avoids adding a duplicate stub for CONFIG_USER_ONLY. Suggested-by: Eduardo Habkost Reviewed-by: Eduardo Habkost Reviewed-by: Juan Quintela Signed-off-by: Andreas Färber --- include/migration/vmstate.h | 12 ++-- savevm.c|7 --- 2 Dateien geändert, 10

[Qemu-devel] [PATCH 04/17] target-sh4: Introduce SuperHCPU subclasses

2013-03-12 Thread Andreas Färber
Store legacy name in SuperHCPUClass for -cpu ? and for case-insensitive class lookup. List CPUs by iterating over TYPE_SUPERH_CPU subclasses. Signed-off-by: Andreas Färber --- target-sh4/cpu-qom.h |7 ++ target-sh4/cpu.c | 180 +++- targe

[Qemu-devel] [PATCH 08/17] cpu: Register VMStateDescription through CPUState

2013-03-12 Thread Andreas Färber
In comparison to DeviceClass::vmsd, CPU VMState is split in two, "cpu_common" and "cpu", and uses cpu_index as instance_id instead of -1. Therefore add a CPU-specific CPUClass::vmsd field. Unlike the legacy CPUArchState registration, rather register CPUState. Signed-off-by: Juan Quintela Signed-

[Qemu-devel] [PATCH 10/17] target-i386: Update VMStateDescription to X86CPU

2013-03-12 Thread Andreas Färber
Expose vmstate_cpu as vmstate_x86_cpu and hook it up to CPUClass::vmsd. Adapt opaques and VMState fields to X86CPU. Drop cpu_{save,load}(). Reviewed-by: Eduardo Habkost Signed-off-by: Andreas Färber --- target-i386/cpu-qom.h |4 + target-i386/cpu.c |2 + target-i386/cpu.h |2

[Qemu-devel] [PATCH 07/17] stubs: Add a vmstate_dummy struct for CONFIG_USER_ONLY

2013-03-12 Thread Andreas Färber
Reviewed-by: Juan Quintela Reviewed-by: Eduardo Habkost Signed-off-by: Andreas Färber --- include/migration/vmstate.h |4 stubs/vmstate.c |2 ++ 2 Dateien geändert, 6 Zeilen hinzugefügt(+) diff --git a/include/migration/vmstate.h b/include/migration/vmstate.h index 20d

[Qemu-devel] [PATCH 13/17] exec: Pass CPUState to cpu_reset_interrupt()

2013-03-12 Thread Andreas Färber
Move it to qom/cpu.c to avoid build failures depending on include order of cpu-qom.h and exec/cpu-all.h. Change opaques of various ..._irq_handler() functions to the appropriate CPU type to facilitate using cpu_reset_interrupt(). Fix Coding Style issues while at it (missing braces, indentation).

[Qemu-devel] [PATCH 11/17] target-cris/helper.c: Update Coding Style

2013-03-12 Thread Andreas Färber
Reindent, add missing braces and drop/adjust whitespace. Prepares for CPUArchState-to-CPUState field movements in cpu_cris_handle_mmu_fault(), do_interruptv10() and do_interrupt(). The remaining functions were so minor that they can be fixed in one go. Acked-by: Edgar E. Iglesias Signed-off-by:

[Qemu-devel] [PATCH 05/17] target-sh4: Move PVR/PRR/CVR into SuperHCPUClass

2013-03-12 Thread Andreas Färber
They are never changed once initialized, and moving them to the class will allow to inspect them before instantiating. Signed-off-by: Andreas Färber --- hw/sh4/sh7750.c | 10 +++--- target-sh4/cpu-qom.h |6 ++ target-sh4/cpu.c | 18 +- target-sh4/cpu.h

[Qemu-devel] [PATCH 17/17] target-lm32: Update VMStateDescription to LM32CPU

2013-03-12 Thread Andreas Färber
Add a vmstate_lm32_cpu referencing the previous VMStateDescription as a sub-struct and hook it up to CPUClass::vmsd. Drop cpu_{save,load}(). Acked-by: Michael Walle Signed-off-by: Andreas Färber --- target-lm32/cpu-qom.h |4 target-lm32/cpu.c |1 + target-lm32/cpu.h |2

[Qemu-devel] [PULL 00/17] QOM CPUState patch queue 2013-03-12

2013-03-12 Thread Andreas Färber
Hello, This is my current QOM CPU patch queue. Please pull. It includes: * qemu_get_cpu() bugfix and more uses, * sh4 CPU subclasses, * declarative VMStateDescription for CPUState, * x86 CPU VMState conversion to CPUState, * CPUState field movements and do_interrupt callback. I am mostly unavail

[Qemu-devel] [PATCH 09/17] cpu: Introduce cpu_class_set_vmsd()

2013-03-12 Thread Andreas Färber
This setter avoids redefining each VMStateDescription value to vmstate_dummy by not referencing the value for CONFIG_USER_ONLY. Suggested-by: Juan Quintela Reviewed-by: Eduardo Habkost Signed-off-by: Andreas Färber --- include/qom/cpu.h | 21 + 1 Datei geändert, 21 Zeilen

[Qemu-devel] [PATCH 14/17] cpu: Pass CPUState to cpu_interrupt()

2013-03-12 Thread Andreas Färber
Move it to qom/cpu.h to avoid issues with include order. Change pc_acpi_smi_interrupt() opaque to X86CPU. Signed-off-by: Andreas Färber --- cpus.c |2 +- exec.c |2 +- hw/alpha_typhoon.c | 10 -- hw/apic.c| 21 +++

[Qemu-devel] [PATCH 02/17] monitor: Use qemu_get_cpu() in monitor_set_cpu()

2013-03-12 Thread Andreas Färber
No functional change, just a reduction of CPU loops. The mon_cpu field is left untouched for now since changing that requires a number of larger prerequisites, including cpu_synchronize_state() and mon_get_cpu(). Reviewed-by: Luiz Capitulino Reviewed-by: Markus Armbruster Signed-off-by: Andreas

[Qemu-devel] [PATCH 16/17] target-arm: Override do_interrupt for ARMv7-M profile

2013-03-12 Thread Andreas Färber
Enable ARMCPUInfo to specify a custom class_init functions. Introduce arm_v7m_class_init() and use it for "cortex-m3" model. Instead of forwarding from arm_cpu_do_interrupt() to do_interrupt_v7m(), override CPUClass::do_interrupt with arm_v7m_cpu_do_interrupt() in arm_v7m_class_init(). Acked-by:

[Qemu-devel] [PATCH 15/17] cpu: Replace do_interrupt() by CPUClass::do_interrupt method

2013-03-12 Thread Andreas Färber
This removes a global per-target function and thus takes us one step closer to compiling multiple targets into one executable. It will also allow to override the interrupt handling for certain CPU families. Signed-off-by: Andreas Färber --- cpu-exec.c | 36 +++

Re: [Qemu-devel] [PATCH V9 00/14] qmp/hmp interfaces for internal snapshot info

2013-03-12 Thread Stefan Hajnoczi
On Mon, Mar 11, 2013 at 07:23:02PM +0800, Wenchao Xia wrote: > In the use of snapshot a way to retrieve related info at runtime is needed, > so this serial of patches will merge some code for qemu and qemu-img, and add > following interfaces for qemu: > > 1) qmp: query-images, show image info fo

[Qemu-devel] [PATCH 02/48] target-ppc: Trivial cleanups in mmu_helper.c

2013-03-12 Thread David Gibson
This removes the never-used pte64_invalidate() function, and makes ppcmas_tlb_check() static, since it's only used within that file. Signed-off-by: David Gibson --- target-ppc/cpu.h|3 --- target-ppc/mmu_helper.c | 11 +++ 2 files changed, 3 insertions(+), 11 deletions(-)

[Qemu-devel] [PATCH 07/48] target-ppc: Disentangle get_segment()

2013-03-12 Thread David Gibson
The poorly named get_segment() function handles most of the address translation logic for hash-based MMUs. It has many ugly conditionals on whether the MMU is 32-bit or 64-bit. This patch splits the function into 32 and 64-bit versions, using the switch on mmu_type that's already in the caller (g

[Qemu-devel] [PATCH 05/48] target-ppc: Disentangle pte_check()

2013-03-12 Thread David Gibson
Currently support for both 32-bit and 64-bit hash MMUs share an implementation of pte_check. But there are enough differences that this means the shared function has several very ugly conditionals on "is_64b". This patch cleans things up by separating out the 64-bit version (putting it into mmu-h

[Qemu-devel] [PATCH 13/48] target-ppc: Don't share get_pteg_offset() between 32 and 64-bit

2013-03-12 Thread David Gibson
The get_pteg_offset() helper function is currently shared between 32-bit and 64-bit hash mmus, taking a parameter for the hash pte size. In the 64-bit paths, it's only called in one place, and it's a trivial calculation. This patch, therefore, open codes it for 64-bit. The remaining version, whi

[Qemu-devel] [PATCH 11/48] target-ppc: Disentangle hash mmu versions of cpu_get_phys_page_debug()

2013-03-12 Thread David Gibson
cpu_get_phys_page_debug() is a trivial wrapper around get_physical_address(). But even the signature of get_physical_address() has some things we'd like to clean up on a per-mmu basis, so this patch moves the test on mmu model out to cpu_get_phys_page_debug(), moving the version for 64-bit hash MM

[Qemu-devel] [0/48] target-ppc: MMU implementation cleanup for hash MMUs

2013-03-12 Thread David Gibson
This large patch series makes a serious overhaul of the MMU implementation for target-ppc. Previously all the quite dissimilar PowerPC MMU variants attempted to use a more-or-less common code path, with dependencies on env->mmu_model scattered throughout. The resulting confused code was not worth

[Qemu-devel] [PATCH 04/48] target-ppc: Move SLB handling into a mmu-hash64.c

2013-03-12 Thread David Gibson
As a first step to disentangling the handling for 64-bit hash MMUs from the rest, we move the code handling the Segment Lookaside Buffer (SLB) (which only exists on 64-bit hash MMUs) into a new mmu-hash64.c file. Signed-off-by: David Gibson --- target-ppc/Makefile.objs |5 +- target-ppc/cpu.

[Qemu-devel] [PATCH 06/48] target-ppc: Disentangle find_pte()

2013-03-12 Thread David Gibson
32-bit and 64-bit hash MMU implementations currently share a find_pte function. This results in a whole bunch of ugly conditionals in the shared function, and not all that much actually shared code. This patch separates out the 32-bit and 64-bit versions, putting then in mmu-hash64.c and mmu-has3

[Qemu-devel] [PATCH 16/48] mmu-hash*: Add header file for definitions

2013-03-12 Thread David Gibson
Currently cpu.h contains a number of definitions relating to the 64-bit hash MMU. Some are used in the MMU emulation code, but some are only used in the spapr MMU management hcall implementations. This patch moves these definitions (except for a few that are needed more widely) into mmu-hash64.h

[Qemu-devel] [PATCH 10/48] target-ppc: Disentangle hash mmu paths for cpu_ppc_handle_mmu_fault

2013-03-12 Thread David Gibson
cpu_ppc_handle_mmu_fault() calls get_physical_address() (whose behaviour depends on MMU type) then, if that fails, issues an appropriate exception - which again has a number of dependencies on MMU type. This patch starts converting cpu_ppc_handle_mmu_fault() to have a single switch on MMU type, ca

[Qemu-devel] [PATCH 09/48] target-ppc: Disentangle get_physical_address() paths

2013-03-12 Thread David Gibson
Depending on the MSR state, for 64-bit hash MMUs, get_physical_address can either call check_physical (which has further tests for mmu type) or get_segment64. Similarly for 32-bit hash MMUs we can either call check_physucal or get_bat() and get_segment32(). This patch splits off the whole get_phy

[Qemu-devel] [PATCH 01/48] target-ppc: Remove vestigial PowerPC 620 support

2013-03-12 Thread David Gibson
The PowerPC 620 was the very first 64-bit PowerPC implementation, but hardly anyone ever actually used the chips. qemu notionally supports the 620, but since we don't actually have code to implement the segment table, the support is broken (quite likely in other ways too). This patch, therefore,

[Qemu-devel] [PATCH 31/48] mmu-hash32: Remove odd pointer usage from BAT code

2013-03-12 Thread David Gibson
In the code for handling BATs, the hash32_bat_size_prot() and hash32_bat_601_size_prot() functions are passed the BAT contents by reference (pointer) for no clear reason, since they only need the values within. This patch removes this odd usage, and uses the resulting change to clean up the caller

[Qemu-devel] [PATCH 03/48] target-ppc: Remove address check for logging

2013-03-12 Thread David Gibson
One LOG_MMU statement in mmu_helper.c has an odd check on the effective address being translated. I can see no reason for this; I suspect it was a debugging hack from long ago. This patch removes it. Signed-off-by: David Gibson --- target-ppc/mmu_helper.c | 10 -- 1 file changed, 4 i

[Qemu-devel] [PATCH 14/48] target-ppc: Disentangle BAT code for 32-bit hash MMUs

2013-03-12 Thread David Gibson
The functions for looking up BATs (Block Address Translation - essentially a level 0 TLB) are shared between the classic 32-bit hash MMUs and the 6xx style software loaded TLB implementations. This patch splits out a copy for the 32-bit hash MMUs, to facilitate cleaning it up. The remaining versi

[Qemu-devel] [PATCH 12/48] target-ppc: Disentangle hash mmu helper functions

2013-03-12 Thread David Gibson
The newly separated paths for hash mmus rely on several helper functions which are still shared with 32-bit hash mmus: pp_check(), check_prot() and pte_update_flags(). While these don't have ugly ifdefs on the mmu type, they're not very well thought out, so sharing them impedes cleaning up the has

[Qemu-devel] [PATCH 24/48] mmu-hash*: Cleanup segment-level NX check

2013-03-12 Thread David Gibson
On the ppc hash mmus, no-execute can be set at the segment level (on more recent 64-bit hash mmus it can also be set at the page level). This patch separates out this check to make it clearer what is going on, and avoiding excessive indentation of the remaining translation code. Signed-off-by: Da

[Qemu-devel] [PATCH 19/48] mmu-hash64: Remove nx from mmu_ctx_hash64

2013-03-12 Thread David Gibson
The nx field in mmu_ctx_hash64 is used in two different functions. But its used for slightly different things in each place, and the value is never propagated between them. In other words, it might as well be two local variables. This patch makes it so. Signed-off-by: David Gibson --- target-

[Qemu-devel] [PATCH 17/48] mmu-hash*: Add hash pte load/store helpers

2013-03-12 Thread David Gibson
On real hardware the ppc hash page table is stored in memory; accordingly our mmu emulation code can read a hash page table in guest memory. But, when paravirtualized under PAPR, the real hash page table is in host memory, accessible to the guest only via hypercalls. We model this by also allowin

[Qemu-devel] [PATCH 32/48] mmu-hash32: Split BAT size logic from permissions logic

2013-03-12 Thread David Gibson
hash32_bat_size_prot() and its 601 variant, as the name suggests, returns both a BAT's size - needed to search for a matching BAT - and its permissions, only relevant once a matching BAT has been located. There's no particular advantage to combining these, so we split these roles into seperate fun

[Qemu-devel] [PATCH 22/48] mmu-hash32: Split out handling of direct store segments

2013-03-12 Thread David Gibson
At present a large chunk of ppc_hash32_translate() is taken up with an ugly if selecting between direct store segments (hardly ever used) and normal paged segments. This patch clarifies the flow of code by handling direct store segments immediately then returning, leaving the straight line code to

[Qemu-devel] [PATCH 28/48] mmu-hash*: Remove permission checking from find_pte{32, 64}()

2013-03-12 Thread David Gibson
find_pte{32,64}() are poorly named, since they both find a PTE and do permissions checking of it. This patch makes them only locate a matching PTE, moving the permission checking and other logic to the caller. We rename the resulting search functions ppc_hash{32,64}_htab_lookup(). Signed-off-by:

[Qemu-devel] [PATCH 23/48] mmu-hash32: Split direct store segment handling into a helper

2013-03-12 Thread David Gibson
This further separates the unusual case handling of direct store segments from the main translation path by moving its logic into a helper function, with some tiny cleanups along the way. Signed-off-by: David Gibson --- target-ppc/mmu-hash32.c | 117 -

  1   2   3   >