qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Alexander Graf <agraf@suse.de>,
	Luiz Capitulino <lcapitulino@redhat.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	qemu-ppc@nongnu.org, Cornelia Huck <cornelia.huck@de.ibm.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH v7 2/4] s390x: Convert QEMUMachine to MachineClass
Date: Fri, 13 Jun 2014 13:44:23 +1000	[thread overview]
Message-ID: <539A7397.7050808@ozlabs.ru> (raw)
In-Reply-To: <1402630619-4408-3-git-send-email-aik@ozlabs.ru>

btw only this patche from the series got "[Qemu-devel]" in the subject line
and others did not, why? Lists of emails are almost the same, only Eric
Blake got kicked off (added him manually to this email cc:), is that
connected? :) Why is that subject thing happening? Thanks.



On 06/13/2014 01:36 PM, Alexey Kardashevskiy wrote:
> This converts s390-virtio and s390-ccw-virtio machines to QOM MachineClass.
> This brings ability to add interfaces to the machine classes. The first
> interface for addition will be NMI.
> 
> The patch is mechanical so no change in behavior is expected.
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
>  hw/s390x/s390-virtio-ccw.c | 43 +++++++++++++++++++++++++++----------------
>  hw/s390x/s390-virtio.c     | 44 +++++++++++++++++++++++++++-----------------
>  2 files changed, 54 insertions(+), 33 deletions(-)
> 
> diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
> index 42f5cec..05311b8 100644
> --- a/hw/s390x/s390-virtio-ccw.c
> +++ b/hw/s390x/s390-virtio-ccw.c
> @@ -18,6 +18,8 @@
>  #include "css.h"
>  #include "virtio-ccw.h"
>  
> +#define TYPE_S390_CCW_MACHINE               "s390-ccw-machine"
> +
>  void io_subsystem_reset(void)
>  {
>      DeviceState *css, *sclp, *flic;
> @@ -134,24 +136,33 @@ static void ccw_init(MachineState *machine)
>      s390_create_virtio_net(BUS(css_bus), "virtio-net-ccw");
>  }
>  
> -static QEMUMachine ccw_machine = {
> -    .name = "s390-ccw-virtio",
> -    .alias = "s390-ccw",
> -    .desc = "VirtIO-ccw based S390 machine",
> -    .init = ccw_init,
> -    .block_default_type = IF_VIRTIO,
> -    .no_cdrom = 1,
> -    .no_floppy = 1,
> -    .no_serial = 1,
> -    .no_parallel = 1,
> -    .no_sdcard = 1,
> -    .use_sclp = 1,
> -    .max_cpus = 255,
> +static void ccw_machine_class_init(ObjectClass *oc, void *data)
> +{
> +    MachineClass *mc = MACHINE_CLASS(oc);
> +
> +    mc->name = "s390-ccw-virtio";
> +    mc->alias = "s390-ccw";
> +    mc->desc = "VirtIO-ccw based S390 machine";
> +    mc->init = ccw_init;
> +    mc->block_default_type = IF_VIRTIO;
> +    mc->no_cdrom = 1;
> +    mc->no_floppy = 1;
> +    mc->no_serial = 1;
> +    mc->no_parallel = 1;
> +    mc->no_sdcard = 1;
> +    mc->use_sclp = 1,
> +    mc->max_cpus = 255;
> +}
> +
> +static const TypeInfo ccw_machine_info = {
> +    .name          = TYPE_S390_CCW_MACHINE,
> +    .parent        = TYPE_MACHINE,
> +    .class_init    = ccw_machine_class_init,
>  };
>  
> -static void ccw_machine_init(void)
> +static void ccw_machine_register_types(void)
>  {
> -    qemu_register_machine(&ccw_machine);
> +    type_register_static(&ccw_machine_info);
>  }
>  
> -machine_init(ccw_machine_init)
> +type_init(ccw_machine_register_types)
> diff --git a/hw/s390x/s390-virtio.c b/hw/s390x/s390-virtio.c
> index 93c7ace..f1e0dbc 100644
> --- a/hw/s390x/s390-virtio.c
> +++ b/hw/s390x/s390-virtio.c
> @@ -51,6 +51,7 @@
>  
>  #define MAX_BLK_DEVS                    10
>  #define ZIPL_FILENAME                   "s390-zipl.rom"
> +#define TYPE_S390_MACHINE               "s390-machine"
>  
>  static VirtIOS390Bus *s390_bus;
>  static S390CPU **ipi_states;
> @@ -279,25 +280,34 @@ static void s390_init(MachineState *machine)
>      s390_create_virtio_net((BusState *)s390_bus, "virtio-net-s390");
>  }
>  
> -static QEMUMachine s390_machine = {
> -    .name = "s390-virtio",
> -    .alias = "s390",
> -    .desc = "VirtIO based S390 machine",
> -    .init = s390_init,
> -    .block_default_type = IF_VIRTIO,
> -    .no_cdrom = 1,
> -    .no_floppy = 1,
> -    .no_serial = 1,
> -    .no_parallel = 1,
> -    .no_sdcard = 1,
> -    .use_virtcon = 1,
> -    .max_cpus = 255,
> -    .is_default = 1,
> +static void s390_machine_class_init(ObjectClass *oc, void *data)
> +{
> +    MachineClass *mc = MACHINE_CLASS(oc);
> +
> +    mc->name = "s390-virtio";
> +    mc->alias = "s390";
> +    mc->desc = "VirtIO based S390 machine";
> +    mc->init = s390_init;
> +    mc->block_default_type = IF_VIRTIO;
> +    mc->max_cpus = 255;
> +    mc->no_serial = 1;
> +    mc->no_parallel = 1;
> +    mc->use_virtcon = 1;
> +    mc->no_floppy = 1;
> +    mc->no_cdrom = 1;
> +    mc->no_sdcard = 1;
> +    mc->is_default = 1;
> +}
> +
> +static const TypeInfo s390_machine_info = {
> +    .name          = TYPE_S390_MACHINE,
> +    .parent        = TYPE_MACHINE,
> +    .class_init    = s390_machine_class_init,
>  };
>  
> -static void s390_machine_init(void)
> +static void s390_machine_register_types(void)
>  {
> -    qemu_register_machine(&s390_machine);
> +    type_register_static(&s390_machine_info);
>  }
>  
> -machine_init(s390_machine_init);
> +type_init(s390_machine_register_types)
> 


-- 
Alexey

  reply	other threads:[~2014-06-13  3:44 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-13  3:36 [Qemu-devel] [PATCH v7 0/4] cpus: Add generic "nmi" monitor command support Alexey Kardashevskiy
2014-06-13  3:36 ` [Qemu-devel] [PATCH v7 1/4] cpus: Define callback for QEMU "nmi" command Alexey Kardashevskiy
2014-07-03  6:41   ` [Qemu-devel] [Qemu-ppc] " Nikunj A Dadhania
2014-07-03 12:36     ` Eric Blake
2014-07-15 14:50   ` [Qemu-devel] " Eric Blake
2014-07-15 15:00     ` Peter Maydell
2014-06-13  3:36 ` [Qemu-devel] [PATCH v7 2/4] s390x: Convert QEMUMachine to MachineClass Alexey Kardashevskiy
2014-06-13  3:44   ` Alexey Kardashevskiy [this message]
2014-06-13 12:47     ` Eric Blake
2014-06-13  5:56   ` Cornelia Huck
2014-06-13  3:36 ` [Qemu-devel] [PATCH v7 3/4] s390x: Migrate to new NMI interface Alexey Kardashevskiy
2014-06-13  6:00   ` Cornelia Huck
2014-06-14  2:41     ` Alexey Kardashevskiy
2014-06-16  7:16       ` Cornelia Huck
2014-06-16  8:33         ` Alexey Kardashevskiy
2014-06-16  8:37           ` Alexander Graf
2014-06-23 13:32             ` Alexey Kardashevskiy
2014-07-03  4:59               ` Alexey Kardashevskiy
2014-07-03  7:11                 ` Markus Armbruster
2014-07-14  3:17                   ` Alexey Kardashevskiy
2014-07-14 20:29                     ` Paolo Bonzini
2014-07-15  5:47                       ` Cornelia Huck
2014-07-17  6:30                       ` Alexey Kardashevskiy
2014-08-20 10:20                         ` Alexey Kardashevskiy
2014-08-20 11:20                           ` Alexander Graf
2014-08-20 11:38                             ` Alexey Kardashevskiy
2014-08-20 12:05                               ` Alexander Graf
2014-08-20 12:11                                 ` Alexey Kardashevskiy
2014-08-20 12:12                                   ` Alexander Graf
2014-08-20 13:13                                     ` Paolo Bonzini
2014-06-13  3:36 ` [Qemu-devel] [PATCH v7 4/4] spapr: Add support for " Alexey Kardashevskiy
2014-06-13 10:50 ` [Qemu-devel] [PATCH v7 0/4] cpus: Add generic "nmi" monitor command support Alexander Graf
2014-06-16  8:57 ` [Qemu-devel] [PATCH v8] s390x: Migrate to new NMI interface Alexey Kardashevskiy
2014-06-16 10:56   ` Cornelia Huck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=539A7397.7050808@ozlabs.ru \
    --to=aik@ozlabs.ru \
    --cc=agraf@suse.de \
    --cc=borntraeger@de.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=lcapitulino@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).