e the plan
is to eventually get rid of the Property.name field.
The declarations for the new functions are being added to
qdev-properties.h, but they will be moved to a QOM header later.
Signed-off-by: Eduardo Habkost
---
Changes v1 -> v2:
* Patch redone after changes in previous patches in th
Move all property types from qdev-properties.c to
qom/property-types.c.
Signed-off-by: Eduardo Habkost
---
Changes v1 -> v2:
* Rebased after changes in previous patches in the series
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
--
Use field properties for the bool and string properties used at
check-qom-proplist.
Signed-off-by: Eduardo Habkost
---
Changes v2:
* Redone patch using PROP_* instead of DEFINE_PROP_*
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
i
Support Property.set_default and PropertyInfo.description even if
PropertyInfo.create is set.
Signed-off-by: Eduardo Habkost
---
Changes v1 -> v2:
* Patch redone after changes in the previous patches in the
series
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habk
core QOM feature.
Signed-off-by: Eduardo Habkost
---
Changes v1 -> v2:
* Redone patch on top of changes in previous patches in the
series
* Forbid allow_set==NULL to avoid confusion with link property
semantics (where NULL makes the property read only)
---
Cc: Paolo Bonzini
Cc: &
The basic property types in qdev-properties.c are not going to be
qdev-specific anymore. Rename the variables to prop_info_*.
Signed-off-by: Eduardo Habkost
---
Changes v1 -> v2:
* Redone patch after moving UUID property to qdev-properties-system.c
---
Cc: Paolo Bonzini
Cc: "Daniel P.
The Property.name field won't always be set and we need to be
100% sure its usage will be restricted to qdev/TYPE_DEVICE code.
Renaming the field is a good way to ensure that and make its
purpose more clear.
Signed-off-by: Eduardo Habkost
---
This is a new patch added in v2 of the series
-
qdev_prop_name is supposed to be used only by qdev property
registration code, we don't need to set it for array element
properties.
Signed-off-by: Eduardo Habkost
---
This is a new patch added in v2 of the series
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Ha
Signed-off-by: Eduardo Habkost
---
Changes v1 -> v2:
* Redone using object_class_add_property_field() + PROP_* macros
instead of DEFINE_PROP_* array, as suggested by Paolo
---
Cc: Eduardo Habkost
Cc: Marcel Apfelbaum
Cc: qemu-devel@nongnu.org
---
hw/core/machine.c |
Every single qdev property setter function manually checks
dev->realized. We can just check dev->realized inside
qdev_property_set() instead.
The check is being added as a separate function
(qdev_prop_allow_set()) because it will become a callback later.
Signed-off-by: Eduardo H
Now that we can call object_property_add() with exactly the same
arguments as object_property_add_field(), we can just reuse the
function.
Signed-off-by: Eduardo Habkost
---
Changes v1 -> v2:
* Now we don't need to hack ObjectProperty.release anymore,
patch became trivial
---
Cc: Paolo
This will make it easier to remove Property.name in the future.
Signed-off-by: Eduardo Habkost
---
This is a new patch added in series v2
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
hw/core/qdev-properties.c | 9 +
1 fi
s not being necessary in most cases).
Signed-off-by: Eduardo Habkost
---
Changes v1 -> v2:
* Redone patch on top of changes in previous patches in the
series
* Provide prop_allow_set_always() and prop_allow_set_never()
helpers
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: E
Add new doc comments and reformat the existing ones,
and include the static-properties.h API reference in
docs/devel/qom.rst.
Signed-off-by: Eduardo Habkost
---
Changes v1 -> v2:
* Redone patch after changes in previous patches in the series
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berra
The new helper macros are just wrappers to DEFINE_PROP_* that can
be used directly as arguments to object_class_property_add_field().
Signed-off-by: Eduardo Habkost
---
This is a new patch added in v2 of the series
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
We're just doing pointer math with the device pointer, we can
simply use obj instead.
Reviewed-by: Marc-André Lureau
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
hw/core/qdev-properties.c |
Returning ObjectProperty* will be useful for new property
registration code that will add additional callbacks
to ObjectProperty after registering it.
Signed-off-by: Eduardo Habkost
---
Changes v1 -> v2:
* Redone patch on top of additional changes in series v2
* Commit message reword
---
We already get the property name as argument to the property
getter and setters, we don't need to use prop->name. This will
make it easier to remove the Property.name field in the future.
Signed-off-by: Eduardo Habkost
---
This is a new patch added in series v2
---
Cc: Stefan Berger
C
Move the core of the static property code to qom/field-property.c.
The actual property type implementations are still in
qdev-properties.c, they will be moved later.
Signed-off-by: Eduardo Habkost
---
Changes v1 -> v2:
* Rename static-property.* to field-property.*
---
Cc: Paolo Bonzini
mon QOM code.
Signed-off-by: Eduardo Habkost
---
Changes v1 -> v2:
* Redone after changes in previous patches in the series
* Renamed functions from static_prop_* to field_prop_*
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.o
The function will be moved to common QOM code, as it is not
specific to TYPE_DEVICE anymore.
Signed-off-by: Eduardo Habkost
---
Changes v1 -> v2:
* Rename to object_field_prop_ptr() instead of object_static_prop_ptr()
---
Cc: Stefan Berger
Cc: Stefano Stabellini
Cc: Anthony Perard
Cc: P
ned-off-by: Eduardo Habkost
---
This is a new patch added in v2 of the series
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
hw/core/qdev-properties.c | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/hw/core/qdev-pr
Replace `Property *prop` parameter with `char *name`, to reduce
dependency of getter and setter functions on the Property struct
(which will be changed in following patches).
Signed-off-by: Eduardo Habkost
---
This is a new patch added in series v2
---
Cc: Paolo Bonzini
Cc: "Daniel P. Ber
Make the code more generic and not specific to TYPE_DEVICE.
Reviewed-by: Marc-André Lureau
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: Cornelia Huck
Cc: Thomas Huth
Cc: Richard Henderson
Cc: David Hildenbrand
Cc: Halil
Now that we don't store any additional data about the property in
AraryElementStruct, we don't need it anymore. We can just
allocate a Property struct directly.
Signed-off-by: Eduardo Habkost
---
This is a new patch added in v2 of the series
---
Cc: Paolo Bonzini
Cc: "Daniel P
Make the code more generic and not specific to TYPE_DEVICE.
Reviewed-by: Marc-André Lureau
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
hw/core/qdev-properties.c | 10 ++
1 file changed, 6
Instead of duplicating the code that sets name, info, offset,
and does type checking, make DEFINE_PROP accept a variable number
of arguments and reuse it in all DEFINE_PROP_* macros.
Signed-off-by: Eduardo Habkost
---
Changes v1 -> v2:
* Redone after UUID property was moved
---
Cc: Paolo Bonz
This will make it easier to remove the Property.name field in the
future.
Signed-off-by: Eduardo Habkost
---
This is a new patch added in series v2
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
include/hw/qdev-properties.h | 2 +
Make the code more generic and not specific to TYPE_DEVICE.
Reviewed-by: Marc-André Lureau
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
hw/core/qdev-properties-system.c | 10 +-
1 file
Make the code more generic and not specific to TYPE_DEVICE.
Reviewed-by: Marc-André Lureau
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
include/hw/qdev-properties.h | 2 +-
hw/core/qdev-
error_set_from_qdev_prop_error().
Signed-off-by: Eduardo Habkost
---
This is a new patch added in series v2
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
hw/core/qdev-properties-system.c | 57
hw
Use the DEFINE_PROP macro (which will set extra fields in the
struct) instead of initializing a Property struct manually.
Signed-off-by: Eduardo Habkost
---
This is a new patch added in v2 of the series
---
Cc: Mark Cave-Ayland
Cc: Artyom Tarasenko
Cc: qemu-devel@nongnu.org
---
target/sparc
sparc_set_nwindows() is one of the very few property setters that
don't check dev->realized, and there's no reason for it to be
special. Check dev->realized like the other setters.
Reviewed-by: Marc-André Lureau
Signed-off-by: Eduardo Habkost
---
Cc: Mark Cave-Ayland
Cc: Arty
Make the code more generic and not specific to TYPE_DEVICE.
Reviewed-by: Marc-André Lureau
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
include/hw/qdev-properties.h | 2 +-
hw/core/qdev-
All other qdev property error messages use "."
instead of ".". Change set_size32() for consistency,
and to make the code not specific to TYPE_DEVICE.
Reviewed-by: Marc-André Lureau
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Move the property types and property macros implemented in
qdev-properties-system.c to a new qdev-properties-system.h
header.
Signed-off-by: Eduardo Habkost
---
Changes v1 -> v2:
* Move UUID property type too, as it was moved to
qdev-properties-system.c in the previous patch
---
audio/audi
Make the code more generic and not specific to TYPE_DEVICE.
Reviewed-by: Marc-André Lureau
Signed-off-by: Eduardo Habkost
---
Changes v1 -> v2:
- Fix build error with CONFIG_XEN
I took the liberty of keeping the Reviewed-by line from
Marc-André as the build fix is a trivial one line cha
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
hw/core/qdev-properties.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/hw/core/qdev-properties.c b/hw/core/qdev-properties.c
index 12a053e732
There's no reason to keep the property list separate from the CPU
class code. Move the variable to hw/core/cpu.c and make it
static.
Reviewed-by: Marc-André Lureau
Signed-off-by: Eduardo Habkost
---
Cc: Eduardo Habkost
Cc: Marcel Apfelbaum
Cc: qemu-devel@nongnu.org
---
include/hw/core/
An empty props array is unnecessary, we can just not call
device_class_set_props().
Reviewed-by: Marc-André Lureau
Signed-off-by: Eduardo Habkost
---
Cc: Gerd Hoffmann
Cc: qemu-devel@nongnu.org
---
hw/audio/cs4231.c | 5 -
1 file changed, 5 deletions(-)
diff --git a/hw/audio/cs4231.c b
Move everything related to Property and PropertyInfo to
qdev-properties.[ch] to make it easier to refactor that code.
Reviewed-by: Marc-André Lureau
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
a custom
release function for array elements anymore, because we don't
need to save the property name in the Property struct anymore.
* Moved UUID property to qdev-properties-system, because
it still has dependencies on qdev code
Eduardo Habkost (44):
cs4231: Get rid of empty property ar
On Sat, Oct 31, 2020 at 09:51:38PM +0530, Ani Sinha wrote:
> On Thu, Oct 15, 2020 at 10:22 PM Eduardo Habkost wrote:
> >
> > On Mon, Sep 21, 2020 at 03:03:25PM +0530, Ani Sinha wrote:
> > > Object property insertion code iterates over an integer to get an unused
> >
this by executing something like "sudo true" before invoking
> Avocado.)
>
> Signed-off-by: Max Reitz
Fixes the issue detected in v3.
Tested-by: Eduardo Habkost
--
Eduardo
t; (which evaluates to 7).
>
> Note, the biggest input value freq_to_str() can accept is UINT64_MAX,
> which is ~18.446 EHz, less than 1000 EHz.
>
> Reported-by: Eduardo Habkost
> Suggested-by: Peter Maydell
> Signed-off-by: Philippe Mathieu-Daudé
Reviewed-by: Eduardo Habkost
Thanks for taking the time to fix this!
--
Eduardo
On Fri, Oct 30, 2020 at 09:41:46PM +0100, Paolo Bonzini wrote:
> Il ven 30 ott 2020, 21:03 Eduardo Habkost ha scritto:
>
> > > OBJECT_CLASS_PROPERTY_ADD_STR(oc, MachineState, kernel_filename,
> > > "kernel", prop_allow_set_a
object_property_parse() will add a
"Property '.' can't take value ''"
prefix automatically for us.
Signed-off-by: Eduardo Habkost
---
Cc: Jason Wang
Cc: qemu-devel@nongnu.org
---
net/filter-buffer.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
object_property_parse() will add a
"Property '.' can't take value ''"
prefix automatically for us.
Signed-off-by: Eduardo Habkost
---
Cc: Zhang Chen
Cc: Li Zhijian
Cc: Jason Wang
Cc: qemu-devel@nongnu.org
---
net/colo-compare.c | 9 +++--
1 file ch
object_property_parse() will add a
"Property '.' can't take value ''"
prefix automatically for us.
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: Richard Henderson
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
target/i386/cpu.c | 2 +-
object_property_parse() will add a
"Property '.' can't take value ''"
prefix automatically for us.
Signed-off-by: Eduardo Habkost
---
Cc: Stefan Berger
Cc: qemu-devel@nongnu.org
---
backends/tpm/tpm_util.c | 3 +--
1 file changed, 1 insertion(+), 2 dele
object_property_parse() will add a
"Property '.' can't take value ''"
prefix automatically for us.
Signed-off-by: Eduardo Habkost
---
Cc: "Gonglei (Arei)"
Cc: qemu-devel@nongnu.org
---
backends/cryptodev.c | 3 +--
1 file changed, 1 insert
x'
After:
$ qemu-system-s390x -device x-terminal3270,devno=x
qemu-system-s390x: -device x-terminal3270,devno=x: Property
'x-terminal3270.devno' can't take value 'x': invalid devno
Signed-off-by: Eduardo Habkost
---
Cc: Cornelia Huck
Cc: Thomas Huth
Cc: Richard Hen
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
include/hw/qdev-properties.h | 2 --
hw/core/qdev-properties.c| 22 --
2 files changed, 24 deletions(-)
diff --git a/inclu
All existing "Property '.' ..." error messages were
rewritten, we can now add the error message prefix unconditionally.
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
qom/object.c |
object_property_parse() will add a
"Property '.' can't take value ''"
prefix automatically for us.
Signed-off-by: Eduardo Habkost
---
Cc: Xiao Guangrong
Cc: "Michael S. Tsirkin"
Cc: Igor Mammedov
Cc: qemu-devel@nongnu.org
---
hw/mem/nvdimm.c |
emu-system-x86_64 -device vfio-pci,host=x
qemu-system-x86_64: -device vfio-pci,host=x: Property 'vfio-pci.host' can't
take value 'x': invalid host device address
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Hab
Signed-off-by: Eduardo Habkost
---
Cc: Markus Armbruster
Cc: qemu-devel@nongnu.org
---
include/qapi/qmp/qerror.h | 3 ---
1 file changed, 3 deletions(-)
diff --git a/include/qapi/qmp/qerror.h b/include/qapi/qmp/qerror.h
index 7c76e24aa7..646a42c4b4 100644
--- a/include/qapi/qmp/qerror.h
+++ b
object_property_parse() will add a
"Property '.' can't take value ''"
prefix automatically for us.
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
hw/core/qdev-pro
object_property_parse() will add a
"Property '.' can't take value ''"
prefix automatically for us.
Signed-off-by: Eduardo Habkost
---
Cc: Jason Wang
Cc: qemu-devel@nongnu.org
---
net/dump.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --
object_property_parse() will add a
"Property '.' can't take value ''"
prefix automatically for us.
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
hw/core/qdev-p
x86_64 -device e1000,addr=x
qemu-system-x86_64: -device e1000,addr=x: Property 'e1000.addr' can't take
value 'x': invalid PCI address
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
object_property_parse() will add a
"Property '.' can't take value ''"
prefix automatically for us.
Signed-off-by: Eduardo Habkost
---
Cc: Eduardo Habkost
Cc: Igor Mammedov
Cc: qemu-devel@nongnu.org
---
backends/hostmem-memfd.c | 3 +--
1 file changed, 1
ce e1000,netdev=n0: Property 'e1000.netdev' can't
take value 'n0': netdev not found
$ ./qemu-system-x86_64 -netdev id=n0,type=user -device e1000,netdev=n0
-device e1000,netdev=n0
qemu-system-x86_64: -device e1000,netdev=n0: Property 'e1000.netdev' can'
es before prepending our own.
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
qom/object.c | 11 +++
1 file changed, 11 insertions(+)
diff --git a/qom/object.c b/qom/object.c
index 20726e458
86_64 -device e1000,mac=x
qemu-system-x86_64: -device e1000,mac=x: Property 'e1000.mac' can't take
value 'x': invalid mac address
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
emu-system-x86_64 -device AC97,audiodev=a0
qemu-system-x86_64: -device AC97,audiodev=a0: Property 'AC97.audiodev' can't
take value 'a0': audiodev not found
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc:
make the code that parses
-device and -object add a
"Property '.' can't take value '': "
prefix automatically when encountering an error
when setting a property. This is the approach implemented in
this series.
Eduardo Habkost (20):
qom: Add prefix to err
On Fri, Oct 30, 2020 at 06:10:34PM +0100, Paolo Bonzini wrote:
> On 29/10/20 23:02, Eduardo Habkost wrote:
> > +static Property machine_props[] = {
> > +DEFINE_PROP_STRING("kernel", MachineState, kernel_filename),
> > +DEFINE_PROP_STRING("in
On Fri, Oct 30, 2020 at 11:29:25AM +0400, Marc-André Lureau wrote:
> On Fri, Oct 30, 2020 at 2:07 AM Eduardo Habkost wrote:
>
> > Make the code more generic and not specific to TYPE_DEVICE.
> >
> > Signed-off-by: Eduardo Habkost
> >
>
> Nice cleanup!, but
On Fri, Oct 30, 2020 at 02:03:07PM +0400, Marc-André Lureau wrote:
> On Fri, Oct 30, 2020 at 2:17 AM Eduardo Habkost wrote:
>
> > The array property registration code is hard to follow. Move the
> > two steps into separate functions that have clear
> > responsibilitie
On Fri, Oct 30, 2020 at 12:00:33PM +0400, Marc-André Lureau wrote:
> On Fri, Oct 30, 2020 at 2:16 AM Eduardo Habkost wrote:
>
> > Make the code more generic and not specific to TYPE_DEVICE.
> >
> > Signed-off-by: Eduardo Habkost
> >
>
> What about dropping
Add new doc comments and reformat the existing ones,
and include the static-properties.h API reference in
docs/devel/qom.rst.
Signed-off-by: Eduardo Habkost
---
docs/devel/qom.rst| 6 ++
include/qom/static-property.h | 154 --
2 files changed, 151
Use static properties for the bool and string properties used at
check-qom-proplist.
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
tests/check-qom-proplist.c | 61 +---
Move all property types from qdev-properties.c to
qom/property-types.c.
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
include/hw/qdev-properties.h | 130 ---
include/qom/static-property.h | 128 +
Signed-off-by: Eduardo Habkost
---
hw/core/machine.c | 166 ++
1 file changed, 19 insertions(+), 147 deletions(-)
diff --git a/hw/core/machine.c b/hw/core/machine.c
index c5e0e79e6d..97e102911a 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
Move the variable declaration close to the macro that uses it.
Signed-off-by: Eduardo Habkost
---
Cc: Stefan Berger
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
hw/tpm/tpm_prop.h| 2 ++
include/hw/qdev-properties.h | 1
Instead of duplicating the code that sets name, info, offset,
and does type checking, make DEFINE_PROP accept a variable number
of arguments and reuse it in all DEFINE_PROP_* macros.
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Unfortunately, the "usb" property is not trivial because it
actually represents a pair of booleans. It probably should be
replaced by a OnOffAuto property instead.
Signed-off-by: Eduardo Habkost
---
hw/core/machine.c | 77 +++
1 file
emu-system-x86_64 -device vmgenid,guid=x
qemu-system-x86_64: -device vmgenid,guid=x: invalid UUID: 'x'
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
hw/core/qdev-properties.c | 2 +-
1 file chang
There are no users of the function outside qdev-properties.c.
Make function static and rename it to get_uint16().
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
hw/core/qdev-prop-internal.h | 2 --
hw
The function will be moved to common QOM code, as it is not
specific to TYPE_DEVICE anymore.
Signed-off-by: Eduardo Habkost
---
Cc: Stefan Berger
Cc: Stefano Stabellini
Cc: Anthony Perard
Cc: Paul Durrant
Cc: Kevin Wolf
Cc: Max Reitz
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
C
The basic property types in qdev-properties.c are not going to be
qdev-specific anymore. Rename the variables to prop_info_*.
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: Peter Maydell
Cc: Yoshinori Sato
Cc: Dmitry Fl
e new functions are being added to
qdev-properties.h, but they will be moved to a QOM header later.
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
hw/core/qdev-prop-internal.h | 11 +++
We're just doing pointer math with the device pointer, we can
simply use obj instead.
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
hw/core/qdev-properties.c | 5 ++---
1 file changed, 2 i
Move the core of the static property code to qom/static-property.c.
The actual property type implementations are still in
qdev-properties.c, they will be moved later.
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@
The array property registration code is hard to follow. Move the
two steps into separate functions that have clear
responsibilities.
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
hw/core/qdev-propert
Move the property types and property macros implemented in
qdev-properties-system.c to a new qdev-properties-system.h
header.
Signed-off-by: Eduardo Habkost
---
audio/audio.h | 1 +
include/hw/block/block.h| 1 +
include/hw/qdev-properties-system.h | 68
This removes the last remaining DeviceState-specific line of code
inside qdev property registration code, and will allow us to make
static properties a core QOM feature.
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@
Make the code more generic and not specific to TYPE_DEVICE.
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: Cornelia Huck
Cc: Thomas Huth
Cc: Richard Henderson
Cc: David Hildenbrand
Cc: Halil Pasic
Cc: Christian Borntraeger
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
include/hw/qdev-properties.h | 2 +-
hw/core/qdev-properties.c| 10 +-
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/inclu
These functions will be moved to be part of QOM, so rename them.
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
hw/core/qdev-prop-internal.h | 28 +--
hw/core/qdev-properties-sys
Make the code more generic and not specific to TYPE_DEVICE.
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
hw/core/qdev-properties-system.c | 10 +-
1 file changed, 5 insertions(+), 5 deletion
Support Property.set_default and PropertyInfo.description even if
PropertyInfo.create is set.
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
hw/core/qdev-properties.c | 17 +
1 file
Note that this doesn't replace the check callback at
object*_property_add_link() (yet), because currently the link
property check callback needs to get the property value as
argument (despite this not being necessary in most cases).
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzin
mon QOM code.
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
hw/core/qdev-properties.c | 44 +++
1 file changed, 40 insertions(+), 4 deletions(-)
diff --git a/hw/co
Make the code more generic and not specific to TYPE_DEVICE.
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
hw/core/qdev-properties.c | 10 ++
1 file changed, 6 insertions(+), 4 deletions(-)
di
Every single qdev property setter function manually checks
dev->realized. We can just check dev->realized inside
qdev_property_set() instead.
The check is being added as a separate function
(qdev_prop_allow_set()) because it will become a callback later.
Signed-off-by: Eduardo Habkost
Make the code more generic and not specific to TYPE_DEVICE.
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
include/hw/qdev-properties.h | 2 +-
hw/core/qdev-properties-system.c | 2 +-
hw
Make the code more generic and not specific to TYPE_DEVICE.
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
include/hw/qdev-properties.h | 2 +-
hw/core/qdev-properties-system.c | 3 ++-
hw
Reuse function instead of calling object_property_add() directly.
We need to hack ObjectProperty.release to make sure we will free
the array property.
Signed-off-by: Eduardo Habkost
---
Cc: Paolo Bonzini
Cc: "Daniel P. Berrangé"
Cc: Eduardo Habkost
Cc: qemu-devel@nongnu.org
---
hw
801 - 900 of 11360 matches
Mail list logo