mirror of https://github.com/xemu-project/xemu.git
QOM patches for 2020-05-15
-----BEGIN PGP SIGNATURE----- iQJGBAABCAAwFiEENUvIs9frKmtoZ05fOHC0AOuRhlMFAl6+L4USHGFybWJydUBy ZWRoYXQuY29tAAoJEDhwtADrkYZTM5QQAJvaXZkLGJZR9VVjnMudByiyYfxZmL0U 4CwCY3MzkYB5Htrd9n6H1sd1AbdRwW6D0zbriHg3r7TmEXG99qoifecUCpOg110P tr8UYmxm40hLTOy2tY6fJ5eVDll4wBmIkCQ5B1RUUmN4HgixqOrApw+2ZSaI6ubJ GQ0/k3w4yx3GT09CaE2i7vemtevfhwXIef5Bta9nyu7aVsZit92+P4SzHP4jqAc8 oZ2tbIiyM0dp8Nlem3M2c8W1tEYj3U9TmK3wbj4bCQRVNKRP7pms15QkJm2FUKJC U+oEfOhaHwO4Lx/7I/5Z7Gb/5iLTeo+7Cehpx4dpAf71VkQe9uu8xXoM1RWHhOjY UtEqn5e5MzBkvqw4KXHDY+/DSfe3XESUHEw4aAT+eVU4S4D/PdXerKyYSELSTKjx nkwbe1RuwPkPTbOS3Ay49UmDqB+k+0mNrOIsZlFyQELSCGIyLV0zgbDXI6L2sik2 PzEzJmEpvzU5iV5EckdbW5i5BwMpp3Va1JEzg/NbAXS5iiQD03SPreRPHptIW139 jqvycEWQGB4HmZWAfHQHtAiDFvrTRyGuWx3J84CY1ygMtrDMA6DsYS0/lCoJP6pP jaCIGYtnGv02+GcrjuY/cTnoLk9oh0FNJ/jwNVDIkm+YUOFNx0gO9pf8l3hxg/hJ +TovRhtBbhHG =+Qby -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/armbru/tags/pull-qom-2020-05-15' into staging QOM patches for 2020-05-15 # gpg: Signature made Fri 15 May 2020 06:58:29 BST # gpg: using RSA key 354BC8B3D7EB2A6B68674E5F3870B400EB918653 # gpg: issuer "armbru@redhat.com" # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" [full] # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" [full] # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * remotes/armbru/tags/pull-qom-2020-05-15: (21 commits) hw: Remove unnecessary DEVICE() cast various: Remove unnecessary OBJECT() cast target: Remove unnecessary CPU() cast qom: Drop @errp parameter of object_property_del() spapr_pci: Drop some dead error handling qdev: Unrealize must not fail Drop more @errp parameters after previous commit qom: Drop parameter @errp of object_property_add() & friends qdev: Clean up qdev_connect_gpio_out_named() hw/arm/bcm2835: Drop futile attempts at QOM-adopting memory e1000: Don't run e1000_instance_init() twice hw/isa/superio: Make the components QOM children s390x/cpumodel: Fix UI to CPU features pcc-cmac-{aes,eaes}-256 tests/check-qom-proplist: Improve iterator coverage qom: Drop object_property_set_description() parameter @errp qom: Make all the object_property_add_FOO() return the property qom: Drop convenience method object_property_get_uint16List() qom: Simplify object_property_get_enum() qom: Drop object_property_del_child()'s unused parameter @errp qom: Clean up inconsistent use of gchar * vs. char * ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
0db949f181
|
@ -3111,15 +3111,15 @@ static void kvm_accel_class_init(ObjectClass *oc, void *data)
|
||||||
|
|
||||||
object_class_property_add(oc, "kernel-irqchip", "on|off|split",
|
object_class_property_add(oc, "kernel-irqchip", "on|off|split",
|
||||||
NULL, kvm_set_kernel_irqchip,
|
NULL, kvm_set_kernel_irqchip,
|
||||||
NULL, NULL, &error_abort);
|
NULL, NULL);
|
||||||
object_class_property_set_description(oc, "kernel-irqchip",
|
object_class_property_set_description(oc, "kernel-irqchip",
|
||||||
"Configure KVM in-kernel irqchip", &error_abort);
|
"Configure KVM in-kernel irqchip");
|
||||||
|
|
||||||
object_class_property_add(oc, "kvm-shadow-mem", "int",
|
object_class_property_add(oc, "kvm-shadow-mem", "int",
|
||||||
kvm_get_kvm_shadow_mem, kvm_set_kvm_shadow_mem,
|
kvm_get_kvm_shadow_mem, kvm_set_kvm_shadow_mem,
|
||||||
NULL, NULL, &error_abort);
|
NULL, NULL);
|
||||||
object_class_property_set_description(oc, "kvm-shadow-mem",
|
object_class_property_set_description(oc, "kvm-shadow-mem",
|
||||||
"KVM shadow MMU size", &error_abort);
|
"KVM shadow MMU size");
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo kvm_accel_type = {
|
static const TypeInfo kvm_accel_type = {
|
||||||
|
|
|
@ -203,14 +203,13 @@ static void tcg_accel_class_init(ObjectClass *oc, void *data)
|
||||||
|
|
||||||
object_class_property_add_str(oc, "thread",
|
object_class_property_add_str(oc, "thread",
|
||||||
tcg_get_thread,
|
tcg_get_thread,
|
||||||
tcg_set_thread,
|
tcg_set_thread);
|
||||||
NULL);
|
|
||||||
|
|
||||||
object_class_property_add(oc, "tb-size", "int",
|
object_class_property_add(oc, "tb-size", "int",
|
||||||
tcg_get_tb_size, tcg_set_tb_size,
|
tcg_get_tb_size, tcg_set_tb_size,
|
||||||
NULL, NULL, &error_abort);
|
NULL, NULL);
|
||||||
object_class_property_set_description(oc, "tb-size",
|
object_class_property_set_description(oc, "tb-size",
|
||||||
"TCG translation block cache size", &error_abort);
|
"TCG translation block cache size");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -124,13 +124,12 @@ qauthz_list_class_init(ObjectClass *oc, void *data)
|
||||||
"QAuthZListPolicy",
|
"QAuthZListPolicy",
|
||||||
&QAuthZListPolicy_lookup,
|
&QAuthZListPolicy_lookup,
|
||||||
qauthz_list_prop_get_policy,
|
qauthz_list_prop_get_policy,
|
||||||
qauthz_list_prop_set_policy,
|
qauthz_list_prop_set_policy);
|
||||||
NULL);
|
|
||||||
|
|
||||||
object_class_property_add(oc, "rules", "QAuthZListRule",
|
object_class_property_add(oc, "rules", "QAuthZListRule",
|
||||||
qauthz_list_prop_get_rules,
|
qauthz_list_prop_get_rules,
|
||||||
qauthz_list_prop_set_rules,
|
qauthz_list_prop_set_rules,
|
||||||
NULL, NULL, NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
authz->is_allowed = qauthz_list_is_allowed;
|
authz->is_allowed = qauthz_list_is_allowed;
|
||||||
}
|
}
|
||||||
|
|
|
@ -221,12 +221,10 @@ qauthz_list_file_class_init(ObjectClass *oc, void *data)
|
||||||
|
|
||||||
object_class_property_add_str(oc, "filename",
|
object_class_property_add_str(oc, "filename",
|
||||||
qauthz_list_file_prop_get_filename,
|
qauthz_list_file_prop_get_filename,
|
||||||
qauthz_list_file_prop_set_filename,
|
qauthz_list_file_prop_set_filename);
|
||||||
NULL);
|
|
||||||
object_class_property_add_bool(oc, "refresh",
|
object_class_property_add_bool(oc, "refresh",
|
||||||
qauthz_list_file_prop_get_refresh,
|
qauthz_list_file_prop_get_refresh,
|
||||||
qauthz_list_file_prop_set_refresh,
|
qauthz_list_file_prop_set_refresh);
|
||||||
NULL);
|
|
||||||
|
|
||||||
authz->is_allowed = qauthz_list_file_is_allowed;
|
authz->is_allowed = qauthz_list_file_is_allowed;
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,8 +107,7 @@ qauthz_pam_class_init(ObjectClass *oc, void *data)
|
||||||
|
|
||||||
object_class_property_add_str(oc, "service",
|
object_class_property_add_str(oc, "service",
|
||||||
qauthz_pam_prop_get_service,
|
qauthz_pam_prop_get_service,
|
||||||
qauthz_pam_prop_set_service,
|
qauthz_pam_prop_set_service);
|
||||||
NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -74,8 +74,7 @@ qauthz_simple_class_init(ObjectClass *oc, void *data)
|
||||||
|
|
||||||
object_class_property_add_str(oc, "identity",
|
object_class_property_add_str(oc, "identity",
|
||||||
qauthz_simple_prop_get_identity,
|
qauthz_simple_prop_get_identity,
|
||||||
qauthz_simple_prop_set_identity,
|
qauthz_simple_prop_set_identity);
|
||||||
NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -340,8 +340,7 @@ static void cryptodev_vhost_user_instance_int(Object *obj)
|
||||||
{
|
{
|
||||||
object_property_add_str(obj, "chardev",
|
object_property_add_str(obj, "chardev",
|
||||||
cryptodev_vhost_user_get_chardev,
|
cryptodev_vhost_user_get_chardev,
|
||||||
cryptodev_vhost_user_set_chardev,
|
cryptodev_vhost_user_set_chardev);
|
||||||
NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cryptodev_vhost_user_finalize(Object *obj)
|
static void cryptodev_vhost_user_finalize(Object *obj)
|
||||||
|
|
|
@ -213,7 +213,7 @@ static void cryptodev_backend_instance_init(Object *obj)
|
||||||
object_property_add(obj, "queues", "uint32",
|
object_property_add(obj, "queues", "uint32",
|
||||||
cryptodev_backend_get_queues,
|
cryptodev_backend_get_queues,
|
||||||
cryptodev_backend_set_queues,
|
cryptodev_backend_set_queues,
|
||||||
NULL, NULL, NULL);
|
NULL, NULL);
|
||||||
/* Initialize devices' queues property to 1 */
|
/* Initialize devices' queues property to 1 */
|
||||||
object_property_set_int(obj, 1, "queues", NULL);
|
object_property_set_int(obj, 1, "queues", NULL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -481,11 +481,9 @@ dbus_vmstate_class_init(ObjectClass *oc, void *data)
|
||||||
vc->get_id = dbus_vmstate_get_id;
|
vc->get_id = dbus_vmstate_get_id;
|
||||||
|
|
||||||
object_class_property_add_str(oc, "addr",
|
object_class_property_add_str(oc, "addr",
|
||||||
get_dbus_addr, set_dbus_addr,
|
get_dbus_addr, set_dbus_addr);
|
||||||
&error_abort);
|
|
||||||
object_class_property_add_str(oc, "id-list",
|
object_class_property_add_str(oc, "id-list",
|
||||||
get_id_list, set_id_list,
|
get_id_list, set_id_list);
|
||||||
&error_abort);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo dbus_vmstate_info = {
|
static const TypeInfo dbus_vmstate_info = {
|
||||||
|
|
|
@ -184,18 +184,15 @@ file_backend_class_init(ObjectClass *oc, void *data)
|
||||||
oc->unparent = file_backend_unparent;
|
oc->unparent = file_backend_unparent;
|
||||||
|
|
||||||
object_class_property_add_bool(oc, "discard-data",
|
object_class_property_add_bool(oc, "discard-data",
|
||||||
file_memory_backend_get_discard_data, file_memory_backend_set_discard_data,
|
file_memory_backend_get_discard_data, file_memory_backend_set_discard_data);
|
||||||
&error_abort);
|
|
||||||
object_class_property_add_str(oc, "mem-path",
|
object_class_property_add_str(oc, "mem-path",
|
||||||
get_mem_path, set_mem_path,
|
get_mem_path, set_mem_path);
|
||||||
&error_abort);
|
|
||||||
object_class_property_add(oc, "align", "int",
|
object_class_property_add(oc, "align", "int",
|
||||||
file_memory_backend_get_align,
|
file_memory_backend_get_align,
|
||||||
file_memory_backend_set_align,
|
file_memory_backend_set_align,
|
||||||
NULL, NULL, &error_abort);
|
NULL, NULL);
|
||||||
object_class_property_add_bool(oc, "pmem",
|
object_class_property_add_bool(oc, "pmem",
|
||||||
file_memory_backend_get_pmem, file_memory_backend_set_pmem,
|
file_memory_backend_get_pmem, file_memory_backend_set_pmem);
|
||||||
&error_abort);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void file_backend_instance_finalize(Object *o)
|
static void file_backend_instance_finalize(Object *o)
|
||||||
|
|
|
@ -141,26 +141,21 @@ memfd_backend_class_init(ObjectClass *oc, void *data)
|
||||||
if (qemu_memfd_check(MFD_HUGETLB)) {
|
if (qemu_memfd_check(MFD_HUGETLB)) {
|
||||||
object_class_property_add_bool(oc, "hugetlb",
|
object_class_property_add_bool(oc, "hugetlb",
|
||||||
memfd_backend_get_hugetlb,
|
memfd_backend_get_hugetlb,
|
||||||
memfd_backend_set_hugetlb,
|
memfd_backend_set_hugetlb);
|
||||||
&error_abort);
|
|
||||||
object_class_property_set_description(oc, "hugetlb",
|
object_class_property_set_description(oc, "hugetlb",
|
||||||
"Use huge pages",
|
"Use huge pages");
|
||||||
&error_abort);
|
|
||||||
object_class_property_add(oc, "hugetlbsize", "int",
|
object_class_property_add(oc, "hugetlbsize", "int",
|
||||||
memfd_backend_get_hugetlbsize,
|
memfd_backend_get_hugetlbsize,
|
||||||
memfd_backend_set_hugetlbsize,
|
memfd_backend_set_hugetlbsize,
|
||||||
NULL, NULL, &error_abort);
|
NULL, NULL);
|
||||||
object_class_property_set_description(oc, "hugetlbsize",
|
object_class_property_set_description(oc, "hugetlbsize",
|
||||||
"Huge pages size (ex: 2M, 1G)",
|
"Huge pages size (ex: 2M, 1G)");
|
||||||
&error_abort);
|
|
||||||
}
|
}
|
||||||
object_class_property_add_bool(oc, "seal",
|
object_class_property_add_bool(oc, "seal",
|
||||||
memfd_backend_get_seal,
|
memfd_backend_get_seal,
|
||||||
memfd_backend_set_seal,
|
memfd_backend_set_seal);
|
||||||
&error_abort);
|
|
||||||
object_class_property_set_description(oc, "seal",
|
object_class_property_set_description(oc, "seal",
|
||||||
"Seal growing & shrinking",
|
"Seal growing & shrinking");
|
||||||
&error_abort);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo memfd_backend_info = {
|
static const TypeInfo memfd_backend_info = {
|
||||||
|
|
|
@ -463,51 +463,50 @@ host_memory_backend_class_init(ObjectClass *oc, void *data)
|
||||||
|
|
||||||
object_class_property_add_bool(oc, "merge",
|
object_class_property_add_bool(oc, "merge",
|
||||||
host_memory_backend_get_merge,
|
host_memory_backend_get_merge,
|
||||||
host_memory_backend_set_merge, &error_abort);
|
host_memory_backend_set_merge);
|
||||||
object_class_property_set_description(oc, "merge",
|
object_class_property_set_description(oc, "merge",
|
||||||
"Mark memory as mergeable", &error_abort);
|
"Mark memory as mergeable");
|
||||||
object_class_property_add_bool(oc, "dump",
|
object_class_property_add_bool(oc, "dump",
|
||||||
host_memory_backend_get_dump,
|
host_memory_backend_get_dump,
|
||||||
host_memory_backend_set_dump, &error_abort);
|
host_memory_backend_set_dump);
|
||||||
object_class_property_set_description(oc, "dump",
|
object_class_property_set_description(oc, "dump",
|
||||||
"Set to 'off' to exclude from core dump", &error_abort);
|
"Set to 'off' to exclude from core dump");
|
||||||
object_class_property_add_bool(oc, "prealloc",
|
object_class_property_add_bool(oc, "prealloc",
|
||||||
host_memory_backend_get_prealloc,
|
host_memory_backend_get_prealloc,
|
||||||
host_memory_backend_set_prealloc, &error_abort);
|
host_memory_backend_set_prealloc);
|
||||||
object_class_property_set_description(oc, "prealloc",
|
object_class_property_set_description(oc, "prealloc",
|
||||||
"Preallocate memory", &error_abort);
|
"Preallocate memory");
|
||||||
object_class_property_add(oc, "prealloc-threads", "int",
|
object_class_property_add(oc, "prealloc-threads", "int",
|
||||||
host_memory_backend_get_prealloc_threads,
|
host_memory_backend_get_prealloc_threads,
|
||||||
host_memory_backend_set_prealloc_threads,
|
host_memory_backend_set_prealloc_threads,
|
||||||
NULL, NULL, &error_abort);
|
NULL, NULL);
|
||||||
object_class_property_set_description(oc, "prealloc-threads",
|
object_class_property_set_description(oc, "prealloc-threads",
|
||||||
"Number of CPU threads to use for prealloc", &error_abort);
|
"Number of CPU threads to use for prealloc");
|
||||||
object_class_property_add(oc, "size", "int",
|
object_class_property_add(oc, "size", "int",
|
||||||
host_memory_backend_get_size,
|
host_memory_backend_get_size,
|
||||||
host_memory_backend_set_size,
|
host_memory_backend_set_size,
|
||||||
NULL, NULL, &error_abort);
|
NULL, NULL);
|
||||||
object_class_property_set_description(oc, "size",
|
object_class_property_set_description(oc, "size",
|
||||||
"Size of the memory region (ex: 500M)", &error_abort);
|
"Size of the memory region (ex: 500M)");
|
||||||
object_class_property_add(oc, "host-nodes", "int",
|
object_class_property_add(oc, "host-nodes", "int",
|
||||||
host_memory_backend_get_host_nodes,
|
host_memory_backend_get_host_nodes,
|
||||||
host_memory_backend_set_host_nodes,
|
host_memory_backend_set_host_nodes,
|
||||||
NULL, NULL, &error_abort);
|
NULL, NULL);
|
||||||
object_class_property_set_description(oc, "host-nodes",
|
object_class_property_set_description(oc, "host-nodes",
|
||||||
"Binds memory to the list of NUMA host nodes", &error_abort);
|
"Binds memory to the list of NUMA host nodes");
|
||||||
object_class_property_add_enum(oc, "policy", "HostMemPolicy",
|
object_class_property_add_enum(oc, "policy", "HostMemPolicy",
|
||||||
&HostMemPolicy_lookup,
|
&HostMemPolicy_lookup,
|
||||||
host_memory_backend_get_policy,
|
host_memory_backend_get_policy,
|
||||||
host_memory_backend_set_policy, &error_abort);
|
host_memory_backend_set_policy);
|
||||||
object_class_property_set_description(oc, "policy",
|
object_class_property_set_description(oc, "policy",
|
||||||
"Set the NUMA policy", &error_abort);
|
"Set the NUMA policy");
|
||||||
object_class_property_add_bool(oc, "share",
|
object_class_property_add_bool(oc, "share",
|
||||||
host_memory_backend_get_share, host_memory_backend_set_share,
|
host_memory_backend_get_share, host_memory_backend_set_share);
|
||||||
&error_abort);
|
|
||||||
object_class_property_set_description(oc, "share",
|
object_class_property_set_description(oc, "share",
|
||||||
"Mark the memory as private to QEMU or shared", &error_abort);
|
"Mark the memory as private to QEMU or shared");
|
||||||
object_class_property_add_bool(oc, "x-use-canonical-path-for-ramblock-id",
|
object_class_property_add_bool(oc, "x-use-canonical-path-for-ramblock-id",
|
||||||
host_memory_backend_get_use_canonical_path,
|
host_memory_backend_get_use_canonical_path,
|
||||||
host_memory_backend_set_use_canonical_path, &error_abort);
|
host_memory_backend_set_use_canonical_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo host_memory_backend_info = {
|
static const TypeInfo host_memory_backend_info = {
|
||||||
|
|
|
@ -138,8 +138,7 @@ static char *rng_egd_get_chardev(Object *obj, Error **errp)
|
||||||
static void rng_egd_init(Object *obj)
|
static void rng_egd_init(Object *obj)
|
||||||
{
|
{
|
||||||
object_property_add_str(obj, "chardev",
|
object_property_add_str(obj, "chardev",
|
||||||
rng_egd_get_chardev, rng_egd_set_chardev,
|
rng_egd_get_chardev, rng_egd_set_chardev);
|
||||||
NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rng_egd_finalize(Object *obj)
|
static void rng_egd_finalize(Object *obj)
|
||||||
|
|
|
@ -110,8 +110,7 @@ static void rng_random_init(Object *obj)
|
||||||
|
|
||||||
object_property_add_str(obj, "filename",
|
object_property_add_str(obj, "filename",
|
||||||
rng_random_get_filename,
|
rng_random_get_filename,
|
||||||
rng_random_set_filename,
|
rng_random_set_filename);
|
||||||
NULL);
|
|
||||||
|
|
||||||
s->filename = g_strdup("/dev/urandom");
|
s->filename = g_strdup("/dev/urandom");
|
||||||
s->fd = -1;
|
s->fd = -1;
|
||||||
|
|
|
@ -108,8 +108,7 @@ static void rng_backend_init(Object *obj)
|
||||||
|
|
||||||
object_property_add_bool(obj, "opened",
|
object_property_add_bool(obj, "opened",
|
||||||
rng_backend_prop_get_opened,
|
rng_backend_prop_get_opened,
|
||||||
rng_backend_prop_set_opened,
|
rng_backend_prop_set_opened);
|
||||||
NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rng_backend_finalize(Object *obj)
|
static void rng_backend_finalize(Object *obj)
|
||||||
|
|
|
@ -177,7 +177,7 @@ static char *get_chardev(Object *obj, Error **errp)
|
||||||
|
|
||||||
static void vhost_user_backend_init(Object *obj)
|
static void vhost_user_backend_init(Object *obj)
|
||||||
{
|
{
|
||||||
object_property_add_str(obj, "chardev", get_chardev, set_chardev, NULL);
|
object_property_add_str(obj, "chardev", get_chardev, set_chardev);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vhost_user_backend_finalize(Object *obj)
|
static void vhost_user_backend_finalize(Object *obj)
|
||||||
|
|
|
@ -954,8 +954,7 @@ static void throttle_group_obj_class_init(ObjectClass *klass, void *class_data)
|
||||||
"int",
|
"int",
|
||||||
throttle_group_get,
|
throttle_group_get,
|
||||||
throttle_group_set,
|
throttle_group_set,
|
||||||
NULL, &properties[i],
|
NULL, &properties[i]);
|
||||||
&error_abort);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ThrottleLimits */
|
/* ThrottleLimits */
|
||||||
|
@ -963,8 +962,7 @@ static void throttle_group_obj_class_init(ObjectClass *klass, void *class_data)
|
||||||
"limits", "ThrottleLimits",
|
"limits", "ThrottleLimits",
|
||||||
throttle_group_get_limits,
|
throttle_group_get_limits,
|
||||||
throttle_group_set_limits,
|
throttle_group_set_limits,
|
||||||
NULL, NULL,
|
NULL, NULL);
|
||||||
&error_abort);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo throttle_group_info = {
|
static const TypeInfo throttle_group_info = {
|
||||||
|
|
10
bootdevice.c
10
bootdevice.c
|
@ -327,9 +327,8 @@ static void property_release_bootindex(Object *obj, const char *name,
|
||||||
|
|
||||||
void device_add_bootindex_property(Object *obj, int32_t *bootindex,
|
void device_add_bootindex_property(Object *obj, int32_t *bootindex,
|
||||||
const char *name, const char *suffix,
|
const char *name, const char *suffix,
|
||||||
DeviceState *dev, Error **errp)
|
DeviceState *dev)
|
||||||
{
|
{
|
||||||
Error *local_err = NULL;
|
|
||||||
BootIndexProperty *prop = g_malloc0(sizeof(*prop));
|
BootIndexProperty *prop = g_malloc0(sizeof(*prop));
|
||||||
|
|
||||||
prop->bootindex = bootindex;
|
prop->bootindex = bootindex;
|
||||||
|
@ -340,13 +339,8 @@ void device_add_bootindex_property(Object *obj, int32_t *bootindex,
|
||||||
device_get_bootindex,
|
device_get_bootindex,
|
||||||
device_set_bootindex,
|
device_set_bootindex,
|
||||||
property_release_bootindex,
|
property_release_bootindex,
|
||||||
prop, &local_err);
|
prop);
|
||||||
|
|
||||||
if (local_err) {
|
|
||||||
error_propagate(errp, local_err);
|
|
||||||
g_free(prop);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
/* initialize devices' bootindex property to -1 */
|
/* initialize devices' bootindex property to -1 */
|
||||||
object_property_set_int(obj, -1, name, NULL);
|
object_property_set_int(obj, -1, name, NULL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1489,10 +1489,10 @@ static void char_socket_class_init(ObjectClass *oc, void *data)
|
||||||
|
|
||||||
object_class_property_add(oc, "addr", "SocketAddress",
|
object_class_property_add(oc, "addr", "SocketAddress",
|
||||||
char_socket_get_addr, NULL,
|
char_socket_get_addr, NULL,
|
||||||
NULL, NULL, &error_abort);
|
NULL, NULL);
|
||||||
|
|
||||||
object_class_property_add_bool(oc, "connected", char_socket_get_connected,
|
object_class_property_add_bool(oc, "connected", char_socket_get_connected,
|
||||||
NULL, &error_abort);
|
NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo char_socket_type_info = {
|
static const TypeInfo char_socket_type_info = {
|
||||||
|
|
|
@ -986,10 +986,7 @@ static Chardev *chardev_new(const char *id, const char *typename,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (id) {
|
if (id) {
|
||||||
object_property_add_child(get_chardevs_root(), id, obj, &local_err);
|
object_property_add_child(get_chardevs_root(), id, obj);
|
||||||
if (local_err) {
|
|
||||||
goto end;
|
|
||||||
}
|
|
||||||
object_unref(obj);
|
object_unref(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1116,7 +1113,7 @@ ChardevReturn *qmp_chardev_change(const char *id, ChardevBackend *backend,
|
||||||
|
|
||||||
object_unparent(OBJECT(chr));
|
object_unparent(OBJECT(chr));
|
||||||
object_property_add_child(get_chardevs_root(), chr_new->label,
|
object_property_add_child(get_chardevs_root(), chr_new->label,
|
||||||
OBJECT(chr_new), &error_abort);
|
OBJECT(chr_new));
|
||||||
object_unref(OBJECT(chr_new));
|
object_unref(OBJECT(chr_new));
|
||||||
|
|
||||||
ret = g_new0(ChardevReturn, 1);
|
ret = g_new0(ChardevReturn, 1);
|
||||||
|
|
|
@ -369,30 +369,24 @@ qcrypto_secret_class_init(ObjectClass *oc, void *data)
|
||||||
|
|
||||||
object_class_property_add_bool(oc, "loaded",
|
object_class_property_add_bool(oc, "loaded",
|
||||||
qcrypto_secret_prop_get_loaded,
|
qcrypto_secret_prop_get_loaded,
|
||||||
qcrypto_secret_prop_set_loaded,
|
qcrypto_secret_prop_set_loaded);
|
||||||
NULL);
|
|
||||||
object_class_property_add_enum(oc, "format",
|
object_class_property_add_enum(oc, "format",
|
||||||
"QCryptoSecretFormat",
|
"QCryptoSecretFormat",
|
||||||
&QCryptoSecretFormat_lookup,
|
&QCryptoSecretFormat_lookup,
|
||||||
qcrypto_secret_prop_get_format,
|
qcrypto_secret_prop_get_format,
|
||||||
qcrypto_secret_prop_set_format,
|
qcrypto_secret_prop_set_format);
|
||||||
NULL);
|
|
||||||
object_class_property_add_str(oc, "data",
|
object_class_property_add_str(oc, "data",
|
||||||
qcrypto_secret_prop_get_data,
|
qcrypto_secret_prop_get_data,
|
||||||
qcrypto_secret_prop_set_data,
|
qcrypto_secret_prop_set_data);
|
||||||
NULL);
|
|
||||||
object_class_property_add_str(oc, "file",
|
object_class_property_add_str(oc, "file",
|
||||||
qcrypto_secret_prop_get_file,
|
qcrypto_secret_prop_get_file,
|
||||||
qcrypto_secret_prop_set_file,
|
qcrypto_secret_prop_set_file);
|
||||||
NULL);
|
|
||||||
object_class_property_add_str(oc, "keyid",
|
object_class_property_add_str(oc, "keyid",
|
||||||
qcrypto_secret_prop_get_keyid,
|
qcrypto_secret_prop_get_keyid,
|
||||||
qcrypto_secret_prop_set_keyid,
|
qcrypto_secret_prop_set_keyid);
|
||||||
NULL);
|
|
||||||
object_class_property_add_str(oc, "iv",
|
object_class_property_add_str(oc, "iv",
|
||||||
qcrypto_secret_prop_get_iv,
|
qcrypto_secret_prop_get_iv,
|
||||||
qcrypto_secret_prop_set_iv,
|
qcrypto_secret_prop_set_iv);
|
||||||
NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -226,22 +226,18 @@ qcrypto_tls_creds_class_init(ObjectClass *oc, void *data)
|
||||||
{
|
{
|
||||||
object_class_property_add_bool(oc, "verify-peer",
|
object_class_property_add_bool(oc, "verify-peer",
|
||||||
qcrypto_tls_creds_prop_get_verify,
|
qcrypto_tls_creds_prop_get_verify,
|
||||||
qcrypto_tls_creds_prop_set_verify,
|
qcrypto_tls_creds_prop_set_verify);
|
||||||
NULL);
|
|
||||||
object_class_property_add_str(oc, "dir",
|
object_class_property_add_str(oc, "dir",
|
||||||
qcrypto_tls_creds_prop_get_dir,
|
qcrypto_tls_creds_prop_get_dir,
|
||||||
qcrypto_tls_creds_prop_set_dir,
|
qcrypto_tls_creds_prop_set_dir);
|
||||||
NULL);
|
|
||||||
object_class_property_add_enum(oc, "endpoint",
|
object_class_property_add_enum(oc, "endpoint",
|
||||||
"QCryptoTLSCredsEndpoint",
|
"QCryptoTLSCredsEndpoint",
|
||||||
&QCryptoTLSCredsEndpoint_lookup,
|
&QCryptoTLSCredsEndpoint_lookup,
|
||||||
qcrypto_tls_creds_prop_get_endpoint,
|
qcrypto_tls_creds_prop_get_endpoint,
|
||||||
qcrypto_tls_creds_prop_set_endpoint,
|
qcrypto_tls_creds_prop_set_endpoint);
|
||||||
NULL);
|
|
||||||
object_class_property_add_str(oc, "priority",
|
object_class_property_add_str(oc, "priority",
|
||||||
qcrypto_tls_creds_prop_get_priority,
|
qcrypto_tls_creds_prop_get_priority,
|
||||||
qcrypto_tls_creds_prop_set_priority,
|
qcrypto_tls_creds_prop_set_priority);
|
||||||
NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -187,8 +187,7 @@ qcrypto_tls_creds_anon_class_init(ObjectClass *oc, void *data)
|
||||||
|
|
||||||
object_class_property_add_bool(oc, "loaded",
|
object_class_property_add_bool(oc, "loaded",
|
||||||
qcrypto_tls_creds_anon_prop_get_loaded,
|
qcrypto_tls_creds_anon_prop_get_loaded,
|
||||||
qcrypto_tls_creds_anon_prop_set_loaded,
|
qcrypto_tls_creds_anon_prop_set_loaded);
|
||||||
NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -275,12 +275,10 @@ qcrypto_tls_creds_psk_class_init(ObjectClass *oc, void *data)
|
||||||
|
|
||||||
object_class_property_add_bool(oc, "loaded",
|
object_class_property_add_bool(oc, "loaded",
|
||||||
qcrypto_tls_creds_psk_prop_get_loaded,
|
qcrypto_tls_creds_psk_prop_get_loaded,
|
||||||
qcrypto_tls_creds_psk_prop_set_loaded,
|
qcrypto_tls_creds_psk_prop_set_loaded);
|
||||||
NULL);
|
|
||||||
object_class_property_add_str(oc, "username",
|
object_class_property_add_str(oc, "username",
|
||||||
qcrypto_tls_creds_psk_prop_get_username,
|
qcrypto_tls_creds_psk_prop_get_username,
|
||||||
qcrypto_tls_creds_psk_prop_set_username,
|
qcrypto_tls_creds_psk_prop_set_username);
|
||||||
NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -806,16 +806,13 @@ qcrypto_tls_creds_x509_class_init(ObjectClass *oc, void *data)
|
||||||
|
|
||||||
object_class_property_add_bool(oc, "loaded",
|
object_class_property_add_bool(oc, "loaded",
|
||||||
qcrypto_tls_creds_x509_prop_get_loaded,
|
qcrypto_tls_creds_x509_prop_get_loaded,
|
||||||
qcrypto_tls_creds_x509_prop_set_loaded,
|
qcrypto_tls_creds_x509_prop_set_loaded);
|
||||||
NULL);
|
|
||||||
object_class_property_add_bool(oc, "sanity-check",
|
object_class_property_add_bool(oc, "sanity-check",
|
||||||
qcrypto_tls_creds_x509_prop_get_sanity,
|
qcrypto_tls_creds_x509_prop_get_sanity,
|
||||||
qcrypto_tls_creds_x509_prop_set_sanity,
|
qcrypto_tls_creds_x509_prop_set_sanity);
|
||||||
NULL);
|
|
||||||
object_class_property_add_str(oc, "passwordid",
|
object_class_property_add_str(oc, "passwordid",
|
||||||
qcrypto_tls_creds_x509_prop_get_passwordid,
|
qcrypto_tls_creds_x509_prop_get_passwordid,
|
||||||
qcrypto_tls_creds_x509_prop_set_passwordid,
|
qcrypto_tls_creds_x509_prop_set_passwordid);
|
||||||
NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4124,13 +4124,13 @@ int v9fs_device_realize_common(V9fsState *s, const V9fsTransport *t,
|
||||||
rc = 0;
|
rc = 0;
|
||||||
out:
|
out:
|
||||||
if (rc) {
|
if (rc) {
|
||||||
v9fs_device_unrealize_common(s, NULL);
|
v9fs_device_unrealize_common(s);
|
||||||
}
|
}
|
||||||
v9fs_path_free(&path);
|
v9fs_path_free(&path);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void v9fs_device_unrealize_common(V9fsState *s, Error **errp)
|
void v9fs_device_unrealize_common(V9fsState *s)
|
||||||
{
|
{
|
||||||
if (s->ops && s->ops->cleanup) {
|
if (s->ops && s->ops->cleanup) {
|
||||||
s->ops->cleanup(&s->ctx);
|
s->ops->cleanup(&s->ctx);
|
||||||
|
|
|
@ -423,7 +423,7 @@ int v9fs_name_to_path(V9fsState *s, V9fsPath *dirpath,
|
||||||
const char *name, V9fsPath *path);
|
const char *name, V9fsPath *path);
|
||||||
int v9fs_device_realize_common(V9fsState *s, const V9fsTransport *t,
|
int v9fs_device_realize_common(V9fsState *s, const V9fsTransport *t,
|
||||||
Error **errp);
|
Error **errp);
|
||||||
void v9fs_device_unrealize_common(V9fsState *s, Error **errp);
|
void v9fs_device_unrealize_common(V9fsState *s);
|
||||||
|
|
||||||
V9fsPDU *pdu_alloc(V9fsState *s);
|
V9fsPDU *pdu_alloc(V9fsState *s);
|
||||||
void pdu_free(V9fsPDU *pdu);
|
void pdu_free(V9fsPDU *pdu);
|
||||||
|
|
|
@ -212,7 +212,7 @@ static void virtio_9p_device_realize(DeviceState *dev, Error **errp)
|
||||||
v->vq = virtio_add_queue(vdev, MAX_REQ, handle_9p_output);
|
v->vq = virtio_add_queue(vdev, MAX_REQ, handle_9p_output);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void virtio_9p_device_unrealize(DeviceState *dev, Error **errp)
|
static void virtio_9p_device_unrealize(DeviceState *dev)
|
||||||
{
|
{
|
||||||
VirtIODevice *vdev = VIRTIO_DEVICE(dev);
|
VirtIODevice *vdev = VIRTIO_DEVICE(dev);
|
||||||
V9fsVirtioState *v = VIRTIO_9P(dev);
|
V9fsVirtioState *v = VIRTIO_9P(dev);
|
||||||
|
@ -220,7 +220,7 @@ static void virtio_9p_device_unrealize(DeviceState *dev, Error **errp)
|
||||||
|
|
||||||
virtio_delete_queue(v->vq);
|
virtio_delete_queue(v->vq);
|
||||||
virtio_cleanup(vdev);
|
virtio_cleanup(vdev);
|
||||||
v9fs_device_unrealize_common(s, errp);
|
v9fs_device_unrealize_common(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* virtio-9p device */
|
/* virtio-9p device */
|
||||||
|
|
|
@ -369,7 +369,7 @@ static void ich9_pm_set_enable_tco(Object *obj, bool value, Error **errp)
|
||||||
s->pm.enable_tco = value;
|
s->pm.enable_tco = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm, Error **errp)
|
void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm)
|
||||||
{
|
{
|
||||||
static const uint32_t gpe0_len = ICH9_PMIO_GPE0_LEN;
|
static const uint32_t gpe0_len = ICH9_PMIO_GPE0_LEN;
|
||||||
pm->acpi_memory_hotplug.is_enabled = true;
|
pm->acpi_memory_hotplug.is_enabled = true;
|
||||||
|
@ -379,32 +379,27 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm, Error **errp)
|
||||||
pm->s4_val = 2;
|
pm->s4_val = 2;
|
||||||
|
|
||||||
object_property_add_uint32_ptr(obj, ACPI_PM_PROP_PM_IO_BASE,
|
object_property_add_uint32_ptr(obj, ACPI_PM_PROP_PM_IO_BASE,
|
||||||
&pm->pm_io_base, OBJ_PROP_FLAG_READ, errp);
|
&pm->pm_io_base, OBJ_PROP_FLAG_READ);
|
||||||
object_property_add(obj, ACPI_PM_PROP_GPE0_BLK, "uint32",
|
object_property_add(obj, ACPI_PM_PROP_GPE0_BLK, "uint32",
|
||||||
ich9_pm_get_gpe0_blk,
|
ich9_pm_get_gpe0_blk,
|
||||||
NULL, NULL, pm, NULL);
|
NULL, NULL, pm);
|
||||||
object_property_add_uint32_ptr(obj, ACPI_PM_PROP_GPE0_BLK_LEN,
|
object_property_add_uint32_ptr(obj, ACPI_PM_PROP_GPE0_BLK_LEN,
|
||||||
&gpe0_len, OBJ_PROP_FLAG_READ, errp);
|
&gpe0_len, OBJ_PROP_FLAG_READ);
|
||||||
object_property_add_bool(obj, "memory-hotplug-support",
|
object_property_add_bool(obj, "memory-hotplug-support",
|
||||||
ich9_pm_get_memory_hotplug_support,
|
ich9_pm_get_memory_hotplug_support,
|
||||||
ich9_pm_set_memory_hotplug_support,
|
ich9_pm_set_memory_hotplug_support);
|
||||||
NULL);
|
|
||||||
object_property_add_bool(obj, "cpu-hotplug-legacy",
|
object_property_add_bool(obj, "cpu-hotplug-legacy",
|
||||||
ich9_pm_get_cpu_hotplug_legacy,
|
ich9_pm_get_cpu_hotplug_legacy,
|
||||||
ich9_pm_set_cpu_hotplug_legacy,
|
ich9_pm_set_cpu_hotplug_legacy);
|
||||||
NULL);
|
|
||||||
object_property_add_uint8_ptr(obj, ACPI_PM_PROP_S3_DISABLED,
|
object_property_add_uint8_ptr(obj, ACPI_PM_PROP_S3_DISABLED,
|
||||||
&pm->disable_s3, OBJ_PROP_FLAG_READWRITE,
|
&pm->disable_s3, OBJ_PROP_FLAG_READWRITE);
|
||||||
NULL);
|
|
||||||
object_property_add_uint8_ptr(obj, ACPI_PM_PROP_S4_DISABLED,
|
object_property_add_uint8_ptr(obj, ACPI_PM_PROP_S4_DISABLED,
|
||||||
&pm->disable_s4, OBJ_PROP_FLAG_READWRITE,
|
&pm->disable_s4, OBJ_PROP_FLAG_READWRITE);
|
||||||
NULL);
|
|
||||||
object_property_add_uint8_ptr(obj, ACPI_PM_PROP_S4_VAL,
|
object_property_add_uint8_ptr(obj, ACPI_PM_PROP_S4_VAL,
|
||||||
&pm->s4_val, OBJ_PROP_FLAG_READWRITE, NULL);
|
&pm->s4_val, OBJ_PROP_FLAG_READWRITE);
|
||||||
object_property_add_bool(obj, ACPI_PM_PROP_TCO_ENABLED,
|
object_property_add_bool(obj, ACPI_PM_PROP_TCO_ENABLED,
|
||||||
ich9_pm_get_enable_tco,
|
ich9_pm_get_enable_tco,
|
||||||
ich9_pm_set_enable_tco,
|
ich9_pm_set_enable_tco);
|
||||||
NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ich9_pm_device_pre_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev,
|
void ich9_pm_device_pre_plug_cb(HotplugHandler *hotplug_dev, DeviceState *dev,
|
||||||
|
|
|
@ -80,8 +80,7 @@ static void *acpi_set_bsel(PCIBus *bus, void *opaque)
|
||||||
|
|
||||||
*bus_bsel = (*bsel_alloc)++;
|
*bus_bsel = (*bsel_alloc)++;
|
||||||
object_property_add_uint32_ptr(OBJECT(bus), ACPI_PCIHP_PROP_BSEL,
|
object_property_add_uint32_ptr(OBJECT(bus), ACPI_PCIHP_PROP_BSEL,
|
||||||
bus_bsel, OBJ_PROP_FLAG_READ,
|
bus_bsel, OBJ_PROP_FLAG_READ);
|
||||||
&error_abort);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return bsel_alloc;
|
return bsel_alloc;
|
||||||
|
@ -267,7 +266,7 @@ void acpi_pcihp_device_unplug_cb(HotplugHandler *hotplug_dev, AcpiPciHpState *s,
|
||||||
{
|
{
|
||||||
trace_acpi_pci_unplug(PCI_SLOT(PCI_DEVICE(dev)->devfn),
|
trace_acpi_pci_unplug(PCI_SLOT(PCI_DEVICE(dev)->devfn),
|
||||||
acpi_pcihp_get_bsel(pci_get_bus(PCI_DEVICE(dev))));
|
acpi_pcihp_get_bsel(pci_get_bus(PCI_DEVICE(dev))));
|
||||||
object_property_set_bool(OBJECT(dev), false, "realized", NULL);
|
object_property_set_bool(OBJECT(dev), false, "realized", &error_abort);
|
||||||
}
|
}
|
||||||
|
|
||||||
void acpi_pcihp_device_unplug_request_cb(HotplugHandler *hotplug_dev,
|
void acpi_pcihp_device_unplug_request_cb(HotplugHandler *hotplug_dev,
|
||||||
|
@ -374,9 +373,9 @@ void acpi_pcihp_init(Object *owner, AcpiPciHpState *s, PCIBus *root_bus,
|
||||||
memory_region_add_subregion(address_space_io, s->io_base, &s->io);
|
memory_region_add_subregion(address_space_io, s->io_base, &s->io);
|
||||||
|
|
||||||
object_property_add_uint16_ptr(owner, ACPI_PCIHP_IO_BASE_PROP, &s->io_base,
|
object_property_add_uint16_ptr(owner, ACPI_PCIHP_IO_BASE_PROP, &s->io_base,
|
||||||
OBJ_PROP_FLAG_READ, &error_abort);
|
OBJ_PROP_FLAG_READ);
|
||||||
object_property_add_uint16_ptr(owner, ACPI_PCIHP_IO_LEN_PROP, &s->io_len,
|
object_property_add_uint16_ptr(owner, ACPI_PCIHP_IO_LEN_PROP, &s->io_len,
|
||||||
OBJ_PROP_FLAG_READ, &error_abort);
|
OBJ_PROP_FLAG_READ);
|
||||||
}
|
}
|
||||||
|
|
||||||
const VMStateDescription vmstate_acpi_pcihp_pci_status = {
|
const VMStateDescription vmstate_acpi_pcihp_pci_status = {
|
||||||
|
|
|
@ -444,17 +444,17 @@ static void piix4_pm_add_propeties(PIIX4PMState *s)
|
||||||
static const uint16_t sci_int = 9;
|
static const uint16_t sci_int = 9;
|
||||||
|
|
||||||
object_property_add_uint8_ptr(OBJECT(s), ACPI_PM_PROP_ACPI_ENABLE_CMD,
|
object_property_add_uint8_ptr(OBJECT(s), ACPI_PM_PROP_ACPI_ENABLE_CMD,
|
||||||
&acpi_enable_cmd, OBJ_PROP_FLAG_READ, NULL);
|
&acpi_enable_cmd, OBJ_PROP_FLAG_READ);
|
||||||
object_property_add_uint8_ptr(OBJECT(s), ACPI_PM_PROP_ACPI_DISABLE_CMD,
|
object_property_add_uint8_ptr(OBJECT(s), ACPI_PM_PROP_ACPI_DISABLE_CMD,
|
||||||
&acpi_disable_cmd, OBJ_PROP_FLAG_READ, NULL);
|
&acpi_disable_cmd, OBJ_PROP_FLAG_READ);
|
||||||
object_property_add_uint32_ptr(OBJECT(s), ACPI_PM_PROP_GPE0_BLK,
|
object_property_add_uint32_ptr(OBJECT(s), ACPI_PM_PROP_GPE0_BLK,
|
||||||
&gpe0_blk, OBJ_PROP_FLAG_READ, NULL);
|
&gpe0_blk, OBJ_PROP_FLAG_READ);
|
||||||
object_property_add_uint32_ptr(OBJECT(s), ACPI_PM_PROP_GPE0_BLK_LEN,
|
object_property_add_uint32_ptr(OBJECT(s), ACPI_PM_PROP_GPE0_BLK_LEN,
|
||||||
&gpe0_blk_len, OBJ_PROP_FLAG_READ, NULL);
|
&gpe0_blk_len, OBJ_PROP_FLAG_READ);
|
||||||
object_property_add_uint16_ptr(OBJECT(s), ACPI_PM_PROP_SCI_INT,
|
object_property_add_uint16_ptr(OBJECT(s), ACPI_PM_PROP_SCI_INT,
|
||||||
&sci_int, OBJ_PROP_FLAG_READ, NULL);
|
&sci_int, OBJ_PROP_FLAG_READ);
|
||||||
object_property_add_uint32_ptr(OBJECT(s), ACPI_PM_PROP_PM_IO_BASE,
|
object_property_add_uint32_ptr(OBJECT(s), ACPI_PM_PROP_PM_IO_BASE,
|
||||||
&s->io_base, OBJ_PROP_FLAG_READ, NULL);
|
&s->io_base, OBJ_PROP_FLAG_READ);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void piix4_pm_realize(PCIDevice *dev, Error **errp)
|
static void piix4_pm_realize(PCIDevice *dev, Error **errp)
|
||||||
|
@ -598,8 +598,7 @@ static void piix4_acpi_system_hot_add_init(MemoryRegion *parent,
|
||||||
s->cpu_hotplug_legacy = true;
|
s->cpu_hotplug_legacy = true;
|
||||||
object_property_add_bool(OBJECT(s), "cpu-hotplug-legacy",
|
object_property_add_bool(OBJECT(s), "cpu-hotplug-legacy",
|
||||||
piix4_get_cpu_hotplug_legacy,
|
piix4_get_cpu_hotplug_legacy,
|
||||||
piix4_set_cpu_hotplug_legacy,
|
piix4_set_cpu_hotplug_legacy);
|
||||||
NULL);
|
|
||||||
legacy_acpi_cpu_hotplug_init(parent, OBJECT(s), &s->gpe_cpu,
|
legacy_acpi_cpu_hotplug_init(parent, OBJECT(s), &s->gpe_cpu,
|
||||||
PIIX4_CPU_HOTPLUG_IO_BASE);
|
PIIX4_CPU_HOTPLUG_IO_BASE);
|
||||||
|
|
||||||
|
|
|
@ -178,7 +178,7 @@ static void aw_a10_realize(DeviceState *dev, Error **errp)
|
||||||
sysbus_mmio_map(SYS_BUS_DEVICE(&s->mmc0), 0, AW_A10_MMC0_BASE);
|
sysbus_mmio_map(SYS_BUS_DEVICE(&s->mmc0), 0, AW_A10_MMC0_BASE);
|
||||||
sysbus_connect_irq(SYS_BUS_DEVICE(&s->mmc0), 0, qdev_get_gpio_in(dev, 32));
|
sysbus_connect_irq(SYS_BUS_DEVICE(&s->mmc0), 0, qdev_get_gpio_in(dev, 32));
|
||||||
object_property_add_alias(OBJECT(s), "sd-bus", OBJECT(&s->mmc0),
|
object_property_add_alias(OBJECT(s), "sd-bus", OBJECT(&s->mmc0),
|
||||||
"sd-bus", &error_abort);
|
"sd-bus");
|
||||||
|
|
||||||
/* RTC */
|
/* RTC */
|
||||||
qdev_init_nofail(DEVICE(&s->rtc));
|
qdev_init_nofail(DEVICE(&s->rtc));
|
||||||
|
|
|
@ -205,9 +205,9 @@ static void allwinner_h3_init(Object *obj)
|
||||||
sysbus_init_child_obj(obj, "timer", &s->timer, sizeof(s->timer),
|
sysbus_init_child_obj(obj, "timer", &s->timer, sizeof(s->timer),
|
||||||
TYPE_AW_A10_PIT);
|
TYPE_AW_A10_PIT);
|
||||||
object_property_add_alias(obj, "clk0-freq", OBJECT(&s->timer),
|
object_property_add_alias(obj, "clk0-freq", OBJECT(&s->timer),
|
||||||
"clk0-freq", &error_abort);
|
"clk0-freq");
|
||||||
object_property_add_alias(obj, "clk1-freq", OBJECT(&s->timer),
|
object_property_add_alias(obj, "clk1-freq", OBJECT(&s->timer),
|
||||||
"clk1-freq", &error_abort);
|
"clk1-freq");
|
||||||
|
|
||||||
sysbus_init_child_obj(obj, "ccu", &s->ccu, sizeof(s->ccu),
|
sysbus_init_child_obj(obj, "ccu", &s->ccu, sizeof(s->ccu),
|
||||||
TYPE_AW_H3_CCU);
|
TYPE_AW_H3_CCU);
|
||||||
|
@ -221,7 +221,7 @@ static void allwinner_h3_init(Object *obj)
|
||||||
sysbus_init_child_obj(obj, "sid", &s->sid, sizeof(s->sid),
|
sysbus_init_child_obj(obj, "sid", &s->sid, sizeof(s->sid),
|
||||||
TYPE_AW_SID);
|
TYPE_AW_SID);
|
||||||
object_property_add_alias(obj, "identifier", OBJECT(&s->sid),
|
object_property_add_alias(obj, "identifier", OBJECT(&s->sid),
|
||||||
"identifier", &error_abort);
|
"identifier");
|
||||||
|
|
||||||
sysbus_init_child_obj(obj, "mmc0", &s->mmc0, sizeof(s->mmc0),
|
sysbus_init_child_obj(obj, "mmc0", &s->mmc0, sizeof(s->mmc0),
|
||||||
TYPE_AW_SDHOST_SUN5I);
|
TYPE_AW_SDHOST_SUN5I);
|
||||||
|
@ -232,9 +232,9 @@ static void allwinner_h3_init(Object *obj)
|
||||||
sysbus_init_child_obj(obj, "dramc", &s->dramc, sizeof(s->dramc),
|
sysbus_init_child_obj(obj, "dramc", &s->dramc, sizeof(s->dramc),
|
||||||
TYPE_AW_H3_DRAMC);
|
TYPE_AW_H3_DRAMC);
|
||||||
object_property_add_alias(obj, "ram-addr", OBJECT(&s->dramc),
|
object_property_add_alias(obj, "ram-addr", OBJECT(&s->dramc),
|
||||||
"ram-addr", &error_abort);
|
"ram-addr");
|
||||||
object_property_add_alias(obj, "ram-size", OBJECT(&s->dramc),
|
object_property_add_alias(obj, "ram-size", OBJECT(&s->dramc),
|
||||||
"ram-size", &error_abort);
|
"ram-size");
|
||||||
|
|
||||||
sysbus_init_child_obj(obj, "rtc", &s->rtc, sizeof(s->rtc),
|
sysbus_init_child_obj(obj, "rtc", &s->rtc, sizeof(s->rtc),
|
||||||
TYPE_AW_RTC_SUN6I);
|
TYPE_AW_RTC_SUN6I);
|
||||||
|
@ -366,7 +366,7 @@ static void allwinner_h3_realize(DeviceState *dev, Error **errp)
|
||||||
qdev_get_gpio_in(DEVICE(&s->gic), AW_H3_GIC_SPI_MMC0));
|
qdev_get_gpio_in(DEVICE(&s->gic), AW_H3_GIC_SPI_MMC0));
|
||||||
|
|
||||||
object_property_add_alias(OBJECT(s), "sd-bus", OBJECT(&s->mmc0),
|
object_property_add_alias(OBJECT(s), "sd-bus", OBJECT(&s->mmc0),
|
||||||
"sd-bus", &error_abort);
|
"sd-bus");
|
||||||
|
|
||||||
/* EMAC */
|
/* EMAC */
|
||||||
if (nd_table[0].used) {
|
if (nd_table[0].used) {
|
||||||
|
|
|
@ -138,7 +138,7 @@ static void armv7m_instance_init(Object *obj)
|
||||||
|
|
||||||
sysbus_init_child_obj(obj, "nvnic", &s->nvic, sizeof(s->nvic), TYPE_NVIC);
|
sysbus_init_child_obj(obj, "nvnic", &s->nvic, sizeof(s->nvic), TYPE_NVIC);
|
||||||
object_property_add_alias(obj, "num-irq",
|
object_property_add_alias(obj, "num-irq",
|
||||||
OBJECT(&s->nvic), "num-irq", &error_abort);
|
OBJECT(&s->nvic), "num-irq");
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(s->bitband); i++) {
|
for (i = 0; i < ARRAY_SIZE(s->bitband); i++) {
|
||||||
sysbus_init_child_obj(obj, "bitband[*]", &s->bitband[i],
|
sysbus_init_child_obj(obj, "bitband[*]", &s->bitband[i],
|
||||||
|
|
|
@ -544,9 +544,9 @@ static void aspeed_machine_class_props_init(ObjectClass *oc)
|
||||||
{
|
{
|
||||||
object_class_property_add_bool(oc, "execute-in-place",
|
object_class_property_add_bool(oc, "execute-in-place",
|
||||||
aspeed_get_mmio_exec,
|
aspeed_get_mmio_exec,
|
||||||
aspeed_set_mmio_exec, &error_abort);
|
aspeed_set_mmio_exec);
|
||||||
object_class_property_set_description(oc, "execute-in-place",
|
object_class_property_set_description(oc, "execute-in-place",
|
||||||
"boot directly from CE0 flash device", &error_abort);
|
"boot directly from CE0 flash device");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void aspeed_machine_class_init(ObjectClass *oc, void *data)
|
static void aspeed_machine_class_init(ObjectClass *oc, void *data)
|
||||||
|
|
|
@ -138,11 +138,11 @@ static void aspeed_soc_ast2600_init(Object *obj)
|
||||||
qdev_prop_set_uint32(DEVICE(&s->scu), "silicon-rev",
|
qdev_prop_set_uint32(DEVICE(&s->scu), "silicon-rev",
|
||||||
sc->silicon_rev);
|
sc->silicon_rev);
|
||||||
object_property_add_alias(obj, "hw-strap1", OBJECT(&s->scu),
|
object_property_add_alias(obj, "hw-strap1", OBJECT(&s->scu),
|
||||||
"hw-strap1", &error_abort);
|
"hw-strap1");
|
||||||
object_property_add_alias(obj, "hw-strap2", OBJECT(&s->scu),
|
object_property_add_alias(obj, "hw-strap2", OBJECT(&s->scu),
|
||||||
"hw-strap2", &error_abort);
|
"hw-strap2");
|
||||||
object_property_add_alias(obj, "hw-prot-key", OBJECT(&s->scu),
|
object_property_add_alias(obj, "hw-prot-key", OBJECT(&s->scu),
|
||||||
"hw-prot-key", &error_abort);
|
"hw-prot-key");
|
||||||
|
|
||||||
sysbus_init_child_obj(obj, "a7mpcore", &s->a7mpcore,
|
sysbus_init_child_obj(obj, "a7mpcore", &s->a7mpcore,
|
||||||
sizeof(s->a7mpcore), TYPE_A15MPCORE_PRIV);
|
sizeof(s->a7mpcore), TYPE_A15MPCORE_PRIV);
|
||||||
|
@ -161,8 +161,7 @@ static void aspeed_soc_ast2600_init(Object *obj)
|
||||||
snprintf(typename, sizeof(typename), "aspeed.fmc-%s", socname);
|
snprintf(typename, sizeof(typename), "aspeed.fmc-%s", socname);
|
||||||
sysbus_init_child_obj(obj, "fmc", OBJECT(&s->fmc), sizeof(s->fmc),
|
sysbus_init_child_obj(obj, "fmc", OBJECT(&s->fmc), sizeof(s->fmc),
|
||||||
typename);
|
typename);
|
||||||
object_property_add_alias(obj, "num-cs", OBJECT(&s->fmc), "num-cs",
|
object_property_add_alias(obj, "num-cs", OBJECT(&s->fmc), "num-cs");
|
||||||
&error_abort);
|
|
||||||
|
|
||||||
for (i = 0; i < sc->spis_num; i++) {
|
for (i = 0; i < sc->spis_num; i++) {
|
||||||
snprintf(typename, sizeof(typename), "aspeed.spi%d-%s", i + 1, socname);
|
snprintf(typename, sizeof(typename), "aspeed.spi%d-%s", i + 1, socname);
|
||||||
|
@ -179,9 +178,9 @@ static void aspeed_soc_ast2600_init(Object *obj)
|
||||||
sysbus_init_child_obj(obj, "sdmc", OBJECT(&s->sdmc), sizeof(s->sdmc),
|
sysbus_init_child_obj(obj, "sdmc", OBJECT(&s->sdmc), sizeof(s->sdmc),
|
||||||
typename);
|
typename);
|
||||||
object_property_add_alias(obj, "ram-size", OBJECT(&s->sdmc),
|
object_property_add_alias(obj, "ram-size", OBJECT(&s->sdmc),
|
||||||
"ram-size", &error_abort);
|
"ram-size");
|
||||||
object_property_add_alias(obj, "max-ram-size", OBJECT(&s->sdmc),
|
object_property_add_alias(obj, "max-ram-size", OBJECT(&s->sdmc),
|
||||||
"max-ram-size", &error_abort);
|
"max-ram-size");
|
||||||
|
|
||||||
for (i = 0; i < sc->wdts_num; i++) {
|
for (i = 0; i < sc->wdts_num; i++) {
|
||||||
snprintf(typename, sizeof(typename), "aspeed.wdt-%s", socname);
|
snprintf(typename, sizeof(typename), "aspeed.wdt-%s", socname);
|
||||||
|
|
|
@ -153,11 +153,11 @@ static void aspeed_soc_init(Object *obj)
|
||||||
qdev_prop_set_uint32(DEVICE(&s->scu), "silicon-rev",
|
qdev_prop_set_uint32(DEVICE(&s->scu), "silicon-rev",
|
||||||
sc->silicon_rev);
|
sc->silicon_rev);
|
||||||
object_property_add_alias(obj, "hw-strap1", OBJECT(&s->scu),
|
object_property_add_alias(obj, "hw-strap1", OBJECT(&s->scu),
|
||||||
"hw-strap1", &error_abort);
|
"hw-strap1");
|
||||||
object_property_add_alias(obj, "hw-strap2", OBJECT(&s->scu),
|
object_property_add_alias(obj, "hw-strap2", OBJECT(&s->scu),
|
||||||
"hw-strap2", &error_abort);
|
"hw-strap2");
|
||||||
object_property_add_alias(obj, "hw-prot-key", OBJECT(&s->scu),
|
object_property_add_alias(obj, "hw-prot-key", OBJECT(&s->scu),
|
||||||
"hw-prot-key", &error_abort);
|
"hw-prot-key");
|
||||||
|
|
||||||
sysbus_init_child_obj(obj, "vic", OBJECT(&s->vic), sizeof(s->vic),
|
sysbus_init_child_obj(obj, "vic", OBJECT(&s->vic), sizeof(s->vic),
|
||||||
TYPE_ASPEED_VIC);
|
TYPE_ASPEED_VIC);
|
||||||
|
@ -176,8 +176,7 @@ static void aspeed_soc_init(Object *obj)
|
||||||
snprintf(typename, sizeof(typename), "aspeed.fmc-%s", socname);
|
snprintf(typename, sizeof(typename), "aspeed.fmc-%s", socname);
|
||||||
sysbus_init_child_obj(obj, "fmc", OBJECT(&s->fmc), sizeof(s->fmc),
|
sysbus_init_child_obj(obj, "fmc", OBJECT(&s->fmc), sizeof(s->fmc),
|
||||||
typename);
|
typename);
|
||||||
object_property_add_alias(obj, "num-cs", OBJECT(&s->fmc), "num-cs",
|
object_property_add_alias(obj, "num-cs", OBJECT(&s->fmc), "num-cs");
|
||||||
&error_abort);
|
|
||||||
|
|
||||||
for (i = 0; i < sc->spis_num; i++) {
|
for (i = 0; i < sc->spis_num; i++) {
|
||||||
snprintf(typename, sizeof(typename), "aspeed.spi%d-%s", i + 1, socname);
|
snprintf(typename, sizeof(typename), "aspeed.spi%d-%s", i + 1, socname);
|
||||||
|
@ -194,9 +193,9 @@ static void aspeed_soc_init(Object *obj)
|
||||||
sysbus_init_child_obj(obj, "sdmc", OBJECT(&s->sdmc), sizeof(s->sdmc),
|
sysbus_init_child_obj(obj, "sdmc", OBJECT(&s->sdmc), sizeof(s->sdmc),
|
||||||
typename);
|
typename);
|
||||||
object_property_add_alias(obj, "ram-size", OBJECT(&s->sdmc),
|
object_property_add_alias(obj, "ram-size", OBJECT(&s->sdmc),
|
||||||
"ram-size", &error_abort);
|
"ram-size");
|
||||||
object_property_add_alias(obj, "max-ram-size", OBJECT(&s->sdmc),
|
object_property_add_alias(obj, "max-ram-size", OBJECT(&s->sdmc),
|
||||||
"max-ram-size", &error_abort);
|
"max-ram-size");
|
||||||
|
|
||||||
for (i = 0; i < sc->wdts_num; i++) {
|
for (i = 0; i < sc->wdts_num; i++) {
|
||||||
snprintf(typename, sizeof(typename), "aspeed.wdt-%s", socname);
|
snprintf(typename, sizeof(typename), "aspeed.wdt-%s", socname);
|
||||||
|
|
|
@ -43,12 +43,10 @@ static void bcm2835_peripherals_init(Object *obj)
|
||||||
|
|
||||||
/* Memory region for peripheral devices, which we export to our parent */
|
/* Memory region for peripheral devices, which we export to our parent */
|
||||||
memory_region_init(&s->peri_mr, obj,"bcm2835-peripherals", 0x1000000);
|
memory_region_init(&s->peri_mr, obj,"bcm2835-peripherals", 0x1000000);
|
||||||
object_property_add_child(obj, "peripheral-io", OBJECT(&s->peri_mr), NULL);
|
|
||||||
sysbus_init_mmio(SYS_BUS_DEVICE(s), &s->peri_mr);
|
sysbus_init_mmio(SYS_BUS_DEVICE(s), &s->peri_mr);
|
||||||
|
|
||||||
/* Internal memory region for peripheral bus addresses (not exported) */
|
/* Internal memory region for peripheral bus addresses (not exported) */
|
||||||
memory_region_init(&s->gpu_bus_mr, obj, "bcm2835-gpu", (uint64_t)1 << 32);
|
memory_region_init(&s->gpu_bus_mr, obj, "bcm2835-gpu", (uint64_t)1 << 32);
|
||||||
object_property_add_child(obj, "gpu-bus", OBJECT(&s->gpu_bus_mr), NULL);
|
|
||||||
|
|
||||||
/* Internal memory region for request/response communication with
|
/* Internal memory region for request/response communication with
|
||||||
* mailbox-addressable peripherals (not exported)
|
* mailbox-addressable peripherals (not exported)
|
||||||
|
@ -76,26 +74,25 @@ static void bcm2835_peripherals_init(Object *obj)
|
||||||
TYPE_BCM2835_MBOX);
|
TYPE_BCM2835_MBOX);
|
||||||
|
|
||||||
object_property_add_const_link(OBJECT(&s->mboxes), "mbox-mr",
|
object_property_add_const_link(OBJECT(&s->mboxes), "mbox-mr",
|
||||||
OBJECT(&s->mbox_mr), &error_abort);
|
OBJECT(&s->mbox_mr));
|
||||||
|
|
||||||
/* Framebuffer */
|
/* Framebuffer */
|
||||||
sysbus_init_child_obj(obj, "fb", &s->fb, sizeof(s->fb), TYPE_BCM2835_FB);
|
sysbus_init_child_obj(obj, "fb", &s->fb, sizeof(s->fb), TYPE_BCM2835_FB);
|
||||||
object_property_add_alias(obj, "vcram-size", OBJECT(&s->fb), "vcram-size",
|
object_property_add_alias(obj, "vcram-size", OBJECT(&s->fb), "vcram-size");
|
||||||
&error_abort);
|
|
||||||
|
|
||||||
object_property_add_const_link(OBJECT(&s->fb), "dma-mr",
|
object_property_add_const_link(OBJECT(&s->fb), "dma-mr",
|
||||||
OBJECT(&s->gpu_bus_mr), &error_abort);
|
OBJECT(&s->gpu_bus_mr));
|
||||||
|
|
||||||
/* Property channel */
|
/* Property channel */
|
||||||
sysbus_init_child_obj(obj, "property", &s->property, sizeof(s->property),
|
sysbus_init_child_obj(obj, "property", &s->property, sizeof(s->property),
|
||||||
TYPE_BCM2835_PROPERTY);
|
TYPE_BCM2835_PROPERTY);
|
||||||
object_property_add_alias(obj, "board-rev", OBJECT(&s->property),
|
object_property_add_alias(obj, "board-rev", OBJECT(&s->property),
|
||||||
"board-rev", &error_abort);
|
"board-rev");
|
||||||
|
|
||||||
object_property_add_const_link(OBJECT(&s->property), "fb",
|
object_property_add_const_link(OBJECT(&s->property), "fb",
|
||||||
OBJECT(&s->fb), &error_abort);
|
OBJECT(&s->fb));
|
||||||
object_property_add_const_link(OBJECT(&s->property), "dma-mr",
|
object_property_add_const_link(OBJECT(&s->property), "dma-mr",
|
||||||
OBJECT(&s->gpu_bus_mr), &error_abort);
|
OBJECT(&s->gpu_bus_mr));
|
||||||
|
|
||||||
/* Random Number Generator */
|
/* Random Number Generator */
|
||||||
sysbus_init_child_obj(obj, "rng", &s->rng, sizeof(s->rng),
|
sysbus_init_child_obj(obj, "rng", &s->rng, sizeof(s->rng),
|
||||||
|
@ -114,7 +111,7 @@ static void bcm2835_peripherals_init(Object *obj)
|
||||||
TYPE_BCM2835_DMA);
|
TYPE_BCM2835_DMA);
|
||||||
|
|
||||||
object_property_add_const_link(OBJECT(&s->dma), "dma-mr",
|
object_property_add_const_link(OBJECT(&s->dma), "dma-mr",
|
||||||
OBJECT(&s->gpu_bus_mr), &error_abort);
|
OBJECT(&s->gpu_bus_mr));
|
||||||
|
|
||||||
/* Thermal */
|
/* Thermal */
|
||||||
sysbus_init_child_obj(obj, "thermal", &s->thermal, sizeof(s->thermal),
|
sysbus_init_child_obj(obj, "thermal", &s->thermal, sizeof(s->thermal),
|
||||||
|
@ -125,9 +122,9 @@ static void bcm2835_peripherals_init(Object *obj)
|
||||||
TYPE_BCM2835_GPIO);
|
TYPE_BCM2835_GPIO);
|
||||||
|
|
||||||
object_property_add_const_link(OBJECT(&s->gpio), "sdbus-sdhci",
|
object_property_add_const_link(OBJECT(&s->gpio), "sdbus-sdhci",
|
||||||
OBJECT(&s->sdhci.sdbus), &error_abort);
|
OBJECT(&s->sdhci.sdbus));
|
||||||
object_property_add_const_link(OBJECT(&s->gpio), "sdbus-sdhost",
|
object_property_add_const_link(OBJECT(&s->gpio), "sdbus-sdhost",
|
||||||
OBJECT(&s->sdhost.sdbus), &error_abort);
|
OBJECT(&s->sdhost.sdbus));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)
|
static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)
|
||||||
|
@ -361,12 +358,7 @@ static void bcm2835_peripherals_realize(DeviceState *dev, Error **errp)
|
||||||
memory_region_add_subregion(&s->peri_mr, GPIO_OFFSET,
|
memory_region_add_subregion(&s->peri_mr, GPIO_OFFSET,
|
||||||
sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->gpio), 0));
|
sysbus_mmio_get_region(SYS_BUS_DEVICE(&s->gpio), 0));
|
||||||
|
|
||||||
object_property_add_alias(OBJECT(s), "sd-bus", OBJECT(&s->gpio), "sd-bus",
|
object_property_add_alias(OBJECT(s), "sd-bus", OBJECT(&s->gpio), "sd-bus");
|
||||||
&err);
|
|
||||||
if (err) {
|
|
||||||
error_propagate(errp, err);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
create_unimp(s, &s->armtmr, "bcm2835-sp804", ARMCTRL_TIMER0_1_OFFSET, 0x40);
|
create_unimp(s, &s->armtmr, "bcm2835-sp804", ARMCTRL_TIMER0_1_OFFSET, 0x40);
|
||||||
create_unimp(s, &s->cprman, "bcm2835-cprman", CPRMAN_OFFSET, 0x1000);
|
create_unimp(s, &s->cprman, "bcm2835-cprman", CPRMAN_OFFSET, 0x1000);
|
||||||
|
|
|
@ -63,9 +63,9 @@ static void bcm2836_init(Object *obj)
|
||||||
sysbus_init_child_obj(obj, "peripherals", &s->peripherals,
|
sysbus_init_child_obj(obj, "peripherals", &s->peripherals,
|
||||||
sizeof(s->peripherals), TYPE_BCM2835_PERIPHERALS);
|
sizeof(s->peripherals), TYPE_BCM2835_PERIPHERALS);
|
||||||
object_property_add_alias(obj, "board-rev", OBJECT(&s->peripherals),
|
object_property_add_alias(obj, "board-rev", OBJECT(&s->peripherals),
|
||||||
"board-rev", &error_abort);
|
"board-rev");
|
||||||
object_property_add_alias(obj, "vcram-size", OBJECT(&s->peripherals),
|
object_property_add_alias(obj, "vcram-size", OBJECT(&s->peripherals),
|
||||||
"vcram-size", &error_abort);
|
"vcram-size");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void bcm2836_realize(DeviceState *dev, Error **errp)
|
static void bcm2836_realize(DeviceState *dev, Error **errp)
|
||||||
|
@ -86,11 +86,7 @@ static void bcm2836_realize(DeviceState *dev, Error **errp)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
object_property_add_const_link(OBJECT(&s->peripherals), "ram", obj, &err);
|
object_property_add_const_link(OBJECT(&s->peripherals), "ram", obj);
|
||||||
if (err) {
|
|
||||||
error_propagate(errp, err);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
object_property_set_bool(OBJECT(&s->peripherals), true, "realized", &err);
|
object_property_set_bool(OBJECT(&s->peripherals), true, "realized", &err);
|
||||||
if (err) {
|
if (err) {
|
||||||
|
@ -99,11 +95,7 @@ static void bcm2836_realize(DeviceState *dev, Error **errp)
|
||||||
}
|
}
|
||||||
|
|
||||||
object_property_add_alias(OBJECT(s), "sd-bus", OBJECT(&s->peripherals),
|
object_property_add_alias(OBJECT(s), "sd-bus", OBJECT(&s->peripherals),
|
||||||
"sd-bus", &err);
|
"sd-bus");
|
||||||
if (err) {
|
|
||||||
error_propagate(errp, err);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
sysbus_mmio_map_overlap(SYS_BUS_DEVICE(&s->peripherals), 0,
|
sysbus_mmio_map_overlap(SYS_BUS_DEVICE(&s->peripherals), 0,
|
||||||
info->peri_base, 1);
|
info->peri_base, 1);
|
||||||
|
|
|
@ -59,8 +59,7 @@ static void cubieboard_init(MachineState *machine)
|
||||||
}
|
}
|
||||||
|
|
||||||
a10 = AW_A10(object_new(TYPE_AW_A10));
|
a10 = AW_A10(object_new(TYPE_AW_A10));
|
||||||
object_property_add_child(OBJECT(machine), "soc", OBJECT(a10),
|
object_property_add_child(OBJECT(machine), "soc", OBJECT(a10));
|
||||||
&error_abort);
|
|
||||||
object_unref(OBJECT(a10));
|
object_unref(OBJECT(a10));
|
||||||
|
|
||||||
object_property_set_int(OBJECT(&a10->emac), 1, "phy-addr", &err);
|
object_property_set_int(OBJECT(&a10->emac), 1, "phy-addr", &err);
|
||||||
|
|
|
@ -39,7 +39,7 @@ static void mcimx6ul_evk_init(MachineState *machine)
|
||||||
};
|
};
|
||||||
|
|
||||||
s = FSL_IMX6UL(object_new(TYPE_FSL_IMX6UL));
|
s = FSL_IMX6UL(object_new(TYPE_FSL_IMX6UL));
|
||||||
object_property_add_child(OBJECT(machine), "soc", OBJECT(s), &error_fatal);
|
object_property_add_child(OBJECT(machine), "soc", OBJECT(s));
|
||||||
object_property_set_bool(OBJECT(s), true, "realized", &error_fatal);
|
object_property_set_bool(OBJECT(s), true, "realized", &error_fatal);
|
||||||
|
|
||||||
memory_region_add_subregion(get_system_memory(), FSL_IMX6UL_MMDC_ADDR,
|
memory_region_add_subregion(get_system_memory(), FSL_IMX6UL_MMDC_ADDR,
|
||||||
|
|
|
@ -41,7 +41,7 @@ static void mcimx7d_sabre_init(MachineState *machine)
|
||||||
};
|
};
|
||||||
|
|
||||||
s = FSL_IMX7(object_new(TYPE_FSL_IMX7));
|
s = FSL_IMX7(object_new(TYPE_FSL_IMX7));
|
||||||
object_property_add_child(OBJECT(machine), "soc", OBJECT(s), &error_fatal);
|
object_property_add_child(OBJECT(machine), "soc", OBJECT(s));
|
||||||
object_property_set_bool(OBJECT(s), true, "realized", &error_fatal);
|
object_property_set_bool(OBJECT(s), true, "realized", &error_fatal);
|
||||||
|
|
||||||
memory_region_add_subregion(get_system_memory(), FSL_IMX7_MMDC_ADDR,
|
memory_region_add_subregion(get_system_memory(), FSL_IMX7_MMDC_ADDR,
|
||||||
|
|
|
@ -197,8 +197,7 @@ static void m2sxxx_soc_realize(DeviceState *dev_soc, Error **errp)
|
||||||
/* Alias controller SPI bus to the SoC itself */
|
/* Alias controller SPI bus to the SoC itself */
|
||||||
bus_name = g_strdup_printf("spi%d", i);
|
bus_name = g_strdup_printf("spi%d", i);
|
||||||
object_property_add_alias(OBJECT(s), bus_name,
|
object_property_add_alias(OBJECT(s), bus_name,
|
||||||
OBJECT(&s->spi[i]), "spi",
|
OBJECT(&s->spi[i]), "spi");
|
||||||
&error_abort);
|
|
||||||
g_free(bus_name);
|
g_free(bus_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -197,8 +197,7 @@ static void nrf51_soc_init(Object *obj)
|
||||||
|
|
||||||
sysbus_init_child_obj(obj, "uart", &s->uart, sizeof(s->uart),
|
sysbus_init_child_obj(obj, "uart", &s->uart, sizeof(s->uart),
|
||||||
TYPE_NRF51_UART);
|
TYPE_NRF51_UART);
|
||||||
object_property_add_alias(obj, "serial0", OBJECT(&s->uart), "chardev",
|
object_property_add_alias(obj, "serial0", OBJECT(&s->uart), "chardev");
|
||||||
&error_abort);
|
|
||||||
|
|
||||||
sysbus_init_child_obj(obj, "rng", &s->rng, sizeof(s->rng),
|
sysbus_init_child_obj(obj, "rng", &s->rng, sizeof(s->rng),
|
||||||
TYPE_NRF51_RNG);
|
TYPE_NRF51_RNG);
|
||||||
|
|
|
@ -59,8 +59,7 @@ static void orangepi_init(MachineState *machine)
|
||||||
}
|
}
|
||||||
|
|
||||||
h3 = AW_H3(object_new(TYPE_AW_H3));
|
h3 = AW_H3(object_new(TYPE_AW_H3));
|
||||||
object_property_add_child(OBJECT(machine), "soc", OBJECT(h3),
|
object_property_add_child(OBJECT(machine), "soc", OBJECT(h3));
|
||||||
&error_abort);
|
|
||||||
object_unref(OBJECT(h3));
|
object_unref(OBJECT(h3));
|
||||||
|
|
||||||
/* Setup timer properties */
|
/* Setup timer properties */
|
||||||
|
|
|
@ -284,8 +284,7 @@ static void raspi_machine_init(MachineState *machine)
|
||||||
/* Setup the SOC */
|
/* Setup the SOC */
|
||||||
object_initialize_child(OBJECT(machine), "soc", &s->soc, sizeof(s->soc),
|
object_initialize_child(OBJECT(machine), "soc", &s->soc, sizeof(s->soc),
|
||||||
board_soc_type(board_rev), &error_abort, NULL);
|
board_soc_type(board_rev), &error_abort, NULL);
|
||||||
object_property_add_const_link(OBJECT(&s->soc), "ram", OBJECT(machine->ram),
|
object_property_add_const_link(OBJECT(&s->soc), "ram", OBJECT(machine->ram));
|
||||||
&error_abort);
|
|
||||||
object_property_set_int(OBJECT(&s->soc), board_rev, "board-rev",
|
object_property_set_int(OBJECT(&s->soc), board_rev, "board-rev",
|
||||||
&error_abort);
|
&error_abort);
|
||||||
object_property_set_bool(OBJECT(&s->soc), true, "realized", &error_abort);
|
object_property_set_bool(OBJECT(&s->soc), true, "realized", &error_abort);
|
||||||
|
|
|
@ -51,7 +51,7 @@ static void sabrelite_init(MachineState *machine)
|
||||||
}
|
}
|
||||||
|
|
||||||
s = FSL_IMX6(object_new(TYPE_FSL_IMX6));
|
s = FSL_IMX6(object_new(TYPE_FSL_IMX6));
|
||||||
object_property_add_child(OBJECT(machine), "soc", OBJECT(s), &error_fatal);
|
object_property_add_child(OBJECT(machine), "soc", OBJECT(s));
|
||||||
object_property_set_bool(OBJECT(s), true, "realized", &err);
|
object_property_set_bool(OBJECT(s), true, "realized", &err);
|
||||||
if (err != NULL) {
|
if (err != NULL) {
|
||||||
error_report("%s", error_get_pretty(err));
|
error_report("%s", error_get_pretty(err));
|
||||||
|
|
|
@ -222,10 +222,9 @@ static PFlashCFI01 *sbsa_flash_create1(SBSAMachineState *sms,
|
||||||
qdev_prop_set_uint16(dev, "id2", 0x00);
|
qdev_prop_set_uint16(dev, "id2", 0x00);
|
||||||
qdev_prop_set_uint16(dev, "id3", 0x00);
|
qdev_prop_set_uint16(dev, "id3", 0x00);
|
||||||
qdev_prop_set_string(dev, "name", name);
|
qdev_prop_set_string(dev, "name", name);
|
||||||
object_property_add_child(OBJECT(sms), name, OBJECT(dev),
|
object_property_add_child(OBJECT(sms), name, OBJECT(dev));
|
||||||
&error_abort);
|
|
||||||
object_property_add_alias(OBJECT(sms), alias_prop_name,
|
object_property_add_alias(OBJECT(sms), alias_prop_name,
|
||||||
OBJECT(dev), "drive", &error_abort);
|
OBJECT(dev), "drive");
|
||||||
return PFLASH_CFI01(dev);
|
return PFLASH_CFI01(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -749,11 +749,10 @@ static void vexpress_instance_init(Object *obj)
|
||||||
/* EL3 is enabled by default on vexpress */
|
/* EL3 is enabled by default on vexpress */
|
||||||
vms->secure = true;
|
vms->secure = true;
|
||||||
object_property_add_bool(obj, "secure", vexpress_get_secure,
|
object_property_add_bool(obj, "secure", vexpress_get_secure,
|
||||||
vexpress_set_secure, NULL);
|
vexpress_set_secure);
|
||||||
object_property_set_description(obj, "secure",
|
object_property_set_description(obj, "secure",
|
||||||
"Set on/off to enable/disable the ARM "
|
"Set on/off to enable/disable the ARM "
|
||||||
"Security Extensions (TrustZone)",
|
"Security Extensions (TrustZone)");
|
||||||
NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vexpress_a15_instance_init(Object *obj)
|
static void vexpress_a15_instance_init(Object *obj)
|
||||||
|
@ -766,12 +765,11 @@ static void vexpress_a15_instance_init(Object *obj)
|
||||||
*/
|
*/
|
||||||
vms->virt = true;
|
vms->virt = true;
|
||||||
object_property_add_bool(obj, "virtualization", vexpress_get_virt,
|
object_property_add_bool(obj, "virtualization", vexpress_get_virt,
|
||||||
vexpress_set_virt, NULL);
|
vexpress_set_virt);
|
||||||
object_property_set_description(obj, "virtualization",
|
object_property_set_description(obj, "virtualization",
|
||||||
"Set on/off to enable/disable the ARM "
|
"Set on/off to enable/disable the ARM "
|
||||||
"Virtualization Extensions "
|
"Virtualization Extensions "
|
||||||
"(defaults to same as 'secure')",
|
"(defaults to same as 'secure')");
|
||||||
NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vexpress_a9_instance_init(Object *obj)
|
static void vexpress_a9_instance_init(Object *obj)
|
||||||
|
|
|
@ -959,10 +959,9 @@ static PFlashCFI01 *virt_flash_create1(VirtMachineState *vms,
|
||||||
qdev_prop_set_uint16(dev, "id2", 0x00);
|
qdev_prop_set_uint16(dev, "id2", 0x00);
|
||||||
qdev_prop_set_uint16(dev, "id3", 0x00);
|
qdev_prop_set_uint16(dev, "id3", 0x00);
|
||||||
qdev_prop_set_string(dev, "name", name);
|
qdev_prop_set_string(dev, "name", name);
|
||||||
object_property_add_child(OBJECT(vms), name, OBJECT(dev),
|
object_property_add_child(OBJECT(vms), name, OBJECT(dev));
|
||||||
&error_abort);
|
|
||||||
object_property_add_alias(OBJECT(vms), alias_prop_name,
|
object_property_add_alias(OBJECT(vms), alias_prop_name,
|
||||||
OBJECT(dev), "drive", &error_abort);
|
OBJECT(dev), "drive");
|
||||||
return PFLASH_CFI01(dev);
|
return PFLASH_CFI01(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2270,9 +2269,9 @@ static void virt_machine_class_init(ObjectClass *oc, void *data)
|
||||||
|
|
||||||
object_class_property_add(oc, "acpi", "OnOffAuto",
|
object_class_property_add(oc, "acpi", "OnOffAuto",
|
||||||
virt_get_acpi, virt_set_acpi,
|
virt_get_acpi, virt_set_acpi,
|
||||||
NULL, NULL, &error_abort);
|
NULL, NULL);
|
||||||
object_class_property_set_description(oc, "acpi",
|
object_class_property_set_description(oc, "acpi",
|
||||||
"Enable ACPI", &error_abort);
|
"Enable ACPI");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void virt_instance_init(Object *obj)
|
static void virt_instance_init(Object *obj)
|
||||||
|
@ -2286,37 +2285,33 @@ static void virt_instance_init(Object *obj)
|
||||||
*/
|
*/
|
||||||
vms->secure = false;
|
vms->secure = false;
|
||||||
object_property_add_bool(obj, "secure", virt_get_secure,
|
object_property_add_bool(obj, "secure", virt_get_secure,
|
||||||
virt_set_secure, NULL);
|
virt_set_secure);
|
||||||
object_property_set_description(obj, "secure",
|
object_property_set_description(obj, "secure",
|
||||||
"Set on/off to enable/disable the ARM "
|
"Set on/off to enable/disable the ARM "
|
||||||
"Security Extensions (TrustZone)",
|
"Security Extensions (TrustZone)");
|
||||||
NULL);
|
|
||||||
|
|
||||||
/* EL2 is also disabled by default, for similar reasons */
|
/* EL2 is also disabled by default, for similar reasons */
|
||||||
vms->virt = false;
|
vms->virt = false;
|
||||||
object_property_add_bool(obj, "virtualization", virt_get_virt,
|
object_property_add_bool(obj, "virtualization", virt_get_virt,
|
||||||
virt_set_virt, NULL);
|
virt_set_virt);
|
||||||
object_property_set_description(obj, "virtualization",
|
object_property_set_description(obj, "virtualization",
|
||||||
"Set on/off to enable/disable emulating a "
|
"Set on/off to enable/disable emulating a "
|
||||||
"guest CPU which implements the ARM "
|
"guest CPU which implements the ARM "
|
||||||
"Virtualization Extensions",
|
"Virtualization Extensions");
|
||||||
NULL);
|
|
||||||
|
|
||||||
/* High memory is enabled by default */
|
/* High memory is enabled by default */
|
||||||
vms->highmem = true;
|
vms->highmem = true;
|
||||||
object_property_add_bool(obj, "highmem", virt_get_highmem,
|
object_property_add_bool(obj, "highmem", virt_get_highmem,
|
||||||
virt_set_highmem, NULL);
|
virt_set_highmem);
|
||||||
object_property_set_description(obj, "highmem",
|
object_property_set_description(obj, "highmem",
|
||||||
"Set on/off to enable/disable using "
|
"Set on/off to enable/disable using "
|
||||||
"physical address space above 32 bits",
|
"physical address space above 32 bits");
|
||||||
NULL);
|
|
||||||
vms->gic_version = VIRT_GIC_VERSION_NOSEL;
|
vms->gic_version = VIRT_GIC_VERSION_NOSEL;
|
||||||
object_property_add_str(obj, "gic-version", virt_get_gic_version,
|
object_property_add_str(obj, "gic-version", virt_get_gic_version,
|
||||||
virt_set_gic_version, NULL);
|
virt_set_gic_version);
|
||||||
object_property_set_description(obj, "gic-version",
|
object_property_set_description(obj, "gic-version",
|
||||||
"Set GIC version. "
|
"Set GIC version. "
|
||||||
"Valid values are 2, 3, host and max",
|
"Valid values are 2, 3, host and max");
|
||||||
NULL);
|
|
||||||
|
|
||||||
vms->highmem_ecam = !vmc->no_highmem_ecam;
|
vms->highmem_ecam = !vmc->no_highmem_ecam;
|
||||||
|
|
||||||
|
@ -2326,29 +2321,26 @@ static void virt_instance_init(Object *obj)
|
||||||
/* Default allows ITS instantiation */
|
/* Default allows ITS instantiation */
|
||||||
vms->its = true;
|
vms->its = true;
|
||||||
object_property_add_bool(obj, "its", virt_get_its,
|
object_property_add_bool(obj, "its", virt_get_its,
|
||||||
virt_set_its, NULL);
|
virt_set_its);
|
||||||
object_property_set_description(obj, "its",
|
object_property_set_description(obj, "its",
|
||||||
"Set on/off to enable/disable "
|
"Set on/off to enable/disable "
|
||||||
"ITS instantiation",
|
"ITS instantiation");
|
||||||
NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Default disallows iommu instantiation */
|
/* Default disallows iommu instantiation */
|
||||||
vms->iommu = VIRT_IOMMU_NONE;
|
vms->iommu = VIRT_IOMMU_NONE;
|
||||||
object_property_add_str(obj, "iommu", virt_get_iommu, virt_set_iommu, NULL);
|
object_property_add_str(obj, "iommu", virt_get_iommu, virt_set_iommu);
|
||||||
object_property_set_description(obj, "iommu",
|
object_property_set_description(obj, "iommu",
|
||||||
"Set the IOMMU type. "
|
"Set the IOMMU type. "
|
||||||
"Valid values are none and smmuv3",
|
"Valid values are none and smmuv3");
|
||||||
NULL);
|
|
||||||
|
|
||||||
/* Default disallows RAS instantiation */
|
/* Default disallows RAS instantiation */
|
||||||
vms->ras = false;
|
vms->ras = false;
|
||||||
object_property_add_bool(obj, "ras", virt_get_ras,
|
object_property_add_bool(obj, "ras", virt_get_ras,
|
||||||
virt_set_ras, NULL);
|
virt_set_ras);
|
||||||
object_property_set_description(obj, "ras",
|
object_property_set_description(obj, "ras",
|
||||||
"Set on/off to enable/disable reporting host memory errors "
|
"Set on/off to enable/disable reporting host memory errors "
|
||||||
"to a KVM guest using ACPI and guest external abort exceptions",
|
"to a KVM guest using ACPI and guest external abort exceptions");
|
||||||
NULL);
|
|
||||||
|
|
||||||
vms->irqmap = a15irqmap;
|
vms->irqmap = a15irqmap;
|
||||||
|
|
||||||
|
|
|
@ -229,7 +229,7 @@ static void zynq_init(MachineState *machine)
|
||||||
/* Create the main clock source, and feed slcr with it */
|
/* Create the main clock source, and feed slcr with it */
|
||||||
zynq_machine->ps_clk = CLOCK(object_new(TYPE_CLOCK));
|
zynq_machine->ps_clk = CLOCK(object_new(TYPE_CLOCK));
|
||||||
object_property_add_child(OBJECT(zynq_machine), "ps_clk",
|
object_property_add_child(OBJECT(zynq_machine), "ps_clk",
|
||||||
OBJECT(zynq_machine->ps_clk), &error_abort);
|
OBJECT(zynq_machine->ps_clk));
|
||||||
object_unref(OBJECT(zynq_machine->ps_clk));
|
object_unref(OBJECT(zynq_machine->ps_clk));
|
||||||
clock_set_hz(zynq_machine->ps_clk, PS_CLK_FREQUENCY);
|
clock_set_hz(zynq_machine->ps_clk, PS_CLK_FREQUENCY);
|
||||||
qdev_connect_clock_in(slcr, "ps_clk", zynq_machine->ps_clk);
|
qdev_connect_clock_in(slcr, "ps_clk", zynq_machine->ps_clk);
|
||||||
|
|
|
@ -433,8 +433,7 @@ static void create_virtio_regions(VersalVirt *s)
|
||||||
|
|
||||||
pic_irq = qdev_get_gpio_in(DEVICE(&s->soc.fpd.apu.gic), irq);
|
pic_irq = qdev_get_gpio_in(DEVICE(&s->soc.fpd.apu.gic), irq);
|
||||||
dev = qdev_create(NULL, "virtio-mmio");
|
dev = qdev_create(NULL, "virtio-mmio");
|
||||||
object_property_add_child(OBJECT(&s->soc), name, OBJECT(dev),
|
object_property_add_child(OBJECT(&s->soc), name, OBJECT(dev));
|
||||||
&error_fatal);
|
|
||||||
qdev_init_nofail(dev);
|
qdev_init_nofail(dev);
|
||||||
sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic_irq);
|
sysbus_connect_irq(SYS_BUS_DEVICE(dev), 0, pic_irq);
|
||||||
mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0);
|
mr = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0);
|
||||||
|
@ -465,8 +464,7 @@ static void sd_plugin_card(SDHCIState *sd, DriveInfo *di)
|
||||||
DeviceState *card;
|
DeviceState *card;
|
||||||
|
|
||||||
card = qdev_create(qdev_get_child_bus(DEVICE(sd), "sd-bus"), TYPE_SD_CARD);
|
card = qdev_create(qdev_get_child_bus(DEVICE(sd), "sd-bus"), TYPE_SD_CARD);
|
||||||
object_property_add_child(OBJECT(sd), "card[*]", OBJECT(card),
|
object_property_add_child(OBJECT(sd), "card[*]", OBJECT(card));
|
||||||
&error_fatal);
|
|
||||||
qdev_prop_set_drive(card, "drive", blk, &error_fatal);
|
qdev_prop_set_drive(card, "drive", blk, &error_fatal);
|
||||||
object_property_set_bool(OBJECT(card), true, "realized", &error_fatal);
|
object_property_set_bool(OBJECT(card), true, "realized", &error_fatal);
|
||||||
}
|
}
|
||||||
|
|
|
@ -309,7 +309,7 @@ static void versal_unimp_area(Versal *s, const char *name,
|
||||||
|
|
||||||
qdev_prop_set_string(dev, "name", name);
|
qdev_prop_set_string(dev, "name", name);
|
||||||
qdev_prop_set_uint64(dev, "size", size);
|
qdev_prop_set_uint64(dev, "size", size);
|
||||||
object_property_add_child(OBJECT(s), name, OBJECT(dev), &error_fatal);
|
object_property_add_child(OBJECT(s), name, OBJECT(dev));
|
||||||
qdev_init_nofail(dev);
|
qdev_init_nofail(dev);
|
||||||
|
|
||||||
mr_dev = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0);
|
mr_dev = sysbus_mmio_get_region(SYS_BUS_DEVICE(dev), 0);
|
||||||
|
|
|
@ -209,21 +209,19 @@ static void xlnx_zcu102_machine_instance_init(Object *obj)
|
||||||
/* Default to secure mode being disabled */
|
/* Default to secure mode being disabled */
|
||||||
s->secure = false;
|
s->secure = false;
|
||||||
object_property_add_bool(obj, "secure", zcu102_get_secure,
|
object_property_add_bool(obj, "secure", zcu102_get_secure,
|
||||||
zcu102_set_secure, NULL);
|
zcu102_set_secure);
|
||||||
object_property_set_description(obj, "secure",
|
object_property_set_description(obj, "secure",
|
||||||
"Set on/off to enable/disable the ARM "
|
"Set on/off to enable/disable the ARM "
|
||||||
"Security Extensions (TrustZone)",
|
"Security Extensions (TrustZone)");
|
||||||
NULL);
|
|
||||||
|
|
||||||
/* Default to virt (EL2) being disabled */
|
/* Default to virt (EL2) being disabled */
|
||||||
s->virt = false;
|
s->virt = false;
|
||||||
object_property_add_bool(obj, "virtualization", zcu102_get_virt,
|
object_property_add_bool(obj, "virtualization", zcu102_get_virt,
|
||||||
zcu102_set_virt, NULL);
|
zcu102_set_virt);
|
||||||
object_property_set_description(obj, "virtualization",
|
object_property_set_description(obj, "virtualization",
|
||||||
"Set on/off to enable/disable emulating a "
|
"Set on/off to enable/disable emulating a "
|
||||||
"guest CPU which implements the ARM "
|
"guest CPU which implements the ARM "
|
||||||
"Virtualization Extensions",
|
"Virtualization Extensions");
|
||||||
NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void xlnx_zcu102_machine_class_init(ObjectClass *oc, void *data)
|
static void xlnx_zcu102_machine_class_init(ObjectClass *oc, void *data)
|
||||||
|
|
|
@ -554,8 +554,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
|
||||||
|
|
||||||
/* Alias controller SD bus to the SoC itself */
|
/* Alias controller SD bus to the SoC itself */
|
||||||
bus_name = g_strdup_printf("sd-bus%d", i);
|
bus_name = g_strdup_printf("sd-bus%d", i);
|
||||||
object_property_add_alias(OBJECT(s), bus_name, sdhci, "sd-bus",
|
object_property_add_alias(OBJECT(s), bus_name, sdhci, "sd-bus");
|
||||||
&error_abort);
|
|
||||||
g_free(bus_name);
|
g_free(bus_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -575,8 +574,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
|
||||||
/* Alias controller SPI bus to the SoC itself */
|
/* Alias controller SPI bus to the SoC itself */
|
||||||
bus_name = g_strdup_printf("spi%d", i);
|
bus_name = g_strdup_printf("spi%d", i);
|
||||||
object_property_add_alias(OBJECT(s), bus_name,
|
object_property_add_alias(OBJECT(s), bus_name,
|
||||||
OBJECT(&s->spi[i]), "spi0",
|
OBJECT(&s->spi[i]), "spi0");
|
||||||
&error_abort);
|
|
||||||
g_free(bus_name);
|
g_free(bus_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -597,8 +595,7 @@ static void xlnx_zynqmp_realize(DeviceState *dev, Error **errp)
|
||||||
bus_name = g_strdup_printf("qspi%d", i);
|
bus_name = g_strdup_printf("qspi%d", i);
|
||||||
target_bus = g_strdup_printf("spi%d", i);
|
target_bus = g_strdup_printf("spi%d", i);
|
||||||
object_property_add_alias(OBJECT(s), bus_name,
|
object_property_add_alias(OBJECT(s), bus_name,
|
||||||
OBJECT(&s->qspi), target_bus,
|
OBJECT(&s->qspi), target_bus);
|
||||||
&error_abort);
|
|
||||||
g_free(bus_name);
|
g_free(bus_name);
|
||||||
g_free(target_bus);
|
g_free(target_bus);
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ static void hda_codec_dev_realize(DeviceState *qdev, Error **errp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void hda_codec_dev_unrealize(DeviceState *qdev, Error **errp)
|
static void hda_codec_dev_unrealize(DeviceState *qdev)
|
||||||
{
|
{
|
||||||
HDACodecDevice *dev = HDA_CODEC_DEVICE(qdev);
|
HDACodecDevice *dev = HDA_CODEC_DEVICE(qdev);
|
||||||
HDACodecDeviceClass *cdc = HDA_CODEC_DEVICE_GET_CLASS(dev);
|
HDACodecDeviceClass *cdc = HDA_CODEC_DEVICE_GET_CLASS(dev);
|
||||||
|
|
|
@ -259,7 +259,7 @@ static void mv88w8618_audio_init(Object *obj)
|
||||||
object_property_add_link(OBJECT(dev), "wm8750", TYPE_WM8750,
|
object_property_add_link(OBJECT(dev), "wm8750", TYPE_WM8750,
|
||||||
(Object **) &s->wm,
|
(Object **) &s->wm,
|
||||||
qdev_prop_allow_set_link_before_realize,
|
qdev_prop_allow_set_link_before_realize,
|
||||||
0, &error_abort);
|
0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mv88w8618_audio_realize(DeviceState *dev, Error **errp)
|
static void mv88w8618_audio_realize(DeviceState *dev, Error **errp)
|
||||||
|
|
|
@ -175,7 +175,7 @@ static void pcspk_initfn(Object *obj)
|
||||||
object_property_add_link(obj, "pit", TYPE_PIT_COMMON,
|
object_property_add_link(obj, "pit", TYPE_PIT_COMMON,
|
||||||
(Object **)&s->pit,
|
(Object **)&s->pit,
|
||||||
qdev_prop_allow_set_link_before_realize,
|
qdev_prop_allow_set_link_before_realize,
|
||||||
0, &error_abort);
|
0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pcspk_realizefn(DeviceState *dev, Error **errp)
|
static void pcspk_realizefn(DeviceState *dev, Error **errp)
|
||||||
|
|
|
@ -2813,10 +2813,10 @@ static void isabus_fdc_instance_init(Object *obj)
|
||||||
|
|
||||||
device_add_bootindex_property(obj, &isa->bootindexA,
|
device_add_bootindex_property(obj, &isa->bootindexA,
|
||||||
"bootindexA", "/floppy@0",
|
"bootindexA", "/floppy@0",
|
||||||
DEVICE(obj), NULL);
|
DEVICE(obj));
|
||||||
device_add_bootindex_property(obj, &isa->bootindexB,
|
device_add_bootindex_property(obj, &isa->bootindexB,
|
||||||
"bootindexB", "/floppy@1",
|
"bootindexB", "/floppy@1",
|
||||||
DEVICE(obj), NULL);
|
DEVICE(obj));
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo isa_fdc_info = {
|
static const TypeInfo isa_fdc_info = {
|
||||||
|
|
|
@ -1594,7 +1594,7 @@ static void nvme_instance_init(Object *obj)
|
||||||
|
|
||||||
device_add_bootindex_property(obj, &s->conf.bootindex,
|
device_add_bootindex_property(obj, &s->conf.bootindex,
|
||||||
"bootindex", "/namespace@1,0",
|
"bootindex", "/namespace@1,0",
|
||||||
DEVICE(obj), &error_abort);
|
DEVICE(obj));
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo nvme_info = {
|
static const TypeInfo nvme_info = {
|
||||||
|
|
|
@ -949,7 +949,7 @@ static Property pflash_cfi02_properties[] = {
|
||||||
DEFINE_PROP_END_OF_LIST(),
|
DEFINE_PROP_END_OF_LIST(),
|
||||||
};
|
};
|
||||||
|
|
||||||
static void pflash_cfi02_unrealize(DeviceState *dev, Error **errp)
|
static void pflash_cfi02_unrealize(DeviceState *dev)
|
||||||
{
|
{
|
||||||
PFlashCFI02 *pfl = PFLASH_CFI02(dev);
|
PFlashCFI02 *pfl = PFLASH_CFI02(dev);
|
||||||
timer_del(&pfl->timer);
|
timer_del(&pfl->timer);
|
||||||
|
|
|
@ -452,7 +452,7 @@ virtio_err:
|
||||||
vhost_user_cleanup(&s->vhost_user);
|
vhost_user_cleanup(&s->vhost_user);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void vhost_user_blk_device_unrealize(DeviceState *dev, Error **errp)
|
static void vhost_user_blk_device_unrealize(DeviceState *dev)
|
||||||
{
|
{
|
||||||
VirtIODevice *vdev = VIRTIO_DEVICE(dev);
|
VirtIODevice *vdev = VIRTIO_DEVICE(dev);
|
||||||
VHostUserBlk *s = VHOST_USER_BLK(dev);
|
VHostUserBlk *s = VHOST_USER_BLK(dev);
|
||||||
|
@ -481,7 +481,7 @@ static void vhost_user_blk_instance_init(Object *obj)
|
||||||
VHostUserBlk *s = VHOST_USER_BLK(obj);
|
VHostUserBlk *s = VHOST_USER_BLK(obj);
|
||||||
|
|
||||||
device_add_bootindex_property(obj, &s->bootindex, "bootindex",
|
device_add_bootindex_property(obj, &s->bootindex, "bootindex",
|
||||||
"/disk@0,0", DEVICE(obj), NULL);
|
"/disk@0,0", DEVICE(obj));
|
||||||
}
|
}
|
||||||
|
|
||||||
static const VMStateDescription vmstate_vhost_user_blk = {
|
static const VMStateDescription vmstate_vhost_user_blk = {
|
||||||
|
|
|
@ -1223,7 +1223,7 @@ static void virtio_blk_device_realize(DeviceState *dev, Error **errp)
|
||||||
conf->conf.lsecs);
|
conf->conf.lsecs);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void virtio_blk_device_unrealize(DeviceState *dev, Error **errp)
|
static void virtio_blk_device_unrealize(DeviceState *dev)
|
||||||
{
|
{
|
||||||
VirtIODevice *vdev = VIRTIO_DEVICE(dev);
|
VirtIODevice *vdev = VIRTIO_DEVICE(dev);
|
||||||
VirtIOBlock *s = VIRTIO_BLK(dev);
|
VirtIOBlock *s = VIRTIO_BLK(dev);
|
||||||
|
@ -1248,7 +1248,7 @@ static void virtio_blk_instance_init(Object *obj)
|
||||||
|
|
||||||
device_add_bootindex_property(obj, &s->conf.conf.bootindex,
|
device_add_bootindex_property(obj, &s->conf.conf.bootindex,
|
||||||
"bootindex", "/disk@0,0",
|
"bootindex", "/disk@0,0",
|
||||||
DEVICE(obj), NULL);
|
DEVICE(obj));
|
||||||
}
|
}
|
||||||
|
|
||||||
static const VMStateDescription vmstate_virtio_blk = {
|
static const VMStateDescription vmstate_virtio_blk = {
|
||||||
|
|
|
@ -136,7 +136,7 @@ static void xen_block_connect(XenDevice *xendev, Error **errp)
|
||||||
g_free(ring_ref);
|
g_free(ring_ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void xen_block_unrealize(XenDevice *xendev, Error **errp)
|
static void xen_block_unrealize(XenDevice *xendev)
|
||||||
{
|
{
|
||||||
XenBlockDevice *blockdev = XEN_BLOCK_DEVICE(xendev);
|
XenBlockDevice *blockdev = XEN_BLOCK_DEVICE(xendev);
|
||||||
XenBlockDeviceClass *blockdev_class =
|
XenBlockDeviceClass *blockdev_class =
|
||||||
|
@ -157,7 +157,7 @@ static void xen_block_unrealize(XenDevice *xendev, Error **errp)
|
||||||
blockdev->dataplane = NULL;
|
blockdev->dataplane = NULL;
|
||||||
|
|
||||||
if (blockdev_class->unrealize) {
|
if (blockdev_class->unrealize) {
|
||||||
blockdev_class->unrealize(blockdev, errp);
|
blockdev_class->unrealize(blockdev);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -567,7 +567,7 @@ static const TypeInfo xen_block_type_info = {
|
||||||
.class_init = xen_block_class_init,
|
.class_init = xen_block_class_init,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void xen_disk_unrealize(XenBlockDevice *blockdev, Error **errp)
|
static void xen_disk_unrealize(XenBlockDevice *blockdev)
|
||||||
{
|
{
|
||||||
trace_xen_disk_unrealize();
|
trace_xen_disk_unrealize();
|
||||||
}
|
}
|
||||||
|
@ -606,7 +606,7 @@ static const TypeInfo xen_disk_type_info = {
|
||||||
.class_init = xen_disk_class_init,
|
.class_init = xen_disk_class_init,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void xen_cdrom_unrealize(XenBlockDevice *blockdev, Error **errp)
|
static void xen_cdrom_unrealize(XenBlockDevice *blockdev)
|
||||||
{
|
{
|
||||||
trace_xen_cdrom_unrealize();
|
trace_xen_cdrom_unrealize();
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,7 @@ static void multi_serial_pci_exit(PCIDevice *dev)
|
||||||
|
|
||||||
for (i = 0; i < pci->ports; i++) {
|
for (i = 0; i < pci->ports; i++) {
|
||||||
s = pci->state + i;
|
s = pci->state + i;
|
||||||
object_property_set_bool(OBJECT(s), false, "realized", NULL);
|
object_property_set_bool(OBJECT(s), false, "realized", &error_abort);
|
||||||
memory_region_del_subregion(&pci->iobar, &s->io);
|
memory_region_del_subregion(&pci->iobar, &s->io);
|
||||||
g_free(pci->name[i]);
|
g_free(pci->name[i]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,7 +68,7 @@ static void serial_pci_exit(PCIDevice *dev)
|
||||||
PCISerialState *pci = DO_UPCAST(PCISerialState, dev, dev);
|
PCISerialState *pci = DO_UPCAST(PCISerialState, dev, dev);
|
||||||
SerialState *s = &pci->state;
|
SerialState *s = &pci->state;
|
||||||
|
|
||||||
object_property_set_bool(OBJECT(s), false, "realized", NULL);
|
object_property_set_bool(OBJECT(s), false, "realized", &error_abort);
|
||||||
qemu_free_irq(s->irq);
|
qemu_free_irq(s->irq);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -950,7 +950,7 @@ static void serial_realize(DeviceState *dev, Error **errp)
|
||||||
serial_reset(s);
|
serial_reset(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void serial_unrealize(DeviceState *dev, Error **errp)
|
static void serial_unrealize(DeviceState *dev)
|
||||||
{
|
{
|
||||||
SerialState *s = SERIAL(dev);
|
SerialState *s = SERIAL(dev);
|
||||||
|
|
||||||
|
|
|
@ -249,7 +249,7 @@ static void virtconsole_realize(DeviceState *dev, Error **errp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void virtconsole_unrealize(DeviceState *dev, Error **errp)
|
static void virtconsole_unrealize(DeviceState *dev)
|
||||||
{
|
{
|
||||||
VirtConsole *vcon = VIRTIO_CONSOLE(dev);
|
VirtConsole *vcon = VIRTIO_CONSOLE(dev);
|
||||||
|
|
||||||
|
|
|
@ -1010,7 +1010,7 @@ static void virtser_port_device_plug(HotplugHandler *hotplug_dev,
|
||||||
virtio_notify_config(VIRTIO_DEVICE(hotplug_dev));
|
virtio_notify_config(VIRTIO_DEVICE(hotplug_dev));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void virtser_port_device_unrealize(DeviceState *dev, Error **errp)
|
static void virtser_port_device_unrealize(DeviceState *dev)
|
||||||
{
|
{
|
||||||
VirtIOSerialPort *port = VIRTIO_SERIAL_PORT(dev);
|
VirtIOSerialPort *port = VIRTIO_SERIAL_PORT(dev);
|
||||||
VirtIOSerialPortClass *vsc = VIRTIO_SERIAL_PORT_GET_CLASS(dev);
|
VirtIOSerialPortClass *vsc = VIRTIO_SERIAL_PORT_GET_CLASS(dev);
|
||||||
|
@ -1022,7 +1022,7 @@ static void virtser_port_device_unrealize(DeviceState *dev, Error **errp)
|
||||||
QTAILQ_REMOVE(&vser->ports, port, next);
|
QTAILQ_REMOVE(&vser->ports, port, next);
|
||||||
|
|
||||||
if (vsc->unrealize) {
|
if (vsc->unrealize) {
|
||||||
vsc->unrealize(dev, errp);
|
vsc->unrealize(dev);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1122,7 +1122,7 @@ static const TypeInfo virtio_serial_port_type_info = {
|
||||||
.class_init = virtio_serial_port_class_init,
|
.class_init = virtio_serial_port_class_init,
|
||||||
};
|
};
|
||||||
|
|
||||||
static void virtio_serial_device_unrealize(DeviceState *dev, Error **errp)
|
static void virtio_serial_device_unrealize(DeviceState *dev)
|
||||||
{
|
{
|
||||||
VirtIODevice *vdev = VIRTIO_DEVICE(dev);
|
VirtIODevice *vdev = VIRTIO_DEVICE(dev);
|
||||||
VirtIOSerial *vser = VIRTIO_SERIAL(dev);
|
VirtIOSerial *vser = VIRTIO_SERIAL(dev);
|
||||||
|
@ -1147,7 +1147,7 @@ static void virtio_serial_device_unrealize(DeviceState *dev, Error **errp)
|
||||||
g_free(vser->post_load);
|
g_free(vser->post_load);
|
||||||
}
|
}
|
||||||
|
|
||||||
qbus_set_hotplug_handler(BUS(&vser->bus), NULL, errp);
|
qbus_set_hotplug_handler(BUS(&vser->bus), NULL, &error_abort);
|
||||||
|
|
||||||
virtio_cleanup(vdev);
|
virtio_cleanup(vdev);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
void qbus_set_hotplug_handler(BusState *bus, Object *handler, Error **errp)
|
void qbus_set_hotplug_handler(BusState *bus, Object *handler, Error **errp)
|
||||||
{
|
{
|
||||||
object_property_set_link(OBJECT(bus), OBJECT(handler),
|
object_property_set_link(OBJECT(bus), handler,
|
||||||
QDEV_HOTPLUG_HANDLER_PROPERTY, errp);
|
QDEV_HOTPLUG_HANDLER_PROPERTY, errp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ static void qbus_realize(BusState *bus, DeviceState *parent, const char *name)
|
||||||
if (bus->parent) {
|
if (bus->parent) {
|
||||||
QLIST_INSERT_HEAD(&bus->parent->child_bus, bus, sibling);
|
QLIST_INSERT_HEAD(&bus->parent->child_bus, bus, sibling);
|
||||||
bus->parent->num_child_bus++;
|
bus->parent->num_child_bus++;
|
||||||
object_property_add_child(OBJECT(bus->parent), bus->name, OBJECT(bus), NULL);
|
object_property_add_child(OBJECT(bus->parent), bus->name, OBJECT(bus));
|
||||||
object_unref(OBJECT(bus));
|
object_unref(OBJECT(bus));
|
||||||
} else {
|
} else {
|
||||||
/* The only bus without a parent is the main system bus */
|
/* The only bus without a parent is the main system bus */
|
||||||
|
@ -176,11 +176,10 @@ static void bus_set_realized(Object *obj, bool value, Error **errp)
|
||||||
BusState *bus = BUS(obj);
|
BusState *bus = BUS(obj);
|
||||||
BusClass *bc = BUS_GET_CLASS(bus);
|
BusClass *bc = BUS_GET_CLASS(bus);
|
||||||
BusChild *kid;
|
BusChild *kid;
|
||||||
Error *local_err = NULL;
|
|
||||||
|
|
||||||
if (value && !bus->realized) {
|
if (value && !bus->realized) {
|
||||||
if (bc->realize) {
|
if (bc->realize) {
|
||||||
bc->realize(bus, &local_err);
|
bc->realize(bus, errp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: recursive realization */
|
/* TODO: recursive realization */
|
||||||
|
@ -188,21 +187,13 @@ static void bus_set_realized(Object *obj, bool value, Error **errp)
|
||||||
QTAILQ_FOREACH(kid, &bus->children, sibling) {
|
QTAILQ_FOREACH(kid, &bus->children, sibling) {
|
||||||
DeviceState *dev = kid->child;
|
DeviceState *dev = kid->child;
|
||||||
object_property_set_bool(OBJECT(dev), false, "realized",
|
object_property_set_bool(OBJECT(dev), false, "realized",
|
||||||
&local_err);
|
&error_abort);
|
||||||
if (local_err != NULL) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (bc->unrealize && local_err == NULL) {
|
if (bc->unrealize) {
|
||||||
bc->unrealize(bus, &local_err);
|
bc->unrealize(bus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (local_err != NULL) {
|
|
||||||
error_propagate(errp, local_err);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
bus->realized = value;
|
bus->realized = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -215,10 +206,9 @@ static void qbus_initfn(Object *obj)
|
||||||
TYPE_HOTPLUG_HANDLER,
|
TYPE_HOTPLUG_HANDLER,
|
||||||
(Object **)&bus->hotplug_handler,
|
(Object **)&bus->hotplug_handler,
|
||||||
object_property_allow_set_link,
|
object_property_allow_set_link,
|
||||||
0,
|
0);
|
||||||
NULL);
|
|
||||||
object_property_add_bool(obj, "realized",
|
object_property_add_bool(obj, "realized",
|
||||||
bus_get_realized, bus_set_realized, NULL);
|
bus_get_realized, bus_set_realized);
|
||||||
}
|
}
|
||||||
|
|
||||||
static char *default_bus_get_fw_dev_path(DeviceState *dev)
|
static char *default_bus_get_fw_dev_path(DeviceState *dev)
|
||||||
|
|
|
@ -345,7 +345,7 @@ static void cpu_common_realizefn(DeviceState *dev, Error **errp)
|
||||||
trace_init_vcpu(cpu);
|
trace_init_vcpu(cpu);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cpu_common_unrealizefn(DeviceState *dev, Error **errp)
|
static void cpu_common_unrealizefn(DeviceState *dev)
|
||||||
{
|
{
|
||||||
CPUState *cpu = CPU(dev);
|
CPUState *cpu = CPU(dev);
|
||||||
/* NOTE: latest generic point before the cpu is fully unrealized */
|
/* NOTE: latest generic point before the cpu is fully unrealized */
|
||||||
|
|
|
@ -173,7 +173,7 @@ static void generic_loader_realize(DeviceState *dev, Error **errp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void generic_loader_unrealize(DeviceState *dev, Error **errp)
|
static void generic_loader_unrealize(DeviceState *dev)
|
||||||
{
|
{
|
||||||
qemu_unregister_reset(generic_loader_reset, dev);
|
qemu_unregister_reset(generic_loader_reset, dev);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,9 +11,13 @@
|
||||||
#include "cpu.h"
|
#include "cpu.h"
|
||||||
#include "hw/boards.h"
|
#include "hw/boards.h"
|
||||||
#include "qapi/error.h"
|
#include "qapi/error.h"
|
||||||
|
#include "qapi/qapi-builtin-visit.h"
|
||||||
#include "qapi/qapi-commands-machine.h"
|
#include "qapi/qapi-commands-machine.h"
|
||||||
#include "qapi/qmp/qerror.h"
|
#include "qapi/qmp/qerror.h"
|
||||||
|
#include "qapi/qmp/qobject.h"
|
||||||
|
#include "qapi/qobject-input-visitor.h"
|
||||||
#include "qemu/main-loop.h"
|
#include "qemu/main-loop.h"
|
||||||
|
#include "qom/qom-qobject.h"
|
||||||
#include "sysemu/hostmem.h"
|
#include "sysemu/hostmem.h"
|
||||||
#include "sysemu/hw_accel.h"
|
#include "sysemu/hw_accel.h"
|
||||||
#include "sysemu/numa.h"
|
#include "sysemu/numa.h"
|
||||||
|
@ -303,6 +307,8 @@ static int query_memdev(Object *obj, void *opaque)
|
||||||
{
|
{
|
||||||
MemdevList **list = opaque;
|
MemdevList **list = opaque;
|
||||||
MemdevList *m = NULL;
|
MemdevList *m = NULL;
|
||||||
|
QObject *host_nodes;
|
||||||
|
Visitor *v;
|
||||||
|
|
||||||
if (object_dynamic_cast(obj, TYPE_MEMORY_BACKEND)) {
|
if (object_dynamic_cast(obj, TYPE_MEMORY_BACKEND)) {
|
||||||
m = g_malloc0(sizeof(*m));
|
m = g_malloc0(sizeof(*m));
|
||||||
|
@ -325,9 +331,13 @@ static int query_memdev(Object *obj, void *opaque)
|
||||||
"policy",
|
"policy",
|
||||||
"HostMemPolicy",
|
"HostMemPolicy",
|
||||||
&error_abort);
|
&error_abort);
|
||||||
object_property_get_uint16List(obj, "host-nodes",
|
host_nodes = object_property_get_qobject(obj,
|
||||||
&m->value->host_nodes,
|
"host-nodes",
|
||||||
&error_abort);
|
&error_abort);
|
||||||
|
v = qobject_input_visitor_new(host_nodes);
|
||||||
|
visit_type_uint16List(v, NULL, &m->value->host_nodes, &error_abort);
|
||||||
|
visit_free(v);
|
||||||
|
qobject_unref(host_nodes);
|
||||||
|
|
||||||
m->next = *list;
|
m->next = *list;
|
||||||
*list = m;
|
*list = m;
|
||||||
|
|
|
@ -787,85 +787,80 @@ static void machine_class_init(ObjectClass *oc, void *data)
|
||||||
mc->numa_auto_assign_ram = numa_default_auto_assign_ram;
|
mc->numa_auto_assign_ram = numa_default_auto_assign_ram;
|
||||||
|
|
||||||
object_class_property_add_str(oc, "kernel",
|
object_class_property_add_str(oc, "kernel",
|
||||||
machine_get_kernel, machine_set_kernel, &error_abort);
|
machine_get_kernel, machine_set_kernel);
|
||||||
object_class_property_set_description(oc, "kernel",
|
object_class_property_set_description(oc, "kernel",
|
||||||
"Linux kernel image file", &error_abort);
|
"Linux kernel image file");
|
||||||
|
|
||||||
object_class_property_add_str(oc, "initrd",
|
object_class_property_add_str(oc, "initrd",
|
||||||
machine_get_initrd, machine_set_initrd, &error_abort);
|
machine_get_initrd, machine_set_initrd);
|
||||||
object_class_property_set_description(oc, "initrd",
|
object_class_property_set_description(oc, "initrd",
|
||||||
"Linux initial ramdisk file", &error_abort);
|
"Linux initial ramdisk file");
|
||||||
|
|
||||||
object_class_property_add_str(oc, "append",
|
object_class_property_add_str(oc, "append",
|
||||||
machine_get_append, machine_set_append, &error_abort);
|
machine_get_append, machine_set_append);
|
||||||
object_class_property_set_description(oc, "append",
|
object_class_property_set_description(oc, "append",
|
||||||
"Linux kernel command line", &error_abort);
|
"Linux kernel command line");
|
||||||
|
|
||||||
object_class_property_add_str(oc, "dtb",
|
object_class_property_add_str(oc, "dtb",
|
||||||
machine_get_dtb, machine_set_dtb, &error_abort);
|
machine_get_dtb, machine_set_dtb);
|
||||||
object_class_property_set_description(oc, "dtb",
|
object_class_property_set_description(oc, "dtb",
|
||||||
"Linux kernel device tree file", &error_abort);
|
"Linux kernel device tree file");
|
||||||
|
|
||||||
object_class_property_add_str(oc, "dumpdtb",
|
object_class_property_add_str(oc, "dumpdtb",
|
||||||
machine_get_dumpdtb, machine_set_dumpdtb, &error_abort);
|
machine_get_dumpdtb, machine_set_dumpdtb);
|
||||||
object_class_property_set_description(oc, "dumpdtb",
|
object_class_property_set_description(oc, "dumpdtb",
|
||||||
"Dump current dtb to a file and quit", &error_abort);
|
"Dump current dtb to a file and quit");
|
||||||
|
|
||||||
object_class_property_add(oc, "phandle-start", "int",
|
object_class_property_add(oc, "phandle-start", "int",
|
||||||
machine_get_phandle_start, machine_set_phandle_start,
|
machine_get_phandle_start, machine_set_phandle_start,
|
||||||
NULL, NULL, &error_abort);
|
NULL, NULL);
|
||||||
object_class_property_set_description(oc, "phandle-start",
|
object_class_property_set_description(oc, "phandle-start",
|
||||||
"The first phandle ID we may generate dynamically", &error_abort);
|
"The first phandle ID we may generate dynamically");
|
||||||
|
|
||||||
object_class_property_add_str(oc, "dt-compatible",
|
object_class_property_add_str(oc, "dt-compatible",
|
||||||
machine_get_dt_compatible, machine_set_dt_compatible, &error_abort);
|
machine_get_dt_compatible, machine_set_dt_compatible);
|
||||||
object_class_property_set_description(oc, "dt-compatible",
|
object_class_property_set_description(oc, "dt-compatible",
|
||||||
"Overrides the \"compatible\" property of the dt root node",
|
"Overrides the \"compatible\" property of the dt root node");
|
||||||
&error_abort);
|
|
||||||
|
|
||||||
object_class_property_add_bool(oc, "dump-guest-core",
|
object_class_property_add_bool(oc, "dump-guest-core",
|
||||||
machine_get_dump_guest_core, machine_set_dump_guest_core, &error_abort);
|
machine_get_dump_guest_core, machine_set_dump_guest_core);
|
||||||
object_class_property_set_description(oc, "dump-guest-core",
|
object_class_property_set_description(oc, "dump-guest-core",
|
||||||
"Include guest memory in a core dump", &error_abort);
|
"Include guest memory in a core dump");
|
||||||
|
|
||||||
object_class_property_add_bool(oc, "mem-merge",
|
object_class_property_add_bool(oc, "mem-merge",
|
||||||
machine_get_mem_merge, machine_set_mem_merge, &error_abort);
|
machine_get_mem_merge, machine_set_mem_merge);
|
||||||
object_class_property_set_description(oc, "mem-merge",
|
object_class_property_set_description(oc, "mem-merge",
|
||||||
"Enable/disable memory merge support", &error_abort);
|
"Enable/disable memory merge support");
|
||||||
|
|
||||||
object_class_property_add_bool(oc, "usb",
|
object_class_property_add_bool(oc, "usb",
|
||||||
machine_get_usb, machine_set_usb, &error_abort);
|
machine_get_usb, machine_set_usb);
|
||||||
object_class_property_set_description(oc, "usb",
|
object_class_property_set_description(oc, "usb",
|
||||||
"Set on/off to enable/disable usb", &error_abort);
|
"Set on/off to enable/disable usb");
|
||||||
|
|
||||||
object_class_property_add_bool(oc, "graphics",
|
object_class_property_add_bool(oc, "graphics",
|
||||||
machine_get_graphics, machine_set_graphics, &error_abort);
|
machine_get_graphics, machine_set_graphics);
|
||||||
object_class_property_set_description(oc, "graphics",
|
object_class_property_set_description(oc, "graphics",
|
||||||
"Set on/off to enable/disable graphics emulation", &error_abort);
|
"Set on/off to enable/disable graphics emulation");
|
||||||
|
|
||||||
object_class_property_add_str(oc, "firmware",
|
object_class_property_add_str(oc, "firmware",
|
||||||
machine_get_firmware, machine_set_firmware,
|
machine_get_firmware, machine_set_firmware);
|
||||||
&error_abort);
|
|
||||||
object_class_property_set_description(oc, "firmware",
|
object_class_property_set_description(oc, "firmware",
|
||||||
"Firmware image", &error_abort);
|
"Firmware image");
|
||||||
|
|
||||||
object_class_property_add_bool(oc, "suppress-vmdesc",
|
object_class_property_add_bool(oc, "suppress-vmdesc",
|
||||||
machine_get_suppress_vmdesc, machine_set_suppress_vmdesc,
|
machine_get_suppress_vmdesc, machine_set_suppress_vmdesc);
|
||||||
&error_abort);
|
|
||||||
object_class_property_set_description(oc, "suppress-vmdesc",
|
object_class_property_set_description(oc, "suppress-vmdesc",
|
||||||
"Set on to disable self-describing migration", &error_abort);
|
"Set on to disable self-describing migration");
|
||||||
|
|
||||||
object_class_property_add_bool(oc, "enforce-config-section",
|
object_class_property_add_bool(oc, "enforce-config-section",
|
||||||
machine_get_enforce_config_section, machine_set_enforce_config_section,
|
machine_get_enforce_config_section, machine_set_enforce_config_section);
|
||||||
&error_abort);
|
|
||||||
object_class_property_set_description(oc, "enforce-config-section",
|
object_class_property_set_description(oc, "enforce-config-section",
|
||||||
"Set on to enforce configuration section migration", &error_abort);
|
"Set on to enforce configuration section migration");
|
||||||
|
|
||||||
object_class_property_add_str(oc, "memory-encryption",
|
object_class_property_add_str(oc, "memory-encryption",
|
||||||
machine_get_memory_encryption, machine_set_memory_encryption,
|
machine_get_memory_encryption, machine_set_memory_encryption);
|
||||||
&error_abort);
|
|
||||||
object_class_property_set_description(oc, "memory-encryption",
|
object_class_property_set_description(oc, "memory-encryption",
|
||||||
"Set memory encryption object to use", &error_abort);
|
"Set memory encryption object to use");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void machine_class_base_init(ObjectClass *oc, void *data)
|
static void machine_class_base_init(ObjectClass *oc, void *data)
|
||||||
|
@ -894,40 +889,34 @@ static void machine_initfn(Object *obj)
|
||||||
|
|
||||||
ms->nvdimms_state = g_new0(NVDIMMState, 1);
|
ms->nvdimms_state = g_new0(NVDIMMState, 1);
|
||||||
object_property_add_bool(obj, "nvdimm",
|
object_property_add_bool(obj, "nvdimm",
|
||||||
machine_get_nvdimm, machine_set_nvdimm,
|
machine_get_nvdimm, machine_set_nvdimm);
|
||||||
&error_abort);
|
|
||||||
object_property_set_description(obj, "nvdimm",
|
object_property_set_description(obj, "nvdimm",
|
||||||
"Set on/off to enable/disable "
|
"Set on/off to enable/disable "
|
||||||
"NVDIMM instantiation", NULL);
|
"NVDIMM instantiation");
|
||||||
|
|
||||||
object_property_add_str(obj, "nvdimm-persistence",
|
object_property_add_str(obj, "nvdimm-persistence",
|
||||||
machine_get_nvdimm_persistence,
|
machine_get_nvdimm_persistence,
|
||||||
machine_set_nvdimm_persistence,
|
machine_set_nvdimm_persistence);
|
||||||
&error_abort);
|
|
||||||
object_property_set_description(obj, "nvdimm-persistence",
|
object_property_set_description(obj, "nvdimm-persistence",
|
||||||
"Set NVDIMM persistence"
|
"Set NVDIMM persistence"
|
||||||
"Valid values are cpu, mem-ctrl",
|
"Valid values are cpu, mem-ctrl");
|
||||||
NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mc->cpu_index_to_instance_props && mc->get_default_cpu_node_id) {
|
if (mc->cpu_index_to_instance_props && mc->get_default_cpu_node_id) {
|
||||||
ms->numa_state = g_new0(NumaState, 1);
|
ms->numa_state = g_new0(NumaState, 1);
|
||||||
object_property_add_bool(obj, "hmat",
|
object_property_add_bool(obj, "hmat",
|
||||||
machine_get_hmat, machine_set_hmat,
|
machine_get_hmat, machine_set_hmat);
|
||||||
&error_abort);
|
|
||||||
object_property_set_description(obj, "hmat",
|
object_property_set_description(obj, "hmat",
|
||||||
"Set on/off to enable/disable "
|
"Set on/off to enable/disable "
|
||||||
"ACPI Heterogeneous Memory Attribute "
|
"ACPI Heterogeneous Memory Attribute "
|
||||||
"Table (HMAT)", NULL);
|
"Table (HMAT)");
|
||||||
}
|
}
|
||||||
|
|
||||||
object_property_add_str(obj, "memory-backend",
|
object_property_add_str(obj, "memory-backend",
|
||||||
machine_get_memdev, machine_set_memdev,
|
machine_get_memdev, machine_set_memdev);
|
||||||
&error_abort);
|
|
||||||
object_property_set_description(obj, "memory-backend",
|
object_property_set_description(obj, "memory-backend",
|
||||||
"Set RAM backend"
|
"Set RAM backend"
|
||||||
"Valid value is ID of hostmem based backend",
|
"Valid value is ID of hostmem based backend");
|
||||||
&error_abort);
|
|
||||||
|
|
||||||
/* Register notifier when init is done for sysbus sanity checks */
|
/* Register notifier when init is done for sysbus sanity checks */
|
||||||
ms->sysbus_notifier.notify = machine_init_notify;
|
ms->sysbus_notifier.notify = machine_init_notify;
|
||||||
|
|
|
@ -46,7 +46,7 @@ static NamedClockList *qdev_init_clocklist(DeviceState *dev, const char *name,
|
||||||
*/
|
*/
|
||||||
if (clk == NULL) {
|
if (clk == NULL) {
|
||||||
clk = CLOCK(object_new(TYPE_CLOCK));
|
clk = CLOCK(object_new(TYPE_CLOCK));
|
||||||
object_property_add_child(OBJECT(dev), name, OBJECT(clk), &error_abort);
|
object_property_add_child(OBJECT(dev), name, OBJECT(clk));
|
||||||
if (output) {
|
if (output) {
|
||||||
/*
|
/*
|
||||||
* Remove object_new()'s initial reference.
|
* Remove object_new()'s initial reference.
|
||||||
|
@ -59,7 +59,7 @@ static NamedClockList *qdev_init_clocklist(DeviceState *dev, const char *name,
|
||||||
object_property_add_link(OBJECT(dev), name,
|
object_property_add_link(OBJECT(dev), name,
|
||||||
object_get_typename(OBJECT(clk)),
|
object_get_typename(OBJECT(clk)),
|
||||||
(Object **) &ncl->clock,
|
(Object **) &ncl->clock,
|
||||||
NULL, OBJ_PROP_LINK_STRONG, &error_abort);
|
NULL, OBJ_PROP_LINK_STRONG);
|
||||||
}
|
}
|
||||||
|
|
||||||
ncl->clock = clk;
|
ncl->clock = clk;
|
||||||
|
|
|
@ -1043,11 +1043,7 @@ static void set_prop_arraylen(Object *obj, Visitor *v, const char *name,
|
||||||
arrayprop->prop.info->get,
|
arrayprop->prop.info->get,
|
||||||
arrayprop->prop.info->set,
|
arrayprop->prop.info->set,
|
||||||
array_element_release,
|
array_element_release,
|
||||||
arrayprop, &local_err);
|
arrayprop);
|
||||||
if (local_err) {
|
|
||||||
error_propagate(errp, local_err);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1254,13 +1250,12 @@ const PropertyInfo qdev_prop_size = {
|
||||||
|
|
||||||
/* --- object link property --- */
|
/* --- object link property --- */
|
||||||
|
|
||||||
static void create_link_property(ObjectClass *oc, Property *prop, Error **errp)
|
static void create_link_property(ObjectClass *oc, Property *prop)
|
||||||
{
|
{
|
||||||
object_class_property_add_link(oc, prop->name, prop->link_type,
|
object_class_property_add_link(oc, prop->name, prop->link_type,
|
||||||
prop->offset,
|
prop->offset,
|
||||||
qdev_prop_allow_set_link_before_realize,
|
qdev_prop_allow_set_link_before_realize,
|
||||||
OBJ_PROP_LINK_STRONG,
|
OBJ_PROP_LINK_STRONG);
|
||||||
errp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const PropertyInfo qdev_prop_link = {
|
const PropertyInfo qdev_prop_link = {
|
||||||
|
|
|
@ -65,7 +65,7 @@ static void bus_remove_child(BusState *bus, DeviceState *child)
|
||||||
bus->num_children--;
|
bus->num_children--;
|
||||||
|
|
||||||
/* This gives back ownership of kid->child back to us. */
|
/* This gives back ownership of kid->child back to us. */
|
||||||
object_property_del(OBJECT(bus), name, NULL);
|
object_property_del(OBJECT(bus), name);
|
||||||
object_unref(OBJECT(kid->child));
|
object_unref(OBJECT(kid->child));
|
||||||
g_free(kid);
|
g_free(kid);
|
||||||
return;
|
return;
|
||||||
|
@ -91,8 +91,7 @@ static void bus_add_child(BusState *bus, DeviceState *child)
|
||||||
object_get_typename(OBJECT(child)),
|
object_get_typename(OBJECT(child)),
|
||||||
(Object **)&kid->child,
|
(Object **)&kid->child,
|
||||||
NULL, /* read-only property */
|
NULL, /* read-only property */
|
||||||
0, /* return ownership on prop deletion */
|
0);
|
||||||
NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void qdev_set_parent_bus(DeviceState *dev, BusState *bus)
|
void qdev_set_parent_bus(DeviceState *dev, BusState *bus)
|
||||||
|
@ -393,7 +392,7 @@ static void device_reset_child_foreach(Object *obj, ResettableChildCallback cb,
|
||||||
void qdev_simple_device_unplug_cb(HotplugHandler *hotplug_dev,
|
void qdev_simple_device_unplug_cb(HotplugHandler *hotplug_dev,
|
||||||
DeviceState *dev, Error **errp)
|
DeviceState *dev, Error **errp)
|
||||||
{
|
{
|
||||||
object_property_set_bool(OBJECT(dev), false, "realized", NULL);
|
object_property_set_bool(OBJECT(dev), false, "realized", &error_abort);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -481,7 +480,7 @@ void qdev_init_gpio_in_named_with_opaque(DeviceState *dev,
|
||||||
gchar *propname = g_strdup_printf("%s[%u]", name, i);
|
gchar *propname = g_strdup_printf("%s[%u]", name, i);
|
||||||
|
|
||||||
object_property_add_child(OBJECT(dev), propname,
|
object_property_add_child(OBJECT(dev), propname,
|
||||||
OBJECT(gpio_list->in[i]), &error_abort);
|
OBJECT(gpio_list->in[i]));
|
||||||
g_free(propname);
|
g_free(propname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -512,8 +511,7 @@ void qdev_init_gpio_out_named(DeviceState *dev, qemu_irq *pins,
|
||||||
object_property_add_link(OBJECT(dev), propname, TYPE_IRQ,
|
object_property_add_link(OBJECT(dev), propname, TYPE_IRQ,
|
||||||
(Object **)&pins[i],
|
(Object **)&pins[i],
|
||||||
object_property_allow_set_link,
|
object_property_allow_set_link,
|
||||||
OBJ_PROP_LINK_STRONG,
|
OBJ_PROP_LINK_STRONG);
|
||||||
&error_abort);
|
|
||||||
g_free(propname);
|
g_free(propname);
|
||||||
}
|
}
|
||||||
gpio_list->num_out += n;
|
gpio_list->num_out += n;
|
||||||
|
@ -542,15 +540,11 @@ void qdev_connect_gpio_out_named(DeviceState *dev, const char *name, int n,
|
||||||
{
|
{
|
||||||
char *propname = g_strdup_printf("%s[%d]",
|
char *propname = g_strdup_printf("%s[%d]",
|
||||||
name ? name : "unnamed-gpio-out", n);
|
name ? name : "unnamed-gpio-out", n);
|
||||||
if (pin) {
|
if (pin && !OBJECT(pin)->parent) {
|
||||||
/* We need a name for object_property_set_link to work. If the
|
/* We need a name for object_property_set_link to work */
|
||||||
* object has a parent, object_property_add_child will come back
|
|
||||||
* with an error without doing anything. If it has none, it will
|
|
||||||
* never fail. So we can just call it with a NULL Error pointer.
|
|
||||||
*/
|
|
||||||
object_property_add_child(container_get(qdev_get_machine(),
|
object_property_add_child(container_get(qdev_get_machine(),
|
||||||
"/unattached"),
|
"/unattached"),
|
||||||
"non-qdev-gpio[*]", OBJECT(pin), NULL);
|
"non-qdev-gpio[*]", OBJECT(pin));
|
||||||
}
|
}
|
||||||
object_property_set_link(OBJECT(dev), OBJECT(pin), propname, &error_abort);
|
object_property_set_link(OBJECT(dev), OBJECT(pin), propname, &error_abort);
|
||||||
g_free(propname);
|
g_free(propname);
|
||||||
|
@ -608,8 +602,7 @@ void qdev_pass_gpios(DeviceState *dev, DeviceState *container,
|
||||||
char *propname = g_strdup_printf("%s[%d]", nm, i);
|
char *propname = g_strdup_printf("%s[%d]", nm, i);
|
||||||
|
|
||||||
object_property_add_alias(OBJECT(container), propname,
|
object_property_add_alias(OBJECT(container), propname,
|
||||||
OBJECT(dev), propname,
|
OBJECT(dev), propname);
|
||||||
&error_abort);
|
|
||||||
g_free(propname);
|
g_free(propname);
|
||||||
}
|
}
|
||||||
for (i = 0; i < ngl->num_out; i++) {
|
for (i = 0; i < ngl->num_out; i++) {
|
||||||
|
@ -617,8 +610,7 @@ void qdev_pass_gpios(DeviceState *dev, DeviceState *container,
|
||||||
char *propname = g_strdup_printf("%s[%d]", nm, i);
|
char *propname = g_strdup_printf("%s[%d]", nm, i);
|
||||||
|
|
||||||
object_property_add_alias(OBJECT(container), propname,
|
object_property_add_alias(OBJECT(container), propname,
|
||||||
OBJECT(dev), propname,
|
OBJECT(dev), propname);
|
||||||
&error_abort);
|
|
||||||
g_free(propname);
|
g_free(propname);
|
||||||
}
|
}
|
||||||
QLIST_REMOVE(ngl, node);
|
QLIST_REMOVE(ngl, node);
|
||||||
|
@ -759,7 +751,7 @@ static void qdev_class_add_legacy_property(DeviceClass *dc, Property *prop)
|
||||||
name = g_strdup_printf("legacy-%s", prop->name);
|
name = g_strdup_printf("legacy-%s", prop->name);
|
||||||
object_class_property_add(OBJECT_CLASS(dc), name, "str",
|
object_class_property_add(OBJECT_CLASS(dc), name, "str",
|
||||||
prop->info->print ? qdev_get_legacy_property : prop->info->get,
|
prop->info->print ? qdev_get_legacy_property : prop->info->get,
|
||||||
NULL, NULL, prop, &error_abort);
|
NULL, NULL, prop);
|
||||||
}
|
}
|
||||||
|
|
||||||
void qdev_property_add_static(DeviceState *dev, Property *prop)
|
void qdev_property_add_static(DeviceState *dev, Property *prop)
|
||||||
|
@ -772,11 +764,10 @@ void qdev_property_add_static(DeviceState *dev, Property *prop)
|
||||||
op = object_property_add(obj, prop->name, prop->info->name,
|
op = object_property_add(obj, prop->name, prop->info->name,
|
||||||
prop->info->get, prop->info->set,
|
prop->info->get, prop->info->set,
|
||||||
prop->info->release,
|
prop->info->release,
|
||||||
prop, &error_abort);
|
prop);
|
||||||
|
|
||||||
object_property_set_description(obj, prop->name,
|
object_property_set_description(obj, prop->name,
|
||||||
prop->info->description,
|
prop->info->description);
|
||||||
&error_abort);
|
|
||||||
|
|
||||||
if (prop->set_default) {
|
if (prop->set_default) {
|
||||||
prop->info->set_default_value(op, prop);
|
prop->info->set_default_value(op, prop);
|
||||||
|
@ -791,7 +782,7 @@ static void qdev_class_add_property(DeviceClass *klass, Property *prop)
|
||||||
ObjectClass *oc = OBJECT_CLASS(klass);
|
ObjectClass *oc = OBJECT_CLASS(klass);
|
||||||
|
|
||||||
if (prop->info->create) {
|
if (prop->info->create) {
|
||||||
prop->info->create(oc, prop, &error_abort);
|
prop->info->create(oc, prop);
|
||||||
} else {
|
} else {
|
||||||
ObjectProperty *op;
|
ObjectProperty *op;
|
||||||
|
|
||||||
|
@ -799,14 +790,13 @@ static void qdev_class_add_property(DeviceClass *klass, Property *prop)
|
||||||
prop->name, prop->info->name,
|
prop->name, prop->info->name,
|
||||||
prop->info->get, prop->info->set,
|
prop->info->get, prop->info->set,
|
||||||
prop->info->release,
|
prop->info->release,
|
||||||
prop, &error_abort);
|
prop);
|
||||||
if (prop->set_default) {
|
if (prop->set_default) {
|
||||||
prop->info->set_default_value(op, prop);
|
prop->info->set_default_value(op, prop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
object_class_property_set_description(oc, prop->name,
|
object_class_property_set_description(oc, prop->name,
|
||||||
prop->info->description,
|
prop->info->description);
|
||||||
&error_abort);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* @qdev_alias_all_properties - Add alias properties to the source object for
|
/* @qdev_alias_all_properties - Add alias properties to the source object for
|
||||||
|
@ -823,8 +813,7 @@ void qdev_alias_all_properties(DeviceState *target, Object *source)
|
||||||
|
|
||||||
for (prop = dc->props_; prop && prop->name; prop++) {
|
for (prop = dc->props_; prop && prop->name; prop++) {
|
||||||
object_property_add_alias(source, prop->name,
|
object_property_add_alias(source, prop->name,
|
||||||
OBJECT(target), prop->name,
|
OBJECT(target), prop->name);
|
||||||
&error_abort);
|
|
||||||
}
|
}
|
||||||
class = object_class_get_parent(class);
|
class = object_class_get_parent(class);
|
||||||
} while (class != object_class_by_name(TYPE_DEVICE));
|
} while (class != object_class_by_name(TYPE_DEVICE));
|
||||||
|
@ -876,7 +865,7 @@ static void device_set_realized(Object *obj, bool value, Error **errp)
|
||||||
|
|
||||||
object_property_add_child(container_get(qdev_get_machine(),
|
object_property_add_child(container_get(qdev_get_machine(),
|
||||||
"/unattached"),
|
"/unattached"),
|
||||||
name, obj, &error_abort);
|
name, obj);
|
||||||
unattached_parent = true;
|
unattached_parent = true;
|
||||||
g_free(name);
|
g_free(name);
|
||||||
}
|
}
|
||||||
|
@ -956,23 +945,18 @@ static void device_set_realized(Object *obj, bool value, Error **errp)
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (!value && dev->realized) {
|
} else if (!value && dev->realized) {
|
||||||
/* We want local_err to track only the first error */
|
|
||||||
QLIST_FOREACH(bus, &dev->child_bus, sibling) {
|
QLIST_FOREACH(bus, &dev->child_bus, sibling) {
|
||||||
object_property_set_bool(OBJECT(bus), false, "realized",
|
object_property_set_bool(OBJECT(bus), false, "realized",
|
||||||
local_err ? NULL : &local_err);
|
&error_abort);
|
||||||
}
|
}
|
||||||
if (qdev_get_vmsd(dev)) {
|
if (qdev_get_vmsd(dev)) {
|
||||||
vmstate_unregister(VMSTATE_IF(dev), qdev_get_vmsd(dev), dev);
|
vmstate_unregister(VMSTATE_IF(dev), qdev_get_vmsd(dev), dev);
|
||||||
}
|
}
|
||||||
if (dc->unrealize) {
|
if (dc->unrealize) {
|
||||||
dc->unrealize(dev, local_err ? NULL : &local_err);
|
dc->unrealize(dev);
|
||||||
}
|
}
|
||||||
dev->pending_deleted_event = true;
|
dev->pending_deleted_event = true;
|
||||||
DEVICE_LISTENER_CALL(unrealize, Reverse, dev);
|
DEVICE_LISTENER_CALL(unrealize, Reverse, dev);
|
||||||
|
|
||||||
if (local_err != NULL) {
|
|
||||||
goto fail;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(local_err == NULL);
|
assert(local_err == NULL);
|
||||||
|
@ -982,7 +966,7 @@ static void device_set_realized(Object *obj, bool value, Error **errp)
|
||||||
child_realize_fail:
|
child_realize_fail:
|
||||||
QLIST_FOREACH(bus, &dev->child_bus, sibling) {
|
QLIST_FOREACH(bus, &dev->child_bus, sibling) {
|
||||||
object_property_set_bool(OBJECT(bus), false, "realized",
|
object_property_set_bool(OBJECT(bus), false, "realized",
|
||||||
NULL);
|
&error_abort);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qdev_get_vmsd(dev)) {
|
if (qdev_get_vmsd(dev)) {
|
||||||
|
@ -993,7 +977,7 @@ post_realize_fail:
|
||||||
g_free(dev->canonical_path);
|
g_free(dev->canonical_path);
|
||||||
dev->canonical_path = NULL;
|
dev->canonical_path = NULL;
|
||||||
if (dc->unrealize) {
|
if (dc->unrealize) {
|
||||||
dc->unrealize(dev, NULL);
|
dc->unrealize(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
|
@ -1094,7 +1078,7 @@ static void device_unparent(Object *obj)
|
||||||
BusState *bus;
|
BusState *bus;
|
||||||
|
|
||||||
if (dev->realized) {
|
if (dev->realized) {
|
||||||
object_property_set_bool(obj, false, "realized", NULL);
|
object_property_set_bool(obj, false, "realized", &error_abort);
|
||||||
}
|
}
|
||||||
while (dev->num_child_bus) {
|
while (dev->num_child_bus) {
|
||||||
bus = QLIST_FIRST(&dev->child_bus);
|
bus = QLIST_FIRST(&dev->child_bus);
|
||||||
|
@ -1203,17 +1187,13 @@ static void device_class_init(ObjectClass *class, void *data)
|
||||||
rc->get_transitional_function = device_get_transitional_reset;
|
rc->get_transitional_function = device_get_transitional_reset;
|
||||||
|
|
||||||
object_class_property_add_bool(class, "realized",
|
object_class_property_add_bool(class, "realized",
|
||||||
device_get_realized, device_set_realized,
|
device_get_realized, device_set_realized);
|
||||||
&error_abort);
|
|
||||||
object_class_property_add_bool(class, "hotpluggable",
|
object_class_property_add_bool(class, "hotpluggable",
|
||||||
device_get_hotpluggable, NULL,
|
device_get_hotpluggable, NULL);
|
||||||
&error_abort);
|
|
||||||
object_class_property_add_bool(class, "hotplugged",
|
object_class_property_add_bool(class, "hotplugged",
|
||||||
device_get_hotplugged, NULL,
|
device_get_hotplugged, NULL);
|
||||||
&error_abort);
|
|
||||||
object_class_property_add_link(class, "parent_bus", TYPE_BUS,
|
object_class_property_add_link(class, "parent_bus", TYPE_BUS,
|
||||||
offsetof(DeviceState, parent_bus), NULL, 0,
|
offsetof(DeviceState, parent_bus), NULL, 0);
|
||||||
&error_abort);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void device_class_set_props(DeviceClass *dc, Property *props)
|
void device_class_set_props(DeviceClass *dc, Property *props)
|
||||||
|
|
|
@ -76,9 +76,9 @@ static void cpu_core_instance_init(Object *obj)
|
||||||
CPUCore *core = CPU_CORE(obj);
|
CPUCore *core = CPU_CORE(obj);
|
||||||
|
|
||||||
object_property_add(obj, "core-id", "int", core_prop_get_core_id,
|
object_property_add(obj, "core-id", "int", core_prop_get_core_id,
|
||||||
core_prop_set_core_id, NULL, NULL, NULL);
|
core_prop_set_core_id, NULL, NULL);
|
||||||
object_property_add(obj, "nr-threads", "int", core_prop_get_nr_threads,
|
object_property_add(obj, "nr-threads", "int", core_prop_get_nr_threads,
|
||||||
core_prop_set_nr_threads, NULL, NULL, NULL);
|
core_prop_set_nr_threads, NULL, NULL);
|
||||||
core->nr_threads = ms->smp.threads;
|
core->nr_threads = ms->smp.threads;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1353,7 +1353,7 @@ static void artist_realizefn(DeviceState *dev, Error **errp)
|
||||||
s->cursor_height = 32;
|
s->cursor_height = 32;
|
||||||
s->cursor_width = 32;
|
s->cursor_width = 32;
|
||||||
|
|
||||||
s->con = graphic_console_init(DEVICE(dev), 0, &artist_ops, s);
|
s->con = graphic_console_init(dev, 0, &artist_ops, s);
|
||||||
qemu_console_resize(s->con, s->width, s->height);
|
qemu_console_resize(s->con, s->width, s->height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -333,8 +333,7 @@ static void bochs_display_init(Object *obj)
|
||||||
/* Expose framebuffer byteorder via QOM */
|
/* Expose framebuffer byteorder via QOM */
|
||||||
object_property_add_bool(obj, "big-endian-framebuffer",
|
object_property_add_bool(obj, "big-endian-framebuffer",
|
||||||
bochs_display_get_big_endian_fb,
|
bochs_display_get_big_endian_fb,
|
||||||
bochs_display_set_big_endian_fb,
|
bochs_display_set_big_endian_fb);
|
||||||
NULL);
|
|
||||||
|
|
||||||
dev->cap_present |= QEMU_PCI_CAP_EXPRESS;
|
dev->cap_present |= QEMU_PCI_CAP_EXPRESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -321,7 +321,7 @@ static void cg3_realizefn(DeviceState *dev, Error **errp)
|
||||||
|
|
||||||
sysbus_init_irq(sbd, &s->irq);
|
sysbus_init_irq(sbd, &s->irq);
|
||||||
|
|
||||||
s->con = graphic_console_init(DEVICE(dev), 0, &cg3_ops, s);
|
s->con = graphic_console_init(dev, 0, &cg3_ops, s);
|
||||||
qemu_console_resize(s->con, s->width, s->height);
|
qemu_console_resize(s->con, s->width, s->height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1839,7 +1839,7 @@ static void sm501_init(SM501State *s, DeviceState *dev,
|
||||||
&s->twoD_engine_region);
|
&s->twoD_engine_region);
|
||||||
|
|
||||||
/* create qemu graphic console */
|
/* create qemu graphic console */
|
||||||
s->con = graphic_console_init(DEVICE(dev), 0, &sm501_ops, s);
|
s->con = graphic_console_init(dev, 0, &sm501_ops, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const VMStateDescription vmstate_sm501_state = {
|
static const VMStateDescription vmstate_sm501_state = {
|
||||||
|
@ -2011,7 +2011,7 @@ static void sm501_sysbus_init(Object *o)
|
||||||
qdev_prop_set_uint8(DEVICE(smm), "endianness", DEVICE_LITTLE_ENDIAN);
|
qdev_prop_set_uint8(DEVICE(smm), "endianness", DEVICE_LITTLE_ENDIAN);
|
||||||
|
|
||||||
object_property_add_alias(o, "chardev",
|
object_property_add_alias(o, "chardev",
|
||||||
OBJECT(smm), "chardev", &error_abort);
|
OBJECT(smm), "chardev");
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo sm501_sysbus_info = {
|
static const TypeInfo sm501_sysbus_info = {
|
||||||
|
|
|
@ -868,9 +868,9 @@ static void tcx_realizefn(DeviceState *dev, Error **errp)
|
||||||
sysbus_init_irq(sbd, &s->irq);
|
sysbus_init_irq(sbd, &s->irq);
|
||||||
|
|
||||||
if (s->depth == 8) {
|
if (s->depth == 8) {
|
||||||
s->con = graphic_console_init(DEVICE(dev), 0, &tcx_ops, s);
|
s->con = graphic_console_init(dev, 0, &tcx_ops, s);
|
||||||
} else {
|
} else {
|
||||||
s->con = graphic_console_init(DEVICE(dev), 0, &tcx24_ops, s);
|
s->con = graphic_console_init(dev, 0, &tcx24_ops, s);
|
||||||
}
|
}
|
||||||
s->thcmisc = 0;
|
s->thcmisc = 0;
|
||||||
|
|
||||||
|
|
|
@ -74,7 +74,7 @@ static void vga_isa_realizefn(DeviceState *dev, Error **errp)
|
||||||
0x000a0000,
|
0x000a0000,
|
||||||
vga_io_memory, 1);
|
vga_io_memory, 1);
|
||||||
memory_region_set_coalescing(vga_io_memory);
|
memory_region_set_coalescing(vga_io_memory);
|
||||||
s->con = graphic_console_init(DEVICE(dev), 0, s->hw_ops, s);
|
s->con = graphic_console_init(dev, 0, s->hw_ops, s);
|
||||||
|
|
||||||
memory_region_add_subregion(isa_address_space(isadev),
|
memory_region_add_subregion(isa_address_space(isadev),
|
||||||
VBE_DISPI_LFB_PHYSICAL_ADDRESS,
|
VBE_DISPI_LFB_PHYSICAL_ADDRESS,
|
||||||
|
|
|
@ -270,7 +270,7 @@ static void pci_std_vga_init(Object *obj)
|
||||||
{
|
{
|
||||||
/* Expose framebuffer byteorder via QOM */
|
/* Expose framebuffer byteorder via QOM */
|
||||||
object_property_add_bool(obj, "big-endian-framebuffer",
|
object_property_add_bool(obj, "big-endian-framebuffer",
|
||||||
vga_get_big_endian_fb, vga_set_big_endian_fb, NULL);
|
vga_get_big_endian_fb, vga_set_big_endian_fb);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pci_secondary_vga_realize(PCIDevice *dev, Error **errp)
|
static void pci_secondary_vga_realize(PCIDevice *dev, Error **errp)
|
||||||
|
@ -321,7 +321,7 @@ static void pci_secondary_vga_init(Object *obj)
|
||||||
{
|
{
|
||||||
/* Expose framebuffer byteorder via QOM */
|
/* Expose framebuffer byteorder via QOM */
|
||||||
object_property_add_bool(obj, "big-endian-framebuffer",
|
object_property_add_bool(obj, "big-endian-framebuffer",
|
||||||
vga_get_big_endian_fb, vga_set_big_endian_fb, NULL);
|
vga_get_big_endian_fb, vga_set_big_endian_fb);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pci_secondary_vga_reset(DeviceState *dev)
|
static void pci_secondary_vga_reset(DeviceState *dev)
|
||||||
|
|
|
@ -32,8 +32,7 @@ static void vhost_user_gpu_pci_initfn(Object *obj)
|
||||||
VIRTIO_GPU_PCI_BASE(obj)->vgpu = VIRTIO_GPU_BASE(&dev->vdev);
|
VIRTIO_GPU_PCI_BASE(obj)->vgpu = VIRTIO_GPU_BASE(&dev->vdev);
|
||||||
|
|
||||||
object_property_add_alias(obj, "chardev",
|
object_property_add_alias(obj, "chardev",
|
||||||
OBJECT(&dev->vdev), "chardev",
|
OBJECT(&dev->vdev), "chardev");
|
||||||
&error_abort);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const VirtioPCIDeviceTypeInfo vhost_user_gpu_pci_info = {
|
static const VirtioPCIDeviceTypeInfo vhost_user_gpu_pci_info = {
|
||||||
|
|
|
@ -512,7 +512,7 @@ vhost_user_gpu_instance_init(Object *obj)
|
||||||
|
|
||||||
g->vhost = VHOST_USER_BACKEND(object_new(TYPE_VHOST_USER_BACKEND));
|
g->vhost = VHOST_USER_BACKEND(object_new(TYPE_VHOST_USER_BACKEND));
|
||||||
object_property_add_alias(obj, "chardev",
|
object_property_add_alias(obj, "chardev",
|
||||||
OBJECT(g->vhost), "chardev", &error_abort);
|
OBJECT(g->vhost), "chardev");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -33,8 +33,7 @@ static void vhost_user_vga_inst_initfn(Object *obj)
|
||||||
VIRTIO_VGA_BASE(dev)->vgpu = VIRTIO_GPU_BASE(&dev->vdev);
|
VIRTIO_VGA_BASE(dev)->vgpu = VIRTIO_GPU_BASE(&dev->vdev);
|
||||||
|
|
||||||
object_property_add_alias(obj, "chardev",
|
object_property_add_alias(obj, "chardev",
|
||||||
OBJECT(&dev->vdev), "chardev",
|
OBJECT(&dev->vdev), "chardev");
|
||||||
&error_abort);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const VirtioPCIDeviceTypeInfo vhost_user_vga_info = {
|
static const VirtioPCIDeviceTypeInfo vhost_user_vga_info = {
|
||||||
|
|
|
@ -203,7 +203,7 @@ virtio_gpu_base_set_features(VirtIODevice *vdev, uint64_t features)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
virtio_gpu_base_device_unrealize(DeviceState *qdev, Error **errp)
|
virtio_gpu_base_device_unrealize(DeviceState *qdev)
|
||||||
{
|
{
|
||||||
VirtIOGPUBase *g = VIRTIO_GPU_BASE(qdev);
|
VirtIOGPUBase *g = VIRTIO_GPU_BASE(qdev);
|
||||||
|
|
||||||
|
|
|
@ -1237,8 +1237,7 @@ static void xlnx_dp_init(Object *obj)
|
||||||
object_property_add_link(obj, "dpdma", TYPE_XLNX_DPDMA,
|
object_property_add_link(obj, "dpdma", TYPE_XLNX_DPDMA,
|
||||||
(Object **) &s->dpdma,
|
(Object **) &s->dpdma,
|
||||||
xlnx_dp_set_dpdma,
|
xlnx_dp_set_dpdma,
|
||||||
OBJ_PROP_LINK_STRONG,
|
OBJ_PROP_LINK_STRONG);
|
||||||
&error_abort);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initialize AUX Bus.
|
* Initialize AUX Bus.
|
||||||
|
@ -1249,11 +1248,11 @@ static void xlnx_dp_init(Object *obj)
|
||||||
* Initialize DPCD and EDID..
|
* Initialize DPCD and EDID..
|
||||||
*/
|
*/
|
||||||
s->dpcd = DPCD(aux_create_slave(s->aux_bus, "dpcd"));
|
s->dpcd = DPCD(aux_create_slave(s->aux_bus, "dpcd"));
|
||||||
object_property_add_child(OBJECT(s), "dpcd", OBJECT(s->dpcd), NULL);
|
object_property_add_child(OBJECT(s), "dpcd", OBJECT(s->dpcd));
|
||||||
|
|
||||||
s->edid = I2CDDC(qdev_create(BUS(aux_get_i2c_bus(s->aux_bus)), "i2c-ddc"));
|
s->edid = I2CDDC(qdev_create(BUS(aux_get_i2c_bus(s->aux_bus)), "i2c-ddc"));
|
||||||
i2c_set_slave_address(I2C_SLAVE(s->edid), 0x50);
|
i2c_set_slave_address(I2C_SLAVE(s->edid), 0x50);
|
||||||
object_property_add_child(OBJECT(s), "edid", OBJECT(s->edid), NULL);
|
object_property_add_child(OBJECT(s), "edid", OBJECT(s->edid));
|
||||||
|
|
||||||
fifo8_create(&s->rx_fifo, 16);
|
fifo8_create(&s->rx_fifo, 16);
|
||||||
fifo8_create(&s->tx_fifo, 16);
|
fifo8_create(&s->tx_fifo, 16);
|
||||||
|
|
|
@ -690,7 +690,7 @@ static void rc4030_realize(DeviceState *dev, Error **errp)
|
||||||
address_space_init(&s->dma_as, MEMORY_REGION(&s->dma_mr), "rc4030-dma");
|
address_space_init(&s->dma_as, MEMORY_REGION(&s->dma_mr), "rc4030-dma");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rc4030_unrealize(DeviceState *dev, Error **errp)
|
static void rc4030_unrealize(DeviceState *dev)
|
||||||
{
|
{
|
||||||
rc4030State *s = RC4030(dev);
|
rc4030State *s = RC4030(dev);
|
||||||
|
|
||||||
|
|
|
@ -264,7 +264,7 @@ static void sparc32_dma_device_init(Object *obj)
|
||||||
object_property_add_link(OBJECT(dev), "iommu", TYPE_SUN4M_IOMMU,
|
object_property_add_link(OBJECT(dev), "iommu", TYPE_SUN4M_IOMMU,
|
||||||
(Object **) &s->iommu,
|
(Object **) &s->iommu,
|
||||||
qdev_prop_allow_set_link_before_realize,
|
qdev_prop_allow_set_link_before_realize,
|
||||||
0, NULL);
|
0);
|
||||||
|
|
||||||
qdev_init_gpio_in(dev, dma_set_irq, 1);
|
qdev_init_gpio_in(dev, dma_set_irq, 1);
|
||||||
qdev_init_gpio_out(dev, s->gpio, 2);
|
qdev_init_gpio_out(dev, s->gpio, 2);
|
||||||
|
@ -302,7 +302,7 @@ static void sparc32_espdma_device_realize(DeviceState *dev, Error **errp)
|
||||||
ESPState *esp;
|
ESPState *esp;
|
||||||
|
|
||||||
d = qdev_create(NULL, TYPE_ESP);
|
d = qdev_create(NULL, TYPE_ESP);
|
||||||
object_property_add_child(OBJECT(dev), "esp", OBJECT(d), errp);
|
object_property_add_child(OBJECT(dev), "esp", OBJECT(d));
|
||||||
sysbus = ESP_STATE(d);
|
sysbus = ESP_STATE(d);
|
||||||
esp = &sysbus->esp;
|
esp = &sysbus->esp;
|
||||||
esp->dma_memory_read = espdma_memory_read;
|
esp->dma_memory_read = espdma_memory_read;
|
||||||
|
@ -344,7 +344,7 @@ static void sparc32_ledma_device_realize(DeviceState *dev, Error **errp)
|
||||||
qemu_check_nic_model(nd, TYPE_LANCE);
|
qemu_check_nic_model(nd, TYPE_LANCE);
|
||||||
|
|
||||||
d = qdev_create(NULL, TYPE_LANCE);
|
d = qdev_create(NULL, TYPE_LANCE);
|
||||||
object_property_add_child(OBJECT(dev), "lance", OBJECT(d), errp);
|
object_property_add_child(OBJECT(dev), "lance", OBJECT(d));
|
||||||
qdev_set_nic_properties(d, nd);
|
qdev_set_nic_properties(d, nd);
|
||||||
object_property_set_link(OBJECT(d), OBJECT(dev), "dma", errp);
|
object_property_set_link(OBJECT(d), OBJECT(dev), "dma", errp);
|
||||||
qdev_init_nofail(d);
|
qdev_init_nofail(d);
|
||||||
|
@ -380,7 +380,7 @@ static void sparc32_dma_realize(DeviceState *dev, Error **errp)
|
||||||
|
|
||||||
espdma = qdev_create(NULL, TYPE_SPARC32_ESPDMA_DEVICE);
|
espdma = qdev_create(NULL, TYPE_SPARC32_ESPDMA_DEVICE);
|
||||||
object_property_set_link(OBJECT(espdma), iommu, "iommu", errp);
|
object_property_set_link(OBJECT(espdma), iommu, "iommu", errp);
|
||||||
object_property_add_child(OBJECT(s), "espdma", OBJECT(espdma), errp);
|
object_property_add_child(OBJECT(s), "espdma", OBJECT(espdma));
|
||||||
qdev_init_nofail(espdma);
|
qdev_init_nofail(espdma);
|
||||||
|
|
||||||
esp = DEVICE(object_resolve_path_component(OBJECT(espdma), "esp"));
|
esp = DEVICE(object_resolve_path_component(OBJECT(espdma), "esp"));
|
||||||
|
@ -395,7 +395,7 @@ static void sparc32_dma_realize(DeviceState *dev, Error **errp)
|
||||||
|
|
||||||
ledma = qdev_create(NULL, TYPE_SPARC32_LEDMA_DEVICE);
|
ledma = qdev_create(NULL, TYPE_SPARC32_LEDMA_DEVICE);
|
||||||
object_property_set_link(OBJECT(ledma), iommu, "iommu", errp);
|
object_property_set_link(OBJECT(ledma), iommu, "iommu", errp);
|
||||||
object_property_add_child(OBJECT(s), "ledma", OBJECT(ledma), errp);
|
object_property_add_child(OBJECT(s), "ledma", OBJECT(ledma));
|
||||||
qdev_init_nofail(ledma);
|
qdev_init_nofail(ledma);
|
||||||
|
|
||||||
lance = DEVICE(object_resolve_path_component(OBJECT(ledma), "lance"));
|
lance = DEVICE(object_resolve_path_component(OBJECT(ledma), "lance"));
|
||||||
|
|
|
@ -543,16 +543,11 @@ static void xilinx_axidma_realize(DeviceState *dev, Error **errp)
|
||||||
object_property_add_link(OBJECT(ds), "dma", TYPE_XILINX_AXI_DMA,
|
object_property_add_link(OBJECT(ds), "dma", TYPE_XILINX_AXI_DMA,
|
||||||
(Object **)&ds->dma,
|
(Object **)&ds->dma,
|
||||||
object_property_allow_set_link,
|
object_property_allow_set_link,
|
||||||
OBJ_PROP_LINK_STRONG,
|
OBJ_PROP_LINK_STRONG);
|
||||||
&local_err);
|
|
||||||
object_property_add_link(OBJECT(cs), "dma", TYPE_XILINX_AXI_DMA,
|
object_property_add_link(OBJECT(cs), "dma", TYPE_XILINX_AXI_DMA,
|
||||||
(Object **)&cs->dma,
|
(Object **)&cs->dma,
|
||||||
object_property_allow_set_link,
|
object_property_allow_set_link,
|
||||||
OBJ_PROP_LINK_STRONG,
|
OBJ_PROP_LINK_STRONG);
|
||||||
&local_err);
|
|
||||||
if (local_err) {
|
|
||||||
goto xilinx_axidma_realize_fail;
|
|
||||||
}
|
|
||||||
object_property_set_link(OBJECT(ds), OBJECT(s), "dma", &local_err);
|
object_property_set_link(OBJECT(ds), OBJECT(s), "dma", &local_err);
|
||||||
object_property_set_link(OBJECT(cs), OBJECT(s), "dma", &local_err);
|
object_property_set_link(OBJECT(cs), OBJECT(s), "dma", &local_err);
|
||||||
if (local_err) {
|
if (local_err) {
|
||||||
|
@ -594,8 +589,7 @@ static void xilinx_axidma_init(Object *obj)
|
||||||
object_property_add_link(obj, "dma", TYPE_MEMORY_REGION,
|
object_property_add_link(obj, "dma", TYPE_MEMORY_REGION,
|
||||||
(Object **)&s->dma_mr,
|
(Object **)&s->dma_mr,
|
||||||
qdev_prop_allow_set_link_before_realize,
|
qdev_prop_allow_set_link_before_realize,
|
||||||
OBJ_PROP_LINK_STRONG,
|
OBJ_PROP_LINK_STRONG);
|
||||||
&error_abort);
|
|
||||||
|
|
||||||
sysbus_init_irq(sbd, &s->streams[0].irq);
|
sysbus_init_irq(sbd, &s->streams[0].irq);
|
||||||
sysbus_init_irq(sbd, &s->streams[1].irq);
|
sysbus_init_irq(sbd, &s->streams[1].irq);
|
||||||
|
|
|
@ -719,7 +719,7 @@ static uint64_t zdma_read(void *opaque, hwaddr addr, unsigned size)
|
||||||
RegisterInfo *r = &s->regs_info[addr / 4];
|
RegisterInfo *r = &s->regs_info[addr / 4];
|
||||||
|
|
||||||
if (!r->data) {
|
if (!r->data) {
|
||||||
gchar *path = object_get_canonical_path(OBJECT(s));
|
char *path = object_get_canonical_path(OBJECT(s));
|
||||||
qemu_log("%s: Decode error: read from %" HWADDR_PRIx "\n",
|
qemu_log("%s: Decode error: read from %" HWADDR_PRIx "\n",
|
||||||
path,
|
path,
|
||||||
addr);
|
addr);
|
||||||
|
@ -738,7 +738,7 @@ static void zdma_write(void *opaque, hwaddr addr, uint64_t value,
|
||||||
RegisterInfo *r = &s->regs_info[addr / 4];
|
RegisterInfo *r = &s->regs_info[addr / 4];
|
||||||
|
|
||||||
if (!r->data) {
|
if (!r->data) {
|
||||||
gchar *path = object_get_canonical_path(OBJECT(s));
|
char *path = object_get_canonical_path(OBJECT(s));
|
||||||
qemu_log("%s: Decode error: write to %" HWADDR_PRIx "=%" PRIx64 "\n",
|
qemu_log("%s: Decode error: write to %" HWADDR_PRIx "=%" PRIx64 "\n",
|
||||||
path,
|
path,
|
||||||
addr, value);
|
addr, value);
|
||||||
|
@ -799,8 +799,7 @@ static void zdma_init(Object *obj)
|
||||||
object_property_add_link(obj, "dma", TYPE_MEMORY_REGION,
|
object_property_add_link(obj, "dma", TYPE_MEMORY_REGION,
|
||||||
(Object **)&s->dma_mr,
|
(Object **)&s->dma_mr,
|
||||||
qdev_prop_allow_set_link_before_realize,
|
qdev_prop_allow_set_link_before_realize,
|
||||||
OBJ_PROP_LINK_STRONG,
|
OBJ_PROP_LINK_STRONG);
|
||||||
&error_abort);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const VMStateDescription vmstate_zdma = {
|
static const VMStateDescription vmstate_zdma = {
|
||||||
|
|
|
@ -873,7 +873,7 @@ static void aspeed_gpio_init(Object *obj)
|
||||||
name = g_strdup_printf("gpio%s%d", props->group_label[group_idx],
|
name = g_strdup_printf("gpio%s%d", props->group_label[group_idx],
|
||||||
pin_idx % GPIOS_PER_GROUP);
|
pin_idx % GPIOS_PER_GROUP);
|
||||||
object_property_add(obj, name, "bool", aspeed_gpio_get_pin,
|
object_property_add(obj, name, "bool", aspeed_gpio_get_pin,
|
||||||
aspeed_gpio_set_pin, NULL, NULL, NULL);
|
aspeed_gpio_set_pin, NULL, NULL);
|
||||||
g_free(name);
|
g_free(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,7 +131,7 @@ void hyperv_synic_add(CPUState *cs)
|
||||||
obj = object_new(TYPE_SYNIC);
|
obj = object_new(TYPE_SYNIC);
|
||||||
synic = SYNIC(obj);
|
synic = SYNIC(obj);
|
||||||
synic->cs = cs;
|
synic->cs = cs;
|
||||||
object_property_add_child(OBJECT(cs), "synic", obj, &error_abort);
|
object_property_add_child(OBJECT(cs), "synic", obj);
|
||||||
object_unref(obj);
|
object_unref(obj);
|
||||||
object_property_set_bool(obj, true, "realized", &error_abort);
|
object_property_set_bool(obj, true, "realized", &error_abort);
|
||||||
}
|
}
|
||||||
|
|
|
@ -305,7 +305,7 @@ static void imx_i2c_realize(DeviceState *dev, Error **errp)
|
||||||
IMX_I2C_MEM_SIZE);
|
IMX_I2C_MEM_SIZE);
|
||||||
sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem);
|
sysbus_init_mmio(SYS_BUS_DEVICE(dev), &s->iomem);
|
||||||
sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->irq);
|
sysbus_init_irq(SYS_BUS_DEVICE(dev), &s->irq);
|
||||||
s->bus = i2c_init_bus(DEVICE(dev), NULL);
|
s->bus = i2c_init_bus(dev, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void imx_i2c_class_init(ObjectClass *klass, void *data)
|
static void imx_i2c_class_init(ObjectClass *klass, void *data)
|
||||||
|
|
|
@ -332,7 +332,7 @@ static void mpc_i2c_realize(DeviceState *dev, Error **errp)
|
||||||
memory_region_init_io(&i2c->iomem, OBJECT(i2c), &i2c_ops, i2c,
|
memory_region_init_io(&i2c->iomem, OBJECT(i2c), &i2c_ops, i2c,
|
||||||
"mpc-i2c", 0x14);
|
"mpc-i2c", 0x14);
|
||||||
sysbus_init_mmio(SYS_BUS_DEVICE(dev), &i2c->iomem);
|
sysbus_init_mmio(SYS_BUS_DEVICE(dev), &i2c->iomem);
|
||||||
i2c->bus = i2c_init_bus(DEVICE(dev), "i2c");
|
i2c->bus = i2c_init_bus(dev, "i2c");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void mpc_i2c_class_init(ObjectClass *klass, void *data)
|
static void mpc_i2c_class_init(ObjectClass *klass, void *data)
|
||||||
|
|
|
@ -230,7 +230,7 @@ static void kvm_apic_realize(DeviceState *dev, Error **errp)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void kvm_apic_unrealize(DeviceState *dev, Error **errp)
|
static void kvm_apic_unrealize(DeviceState *dev)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -510,47 +510,42 @@ static void microvm_class_init(ObjectClass *oc, void *data)
|
||||||
object_class_property_add(oc, MICROVM_MACHINE_PIC, "OnOffAuto",
|
object_class_property_add(oc, MICROVM_MACHINE_PIC, "OnOffAuto",
|
||||||
microvm_machine_get_pic,
|
microvm_machine_get_pic,
|
||||||
microvm_machine_set_pic,
|
microvm_machine_set_pic,
|
||||||
NULL, NULL, &error_abort);
|
NULL, NULL);
|
||||||
object_class_property_set_description(oc, MICROVM_MACHINE_PIC,
|
object_class_property_set_description(oc, MICROVM_MACHINE_PIC,
|
||||||
"Enable i8259 PIC", &error_abort);
|
"Enable i8259 PIC");
|
||||||
|
|
||||||
object_class_property_add(oc, MICROVM_MACHINE_PIT, "OnOffAuto",
|
object_class_property_add(oc, MICROVM_MACHINE_PIT, "OnOffAuto",
|
||||||
microvm_machine_get_pit,
|
microvm_machine_get_pit,
|
||||||
microvm_machine_set_pit,
|
microvm_machine_set_pit,
|
||||||
NULL, NULL, &error_abort);
|
NULL, NULL);
|
||||||
object_class_property_set_description(oc, MICROVM_MACHINE_PIT,
|
object_class_property_set_description(oc, MICROVM_MACHINE_PIT,
|
||||||
"Enable i8254 PIT", &error_abort);
|
"Enable i8254 PIT");
|
||||||
|
|
||||||
object_class_property_add(oc, MICROVM_MACHINE_RTC, "OnOffAuto",
|
object_class_property_add(oc, MICROVM_MACHINE_RTC, "OnOffAuto",
|
||||||
microvm_machine_get_rtc,
|
microvm_machine_get_rtc,
|
||||||
microvm_machine_set_rtc,
|
microvm_machine_set_rtc,
|
||||||
NULL, NULL, &error_abort);
|
NULL, NULL);
|
||||||
object_class_property_set_description(oc, MICROVM_MACHINE_RTC,
|
object_class_property_set_description(oc, MICROVM_MACHINE_RTC,
|
||||||
"Enable MC146818 RTC", &error_abort);
|
"Enable MC146818 RTC");
|
||||||
|
|
||||||
object_class_property_add_bool(oc, MICROVM_MACHINE_ISA_SERIAL,
|
object_class_property_add_bool(oc, MICROVM_MACHINE_ISA_SERIAL,
|
||||||
microvm_machine_get_isa_serial,
|
microvm_machine_get_isa_serial,
|
||||||
microvm_machine_set_isa_serial,
|
microvm_machine_set_isa_serial);
|
||||||
&error_abort);
|
|
||||||
object_class_property_set_description(oc, MICROVM_MACHINE_ISA_SERIAL,
|
object_class_property_set_description(oc, MICROVM_MACHINE_ISA_SERIAL,
|
||||||
"Set off to disable the instantiation an ISA serial port",
|
"Set off to disable the instantiation an ISA serial port");
|
||||||
&error_abort);
|
|
||||||
|
|
||||||
object_class_property_add_bool(oc, MICROVM_MACHINE_OPTION_ROMS,
|
object_class_property_add_bool(oc, MICROVM_MACHINE_OPTION_ROMS,
|
||||||
microvm_machine_get_option_roms,
|
microvm_machine_get_option_roms,
|
||||||
microvm_machine_set_option_roms,
|
microvm_machine_set_option_roms);
|
||||||
&error_abort);
|
|
||||||
object_class_property_set_description(oc, MICROVM_MACHINE_OPTION_ROMS,
|
object_class_property_set_description(oc, MICROVM_MACHINE_OPTION_ROMS,
|
||||||
"Set off to disable loading option ROMs", &error_abort);
|
"Set off to disable loading option ROMs");
|
||||||
|
|
||||||
object_class_property_add_bool(oc, MICROVM_MACHINE_AUTO_KERNEL_CMDLINE,
|
object_class_property_add_bool(oc, MICROVM_MACHINE_AUTO_KERNEL_CMDLINE,
|
||||||
microvm_machine_get_auto_kernel_cmdline,
|
microvm_machine_get_auto_kernel_cmdline,
|
||||||
microvm_machine_set_auto_kernel_cmdline,
|
microvm_machine_set_auto_kernel_cmdline);
|
||||||
&error_abort);
|
|
||||||
object_class_property_set_description(oc,
|
object_class_property_set_description(oc,
|
||||||
MICROVM_MACHINE_AUTO_KERNEL_CMDLINE,
|
MICROVM_MACHINE_AUTO_KERNEL_CMDLINE,
|
||||||
"Set off to disable adding virtio-mmio devices to the kernel cmdline",
|
"Set off to disable adding virtio-mmio devices to the kernel cmdline");
|
||||||
&error_abort);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo microvm_machine_info = {
|
static const TypeInfo microvm_machine_info = {
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue