[Qemu-devel] [patch] replace all strdup() with g_strdup()

2011-12-16 Thread Jun Koi
This patch replaces all the strdup() with g_strdup() Signed-off-by: Jun Koi $ diffstat strdup.diff cmd.c |4 ++-- envlist.c |6 +++--- exec.c |2 +- hw/isa-bus.c|2 +- hw/pc.c |2 +- hw/pci.c|2 +- hw/q

Re: [Qemu-devel] [patch] replace all strdup() with g_strdup()

2011-12-16 Thread 陳韋任
Hi, You can check http://wiki.qemu.org/Contribute/SubmitAPatch to see how to send patch to qemu-devel. :) Regards, chenwj -- Wei-Ren Chen (陳韋任) Computer Systems Lab, Institute of Information Science, Academia Sinica, Taiwan (R.O.C.) Tel:886-2-2788-3799 #1667 Homepage: http://people.cs.nctu.ed

[Qemu-devel] [Bug 899961] Re: qemu/kvm locks up when run 32bit userspace with 64bit kernel

2011-12-16 Thread Michael Tokarev
** Bug watch added: Debian Bug tracker #652329 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652329 ** Also affects: qemu-kvm (Debian) via http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=652329 Importance: Unknown Status: Unknown -- You received this bug notification because

Re: [Qemu-devel] [RFC] virtio-console fails on unconnected pty

2011-12-16 Thread Amit Shah
Hi Christian, On (Thu) 15 Dec 2011 [13:44:41], Christian Borntraeger wrote: > Amit, > > when I tried qemu with -virtio-console pty the guest hangs and attaching on > /dev/pts/ does > not return anything if the attachement is too late. Unfortunately we don't yet have chardevs to signal to fronte

Re: [Qemu-devel] [BUG] [Seabios] PCI 64bit BARs on Win2008 - unable to start the device. (ACPI lacks the _DSM method)

2011-12-16 Thread Gerd Hoffmann
On 12/16/11 05:41, Alexey Korolev wrote: >>> I wonder if there any particular reason to separate prefetchable a >>> non-prefetchable memory regions in pciinit? Extra two more regions would >>> make code more complex. >> Oh yes, there is. Which reminds me that the whole thing isn't that easy >> unf

Re: [Qemu-devel] [patch] replace all strdup() with g_strdup()

2011-12-16 Thread Peter Maydell
On 16 December 2011 08:07, Jun Koi wrote: > This patch replaces all the strdup() with g_strdup() I don't think you can do this as a pure search-and-replace. For example this change: > --- a/envlist.c > +++ b/envlist.c > @@ -109,7 +109,7 @@ envlist_parse(envlist_t *envlist, const char *env, >

Re: [Qemu-devel] [patch] replace all strdup() with g_strdup()

2011-12-16 Thread Paolo Bonzini
On 12/16/2011 09:07 AM, Jun Koi wrote: This patch replaces all the strdup() with g_strdup() Signed-off-by: Jun Koi $ diffstat strdup.diff cmd.c |4 ++-- envlist.c |6 +++--- exec.c |2 +- hw/isa-bus.c|2 +- hw/pc.c |

Re: [Qemu-devel] [Bug 899140] Re: Problem with Linux Kernel Traffic Control

2011-12-16 Thread Stefan Hajnoczi
On Thu, Dec 15, 2011 at 04:48:13PM -, Vincent Autefage wrote: > Here is the problem ! > > The Ubuntu version works only because it not uses an *Intel e1000* but a > *rtl8139*. > Therefore, the problem about the e1000 is present in *all* version > (original or ubuntu ones). > > Thus, the fil

Re: [Qemu-devel] [PATCH v3 2/9] block: add BlockJob interface for long-running operations

2011-12-16 Thread Stefan Hajnoczi
On Thu, Dec 15, 2011 at 08:40:08AM -0200, Marcelo Tosatti wrote: > On Wed, Dec 14, 2011 at 02:51:47PM +0100, Kevin Wolf wrote: > > Am 13.12.2011 14:52, schrieb Stefan Hajnoczi: > > > Signed-off-by: Stefan Hajnoczi > > > --- > > > block_int.h | 83 > > > +

Re: [Qemu-devel] [Qemu-trivial][PATCH] linux-user/main.c: Add option to user-mode emulation so that user can specify log file name

2011-12-16 Thread 陳韋任
Hi Riku, Ping? This patch still applies TOT. Thanks. Regards, chenwj -- Wei-Ren Chen (陳韋任) Computer Systems Lab, Institute of Information Science, Academia Sinica, Taiwan (R.O.C.) Tel:886-2-2788-3799 #1667 Homepage: http://people.cs.nctu.edu.tw/~chenwj

Re: [Qemu-devel] [PATCH v3 00/20] qom: dynamic properties and composition tree

2011-12-16 Thread Kevin Wolf
Am 15.12.2011 19:10, schrieb Anthony Liguori: > On 12/12/2011 02:29 PM, Anthony Liguori wrote: >> This is a follow up to my previous series to get us started in the QOM >> direction. A few things are different this time around. Most notably: >> >> 1) Devices no longer have names. Instead, path

Re: [Qemu-devel] [PATCH] virtio-serial: Allow one MSI-X vector per virtqueue

2011-12-16 Thread Amit Shah
On (Fri) 16 Dec 2011 [09:14:26], zanghongy...@huawei.com wrote: > From: Hongyong Zang > > In pci_enable_msix(), the guest's virtio-serial driver tries to set msi-x > with one vector per queue. But it fails and eventually all virtio-serial > ports share one MSI-X vector. Because every virtio-seria

Re: [Qemu-devel] [patch] replace all strdup() with g_strdup()

2011-12-16 Thread Daniel P. Berrange
On Fri, Dec 16, 2011 at 10:26:33AM +0100, Paolo Bonzini wrote: > On 12/16/2011 09:07 AM, Jun Koi wrote: > >This patch replaces all the strdup() with g_strdup() > > > >Signed-off-by: Jun Koi > > > >$ diffstat strdup.diff > > cmd.c |4 ++-- > > envlist.c |6 +++--- > >

Re: [Qemu-devel] [Qemu-trivial] [PATCH] ide: drop argument to dma_buf_commit

2011-12-16 Thread Stefan Hajnoczi
On Thu, Dec 15, 2011 at 03:11:16PM +0100, Paolo Bonzini wrote: > The argument is unused and even wrong when the function is called > by ide_handle_rw_error. Drop it. > > Signed-off-by: Paolo Bonzini > --- > hw/ide/core.c |6 +++--- > 1 files changed, 3 insertions(+), 3 deletions(-) Thanks,

Re: [Qemu-devel] [PATCH v3 00/20] qom: dynamic properties and composition tree

2011-12-16 Thread Paolo Bonzini
On 12/16/2011 10:42 AM, Kevin Wolf wrote: > > Applied. > > Regards, > > Anthony Liguori So you pushed this with qdev_property_add_child() calls spread all over the place instead of being treated like other properties?:-( I think actually this is not the biggest problem. child properties ar

Re: [Qemu-devel] [patch] replace all strdup() with g_strdup()

2011-12-16 Thread Paolo Bonzini
On 12/16/2011 10:41 AM, Daniel P. Berrange wrote: Yes& no. In general you are correct that g_malloc/g_strdup needs to be matched with g_free, but in the context of the QEMU binary at least we don't strictly need that. The general issue is that GLib's memory allocators default to the system mall

Re: [Qemu-devel] [Xen-devel] [PATCH] xen-qemu: register virtual iommu device on qemu pci bus

2011-12-16 Thread Wei Wang2
On Thursday 15 December 2011 18:33:33 Ian Jackson wrote: > Wei Wang2 writes ("[Xen-devel] [PATCH] xen-qemu: register virtual iommu device on qemu pci bus"): > > Attached patch is for qemu to register iommu device on pci bus. Guest OS > > requires this to access iommu pci config space in some cases

Re: [Qemu-devel] [PATCH v3 00/20] qom: dynamic properties and composition tree

2011-12-16 Thread Kevin Wolf
Am 16.12.2011 11:17, schrieb Paolo Bonzini: > On 12/16/2011 10:42 AM, Kevin Wolf wrote: Applied. Regards, Anthony Liguori >> So you pushed this with qdev_property_add_child() calls spread all over >> the place instead of being treated like other properties?:-( > >

Re: [Qemu-devel] [Qemu-trivial] [PATCH] Makefile.target: Remove unnecessary dependency rules

2011-12-16 Thread Stefan Hajnoczi
On Thu, Dec 15, 2011 at 06:28:52PM +, Peter Maydell wrote: > Remove some dependency rules which aren't necessary (the automatically > generated .d files cover all these). These were leftovers from dyngen > days, when the object files also had a dependency on some generated > files. > > Signed-

Re: [Qemu-devel] [PATCH] stellaris: Calculate system clock period on reset

2011-12-16 Thread Stefan Hajnoczi
On Thu, Dec 15, 2011 at 06:58:26PM +, Peter Maydell wrote: > Calculate the system clock period on reset; otherwise it remains > set to the default value of zero and attempting to use it provokes > a hang. This is one of the issues noted in LP:696094. > > Signed-off-by: Peter Maydell > --- >

Re: [Qemu-devel] [PATCH] kvm: Print something before calling abort() if KVM_RUN fails

2011-12-16 Thread Stefan Hajnoczi
On Fri, Dec 16, 2011 at 11:20:20AM +1100, Michael Ellerman wrote: > It's a little unfriendly to call abort() without printing any sort of > error message. So turn the DPRINTK() into an fprintf(stderr, ...). > > Signed-off-by: Michael Ellerman > --- > kvm-all.c |3 ++- > 1 files changed, 2 in

[Qemu-devel] [PATCH] usb-host: rip out legacy procfs support

2011-12-16 Thread Gerd Hoffmann
This patch removes support for parsing /proc/bus/usb/devices for device discovery. The code lacks a few features compared to the sysfs code and is also bitrotting as everybody has sysfs these days. This implies having sysfs mounted is mandatory now to use the usb-host driver. udev isn't required

[Qemu-devel] [PATCH 3/8] qom: fix swapped parameters

2011-12-16 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- hw/qdev.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/qdev.c b/hw/qdev.c index 83913c7..bda8d6c 100644 --- a/hw/qdev.c +++ b/hw/qdev.c @@ -1110,7 +1110,7 @@ void qdev_property_set(DeviceState *dev, Visitor *v, const char *name,

[Qemu-devel] [PATCH 7/8] qom: distinguish "legacy" property type name from QOM type name

2011-12-16 Thread Paolo Bonzini
For non-string properties, there is no reason to distinguish type names such as "uint32" or "hex32". Restrict those to legacy properties. Signed-off-by: Paolo Bonzini --- hw/qdev-properties.c | 12 hw/qdev.c|9 ++--- hw/qdev.h|1 + 3 files chan

[Qemu-devel] [PATCH 0/8] qom: introduce non-legacy static properties

2011-12-16 Thread Paolo Bonzini
QOM right now does not have a way to communicate values for qdev properties except as strings. This is bad. This patch improves the Property implementation so that properties export a visitor-based interface in addition to the string-based interface. The new interface can then be registered as a

[Qemu-devel] [PATCH 1/8] qapi: fix NULL pointer dereference

2011-12-16 Thread Paolo Bonzini
QAPI currently cannot deal with no object pushed to the stack, and dereferences a NULL pointer. This is visible with qom-get path=/i440fx/piix3 property=romfile after static non-string properties are introduced. Signed-off-by: Paolo Bonzini --- qapi/qmp-output-visitor.c |4 ++-- 1 fil

Re: [Qemu-devel] [PATCH v3 00/20] qom: dynamic properties and composition tree

2011-12-16 Thread Paolo Bonzini
On 12/16/2011 11:36 AM, Kevin Wolf wrote: > I think actually this is not the biggest problem. child properties are > dynamic, and it's not a problem IMO if they are created like that. That they are added in an init function is an indicator that they aren't really dynamic. That's true. Howe

[Qemu-devel] [PATCH 4/8] qom: push permission checks up into qdev_property_add_legacy

2011-12-16 Thread Paolo Bonzini
qdev_property_get and qdev_property_set can generate permission denied errors themselves. Do not duplicate this functionality in qdev_get/set_legacy_property, and clean up excessive indentation. Signed-off-by: Paolo Bonzini --- hw/qdev.c | 46 +++--- 1

[Qemu-devel] [PATCH 2/8] qapi: protect against NULL QObject in qmp_input_get_object

2011-12-16 Thread Paolo Bonzini
A NULL qobj can occur when a parameter is fetched via qdict_get, but the parameter is not in the command. By returning NULL, the caller can choose whether to raise a missing parameter error, an invalid parameter type error, or use a default value. For example, qom-set could can use this to reset

[Qemu-devel] [PATCH 8/8] qom: register qdev properties also as non-legacy properties

2011-12-16 Thread Paolo Bonzini
Push legacy properties into a legacy<...> namespace, and make them available with correct types too. Signed-off-by: Paolo Bonzini --- hw/qdev.c | 28 +--- hw/qdev.h |7 +++ 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/hw/qdev.c b/hw/qdev.c ind

[Qemu-devel] [PATCH 5/8] qom: introduce QERR_PROPERTY_VALUE_OUT_OF_RANGE

2011-12-16 Thread Paolo Bonzini
This will be used when reject invalid values for integer fields that are less than 64-bits wide. Signed-off-by: Paolo Bonzini --- qerror.c |5 + qerror.h |3 +++ 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/qerror.c b/qerror.c index adde8a5..9a75d06 100644 --- a/qer

[Qemu-devel] [PATCH 6/8] qom: introduce get/set methods for Property

2011-12-16 Thread Paolo Bonzini
This patch adds a visitor interface to Property. This way, QOM will be able to expose Properties that access a fixed field in a struct without exposing also the everything-is-a-string "feature" of qdev properties. Whenever the printed representation in both QOM and qdev (which is typically the ca

Re: [Qemu-devel] [PATCH v3 00/20] qom: dynamic properties and composition tree

2011-12-16 Thread Kevin Wolf
Am 16.12.2011 13:24, schrieb Paolo Bonzini: > On 12/16/2011 11:36 AM, Kevin Wolf wrote: >>> I think actually this is not the biggest problem. child properties are >>> dynamic, and it's not a problem IMO if they are created like that. >> >> That they are added in an init function is an indicator

Re: [Qemu-devel] [PATCH 6/8] qom: introduce get/set methods for Property

2011-12-16 Thread Gerd Hoffmann
Hi, > PropertyInfo qdev_prop_drive = { > .name = "drive", > .type = PROP_TYPE_DRIVE, > .size = sizeof(BlockDriverState *), > .parse = parse_drive, > .print = print_drive, > +.get = get_generic, > +.set = set_generic, > .free = free_drive, > }; >

Re: [Qemu-devel] [PATCH v3 00/20] qom: dynamic properties and composition tree

2011-12-16 Thread Paolo Bonzini
On 12/16/2011 01:55 PM, Kevin Wolf wrote: I don't think that not remembering the child device because you don't need to reference it any more makes it any less static. You could easily add the struct member, assign it once and then it matches your definition of static. I think in that case you

Re: [Qemu-devel] [PATCH v3 00/20] qom: dynamic properties and composition tree

2011-12-16 Thread Anthony Liguori
On 12/16/2011 03:42 AM, Kevin Wolf wrote: Am 15.12.2011 19:10, schrieb Anthony Liguori: On 12/12/2011 02:29 PM, Anthony Liguori wrote: This is a follow up to my previous series to get us started in the QOM direction. A few things are different this time around. Most notably: 1) Devices no

Re: [Qemu-devel] [PATCH v3 00/20] qom: dynamic properties and composition tree

2011-12-16 Thread Anthony Liguori
On 12/16/2011 04:17 AM, Paolo Bonzini wrote: On 12/16/2011 10:42 AM, Kevin Wolf wrote: > > Applied. > > Regards, > > Anthony Liguori So you pushed this with qdev_property_add_child() calls spread all over the place instead of being treated like other properties?:-( I think actually this is no

Re: [Qemu-devel] [PATCH 6/8] qom: introduce get/set methods for Property

2011-12-16 Thread Paolo Bonzini
On 12/16/2011 02:11 PM, Gerd Hoffmann wrote: I think we should not touch these. First it doesn't buy us much as we are using the old parse/print functions for the visitor-based access, which doesn't look like a good idea to me. Also they will not stay but will be converted to child<> and link<

Re: [Qemu-devel] [PATCH v3 00/20] qom: dynamic properties and composition tree

2011-12-16 Thread Anthony Liguori
On 12/16/2011 06:24 AM, Paolo Bonzini wrote: On 12/16/2011 11:36 AM, Kevin Wolf wrote: > I think actually this is not the biggest problem. child properties are > dynamic, and it's not a problem IMO if they are created like that. That they are added in an init function is an indicator that they

Re: [Qemu-devel] [PATCH v3 00/20] qom: dynamic properties and composition tree

2011-12-16 Thread Anthony Liguori
On 12/16/2011 07:28 AM, Paolo Bonzini wrote: On 12/16/2011 01:55 PM, Kevin Wolf wrote: I don't think that not remembering the child device because you don't need to reference it any more makes it any less static. You could easily add the struct member, assign it once and then it matches your def

Re: [Qemu-devel] [PATCH v3 00/20] qom: dynamic properties and composition tree

2011-12-16 Thread Paolo Bonzini
On 12/16/2011 02:51 PM, Anthony Liguori wrote: struct ISASerial { Device parent; UART _child uart; ISABus _link *bus; }; A child should be able to be part of the parent devices memory with its life cycle bound to the parents life cycle. This is why a child property shouldn't be nul

Re: [Qemu-devel] [PATCH 0/8] qom: introduce non-legacy static properties

2011-12-16 Thread Anthony Liguori
On 12/16/2011 06:01 AM, Paolo Bonzini wrote: QOM right now does not have a way to communicate values for qdev properties except as strings. This is bad. This patch improves the Property implementation so that properties export a visitor-based interface in addition to the string-based interface.

Re: [Qemu-devel] [PATCH 1/8] qapi: fix NULL pointer dereference

2011-12-16 Thread Anthony Liguori
On 12/16/2011 06:01 AM, Paolo Bonzini wrote: QAPI currently cannot deal with no object pushed to the stack, and dereferences a NULL pointer. This is visible with qom-get path=/i440fx/piix3 property=romfile after static non-string properties are introduced. I'm a bit confused about what'

Re: [Qemu-devel] [PATCH 2/8] qapi: protect against NULL QObject in qmp_input_get_object

2011-12-16 Thread Anthony Liguori
On 12/16/2011 06:01 AM, Paolo Bonzini wrote: A NULL qobj can occur when a parameter is fetched via qdict_get, but the parameter is not in the command. By returning NULL, the caller can choose whether to raise a missing parameter error, an invalid parameter type error, or use a default value. Fo

Re: [Qemu-devel] [PATCH 3/8] qom: fix swapped parameters

2011-12-16 Thread Anthony Liguori
On 12/16/2011 06:01 AM, Paolo Bonzini wrote: Signed-off-by: Paolo Bonzini Yeah, this code path is currently dead as there is no way to test it until we defer s/init/realize/ and defer it to guest launch. In my next series when I introduce Object and move properties into it, we can write som

Re: [Qemu-devel] [PATCH 4/8] qom: push permission checks up into qdev_property_add_legacy

2011-12-16 Thread Anthony Liguori
On 12/16/2011 06:01 AM, Paolo Bonzini wrote: qdev_property_get and qdev_property_set can generate permission denied errors themselves. Do not duplicate this functionality in qdev_get/set_legacy_property, and clean up excessive indentation. Signed-off-by: Paolo Bonzini Nice cleanup. Reviewed-

Re: [Qemu-devel] [PATCH 5/8] qom: introduce QERR_PROPERTY_VALUE_OUT_OF_RANGE

2011-12-16 Thread Anthony Liguori
On 12/16/2011 06:01 AM, Paolo Bonzini wrote: This will be used when reject invalid values for integer fields that are less than 64-bits wide. Signed-off-by: Paolo Bonzini I'd rather use generic errors when possible. How about VALUE_OUT_OF_RANGE and we can make the message "'%(item)' doesn't

Re: [Qemu-devel] [PATCH 1/8] qapi: fix NULL pointer dereference

2011-12-16 Thread Paolo Bonzini
On 12/16/2011 02:55 PM, Anthony Liguori wrote: This is visible with qom-get path=/i440fx/piix3 property=romfile after static non-string properties are introduced. I'm a bit confused about what's happening here. What's the significance of non-string properties? Should have been "static

Re: [Qemu-devel] [PATCH 5/8] qom: introduce QERR_PROPERTY_VALUE_OUT_OF_RANGE

2011-12-16 Thread Paolo Bonzini
On 12/16/2011 03:00 PM, Anthony Liguori wrote: This will be used when reject invalid values for integer fields that are less than 64-bits wide. Signed-off-by: Paolo Bonzini I'd rather use generic errors when possible. How about VALUE_OUT_OF_RANGE and we can make the message "'%(item)' doesn't

[Qemu-devel] [PATCH] i440fx: clean up

2011-12-16 Thread Paolo Bonzini
Add the piix3 child also in the Xen case. Drop the unused piix3 field from PCII440FXState. Signed-off-by: Paolo Bonzini --- hw/piix_pci.c |8 +++- 1 files changed, 3 insertions(+), 5 deletions(-) diff --git a/hw/piix_pci.c b/hw/piix_pci.c index d785d4b..8d106a8 100644 --- a/hw/piix_pci

Re: [Qemu-devel] [PATCH 6/8] qom: introduce get/set methods for Property

2011-12-16 Thread Anthony Liguori
On 12/16/2011 07:51 AM, Paolo Bonzini wrote: On 12/16/2011 02:11 PM, Gerd Hoffmann wrote: I think we should not touch these. First it doesn't buy us much as we are using the old parse/print functions for the visitor-based access, which doesn't look like a good idea to me. Also they will not stay

Re: [Qemu-devel] [PATCH 7/8] qom: distinguish "legacy" property type name from QOM type name

2011-12-16 Thread Anthony Liguori
On 12/16/2011 06:01 AM, Paolo Bonzini wrote: For non-string properties, there is no reason to distinguish type names such as "uint32" or "hex32". Restrict those to legacy properties. Signed-off-by: Paolo Bonzini --- hw/qdev-properties.c | 12 hw/qdev.c|9 ++

Re: [Qemu-devel] [PATCH 1/8] qapi: fix NULL pointer dereference

2011-12-16 Thread Anthony Liguori
On 12/16/2011 08:00 AM, Paolo Bonzini wrote: On 12/16/2011 02:55 PM, Anthony Liguori wrote: This is visible with qom-get path=/i440fx/piix3 property=romfile after static non-string properties are introduced. I'm a bit confused about what's happening here. What's the significance of non-strin

Re: [Qemu-devel] [PATCH v3 00/20] qom: dynamic properties and composition tree

2011-12-16 Thread Anthony Liguori
On 12/16/2011 07:52 AM, Paolo Bonzini wrote: On 12/16/2011 02:51 PM, Anthony Liguori wrote: struct ISASerial { Device parent; UART _child uart; ISABus _link *bus; }; A child should be able to be part of the parent devices memory with its life cycle bound to the parents life cycle. This is why

Re: [Qemu-devel] [PATCH v3 00/20] qom: dynamic properties and composition tree

2011-12-16 Thread Kevin Wolf
Am 16.12.2011 14:51, schrieb Anthony Liguori: > On 12/16/2011 06:24 AM, Paolo Bonzini wrote: >> On 12/16/2011 11:36 AM, Kevin Wolf wrote: I think actually this is not the biggest problem. child properties are dynamic, and it's not a problem IMO if they are created like that. >>> >>> That

Re: [Qemu-devel] [PATCH 6/8] qom: introduce get/set methods for Property

2011-12-16 Thread Paolo Bonzini
On 12/16/2011 03:05 PM, Anthony Liguori wrote: I thought the same initially. However, I noticed that the visitor interfaces for links is also a string. So, even if a block/char/netdev property later becomes a link<>, the interface would not change. The semantics change though. A "drive" link

Re: [Qemu-devel] [PATCH 7/8] qom: distinguish "legacy" property type name from QOM type name

2011-12-16 Thread Paolo Bonzini
On 12/16/2011 03:06 PM, Anthony Liguori wrote: -type = g_strdup_printf("legacy<%s>", prop->info->name); +type = g_strdup_printf("legacy<%s>", + prop->info->legacy_name ?: prop->info->name); I think this confuses the legacy type with the legacy property names.

Re: [Qemu-devel] [PATCH 1/8] qapi: fix NULL pointer dereference

2011-12-16 Thread Paolo Bonzini
On 12/16/2011 03:10 PM, Anthony Liguori wrote: If a property function does not set the Error pointer, it must visit something. Hmm, then we have to introduce NULL into QJson and visitors. Paolo

Re: [Qemu-devel] [PATCH 7/8] qom: distinguish "legacy" property type name from QOM type name

2011-12-16 Thread Anthony Liguori
On 12/16/2011 08:18 AM, Paolo Bonzini wrote: On 12/16/2011 03:06 PM, Anthony Liguori wrote: - type = g_strdup_printf("legacy<%s>", prop->info->name); + type = g_strdup_printf("legacy<%s>", + prop->info->legacy_name ?: prop->info->name); I think this confuses the legacy type with the legacy pr

Re: [Qemu-devel] [PATCH 6/8] qom: introduce get/set methods for Property

2011-12-16 Thread Anthony Liguori
On 12/16/2011 08:18 AM, Paolo Bonzini wrote: On 12/16/2011 03:05 PM, Anthony Liguori wrote: I thought the same initially. However, I noticed that the visitor interfaces for links is also a string. So, even if a block/char/netdev property later becomes a link<>, the interface would not change.

Re: [Qemu-devel] [PATCH 1/8] qapi: fix NULL pointer dereference

2011-12-16 Thread Anthony Liguori
On 12/16/2011 08:22 AM, Paolo Bonzini wrote: On 12/16/2011 03:10 PM, Anthony Liguori wrote: If a property function does not set the Error pointer, it must visit something. Hmm, then we have to introduce NULL into QJson and visitors. Visitors assume that strings aren't nullable (which is actu

Re: [Qemu-devel] [PATCH 1/8] qapi: fix NULL pointer dereference

2011-12-16 Thread Paolo Bonzini
On 12/16/2011 03:46 PM, Anthony Liguori wrote: Hmm, then we have to introduce NULL into QJson and visitors. Visitors assume that strings aren't nullable (which is actually true in JSON and in QString). I also think that string properties shouldn't be nullable. Unfortunately, qdev string pro

Re: [Qemu-devel] [RFC] Device isolation infrastructure v2

2011-12-16 Thread Joerg Roedel
On Thu, Dec 15, 2011 at 11:05:07AM -0700, Alex Williamson wrote: > Starting with it in the core and hand waving some future use that we > don't plan to implement right now seems like the wrong direction. I agree with Alex. First of all, I havn't seen any real vfio problem that can't be solved with

Re: [Qemu-devel] [PATCH v3 00/20] qom: dynamic properties and composition tree

2011-12-16 Thread Anthony Liguori
On 12/16/2011 08:18 AM, Kevin Wolf wrote: Am 16.12.2011 14:51, schrieb Anthony Liguori: On 12/16/2011 06:24 AM, Paolo Bonzini wrote: On 12/16/2011 11:36 AM, Kevin Wolf wrote: I think actually this is not the biggest problem. child properties are dynamic, and it's not a problem IMO if they are

Re: [Qemu-devel] [PATCH v3 00/20] qom: dynamic properties and composition tree

2011-12-16 Thread Paolo Bonzini
On 12/16/2011 03:54 PM, Anthony Liguori wrote: Yes. I'm not terribly sure how this would work yet. A link and a child property both acquire references to a device and release a reference to a device at destruction time. For a child property, the reference held by the parent is the only refere

Re: [Qemu-devel] [PATCH 1/8] qapi: fix NULL pointer dereference

2011-12-16 Thread Anthony Liguori
On 12/16/2011 08:49 AM, Paolo Bonzini wrote: On 12/16/2011 03:46 PM, Anthony Liguori wrote: Hmm, then we have to introduce NULL into QJson and visitors. Visitors assume that strings aren't nullable (which is actually true in JSON and in QString). I also think that string properties shouldn't

Re: [Qemu-devel] [PATCH 1/8] qapi: fix NULL pointer dereference

2011-12-16 Thread Paolo Bonzini
On 12/16/2011 03:56 PM, Anthony Liguori wrote: I'd really prefer to stick to non-nullable strings as there is no obvious way to specify NULL in command line options. We can leave it as the default. A property with a non-null default is implicitly not nullable, which actually makes some sense.

Re: [Qemu-devel] [PATCH 1/8] qapi: fix NULL pointer dereference

2011-12-16 Thread Anthony Liguori
On 12/16/2011 09:03 AM, Paolo Bonzini wrote: On 12/16/2011 03:56 PM, Anthony Liguori wrote: I'd really prefer to stick to non-nullable strings as there is no obvious way to specify NULL in command line options. We can leave it as the default. A property with a non-null default is implicitly no

Re: [Qemu-devel] [PATCH v3 00/20] qom: dynamic properties and composition tree

2011-12-16 Thread Kevin Wolf
Am 16.12.2011 15:54, schrieb Anthony Liguori: > On 12/16/2011 08:18 AM, Kevin Wolf wrote: >> Am 16.12.2011 14:51, schrieb Anthony Liguori: >>> What I would like to get to eventually is: >>> >>> struct ISASerial { >>> Device parent; >>> >>> UART _child uart; >>> ISABus _link *bus; >>>

Re: [Qemu-devel] [PATCH 1/8] qapi: fix NULL pointer dereference

2011-12-16 Thread Paolo Bonzini
On 12/16/2011 04:05 PM, Anthony Liguori wrote: What are the uses of null in qdev string properties? I know you can't set a string to null since parse() doesn't have a null syntax. So we're really just talking about an uninitialized state, right? Yes. No ROM BAR is an example of a NULL string

Re: [Qemu-devel] [PATCH 1/8] qapi: fix NULL pointer dereference

2011-12-16 Thread Anthony Liguori
On 12/16/2011 09:13 AM, Paolo Bonzini wrote: On 12/16/2011 04:05 PM, Anthony Liguori wrote: What are the uses of null in qdev string properties? I know you can't set a string to null since parse() doesn't have a null syntax. So we're really just talking about an uninitialized state, right?

Re: [Qemu-devel] [PATCH 1/8] qapi: fix NULL pointer dereference

2011-12-16 Thread Paolo Bonzini
On 12/16/2011 04:23 PM, Anthony Liguori wrote: Ok. I think nullable strings are not a good idea simply because it means that a property can have a state that cannot be set. How is this different from NULL links? (Honest, not trick question :)). Long term, I want to be able to do something l

Re: [Qemu-devel] [PATCH 1/8] qapi: fix NULL pointer dereference

2011-12-16 Thread Anthony Liguori
On 12/16/2011 09:42 AM, Paolo Bonzini wrote: On 12/16/2011 04:23 PM, Anthony Liguori wrote: Ok. I think nullable strings are not a good idea simply because it means that a property can have a state that cannot be set. How is this different from NULL links? (Honest, not trick question :)). An

Re: [Qemu-devel] [PATCH 1/8] qapi: fix NULL pointer dereference

2011-12-16 Thread Paolo Bonzini
On 12/16/2011 04:54 PM, Anthony Liguori wrote: On 12/16/2011 09:42 AM, Paolo Bonzini wrote: On 12/16/2011 04:23 PM, Anthony Liguori wrote: Ok. I think nullable strings are not a good idea simply because it means that a property can have a state that cannot be set. How is this different from N

Re: [Qemu-devel] [PATCH 1/8] qapi: fix NULL pointer dereference

2011-12-16 Thread Gerd Hoffmann
Hi, >> What are the uses of null in qdev string properties? I know you can't >> set a string to null since parse() doesn't have a null syntax. So we're >> really just talking about an uninitialized state, right? > > Yes. No ROM BAR is an example of a NULL string property. Both NULL and zero

[Qemu-devel] [PATCH v2 2/8] qom: fix swapped parameters

2011-12-16 Thread Paolo Bonzini
Reviewed-by: Anthony Liguori Signed-off-by: Paolo Bonzini --- hw/qdev.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/hw/qdev.c b/hw/qdev.c index 83913c7..bda8d6c 100644 --- a/hw/qdev.c +++ b/hw/qdev.c @@ -1110,7 +1110,7 @@ void qdev_property_set(DeviceState *dev, Vis

[Qemu-devel] [PATCH v2 1/8] qapi: protect against NULL QObject in qmp_input_get_object

2011-12-16 Thread Paolo Bonzini
A NULL qobj can occur when a parameter is fetched via qdict_get, but the parameter is not in the command. By returning NULL, the caller can choose whether to raise a missing parameter error, an invalid parameter type error, or use a default value. For example, qom-set could can use this to reset

[Qemu-devel] [PATCH v2 3/8] qom: push permission checks up into qdev_property_add_legacy

2011-12-16 Thread Paolo Bonzini
qdev_property_get and qdev_property_set can generate permission denied errors themselves. Do not duplicate this functionality in qdev_get/set_legacy_property, and clean up excessive indentation. Reviewed-by: Anthony Liguori Signed-off-by: Paolo Bonzini --- hw/qdev.c | 46 +++-

Re: [Qemu-devel] [PATCH v2 4/8] qom: interpret the return value when setting legacy properties

2011-12-16 Thread Anthony Liguori
On 12/16/2011 10:47 AM, Paolo Bonzini wrote: Signed-off-by: Paolo Bonzini --- hw/qdev-properties.c | 39 --- hw/qdev.c|3 +-- hw/qdev.h|2 ++ 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/hw/qdev-propert

Re: [Qemu-devel] [PATCH 5/8] qom: introduce QERR_PROPERTY_VALUE_OUT_OF_RANGE

2011-12-16 Thread Paolo Bonzini
On 12/16/2011 03:01 PM, Paolo Bonzini wrote: I'd rather use generic errors when possible. How about VALUE_OUT_OF_RANGE and we can make the message "'%(item)' doesn't take value..." and pass "%s.%s" % (device, property) for item. Ok. I didn't do this in the end for two reasons. First, that

Re: [Qemu-devel] [PATCH v2 5/8] qom: introduce QERR_PROPERTY_VALUE_OUT_OF_RANGE

2011-12-16 Thread Anthony Liguori
On 12/16/2011 10:47 AM, Paolo Bonzini wrote: This will be used when reject invalid values for integer fields that are less than 64-bits wide. Signed-off-by: Paolo Bonzini VALUE_OUT_OF_RANGE? Regards, Anthony Liguori --- qerror.c |5 + qerror.h |3 +++ 2 files changed, 8 ins

Re: [Qemu-devel] [PATCH 5/8] qom: introduce QERR_PROPERTY_VALUE_OUT_OF_RANGE

2011-12-16 Thread Anthony Liguori
On 12/16/2011 11:00 AM, Paolo Bonzini wrote: On 12/16/2011 03:01 PM, Paolo Bonzini wrote: I'd rather use generic errors when possible. How about VALUE_OUT_OF_RANGE and we can make the message "'%(item)' doesn't take value..." and pass "%s.%s" % (device, property) for item. Ok. I didn't do t

Re: [Qemu-devel] [PATCH v2 6/8] qom: introduce get/set methods for Property

2011-12-16 Thread Anthony Liguori
On 12/16/2011 10:47 AM, Paolo Bonzini wrote: This patch adds a visitor interface to Property. This way, QOM will be able to expose Properties that access a fixed field in a struct without exposing also the everything-is-a-string "feature" of qdev properties. Whenever the printed representation

Re: [Qemu-devel] [PATCH v2 7/8] qom: distinguish "legacy" property type name from QOM type name

2011-12-16 Thread Anthony Liguori
On 12/16/2011 10:47 AM, Paolo Bonzini wrote: Signed-off-by: Paolo Bonzini Reviewed-by: Anthony Liguori Regards, Anthony Liguori --- hw/qdev-properties.c | 12 hw/qdev.c|9 ++--- hw/qdev.h|1 + 3 files changed, 15 insertions(+), 7 dele

Re: [Qemu-devel] [PATCH v2 8/8] qom: register qdev properties also as non-legacy properties

2011-12-16 Thread Anthony Liguori
On 12/16/2011 10:47 AM, Paolo Bonzini wrote: Push legacy properties into a legacy<...> namespace, and make them available with correct types too. Signed-off-by: Paolo Bonzini --- hw/qdev.c | 28 +--- hw/qdev.h |7 +++ 2 files changed, 28 insertions(+), 7 de

[Qemu-devel] [PATCH v2 0/8] qom: introduce non-legacy static properties

2011-12-16 Thread Paolo Bonzini
QOM right now does not have a way to communicate values for qdev properties except as strings. This is bad. This patch improves the Property implementation so that properties export a visitor-based interface in addition to the string-based interface. The new interface can then be registered as a

[Qemu-devel] [PATCH v2 8/8] qom: register qdev properties also as non-legacy properties

2011-12-16 Thread Paolo Bonzini
Push legacy properties into a legacy<...> namespace, and make them available with correct types too. Signed-off-by: Paolo Bonzini --- hw/qdev.c | 28 +--- hw/qdev.h |7 +++ 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/hw/qdev.c b/hw/qdev.c ind

[Qemu-devel] [PATCH v2 5/8] qom: introduce QERR_PROPERTY_VALUE_OUT_OF_RANGE

2011-12-16 Thread Paolo Bonzini
This will be used when reject invalid values for integer fields that are less than 64-bits wide. Signed-off-by: Paolo Bonzini --- qerror.c |5 + qerror.h |3 +++ 2 files changed, 8 insertions(+), 0 deletions(-) diff --git a/qerror.c b/qerror.c index adde8a5..9a75d06 100644 --- a/qer

Re: [Qemu-devel] [PATCH v2 4/8] qom: interpret the return value when setting legacy properties

2011-12-16 Thread Paolo Bonzini
On 12/16/2011 06:00 PM, Anthony Liguori wrote: And perhaps it would make more sense to return Error * and make the function name be a constructor: Error *error_from_qdev_prop_err(int ret, DeviceState *dev, Property *prop, const char *value); That doesn't work

[Qemu-devel] [PATCH v2 6/8] qom: introduce get/set methods for Property

2011-12-16 Thread Paolo Bonzini
This patch adds a visitor interface to Property. This way, QOM will be able to expose Properties that access a fixed field in a struct without exposing also the everything-is-a-string "feature" of qdev properties. Whenever the printed representation in both QOM and qdev (which is typically the ca

[Qemu-devel] [PATCH v2 7/8] qom: distinguish "legacy" property type name from QOM type name

2011-12-16 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- hw/qdev-properties.c | 12 hw/qdev.c|9 ++--- hw/qdev.h|1 + 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c index f7aa3cb..dd41e5a 100644 --- a/hw/qdev-

[Qemu-devel] [PATCH v2 4/8] qom: interpret the return value when setting legacy properties

2011-12-16 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini --- hw/qdev-properties.c | 39 --- hw/qdev.c|3 +-- hw/qdev.h|2 ++ 3 files changed, 27 insertions(+), 17 deletions(-) diff --git a/hw/qdev-properties.c b/hw/qdev-properties.c index f0b811c..76ecb3

[Qemu-devel] [PATCH] target-arm: Fixed ARMv7-M SHPR access

2011-12-16 Thread Sebastian Huber
According to "ARMv7-M Architecture Reference Manual" issue D section "B3.2.10 System Handler Prioriy Register 1, SHPR1", "B3.2.11 System Handler Prioriy Register 2, SHPR2", and "B3.2.12 System Handler Prioriy Register 3, SHPR3". Signed-off-by: Sebastian Huber --- hw/arm_gic.c | 16

Re: [Qemu-devel] [Bug 696094] Re: TI Stellaris lm3s811evb (ARM Cortex-M3) : Systick interrupt not working

2011-12-16 Thread Sebastian Huber
Hello, I am able to run the RTEMS real time system on the TI Stellaris LM3S6965 with a working system tick. I used the attached local hacks and patches with the Qemu development branch from today. Have a nice day! -- Sebastian Huber, embedded brains GmbH Address : Obere Lagerstr. 30, D-8217

[Qemu-devel] [PATCH 2/4] target-arm: Disable priority_mask feature

2011-12-16 Thread Sebastian Huber
This is unused for the ARMv7-M NVIC. Signed-off-by: Sebastian Huber --- hw/arm_gic.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/hw/arm_gic.c b/hw/arm_gic.c index 5139d95..cafcc81 100644 --- a/hw/arm_gic.c +++ b/hw/arm_gic.c @@ -707,7 +707,11 @@ static void gic_re

[Qemu-devel] [PATCH] target-arm: Fixed ARMv7-M SHPR access

2011-12-16 Thread Sebastian Huber
Hello, this may help to fix Bug 696094. -- Sebastian Huber, embedded brains GmbH Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany Phone : +49 89 18 90 80 79-6 Fax : +49 89 18 90 80 79-9 E-Mail : sebastian.hu...@embedded-brains.de PGP : Public key available on request. Diese N

Re: [Qemu-devel] [PATCH] [RFC] Remove ppc_newworld/ppc_oldworld

2011-12-16 Thread Andreas Färber
Am 16.12.2011 19:08, schrieb Anthony Liguori: > I notice that these two machines have seem to have never really been touched > other than tree-wide refactoring since their introduction. Googling for the > machine types doesn't hit any user questions or comments about the machine > types. > > For

[Qemu-devel] [PATCH] vhost-net: Move asserts to after check for end < start

2011-12-16 Thread Bruce Rogers
When migrating a vm using vhost-net we hit the following assertion: qemu-kvm: /usr/src/packages/BUILD/qemu-kvm-0.15.1/hw/vhost.c:30: vhost_dev_sync_region: Assertion `start / (0x1000 * (8 * sizeof(vhost_log_chunk_t))) < dev->log_size' failed. The cases which the end < start check is intended to c

[Qemu-devel] proposta soluzioni web.

2011-12-16 Thread Andrea Matera
Salve, vorrei cogliere questa occasione per presentarmi. Il mio nome è Andrea e sono la responsabile di Migliorewebsites.com Lavoro al fianco di numerosi siti internet. Gestisco il loro SEO in base alle particolarità dei maggiori motori di ricerca on line, tra cui Google, Bing e Yahoo. Lavorand

Re: [Qemu-devel] [Bug 902306] [NEW] qemu-user -static variants require shared libraries

2011-12-16 Thread Vagrant Cascadian
On Fri, Dec 09, 2011 at 08:20:16PM -, Michael Roth wrote: > On 12/09/2011 01:39 PM, Vagrant Cascadian wrote: > > > > /usr/lib/gcc/i486-linux-gnu/4.6/../../../i386-linux-gnu/libglib-2.0.a(gutils.o): > > In function `g_get_any_init_do': > >(.text+0xbbb): warning: Using 'getpwuid_r' in st

  1   2   >