All of lore.kernel.org
 help / color / mirror / Atom feed
From: Blue Swirl <blauwirbel@gmail.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: qemu-devel <qemu-devel@nongnu.org>,
	Heinz Graalfs <graalfs@linux.vnet.ibm.com>,
	Alexander Graf <agraf@suse.de>,
	afaerber@suse.de, Jens Freimann <jfrei@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH 7/7] s390: make sclp ascii console the default
Date: Tue, 24 Jul 2012 19:35:34 +0000	[thread overview]
Message-ID: <CAAu8pHtMiJs-_RHSXX03DT4icYmZOij3GLP5jyi+mhj7fzyAYw@mail.gmail.com> (raw)
In-Reply-To: <1343115430-34285-8-git-send-email-borntraeger@de.ibm.com>

On Tue, Jul 24, 2012 at 7:37 AM, Christian Borntraeger
<borntraeger@de.ibm.com> wrote:
> This patch makes the sclp ascii default for S390.
>
> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
> ---
>  hw/s390-virtio.c |    1 -
>  vl.c             |   44 ++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 44 insertions(+), 1 deletions(-)
>
> diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c
> index 28e320d..8b48f66 100644
> --- a/hw/s390-virtio.c
> +++ b/hw/s390-virtio.c
> @@ -341,7 +341,6 @@ static QEMUMachine s390_machine = {
>      .no_serial = 1,
>      .no_parallel = 1,
>      .no_sdcard = 1,
> -    .use_virtcon = 1,
>      .max_cpus = 255,
>      .is_default = 1,
>  };
> diff --git a/vl.c b/vl.c
> index 46248b9..7197724 100644
> --- a/vl.c
> +++ b/vl.c
> @@ -168,6 +168,7 @@ int main(int argc, char **argv)
>  #define DEFAULT_RAM_SIZE 128
>
>  #define MAX_VIRTIO_CONSOLES 1
> +#define MAX_SCLP_CONSOLES   1
>
>  static const char *data_dir;
>  const char *bios_name = NULL;
> @@ -195,6 +196,7 @@ int no_quit = 0;
>  CharDriverState *serial_hds[MAX_SERIAL_PORTS];
>  CharDriverState *parallel_hds[MAX_PARALLEL_PORTS];
>  CharDriverState *virtcon_hds[MAX_VIRTIO_CONSOLES];
> +CharDriverState *sclpcon_hds[MAX_SCLP_CONSOLES];
>  int win2k_install_hack = 0;
>  int usb_enabled = 0;
>  int singlestep = 0;
> @@ -268,6 +270,7 @@ static int default_floppy = 1;
>  static int default_cdrom = 1;
>  static int default_sdcard = 1;
>  static int default_vga = 1;
> +static int default_sclpcon = 1;
>
>  static struct {
>      const char *driver;
> @@ -289,6 +292,7 @@ static struct {
>      { .driver = "isa-cirrus-vga",       .flag = &default_vga       },
>      { .driver = "vmware-svga",          .flag = &default_vga       },
>      { .driver = "qxl-vga",              .flag = &default_vga       },
> +    { .driver = "sclpconsole",          .flag = &default_sclpcon   },
>  };
>
>  static void res_free(void)
> @@ -1935,6 +1939,7 @@ struct device_config {
>          DEV_VIRTCON,   /* -virtioconsole */
>          DEV_DEBUGCON,  /* -debugcon */
>          DEV_GDB,       /* -gdb, -s */
> +        DEV_SCLPCON,   /* sclp console */
>      } type;
>      const char *cmdline;
>      Location loc;
> @@ -2014,6 +2019,36 @@ static int parallel_parse(const char *devname)
>      return 0;
>  }
>
> +static int sclpcon_parse(const char *devname)
> +{
> +    QemuOptsList *device = qemu_find_opts("device");
> +    static int index = 0;
> +    char label[32];
> +    QemuOpts *dev_opts;
> +
> +    if (strcmp(devname, "none") == 0)

Braces.

> +        return 0;
> +    if (index == MAX_SCLP_CONSOLES) {
> +        fprintf(stderr, "qemu: too many sclp consoles\n");

The user may wonder what is the max, you could tell that.

> +        exit(1);
> +    }
> +
> +    dev_opts = qemu_opts_create(device, NULL, 0, NULL);
> +    qemu_opt_set(dev_opts, "driver", "sclpconsole");
> +
> +    snprintf(label, sizeof(label), "sclpcon%d", index);
> +    sclpcon_hds[index] = qemu_chr_new(label, devname, NULL);
> +    if (!sclpcon_hds[index]) {
> +        fprintf(stderr, "qemu: could not open sclp console '%s': %s\n",
> +                devname, strerror(errno));
> +        return -1;
> +    }
> +    qemu_opt_set(dev_opts, "chardev", label);
> +
> +    index++;
> +    return 0;
> +}
> +
>  static int virtcon_parse(const char *devname)
>  {
>      QemuOptsList *device = qemu_find_opts("device");
> @@ -3122,6 +3157,7 @@ int main(int argc, char **argv, char **envp)
>                  default_cdrom = 0;
>                  default_sdcard = 0;
>                  default_vga = 0;
> +                default_sclpcon = 0;
>                  break;
>              case QEMU_OPTION_xen_domid:
>                  if (!(xen_available())) {
> @@ -3303,11 +3339,15 @@ int main(int argc, char **argv, char **envp)
>              add_device_config(DEV_PARALLEL, "null");
>          if (default_serial && default_monitor) {
>              add_device_config(DEV_SERIAL, "mon:stdio");
> +        } else if (default_sclpcon && default_monitor) {
> +            add_device_config(DEV_SCLPCON, "mon:stdio");
>          } else if (default_virtcon && default_monitor) {
>              add_device_config(DEV_VIRTCON, "mon:stdio");
>          } else {
>              if (default_serial)
>                  add_device_config(DEV_SERIAL, "stdio");
> +            if (default_sclpcon)

Braces, also below two times.

> +                add_device_config(DEV_SCLPCON, "stdio");
>              if (default_virtcon)
>                  add_device_config(DEV_VIRTCON, "stdio");
>              if (default_monitor)
> @@ -3320,6 +3360,8 @@ int main(int argc, char **argv, char **envp)
>              add_device_config(DEV_PARALLEL, "vc:80Cx24C");
>          if (default_monitor)
>              monitor_parse("vc:80Cx24C", "readline");
> +        if (default_sclpcon)
> +            add_device_config(DEV_SCLPCON, "vc:80Cx24C");
>          if (default_virtcon)
>              add_device_config(DEV_VIRTCON, "vc:80Cx24C");
>      }
> @@ -3490,6 +3532,8 @@ int main(int argc, char **argv, char **envp)
>          exit(1);
>      if (foreach_device_config(DEV_PARALLEL, parallel_parse) < 0)
>          exit(1);
> +    if (foreach_device_config(DEV_SCLPCON, sclpcon_parse) < 0)
> +        exit(1);
>      if (foreach_device_config(DEV_VIRTCON, virtcon_parse) < 0)
>          exit(1);
>      if (foreach_device_config(DEV_DEBUGCON, debugcon_parse) < 0)
> --
> 1.7.0.1
>

  reply	other threads:[~2012-07-24 19:35 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-24  7:37 [Qemu-devel] [PATCH 0/7v3] s390: sclp patch set Christian Borntraeger
2012-07-24  7:37 ` [Qemu-devel] [PATCH 1/7] s390: Fix error handling and condition code of service call Christian Borntraeger
2012-07-24  7:37 ` [Qemu-devel] [PATCH 2/7] s390: provide interface for service interrupt/introduce interrupt.c Christian Borntraeger
2012-07-24  7:37 ` [Qemu-devel] [PATCH 3/7] s390: sclp base support Christian Borntraeger
2012-07-30 12:38   ` Alexander Graf
2012-07-30 14:34     ` Christian Borntraeger
2012-08-20 12:15     ` Heinz Graalfs
2012-08-03 15:23   ` Andreas Färber
2012-07-24  7:37 ` [Qemu-devel] [PATCH 4/7] s390: sclp event support Christian Borntraeger
2012-07-30 13:24   ` Alexander Graf
2012-07-30 14:46     ` Christian Borntraeger
2012-07-30 14:57       ` Alexander Graf
2012-08-20 12:15     ` Heinz Graalfs
2012-07-31 12:59   ` Andreas Färber
2012-08-03 12:31     ` Christian Borntraeger
2012-08-20 12:14     ` Heinz Graalfs
2012-07-24  7:37 ` [Qemu-devel] [PATCH 5/7] s390: sclp signal quiesce support Christian Borntraeger
2012-07-24  7:37 ` [Qemu-devel] [PATCH 6/7] s390: sclp ascii console support Christian Borntraeger
2012-07-24 19:42   ` Blue Swirl
2012-07-26  8:55     ` [Qemu-devel] [PATCH v4 06/07] " Christian Borntraeger
2012-07-30 14:02       ` Alexander Graf
2012-07-31 13:05         ` Christian Borntraeger
2012-07-24  7:37 ` [Qemu-devel] [PATCH 7/7] s390: make sclp ascii console the default Christian Borntraeger
2012-07-24 19:35   ` Blue Swirl [this message]
2012-07-25  6:55     ` Christian Borntraeger
2012-07-26 13:48       ` Andreas Färber
2012-07-26  8:59     ` [Qemu-devel] [PATCH v4 07/07] " Christian Borntraeger
2012-07-30 14:05       ` Alexander Graf
2012-07-31 12:44         ` Christian Borntraeger
2012-07-31 12:52           ` Alexander Graf
2012-07-26  9:11     ` Christian Borntraeger
2012-07-30  9:00 ` [Qemu-devel] [PATCH 0/7v3] s390: sclp patch set Christian Borntraeger
2012-07-30 14:11   ` Alexander Graf

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=CAAu8pHtMiJs-_RHSXX03DT4icYmZOij3GLP5jyi+mhj7fzyAYw@mail.gmail.com \
    --to=blauwirbel@gmail.com \
    --cc=afaerber@suse.de \
    --cc=agraf@suse.de \
    --cc=borntraeger@de.ibm.com \
    --cc=graalfs@linux.vnet.ibm.com \
    --cc=jfrei@linux.vnet.ibm.com \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.