]> rtime.felk.cvut.cz Git - lisovros/qemu_apohw.git/commitdiff
qemu-char: Support suffixed ringbuf size arguments like "size=64K"
authorMarkus Armbruster <armbru@redhat.com>
Wed, 6 Feb 2013 20:27:25 +0000 (21:27 +0100)
committerAnthony Liguori <aliguori@us.ibm.com>
Wed, 6 Feb 2013 22:35:19 +0000 (16:35 -0600)
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
qemu-char.c

index 8a3540389a464fb1e6b85ebb1a9ba32cfbe39a5c..a3ba02127fe83bc1345253b8ba2e9d8588df80ee 100644 (file)
@@ -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 */ }
     },