qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* Re: [Qemu-devel] [PATCH v2 1/2] spapr: Create SPAPRMachine struct
       [not found] ` <1401485072-14781-2-git-send-email-ehabkost@redhat.com>
@ 2014-06-02  7:21   ` Aneesh Kumar K.V
  0 siblings, 0 replies; 4+ messages in thread
From: Aneesh Kumar K.V @ 2014-06-02  7:21 UTC (permalink / raw)
  To: Eduardo Habkost, qemu-devel, Alexander Graf, qemu-ppc

Eduardo Habkost <ehabkost@redhat.com> writes:

> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

Tested-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>

> ---
>  hw/ppc/spapr.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 57e9578..30764aa 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -84,7 +84,20 @@
>  
>  #define HTAB_SIZE(spapr)        (1ULL << ((spapr)->htab_shift))
>  
> +
> +typedef struct SPAPRMachine SPAPRMachine;
>  #define TYPE_SPAPR_MACHINE      "spapr-machine"
> +#define SPAPR_MACHINE(obj) \
> +    OBJECT_CHECK(SPAPRMachine, (obj), TYPE_SPAPR_MACHINE)
> +
> +/**
> + * SPAPRMachine:
> + */
> +struct SPAPRMachine {
> +    /*< private >*/
> +    MachineState parent_obj;
> +};
> +
>  
>  sPAPREnvironment *spapr;
>  
> @@ -1498,6 +1511,7 @@ static void spapr_machine_class_init(ObjectClass *oc, void *data)
>  static const TypeInfo spapr_machine_info = {
>      .name          = TYPE_SPAPR_MACHINE,
>      .parent        = TYPE_MACHINE,
> +    .instance_size = sizeof(SPAPRMachine),
>      .class_init    = spapr_machine_class_init,
>      .interfaces = (InterfaceInfo[]) {
>          { TYPE_FW_PATH_PROVIDER },
> -- 
> 1.9.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH v2 2/2] spapr: Add kvm-type property
       [not found] ` <1401485072-14781-3-git-send-email-ehabkost@redhat.com>
@ 2014-06-02  7:21   ` Aneesh Kumar K.V
  0 siblings, 0 replies; 4+ messages in thread
From: Aneesh Kumar K.V @ 2014-06-02  7:21 UTC (permalink / raw)
  To: Eduardo Habkost, qemu-devel, Alexander Graf, qemu-ppc

Eduardo Habkost <ehabkost@redhat.com> writes:

> The kvm-type machine option was left out when MachineState was
> introduced, preventing the kvm-type option from being used. Add the
> missing property to the sPAPR machine class, so it can be used.
>
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>

Tested-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>

> ---
> Changes v1 -> v2:
>  * Add property only to the sPAPR machine class
>
> Tested in a x86 machine only. Help would be welcome to test it on a
> ppc64 machine supporting KVM.
>
> Before applying this patch:
>
>     $ qemu-system-ppc64 -machine pseries,accel=kvm,kvm-type=HV
>     qemu-system-ppc64: Property '.kvm-type' not found
>
> After applying this patch:
>
>     $ qemu-system-ppc64 -machine pseries,accel=kvm,kvm-type=HV
>     KVM not supported for this target
>     No accelerator found!
> ---
>  hw/ppc/spapr.c | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
>
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index 30764aa..82b1ca8 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -96,6 +96,9 @@ typedef struct SPAPRMachine SPAPRMachine;
>  struct SPAPRMachine {
>      /*< private >*/
>      MachineState parent_obj;
> +
> +    /*< public >*/
> +    char *kvm_type;
>  };
>  
>  
> @@ -1489,6 +1492,27 @@ static char *spapr_get_fw_dev_path(FWPathProvider *p, BusState *bus,
>      return NULL;
>  }
>  
> +static char *spapr_get_kvm_type(Object *obj, Error **errp)
> +{
> +    SPAPRMachine *sm = SPAPR_MACHINE(obj);
> +
> +    return g_strdup(sm->kvm_type);
> +}
> +
> +static void spapr_set_kvm_type(Object *obj, const char *value, Error **errp)
> +{
> +    SPAPRMachine *sm = SPAPR_MACHINE(obj);
> +
> +    g_free(sm->kvm_type);
> +    sm->kvm_type = g_strdup(value);
> +}
> +
> +static void spapr_machine_initfn(Object *obj)
> +{
> +    object_property_add_str(obj, "kvm-type",
> +                            spapr_get_kvm_type, spapr_set_kvm_type, NULL);
> +}
> +
>  static void spapr_machine_class_init(ObjectClass *oc, void *data)
>  {
>      MachineClass *mc = MACHINE_CLASS(oc);
> @@ -1512,6 +1536,7 @@ static const TypeInfo spapr_machine_info = {
>      .name          = TYPE_SPAPR_MACHINE,
>      .parent        = TYPE_MACHINE,
>      .instance_size = sizeof(SPAPRMachine),
> +    .instance_init = spapr_machine_initfn,
>      .class_init    = spapr_machine_class_init,
>      .interfaces = (InterfaceInfo[]) {
>          { TYPE_FW_PATH_PROVIDER },
> -- 
> 1.9.0

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH v2 0/2] Restore kvm-type option support on -machine pseries
       [not found] <1401485072-14781-1-git-send-email-ehabkost@redhat.com>
       [not found] ` <1401485072-14781-2-git-send-email-ehabkost@redhat.com>
       [not found] ` <1401485072-14781-3-git-send-email-ehabkost@redhat.com>
@ 2014-06-02  8:20 ` Alexander Graf
  2014-06-05 22:16 ` Alexander Graf
  3 siblings, 0 replies; 4+ messages in thread
From: Alexander Graf @ 2014-06-02  8:20 UTC (permalink / raw)
  To: Eduardo Habkost, qemu-devel, qemu-ppc
  Cc: Paolo Bonzini, Aneesh Kumar K.V, Andreas Färber,
	Marcel Apfelbaum


On 30.05.14 23:24, Eduardo Habkost wrote:
> Second try, now changing only the pseries machine code at hw/ppc/spapr.c.

Thanks for testing Aneesh. Which queue should this go through?


Alex

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH v2 0/2] Restore kvm-type option support on -machine pseries
       [not found] <1401485072-14781-1-git-send-email-ehabkost@redhat.com>
                   ` (2 preceding siblings ...)
  2014-06-02  8:20 ` [Qemu-devel] [PATCH v2 0/2] Restore kvm-type option support on -machine pseries Alexander Graf
@ 2014-06-05 22:16 ` Alexander Graf
  3 siblings, 0 replies; 4+ messages in thread
From: Alexander Graf @ 2014-06-05 22:16 UTC (permalink / raw)
  To: Eduardo Habkost, qemu-devel, qemu-ppc
  Cc: Paolo Bonzini, Aneesh Kumar K.V, Andreas Färber,
	Marcel Apfelbaum


On 30.05.14 23:24, Eduardo Habkost wrote:
> Second try, now changing only the pseries machine code at hw/ppc/spapr.c.

Thanks, applied to ppc-next.


Alex

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-06-05 22:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1401485072-14781-1-git-send-email-ehabkost@redhat.com>
     [not found] ` <1401485072-14781-2-git-send-email-ehabkost@redhat.com>
2014-06-02  7:21   ` [Qemu-devel] [PATCH v2 1/2] spapr: Create SPAPRMachine struct Aneesh Kumar K.V
     [not found] ` <1401485072-14781-3-git-send-email-ehabkost@redhat.com>
2014-06-02  7:21   ` [Qemu-devel] [PATCH v2 2/2] spapr: Add kvm-type property Aneesh Kumar K.V
2014-06-02  8:20 ` [Qemu-devel] [PATCH v2 0/2] Restore kvm-type option support on -machine pseries Alexander Graf
2014-06-05 22:16 ` Alexander Graf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).