[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 15/17] accel: Create accel object when initia
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v2 15/17] accel: Create accel object when initializing machine |
Date: |
Fri, 26 Sep 2014 17:10:50 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 |
Il 29/08/2014 22:31, Eduardo Habkost ha scritto:
> Create an actual TYPE_ACCEL object when initializing a machine. This
> will allow accelerator classes to implement some initialization on
> instance_init, and to save state on the TYPE_ACCEL object.
>
> Signed-off-by: Eduardo Habkost <address@hidden>
> ---
> hw/core/accel.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/hw/core/accel.c b/hw/core/accel.c
> index 98fcf0d..66ee1fa 100644
> --- a/hw/core/accel.c
> +++ b/hw/core/accel.c
> @@ -60,11 +60,15 @@ static AccelClass *accel_find(const char *opt_name)
>
> static int accel_init_machine(AccelClass *acc, MachineState *ms)
> {
> + ObjectClass *oc = OBJECT_CLASS(acc);
> + const char *cname = object_class_get_name(oc);
> + AccelState *accel = ACCEL(object_new(cname));
> int ret;
> *(acc->allowed) = true;
> ret = acc->init_machine(ms);
> if (ret < 0) {
> *(acc->allowed) = false;
> + object_unref(OBJECT(accel));
> }
> return ret;
> }
>
Reviewed-by: Paolo Bonzini <address@hidden>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [PATCH v2 15/17] accel: Create accel object when initializing machine,
Paolo Bonzini <=