Received: from eggs.gnu.org ([208.118.235.92]:44742) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SpdTu-0007Eb-Fn for qemu-devel@nongnu.org; Fri, 13 Jul 2012 06:52:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SpdTt-0007rA-9v for qemu-devel@nongnu.org; Fri, 13 Jul 2012 06:52:18 -0400 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:50417) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SpdTt-0007qw-18 for qemu-devel@nongnu.org; Fri, 13 Jul 2012 06:52:17 -0400 Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 13 Jul 2012 11:52:16 +0100 Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1707.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6DAqEDC2502716 for ; Fri, 13 Jul 2012 11:52:14 +0100 Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q6DAqBaD030215 for ; Fri, 13 Jul 2012 04:52:13 -0600 From: Christian Borntraeger Date: Fri, 13 Jul 2012 12:52:04 +0200 Message-Id: <1342176724-43776-7-git-send-email-borntraeger@de.ibm.com> In-Reply-To: <1342176724-43776-1-git-send-email-borntraeger@de.ibm.com> References: <1342176724-43776-1-git-send-email-borntraeger@de.ibm.com> Subject: [Qemu-devel] [PATCH 6/6] s390: make sclp ascii console the default List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: Cornelia Huck , Christian Borntraeger , Jens Freimann , Heinz Graalfs , qemu-devel This patch makes the sclp ascii default for S390. Signed-off-by: Christian Borntraeger --- hw/s390-virtio.c | 1 - vl.c | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/hw/s390-virtio.c b/hw/s390-virtio.c index 577fcee..ae53da2 100644 --- a/hw/s390-virtio.c +++ b/hw/s390-virtio.c @@ -342,7 +342,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 1329c30..42741e9 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 = "s390-sclp", .flag = &default_sclpcon }, }; static void res_free(void) @@ -1936,6 +1940,7 @@ struct device_config { DEV_VIRTCON, /* -virtioconsole */ DEV_DEBUGCON, /* -debugcon */ DEV_GDB, /* -gdb, -s */ + DEV_SCLPCON, /* sclp console */ } type; const char *cmdline; Location loc; @@ -2015,6 +2020,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) + return 0; + if (index == MAX_SCLP_CONSOLES) { + fprintf(stderr, "qemu: too many sclp consoles\n"); + 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"); @@ -3123,6 +3158,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())) { @@ -3304,6 +3340,8 @@ 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 { @@ -3491,6 +3529,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.10.5