qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-arm] [PATCH 12/16] qom/cpu: Add MemoryRegion property


From: Paolo Bonzini
Subject: Re: [Qemu-arm] [PATCH 12/16] qom/cpu: Add MemoryRegion property
Date: Mon, 9 Nov 2015 11:56:15 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0


On 05/11/2015 19:15, Peter Maydell wrote:
> +
> +    /* This is a softmmu CPU object, so create a property for it
> +     * so users can wire up its memory. (This can't go in qom/cpu.c
> +     * because that file is compiled only once for both user-mode
> +     * and system builds.) The default if no link is set up is to use
> +     * the system address space.
> +     */
> +    object_property_add_link(OBJECT(cpu), "memory", TYPE_MEMORY_REGION,
> +                             (Object **)&cpu->memory,
> +                             qdev_prop_allow_set_link_before_realize,
> +                             OBJ_PROP_LINK_UNREF_ON_RELEASE,
> +                             &error_abort);
> +    cpu->memory = system_memory;

You need object_ref(cpu->memory) here, because setting cpu->memory will
drop a reference from the previously-set value.

Paolo

>  #endif



reply via email to

[Prev in Thread] Current Thread [Next in Thread]