[Qemu-devel] [PATCH, RFC] qemu-timer: fix alarm_timer pending

2010-03-18 Thread TeLeMan
I fetched the lastest qemu-timer codes and found qemu would have no response when the guest os was WinXP and the timer was "dynticks" on the win32 host. After qemu froze, it seemed the win32_rearm_timer() would never be called and alarm_timer->pending was always 0. I could not find the more deeper

[Qemu-devel] [PATCH] usb-bus: fix no params

2010-03-18 Thread TeLeMan
The "params" is never NULL and the usb hid devices have no params. Signed-off-by: TeLeMan --- hw/usb-bus.c |4 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/hw/usb-bus.c b/hw/usb-bus.c index ce8a694..f3f1ed6 100644 --- a/hw/usb-bus.c +++ b/hw/usb-bus.c @@ -299,10 +299,6

[Qemu-devel] GSoC: we have been accepted

2010-03-18 Thread Luiz Capitulino
Hi all, This is a note to let you know that QEMU has been accepted for Google Summer of Code 2010: http://socghop.appspot.com/gsoc/org/show/google/gsoc2010/qemu Thanks for everyone who contributed with project ideas and volunteered to be a mentor. I'm updating some pages and reading some doc

[Qemu-devel] Re: virtio_blk_load() question

2010-03-18 Thread OHMURA Kei
On 2010/03/18 21:07, Juan Quintela wrote: Really, ordering doesn't matter (in this case): see virtio-blk.c:virtio_blk_dma_restart_bh() QLIST_FOREACH_SAFE(req, &rq_copy, next, next_req) { QLIST_REMOVE(req, next); virtio_blk_handle_request(req, &mrb); } This mean that we

Re: [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abort()

2010-03-18 Thread Jamie Lokier
Blue Swirl wrote: > But what if in addition to > this, the user process forked and the other process ptraced the QEMU > process, How good is the cross-arch ptrace() emulation, anyway? :-) -- Jamie

Re: [Qemu-devel] Re: [PATCH 0/9] Virtio cleanups

2010-03-18 Thread Jamie Lokier
Juan Quintela wrote: > vstrucut virtio_common *create_virtio_comon(, size we really want); > Again, this implements superclass/subclass as well as you can implemnt > it in C. It would be more type-safe for create_virtio_common() to be a macro taking the subclass *type* rather than sizeof. And

[Qemu-devel] Re: [PATCH 2/6] error: Trim includes in qerror.c

2010-03-18 Thread Luiz Capitulino
On Wed, 17 Mar 2010 18:56:50 +0100 Markus Armbruster wrote: > > Signed-off-by: Markus Armbruster > --- > qerror.c |2 -- > 1 files changed, 0 insertions(+), 2 deletions(-) > > diff --git a/qerror.c b/qerror.c > index d0aba61..ff2fbd5 100644 > --- a/qerror.c > +++ b/qerror.c > @@ -11,9 +11

[Qemu-devel] Re: [PATCH 1/6] error: Trim includes after "Move qemu_error & friends..."

2010-03-18 Thread Luiz Capitulino
On Wed, 17 Mar 2010 18:56:49 +0100 Markus Armbruster wrote: > Missed in commit 2f792016. > > Signed-off-by: Markus Armbruster > --- > hw/qdev-properties.c |1 + > monitor.c|2 -- > sysemu.h |2 -- > 3 files changed, 1 insertions(+), 4 deletions(-) > > diff

[Qemu-devel] Re: [PATCH] monitor: convert do_device_del() to QObject, QError

2010-03-18 Thread Luiz Capitulino
On Wed, 17 Mar 2010 17:46:07 +0100 Markus Armbruster wrote: > > Signed-off-by: Markus Armbruster > --- > hw/qdev.c |7 --- > hw/qdev.h |2 +- > qemu-monitor.hx |3 ++- > 3 files changed, 7 insertions(+), 5 deletions(-) > > diff --git a/hw/qdev.c b/hw/qdev.c > index

[Qemu-devel] Re: [PATCH 0/2] qemu-kvm: Introduce wrapper functions to access phys_ram_dirty, and replace existing direct accesses to it.

2010-03-18 Thread Marcelo Tosatti
On Wed, Mar 17, 2010 at 02:51:46PM +0900, Yoshiaki Tamura wrote: > > Before replacing byte-based dirty bitmap with bit-based dirty bitmap, > clearing direct accesses to the bitmap first seems to be good point to > start with. > > This patch set is based on the following discussion. > > http://ww

Re: [Qemu-devel] NetBSD qemu block device support

2010-03-18 Thread Blue Swirl
On 3/17/10, haad wrote: > Hi folks, > > This patch at [1] add support for NetBSD block ioctl calls to qemu > block-raw.c file. It was written for xen version of qemu but basically > it will work with vanilla qemu, too. Would anyone like to commit this > patch so it can be included into the bas

Re: [Qemu-devel] Re: [PATCH 0/9] Virtio cleanups

2010-03-18 Thread Anthony Liguori
On 03/18/2010 11:36 AM, Gerd Hoffmann wrote: Hi, But I still think that this is independent that VirtIO being 1st (or not) memer of VirtIOBlock. There is no strong reason for this other than memory allocation. As long as virtio_common_init() does the allocation there is no way around Vir

[Qemu-devel] Re: [PATCH 0/9] Virtio cleanups

2010-03-18 Thread Juan Quintela
"Michael S. Tsirkin" wrote: > On Thu, Mar 18, 2010 at 06:08:06PM +0100, Juan Quintela wrote: >> Gerd Hoffmann wrote: > > The whole '1st place' hack is really not necessary, if we know the > offset we can use container_of. container_of() don't cut mustard. The whole point is that virtio-pci cod

Re: [Qemu-devel] [PATCH 5/6] error: Link qemu-img, qemu-nbd, qemu-io with qemu-error.o

2010-03-18 Thread Blue Swirl
On 3/18/10, Markus Armbruster wrote: > Blue Swirl writes: > > > On 3/18/10, Markus Armbruster wrote: > >> Blue Swirl writes: > >> > >> > On 3/17/10, Markus Armbruster wrote: > >> >> Blue Swirl writes: > >> >> > >> >> > On 3/17/10, Markus Armbruster wrote: > >> > >> [...] > >>

Re: [Qemu-devel] [PATCH 5/6] error: Link qemu-img, qemu-nbd, qemu-io with qemu-error.o

2010-03-18 Thread Markus Armbruster
Blue Swirl writes: > On 3/18/10, Markus Armbruster wrote: >> Blue Swirl writes: >> >> > On 3/17/10, Markus Armbruster wrote: >> >> Blue Swirl writes: >> >> >> >> > On 3/17/10, Markus Armbruster wrote: >> >> [...] >> >> >> >> +void monitor_set_error(Monitor *mon, QError *qerror) >> >>

[Qemu-devel] Re: qemu-dm writing garbage into PCI BAR registers in HVM guest in XEN 3.3.1 on SLES11

2010-03-18 Thread Dan Gora
Based on a recommendation from the xen-devel list I changed my domU to use the e1000 driver rather than the rtl8139 and the problem went away... So there is definately a bug in the rtl8139 driver somewhere.. thanks, dan On Thu, Mar 18, 2010 at 1:42 AM, Dan Gora wrote: > Hi All, > > I've found a

[Qemu-devel] NetBSD qemu block device support

2010-03-18 Thread haad
Hi folks, This patch at [1] add support for NetBSD block ioctl calls to qemu block-raw.c file. It was written for xen version of qemu but basically it will work with vanilla qemu, too. Would anyone like to commit this patch so it can be included into the base xen distribution ? [1] www.netbsd.or

[Qemu-devel] Re: [PATCH] block: add logical_block_size property

2010-03-18 Thread Christian Borntraeger
Am Donnerstag 04 März 2010 14:20:17 schrieb Christoph Hellwig: > > Add a logical block size attribute as various guest side tools only > increase the filesystem sector size based on it, not the advisory > physical block size. > > For scsi we already have support for a different logical block size

Re: [Qemu-devel] [PATCH 5/6] error: Link qemu-img, qemu-nbd, qemu-io with qemu-error.o

2010-03-18 Thread Blue Swirl
On 3/18/10, Markus Armbruster wrote: > Blue Swirl writes: > > > On 3/17/10, Markus Armbruster wrote: > >> Blue Swirl writes: > >> > >> > On 3/17/10, Markus Armbruster wrote: > > [...] > > >> >> +void monitor_set_error(Monitor *mon, QError *qerror) > >> >> +{ > >> >> +assert(0)

Re: [Qemu-devel] [PATCH 5/6] error: Link qemu-img, qemu-nbd, qemu-io with qemu-error.o

2010-03-18 Thread Markus Armbruster
Blue Swirl writes: > On 3/17/10, Markus Armbruster wrote: >> Blue Swirl writes: >> >> > On 3/17/10, Markus Armbruster wrote: [...] >> >> +void monitor_set_error(Monitor *mon, QError *qerror) >> >> +{ >> >> +assert(0); >> > >> > Please use abort(). >> >> >> Why? > > Because assert(

Re: [Qemu-devel] [PATCH 5/6] error: Link qemu-img, qemu-nbd, qemu-io with qemu-error.o

2010-03-18 Thread Blue Swirl
On 3/17/10, Markus Armbruster wrote: > Blue Swirl writes: > > > On 3/17/10, Markus Armbruster wrote: > >> The location tracking interface is used by code shared with qemi-img, > >> qemu-nbd and qemu-io, so it needs to be available there. Commit > >> 827b0813 provides it in a rather hamfis

[Qemu-devel] Re: [PATCH 0/9] Virtio cleanups

2010-03-18 Thread Michael S. Tsirkin
On Thu, Mar 18, 2010 at 06:08:06PM +0100, Juan Quintela wrote: > Gerd Hoffmann wrote: > > Hi, > > > >> But I still think that this is independent that VirtIO being 1st (or > >> not) memer of VirtIOBlock. > > > > There is no strong reason for this other than memory allocation. As > > long as vir

[Qemu-devel] Re: [PATCH 0/9] Virtio cleanups

2010-03-18 Thread Michael S. Tsirkin
On Thu, Mar 18, 2010 at 03:21:59PM +0100, Juan Quintela wrote: > > My patch removes lines of code. It is actually simpler than > > what we had: no casts, no assumptions. > > It is more complex. You need to add a new offset field to be able to > free it in common code. To add insult to injury, yo

[Qemu-devel] Re: [PATCH 0/9] Virtio cleanups

2010-03-18 Thread Juan Quintela
Gerd Hoffmann wrote: > Hi, > >> But I still think that this is independent that VirtIO being 1st (or >> not) memer of VirtIOBlock. > > There is no strong reason for this other than memory allocation. As > long as virtio_common_init() does the allocation there is no way > around VirtIODevice bei

[Qemu-devel] Re: [PATCH 0/9] Virtio cleanups

2010-03-18 Thread Gerd Hoffmann
Hi, But I still think that this is independent that VirtIO being 1st (or not) memer of VirtIOBlock. There is no strong reason for this other than memory allocation. As long as virtio_common_init() does the allocation there is no way around VirtIODevice being the first member. If this cha

[Qemu-devel] [PATCH 11/11] monitor: New commands netdev_add, netdev_del

2010-03-18 Thread Markus Armbruster
Monitor commands to go with -netdev. Signed-off-by: Markus Armbruster --- net.c | 57 ++- net.h |2 + qemu-monitor.hx | 30 3 files changed, 88 insertions(+), 1 deletions(-) diff --git a

[Qemu-devel] [PATCH 10/11] error: New QERR_DEVICE_IN_USE

2010-03-18 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- qerror.c |4 qerror.h |3 +++ 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/qerror.c b/qerror.c index 97e8d4a..8d885cd 100644 --- a/qerror.c +++ b/qerror.c @@ -69,6 +69,10 @@ static const QErrorStringTable qerror_table[] = {

[Qemu-devel] [PATCH 07/11] error: Use QERR_INVALID_PARAMETER_VALUE instead of QERR_INVALID_PARAMETER

2010-03-18 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- hw/qdev.c |2 +- monitor.c |6 -- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/hw/qdev.c b/hw/qdev.c index 35460eb..c3a00d2 100644 --- a/hw/qdev.c +++ b/hw/qdev.c @@ -207,7 +207,7 @@ DeviceState *qdev_device_add(QemuOpts *opts)

[Qemu-devel] [PATCH 09/11] error: Convert net_client_init() to QError

2010-03-18 Thread Markus Armbruster
The conversion is shallow: client type init() methods aren't converted. Converting them is a big job for relatively little practical benefit, so leave it for later. Signed-off-by: Markus Armbruster --- net.c | 38 ++ 1 files changed, 18 insertions(+), 20 de

[Qemu-devel] [PATCH 05/11] error: Convert qemu_opts_set() to QError

2010-03-18 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- qemu-option.c | 17 ++--- 1 files changed, 6 insertions(+), 11 deletions(-) diff --git a/qemu-option.c b/qemu-option.c index e3916be..5c39666 100644 --- a/qemu-option.c +++ b/qemu-option.c @@ -176,7 +176,7 @@ static int parse_option_bool(const

[Qemu-devel] [PATCH 08/11] error: Convert qemu_opts_validate() to QError

2010-03-18 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- qemu-option.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/qemu-option.c b/qemu-option.c index 5c39666..8b45068 100644 --- a/qemu-option.c +++ b/qemu-option.c @@ -874,8 +874,7 @@ int qemu_opts_validate(QemuOpts *opts, const QemuO

[Qemu-devel] [PATCH 01/11] error: Put error definitions back in alphabetical order

2010-03-18 Thread Markus Armbruster
Add suitable comments to help keerp them in order. Signed-off-by: Markus Armbruster --- qerror.c | 12 qerror.h |8 +--- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/qerror.c b/qerror.c index eaa1deb..4520b0d 100644 --- a/qerror.c +++ b/qerror.c @@ -38,6

[Qemu-devel] [PATCH 06/11] error: Drop extra messages after qemu_opts_set() and qemu_opts_parse()

2010-03-18 Thread Markus Armbruster
Both functions report errors nicely enough now, no need for additional messages. Signed-off-by: Markus Armbruster --- hw/pci-hotplug.c |2 -- net.c|2 -- qemu-config.c|1 - vl.c |5 - 4 files changed, 0 insertions(+), 10 deletions(-) diff --git a/

[Qemu-devel] [PATCH 02/11] error: New QERR_DUPLICATE_ID

2010-03-18 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- qerror.c |4 qerror.h |3 +++ 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/qerror.c b/qerror.c index 4520b0d..9fb817e 100644 --- a/qerror.c +++ b/qerror.c @@ -97,6 +97,10 @@ static const QErrorStringTable qerror_table[] = {

[Qemu-devel] [PATCH 03/11] error: Convert qemu_opts_create() to QError

2010-03-18 Thread Markus Armbruster
Fixes device_add to report duplicate ID properly in QMP, as DuplicateId instead of UndefinedError. Signed-off-by: Markus Armbruster --- qemu-option.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qemu-option.c b/qemu-option.c index dc340b8..e3916be 100644 --- a/qemu

[Qemu-devel] [PATCH 04/11] error: New QERR_INVALID_PARAMETER_VALUE

2010-03-18 Thread Markus Armbruster
Signed-off-by: Markus Armbruster --- qerror.c |4 qerror.h |3 +++ 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/qerror.c b/qerror.c index 9fb817e..97e8d4a 100644 --- a/qerror.c +++ b/qerror.c @@ -121,6 +121,10 @@ static const QErrorStringTable qerror_table[] = {

[Qemu-devel] [PATCH 00/11] monitor: New commands netdev_add, netdev_del

2010-03-18 Thread Markus Armbruster
Markus Armbruster (11): error: Put error definitions back in alphabetical order error: New QERR_DUPLICATE_ID error: Convert qemu_opts_create() to QError error: New QERR_INVALID_PARAMETER_VALUE error: Convert qemu_opts_set() to QError error: Drop extra messages after qemu_opts_set() and

[Qemu-devel] Re: [PATCH 0/9] Virtio cleanups

2010-03-18 Thread Juan Quintela
Gerd Hoffmann wrote: > Hi, > >>> I think we should move away from struct layout assumptions that >>> DO_UPCAST enforces, and to use container_of where possible. >>> I'll post a series shortly that do this for virtio. >> >> Not in this case. qdev needs it to be in that order, and that will not >

Re: [Qemu-devel] Re: [PATCH 0/9] Virtio cleanups

2010-03-18 Thread Gerd Hoffmann
Hi, I think we should move away from struct layout assumptions that DO_UPCAST enforces, and to use container_of where possible. I'll post a series shortly that do this for virtio. Not in this case. qdev needs it to be in that order, and that will not change without changing everything again

[Qemu-devel] Re: [PATCH 0/9] Virtio cleanups

2010-03-18 Thread Juan Quintela
"Michael S. Tsirkin" wrote: > On Thu, Mar 18, 2010 at 02:43:04PM +0100, Juan Quintela wrote: >> "Michael S. Tsirkin" wrote: >> > On Thu, Mar 18, 2010 at 12:53:06PM +0100, Juan Quintela wrote: >> >> >> >> You cant. Your trick of creating of mallocking in the caller the struct >> >> don't work fo

[Qemu-devel] Re: [PATCH 0/9] Virtio cleanups

2010-03-18 Thread Michael S. Tsirkin
On Thu, Mar 18, 2010 at 02:43:04PM +0100, Juan Quintela wrote: > "Michael S. Tsirkin" wrote: > > On Thu, Mar 18, 2010 at 12:53:06PM +0100, Juan Quintela wrote: > >> > >> You cant. Your trick of creating of mallocking in the caller the struct > >> don't work for qdev. qdev is the one that create

[Qemu-devel] Re: [PATCH 6/9] virtio-pci: Remove duplicate test

2010-03-18 Thread Juan Quintela
"Michael S. Tsirkin" wrote: >> It makes my vmstate work more complex, because this is the only user >> that calls a vvnmstat* and uses _nothing_ of it. >> >> rest of users are something like: >> >> VMSTATE(, test_function); >> >> on the caller side. As virtio already needs to know msix us

[Qemu-devel] Re: [PATCH 0/9] Virtio cleanups

2010-03-18 Thread Juan Quintela
"Michael S. Tsirkin" wrote: > On Thu, Mar 18, 2010 at 12:53:06PM +0100, Juan Quintela wrote: >> >> You cant. Your trick of creating of mallocking in the caller the struct >> don't work for qdev. qdev is the one that creates it. Again, any other >> implementation is going to be more complex for

[Qemu-devel] Re: [PATCH 6/9] virtio-pci: Remove duplicate test

2010-03-18 Thread Michael S. Tsirkin
On Thu, Mar 18, 2010 at 12:40:36PM +0100, Juan Quintela wrote: > "Michael S. Tsirkin" wrote: > > On Thu, Mar 18, 2010 at 09:59:03AM +0100, Juan Quintela wrote: > >> "Michael S. Tsirkin" wrote: > >> > On Thu, Mar 18, 2010 at 09:26:10AM +0100, Juan Quintela wrote: > >> >> "Michael S. Tsirkin" wrot

[Qemu-devel] Re: [PATCH 0/9] Virtio cleanups

2010-03-18 Thread Michael S. Tsirkin
On Thu, Mar 18, 2010 at 12:53:06PM +0100, Juan Quintela wrote: > "Michael S. Tsirkin" wrote: > > On Thu, Mar 18, 2010 at 09:36:15AM +0100, Juan Quintela wrote: > >> "Michael S. Tsirkin" wrote: > >> > >> >> Look at the rest of hw/*. > >> > > >> > I think you mean that a similar assumption is ma

Re: [Qemu-devel] [PATCH] QMP: Spec: Private Extensions support

2010-03-18 Thread Luiz Capitulino
On Fri, 05 Mar 2010 20:00:25 +0100 Markus Armbruster wrote: > Anthony asked me to take a stab at rewriting his draft to something more > along the lines of what I'm thinking. Here goes. I put some remarks > [in brackets]. I don't have strong opinions on the differences, so this look ok to me.

[Qemu-devel] Re: virtio_blk_load() question

2010-03-18 Thread Juan Quintela
OHMURA Kei wrote: > Thanks for your reply. > >> When I ported virtio to vmstate, I was unable to get that list not empty >> for more than I tried. It should be not empty in the case of one error >> or similar, but I was not able to reproduce it. > > Actually, I wasn't able to get that condition e

[Qemu-devel] Re: [PATCH 0/9] Virtio cleanups

2010-03-18 Thread Juan Quintela
"Michael S. Tsirkin" wrote: > On Thu, Mar 18, 2010 at 09:36:15AM +0100, Juan Quintela wrote: >> "Michael S. Tsirkin" wrote: >> >> >> Look at the rest of hw/*. >> > >> > I think you mean that a similar assumption is made by lots of >> > other code. Does not mean it's always a good idea and that

[Qemu-devel] Re: [PATCH 6/9] virtio-pci: Remove duplicate test

2010-03-18 Thread Juan Quintela
"Michael S. Tsirkin" wrote: > On Thu, Mar 18, 2010 at 09:59:03AM +0100, Juan Quintela wrote: >> "Michael S. Tsirkin" wrote: >> > On Thu, Mar 18, 2010 at 09:26:10AM +0100, Juan Quintela wrote: >> >> "Michael S. Tsirkin" wrote: >> >> > On Tue, Mar 16, 2010 at 07:51:22PM +0100, Juan Quintela wrote:

Re: [Qemu-devel] [PATCH] Use snapshots from backing disks

2010-03-18 Thread Kevin Wolf
Am 11.03.2010 14:12, schrieb Kevin Wolf: > Am 09.03.2010 02:13, schrieb Rob Earhart: >> Modify the snapshot load path to find and load snapshots contained in backing >> disks, useful when the current disk is a differencing disk. >> >> Add the source of a snapshot when listing snapshots. >> >> This

[Qemu-devel] Re: [PATCH 0/9] Virtio cleanups

2010-03-18 Thread Michael S. Tsirkin
On Thu, Mar 18, 2010 at 09:36:15AM +0100, Juan Quintela wrote: > searching for how to use a qemu api because from only the > prototypes it is not clear, That's the issue right there: if prototype is not enough we should add documentation. > and just pick an example, and that one uses > it in a no

[Qemu-devel] [PATCHv2 5/5] virtio-blk: remove layout assumption

2010-03-18 Thread Michael S. Tsirkin
Use container_of to remove assumption that vdev is 1st member of device state. Signed-off-by: Michael S. Tsirkin --- hw/virtio-blk.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c index 5f61469..ab52d1d 100644 --- a/hw/virtio-blk.c +++

[Qemu-devel] [PATCHv2 4/5] virtio-balloon: remove layout assumptions

2010-03-18 Thread Michael S. Tsirkin
use container_of to remove assumption that vdev is 1st member of structure. Signed-off-by: Michael S. Tsirkin --- hw/virtio-balloon.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/virtio-balloon.c b/hw/virtio-balloon.c index f8ccc00..21687e3 100644 --- a/hw/virti

[Qemu-devel] [PATCHv2 3/5] virtio-serial: remove struct layout assumptions

2010-03-18 Thread Michael S. Tsirkin
Use container_of and remove assumption that vdev is 1st member of structure. Signed-off-by: Michael S. Tsirkin --- hw/virtio-serial-bus.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c index cf6f979..cba60f1 100644

[Qemu-devel] [PATCHv2 2/5] virtio-net: remove layout assumptions

2010-03-18 Thread Michael S. Tsirkin
Use container_of so we do not depend on vdev being first member. Signed-off-by: Michael S. Tsirkin --- hw/virtio-net.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/virtio-net.c b/hw/virtio-net.c index d962a75..ca843f8 100644 --- a/hw/virtio-net.c +++ b/hw/virtio

[Qemu-devel] [PATCHv2 1/5] virtio: add type safe API

2010-03-18 Thread Michael S. Tsirkin
This makes virtio_common_init typesafe in a way that will also let us get rid of struct layout assumptions and of zero initialization assumptions. Signed-off-by: Michael S. Tsirkin --- hw/virtio-balloon.c|6 ++ hw/virtio-blk.c|7 +++ hw/virtio-net.c|7 +++-

[Qemu-devel] [PATCHv2 0/5] virtio: cleanup layout assumptions

2010-03-18 Thread Michael S. Tsirkin
This patchset helps remove the assumption that vdev must be the 1st member in any virtio device implementation. Other assumptions (made by qdev) can be removed in a similar way separately, this patchset does not do this yet. We also make it obvious that all of device structure is zero initialized,

[Qemu-devel] Re: virtio_blk_load() question

2010-03-18 Thread OHMURA Kei
Thanks for your reply. When I ported virtio to vmstate, I was unable to get that list not empty for more than I tried. It should be not empty in the case of one error or similar, but I was not able to reproduce it. Actually, I wasn't able to get that condition either. We're having problem in

[Qemu-devel] Re: [PATCH 0/5] virtio: cleanup layout assumptions

2010-03-18 Thread Michael S. Tsirkin
On Thu, Mar 18, 2010 at 09:23:10AM +0100, Juan Quintela wrote: > Furthermore, your VIRTIO_COMMON_INIT() macro is ugly as hell, again to > gain us nothing. You are right here. Hang on, I'll fix it.

Re: [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abort()

2010-03-18 Thread Paolo Bonzini
> The guest replacing one of QEMU's handlers with SIG_IGN or SIG_DFL would > be "fun", too. No idea whether that's actually possible; I know next to > nothing about user mode emulation. No, the guest program cannot replace QEMU's handlers; the host OS always sees host_signal_handler for all signa

[Qemu-devel] Re: [PATCH 6/9] virtio-pci: Remove duplicate test

2010-03-18 Thread Michael S. Tsirkin
On Thu, Mar 18, 2010 at 09:59:03AM +0100, Juan Quintela wrote: > "Michael S. Tsirkin" wrote: > > On Thu, Mar 18, 2010 at 09:26:10AM +0100, Juan Quintela wrote: > >> "Michael S. Tsirkin" wrote: > >> > On Tue, Mar 16, 2010 at 07:51:22PM +0100, Juan Quintela wrote: > >> >> We already do the test for

[Qemu-devel] Re: [PATCH 0/9] Virtio cleanups

2010-03-18 Thread Michael S. Tsirkin
On Thu, Mar 18, 2010 at 09:36:15AM +0100, Juan Quintela wrote: > "Michael S. Tsirkin" wrote: > > >> Look at the rest of hw/*. > > > > I think you mean that a similar assumption is made by lots of > > other code. Does not mean it's always a good idea and that > > we need to force this assumption

[Qemu-devel] Re: [PATCH 6/9] virtio-pci: Remove duplicate test

2010-03-18 Thread Juan Quintela
"Michael S. Tsirkin" wrote: > On Thu, Mar 18, 2010 at 09:26:10AM +0100, Juan Quintela wrote: >> "Michael S. Tsirkin" wrote: >> > On Tue, Mar 16, 2010 at 07:51:22PM +0100, Juan Quintela wrote: >> >> We already do the test for msix on the caller, just use that test >> >> >> >> Signed-off-by: Juan

[Qemu-devel] Re: [PATCH 6/9] virtio-pci: Remove duplicate test

2010-03-18 Thread Michael S. Tsirkin
On Thu, Mar 18, 2010 at 09:26:10AM +0100, Juan Quintela wrote: > "Michael S. Tsirkin" wrote: > > On Tue, Mar 16, 2010 at 07:51:22PM +0100, Juan Quintela wrote: > >> We already do the test for msix on the caller, just use that test > >> > >> Signed-off-by: Juan Quintela > > > > NAK > > > > I thin

[Qemu-devel] Re: [PATCH 0/9] Virtio cleanups

2010-03-18 Thread Juan Quintela
"Michael S. Tsirkin" wrote: >> Look at the rest of hw/*. > > I think you mean that a similar assumption is made by lots of > other code. Does not mean it's always a good idea and that > we need to force this assumption everywhere. Principle of Least Surprise. as posted in the other email, rem

Re: [Qemu-devel] Re: [PATCH, RFC] Replace assert(0) with abort() or cpu_abort()

2010-03-18 Thread Markus Armbruster
Jamie Lokier writes: > Markus Armbruster wrote: >> Paolo Bonzini writes: >> >> > On 03/15/2010 07:36 PM, Markus Armbruster wrote: >> >> Please don't tell me that user emulators make abort() return. abort() >> >> is declared __noreturn__, and the optimizer may well rely on that. >> > >> > If th

[Qemu-devel] Re: [PATCH 6/9] virtio-pci: Remove duplicate test

2010-03-18 Thread Juan Quintela
"Michael S. Tsirkin" wrote: > On Tue, Mar 16, 2010 at 07:51:22PM +0100, Juan Quintela wrote: >> We already do the test for msix on the caller, just use that test >> >> Signed-off-by: Juan Quintela > > NAK > > I think we are better off not making assumptions > about caller behaviour in msix.c, vi

[Qemu-devel] Re: [PATCH 0/5] virtio: cleanup layout assumptions

2010-03-18 Thread Juan Quintela
"Michael S. Tsirkin" wrote: > This patchset helps remove the assumption that vdev must be the 1st > member in any virtio device implementation. Other assumptions (made by > qdev) can be removed in a similar way separately, this patchset does not > do this yet. > Juan, this is an alternative to you

[Qemu-devel] Re: [PATCH 0/9] Virtio cleanups

2010-03-18 Thread Michael S. Tsirkin
On Thu, Mar 18, 2010 at 08:36:26AM +0100, Juan Quintela wrote: > "Michael S. Tsirkin" wrote: > > On Tue, Mar 16, 2010 at 07:51:16PM +0100, Juan Quintela wrote: > >> Hi > >> > >> This series introduces several virtio cleanups: > >> - add comment to pci (mst) > >> - tell virtio about DO_UPCAST > >

[Qemu-devel] Re: virtio_blk_load() question

2010-03-18 Thread Juan Quintela
OHMURA Kei wrote: > Hi, > > I have a question regarding virtio_blk_load(). > (qemu-kvm.git d1fa468c1cc03ea362d8fe3ed9269bab4d197510) > > VirtIOBlockReq structure is linked list of requests, but it doesn't seem to be > properly linked in virtio_blk_load(). > ... > req->next = s->rq; > s->rq = req->

[Qemu-devel] Re: [PATCH 0/9] Virtio cleanups

2010-03-18 Thread Juan Quintela
"Michael S. Tsirkin" wrote: > On Tue, Mar 16, 2010 at 07:51:16PM +0100, Juan Quintela wrote: >> Hi >> >> This series introduces several virtio cleanups: >> - add comment to pci (mst) >> - tell virtio about DO_UPCAST > > I think we should move away from struct layout assumptions that > DO_UPCAST e

[Qemu-devel] Re: [PATCH 5/9] virtio: Use DO_UPCAST instead of a cast

2010-03-18 Thread Michael S. Tsirkin
On Tue, Mar 16, 2010 at 07:51:21PM +0100, Juan Quintela wrote: > virtio_common_init() creates a struct with the right size, DO_UPCAST > is the appropiate thing here > > Signed-off-by: Juan Quintela Sent a replacement patch for this. > --- > hw/virtio-balloon.c |4 ++-- > hw/virtio-blk.c

[Qemu-devel] Re: [PATCH 4/9] virtio: Teach virtio-net about DO_UPCAST

2010-03-18 Thread Michael S. Tsirkin
On Tue, Mar 16, 2010 at 07:51:20PM +0100, Juan Quintela wrote: > Signed-off-by: Juan Quintela Sent a replacement patch for this. > --- > hw/virtio-net.c | 21 - > 1 files changed, 8 insertions(+), 13 deletions(-) > > diff --git a/hw/virtio-net.c b/hw/virtio-net.c > index

[Qemu-devel] Re: [PATCH 3/9] virtio: Teach virtio-blk about DO_UPCAST

2010-03-18 Thread Michael S. Tsirkin
On Tue, Mar 16, 2010 at 07:51:19PM +0100, Juan Quintela wrote: > Signed-off-by: Juan Quintela Sent a replacement patch for this. > --- > hw/virtio-blk.c | 11 +++ > 1 files changed, 3 insertions(+), 8 deletions(-) > > diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c > index 8939bb2..c

[Qemu-devel] Re: [PATCH 2/9] virtio: Teach virtio-balloon about DO_UPCAST

2010-03-18 Thread Michael S. Tsirkin
On Tue, Mar 16, 2010 at 07:51:18PM +0100, Juan Quintela wrote: > Signed-off-by: Juan Quintela Sent a replacement patch for this. > --- > hw/virtio-balloon.c | 11 +++ > 1 files changed, 3 insertions(+), 8 deletions(-) > > diff --git a/hw/virtio-balloon.c b/hw/virtio-balloon.c > inde

[Qemu-devel] Re: [PATCH 8/9] virtio-blk: change rq type to VirtIOBlockReq

2010-03-18 Thread Michael S. Tsirkin
On Tue, Mar 16, 2010 at 07:51:24PM +0100, Juan Quintela wrote: > Signed-off-by: Juan Quintela Acked-by: Michael S. Tsirkin > --- > hw/virtio-blk.c |8 +--- > 1 files changed, 5 insertions(+), 3 deletions(-) > > diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c > index 672a07b..c2ee27d 10

[Qemu-devel] Re: [PATCH 6/9] virtio-pci: Remove duplicate test

2010-03-18 Thread Michael S. Tsirkin
On Tue, Mar 16, 2010 at 07:51:22PM +0100, Juan Quintela wrote: > We already do the test for msix on the caller, just use that test > > Signed-off-by: Juan Quintela NAK I think we are better off not making assumptions about caller behaviour in msix.c, virtio will not be the only user forever. >

[Qemu-devel] [PATCH 5/5] virtio-blk: remove layout assumption

2010-03-18 Thread Michael S. Tsirkin
Use container_of to remove assumption that vdev is 1st member of device state. Signed-off-by: Michael S. Tsirkin --- hw/virtio-blk.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c index b89f1f4..4ab6671 100644 --- a/hw/virtio-blk.c +++

[Qemu-devel] [PATCH 4/5] virtio-balloon: remove layout assumptions

2010-03-18 Thread Michael S. Tsirkin
use container_of to remove assumption that vdev is 1st member of structure. Signed-off-by: Michael S. Tsirkin --- hw/virtio-balloon.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/virtio-balloon.c b/hw/virtio-balloon.c index 5a3be22..f80f6d0 100644 --- a/hw/virti

[Qemu-devel] [PATCH 3/5] virtio-serial: remove struct layout assumptions

2010-03-18 Thread Michael S. Tsirkin
Use container_of and remove assumption that vdev is 1st member of structure. Signed-off-by: Michael S. Tsirkin --- hw/virtio-serial-bus.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/virtio-serial-bus.c b/hw/virtio-serial-bus.c index 72425f3..6da6449 100644

[Qemu-devel] [PATCH 2/5] virtio-net: remove layout assumptions

2010-03-18 Thread Michael S. Tsirkin
Use container_of so we do not depend on vdev being first member. Signed-off-by: Michael S. Tsirkin --- hw/virtio-net.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/virtio-net.c b/hw/virtio-net.c index 5edb354..ae7751c 100644 --- a/hw/virtio-net.c +++ b/hw/virtio

[Qemu-devel] [PATCH 1/5] virtio: add type safe API

2010-03-18 Thread Michael S. Tsirkin
This adds VIRTIO_COMMON_INIT which is type-safe and let us get rid of struct layout assumptions. Signed-off-by: Michael S. Tsirkin --- hw/virtio-balloon.c|5 ++--- hw/virtio-blk.c|6 +++--- hw/virtio-net.c|6 +++--- hw/virtio-serial-bus.c |6 +++--- hw/virtio.

[Qemu-devel] [PATCH 0/5] virtio: cleanup layout assumptions

2010-03-18 Thread Michael S. Tsirkin
This patchset helps remove the assumption that vdev must be the 1st member in any virtio device implementation. Other assumptions (made by qdev) can be removed in a similar way separately, this patchset does not do this yet. Juan, this is an alternative to your 'tell virtio about DO_UPCAST' patch,