diff options
author | Markus Armbruster <armbru@redhat.com> | 2013-02-06 21:27:25 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-02-06 16:35:19 -0600 |
commit | de1cc36e1039faf65b1739d28bef9f2a4e230eb6 (patch) | |
tree | 7c2a76c027f83be9119742462941122df8f4fe86 /qemu-char.c | |
parent | 3949e59414fccefadc50ae65650d676cc734048c (diff) | |
download | qemu-de1cc36e1039faf65b1739d28bef9f2a4e230eb6.zip qemu-de1cc36e1039faf65b1739d28bef9f2a4e230eb6.tar.gz qemu-de1cc36e1039faf65b1739d28bef9f2a4e230eb6.tar.bz2 |
qemu-char: Support suffixed ringbuf size arguments like "size=64K"
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'qemu-char.c')
-rw-r--r-- | qemu-char.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/qemu-char.c b/qemu-char.c index 8a35403..a3ba021 100644 --- a/qemu-char.c +++ b/qemu-char.c @@ -98,7 +98,6 @@ #include "ui/qemu-spice.h" #define READ_BUF_LEN 4096 -#define CBUFF_SIZE 65536 /***********************************************************/ /* character device */ @@ -2709,9 +2708,9 @@ static CharDriverState *qemu_chr_open_ringbuf(QemuOpts *opts) chr = g_malloc0(sizeof(CharDriverState)); d = g_malloc(sizeof(*d)); - d->size = qemu_opt_get_number(opts, "size", 0); + d->size = qemu_opt_get_size(opts, "size", 0); if (d->size == 0) { - d->size = CBUFF_SIZE; + d->size = 65536; } /* The size must be power of 2 */ @@ -3244,7 +3243,7 @@ QemuOptsList qemu_chardev_opts = { .type = QEMU_OPT_NUMBER, },{ .name = "size", - .type = QEMU_OPT_NUMBER, + .type = QEMU_OPT_SIZE, }, { /* end of list */ } }, |