提交 de1cc36e 编写于 作者: M Markus Armbruster 提交者: Anthony Liguori

qemu-char: Support suffixed ringbuf size arguments like "size=64K"

Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 3949e594
...@@ -98,7 +98,6 @@ ...@@ -98,7 +98,6 @@
#include "ui/qemu-spice.h" #include "ui/qemu-spice.h"
#define READ_BUF_LEN 4096 #define READ_BUF_LEN 4096
#define CBUFF_SIZE 65536
/***********************************************************/ /***********************************************************/
/* character device */ /* character device */
...@@ -2709,9 +2708,9 @@ static CharDriverState *qemu_chr_open_ringbuf(QemuOpts *opts) ...@@ -2709,9 +2708,9 @@ static CharDriverState *qemu_chr_open_ringbuf(QemuOpts *opts)
chr = g_malloc0(sizeof(CharDriverState)); chr = g_malloc0(sizeof(CharDriverState));
d = g_malloc(sizeof(*d)); 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) { if (d->size == 0) {
d->size = CBUFF_SIZE; d->size = 65536;
} }
/* The size must be power of 2 */ /* The size must be power of 2 */
...@@ -3244,7 +3243,7 @@ QemuOptsList qemu_chardev_opts = { ...@@ -3244,7 +3243,7 @@ QemuOptsList qemu_chardev_opts = {
.type = QEMU_OPT_NUMBER, .type = QEMU_OPT_NUMBER,
},{ },{
.name = "size", .name = "size",
.type = QEMU_OPT_NUMBER, .type = QEMU_OPT_SIZE,
}, },
{ /* end of list */ } { /* end of list */ }
}, },
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册