[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 13/17] accel: Rename 'init' method to 'init_m
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH v2 13/17] accel: Rename 'init' method to 'init_machine' |
Date: |
Fri, 26 Sep 2014 17:09:06 +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:
> This makes explicit the fact that the method is for machine
> initialization, not just for accelerator object initialization.
No, it is not for machine initialization. It just picks defaults if
necessary from the passed machine class.
So I don't think this patch is needed.
Paolo
> Signed-off-by: Eduardo Habkost <address@hidden>
> ---
> hw/core/accel.c | 8 ++++----
> include/hw/accel.h | 2 +-
> kvm-all.c | 2 +-
> qtest.c | 2 +-
> xen-common.c | 2 +-
> 5 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/hw/core/accel.c b/hw/core/accel.c
> index 5817c3c..55378f3 100644
> --- a/hw/core/accel.c
> +++ b/hw/core/accel.c
> @@ -57,11 +57,11 @@ static AccelClass *accel_find(const char *opt_name)
> return ac;
> }
>
> -static int accel_init(AccelClass *acc, MachineClass *mc)
> +static int accel_init_machine(AccelClass *acc, MachineClass *mc)
> {
> int ret;
> *(acc->allowed) = true;
> - ret = acc->init(mc);
> + ret = acc->init_machine(mc);
> if (ret < 0) {
> *(acc->allowed) = false;
> }
> @@ -98,7 +98,7 @@ int configure_accelerator(MachineClass *mc)
> acc->name);
> continue;
> }
> - ret = accel_init(acc, mc);
> + ret = accel_init_machine(acc, mc);
> if (ret < 0) {
> init_failed = true;
> fprintf(stderr, "failed to initialize %s: %s\n",
> @@ -128,7 +128,7 @@ static void tcg_accel_class_init(ObjectClass *oc, void
> *data)
> {
> AccelClass *ac = ACCEL_CLASS(oc);
> ac->name = "tcg";
> - ac->init = tcg_init;
> + ac->init_machine = tcg_init;
> ac->allowed = &tcg_allowed;
> }
>
> diff --git a/include/hw/accel.h b/include/hw/accel.h
> index 120ca0e..8812cda 100644
> --- a/include/hw/accel.h
> +++ b/include/hw/accel.h
> @@ -39,7 +39,7 @@ typedef struct AccelClass {
> const char *opt_name;
> const char *name;
> int (*available)(void);
> - int (*init)(MachineClass *mc);
> + int (*init_machine)(MachineClass *mc);
> bool *allowed;
> } AccelClass;
>
> diff --git a/kvm-all.c b/kvm-all.c
> index 7db966e..dd03dc4 100644
> --- a/kvm-all.c
> +++ b/kvm-all.c
> @@ -2221,7 +2221,7 @@ static void kvm_accel_class_init(ObjectClass *oc, void
> *data)
> {
> AccelClass *ac = ACCEL_CLASS(oc);
> ac->name = "KVM";
> - ac->init = kvm_init;
> + ac->init_machine = kvm_init;
> ac->allowed = &kvm_allowed;
> }
>
> diff --git a/qtest.c b/qtest.c
> index 829128e..4051868 100644
> --- a/qtest.c
> +++ b/qtest.c
> @@ -564,7 +564,7 @@ static void qtest_accel_class_init(ObjectClass *oc, void
> *data)
> AccelClass *ac = ACCEL_CLASS(oc);
> ac->name = "QTest";
> ac->available = qtest_available;
> - ac->init = qtest_init_accel;
> + ac->init_machine = qtest_init_accel;
> ac->allowed = &qtest_allowed;
> }
>
> diff --git a/xen-common.c b/xen-common.c
> index f0b34be..246d76b 100644
> --- a/xen-common.c
> +++ b/xen-common.c
> @@ -126,7 +126,7 @@ static void xen_accel_class_init(ObjectClass *oc, void
> *data)
> {
> AccelClass *ac = ACCEL_CLASS(oc);
> ac->name = "Xen";
> - ac->init = xen_init;
> + ac->init_machine = xen_init;
> ac->allowed = &xen_allowed;
> }
>
>
- Re: [Qemu-devel] [PATCH v2 13/17] accel: Rename 'init' method to 'init_machine',
Paolo Bonzini <=