summaryrefslogtreecommitdiffstats
path: root/hw/ppc
diff options
context:
space:
mode:
authorFam Zheng2017-07-14 04:15:09 +0200
committerPaolo Bonzini2017-07-14 12:04:43 +0200
commit68c761e19c2ea453f880dbbd04e867d34d1468b8 (patch)
treecd04c148479df6bbe23849f275a6edfd4587316a /hw/ppc
parentcpu: Convert to DEFINE_PROP_LINK (diff)
downloadqemu-68c761e19c2ea453f880dbbd04e867d34d1468b8.tar.gz
qemu-68c761e19c2ea453f880dbbd04e867d34d1468b8.tar.xz
qemu-68c761e19c2ea453f880dbbd04e867d34d1468b8.zip
spapr_rng: Convert to DEFINE_PROP_LINK
Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <20170714021509.23681-21-famz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw/ppc')
-rw-r--r--hw/ppc/spapr_rng.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/hw/ppc/spapr_rng.c b/hw/ppc/spapr_rng.c
index 80515eb54d..d2acd61a15 100644
--- a/hw/ppc/spapr_rng.c
+++ b/hw/ppc/spapr_rng.c
@@ -96,17 +96,11 @@ static target_ulong h_random(PowerPCCPU *cpu, sPAPRMachineState *spapr,
static void spapr_rng_instance_init(Object *obj)
{
- sPAPRRngState *rngstate = SPAPR_RNG(obj);
-
if (object_resolve_path_type("", TYPE_SPAPR_RNG, NULL) != NULL) {
error_report("spapr-rng can not be instantiated twice!");
return;
}
- object_property_add_link(obj, "rng", TYPE_RNG_BACKEND,
- (Object **)&rngstate->backend,
- object_property_allow_set_link,
- OBJ_PROP_LINK_UNREF_ON_RELEASE, NULL);
object_property_set_description(obj, "rng",
"ID of the random number generator backend",
NULL);
@@ -163,6 +157,8 @@ int spapr_rng_populate_dt(void *fdt)
static Property spapr_rng_properties[] = {
DEFINE_PROP_BOOL("use-kvm", sPAPRRngState, use_kvm, false),
+ DEFINE_PROP_LINK("rng", sPAPRRngState, backend, TYPE_RNG_BACKEND,
+ RngBackend *),
DEFINE_PROP_END_OF_LIST(),
};