提交 27143a44 编写于 作者: A Anthony Liguori

char: rename qemu_chr_open() -> qemu_chr_new()

Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 15f31519
...@@ -2764,7 +2764,7 @@ int gdbserver_start(const char *device) ...@@ -2764,7 +2764,7 @@ int gdbserver_start(const char *device)
sigaction(SIGINT, &act, NULL); sigaction(SIGINT, &act, NULL);
} }
#endif #endif
chr = qemu_chr_open("gdb", device, NULL); chr = qemu_chr_new("gdb", device, NULL);
if (!chr) if (!chr)
return -1; return -1;
......
...@@ -443,7 +443,7 @@ static MaltaFPGAState *malta_fpga_init(target_phys_addr_t base, qemu_irq uart_ir ...@@ -443,7 +443,7 @@ static MaltaFPGAState *malta_fpga_init(target_phys_addr_t base, qemu_irq uart_ir
/* 0xa00 is less than a page, so will still get the right offsets. */ /* 0xa00 is less than a page, so will still get the right offsets. */
cpu_register_physical_memory(base + 0xa00, 0x100000 - 0xa00, malta); cpu_register_physical_memory(base + 0xa00, 0x100000 - 0xa00, malta);
s->display = qemu_chr_open("fpga", "vc:320x200", malta_fpga_led_init); s->display = qemu_chr_new("fpga", "vc:320x200", malta_fpga_led_init);
#ifdef TARGET_WORDS_BIGENDIAN #ifdef TARGET_WORDS_BIGENDIAN
s->uart = serial_mm_init(base + 0x900, 3, uart_irq, 230400, uart_chr, 1, 1); s->uart = serial_mm_init(base + 0x900, 3, uart_irq, 230400, uart_chr, 1, 1);
...@@ -784,7 +784,7 @@ void mips_malta_init (ram_addr_t ram_size, ...@@ -784,7 +784,7 @@ void mips_malta_init (ram_addr_t ram_size,
if (!serial_hds[i]) { if (!serial_hds[i]) {
char label[32]; char label[32];
snprintf(label, sizeof(label), "serial%d", i); snprintf(label, sizeof(label), "serial%d", i);
serial_hds[i] = qemu_chr_open(label, "null", NULL); serial_hds[i] = qemu_chr_new(label, "null", NULL);
} }
} }
......
...@@ -782,7 +782,7 @@ static struct omap_sti_s *omap_sti_init(struct omap_target_agent_s *ta, ...@@ -782,7 +782,7 @@ static struct omap_sti_s *omap_sti_init(struct omap_target_agent_s *ta,
s->irq = irq; s->irq = irq;
omap_sti_reset(s); omap_sti_reset(s);
s->chr = chr ?: qemu_chr_open("null", "null", NULL); s->chr = chr ?: qemu_chr_new("null", "null", NULL);
iomemtype = l4_register_io_memory(omap_sti_readfn, iomemtype = l4_register_io_memory(omap_sti_readfn,
omap_sti_writefn, s); omap_sti_writefn, s);
......
...@@ -62,11 +62,11 @@ struct omap_uart_s *omap_uart_init(target_phys_addr_t base, ...@@ -62,11 +62,11 @@ struct omap_uart_s *omap_uart_init(target_phys_addr_t base,
s->irq = irq; s->irq = irq;
#ifdef TARGET_WORDS_BIGENDIAN #ifdef TARGET_WORDS_BIGENDIAN
s->serial = serial_mm_init(base, 2, irq, omap_clk_getrate(fclk)/16, s->serial = serial_mm_init(base, 2, irq, omap_clk_getrate(fclk)/16,
chr ?: qemu_chr_open(label, "null", NULL), 1, chr ?: qemu_chr_new(label, "null", NULL), 1,
1); 1);
#else #else
s->serial = serial_mm_init(base, 2, irq, omap_clk_getrate(fclk)/16, s->serial = serial_mm_init(base, 2, irq, omap_clk_getrate(fclk)/16,
chr ?: qemu_chr_open(label, "null", NULL), 1, chr ?: qemu_chr_new(label, "null", NULL), 1,
0); 0);
#endif #endif
return s; return s;
...@@ -185,12 +185,12 @@ void omap_uart_attach(struct omap_uart_s *s, CharDriverState *chr) ...@@ -185,12 +185,12 @@ void omap_uart_attach(struct omap_uart_s *s, CharDriverState *chr)
#ifdef TARGET_WORDS_BIGENDIAN #ifdef TARGET_WORDS_BIGENDIAN
s->serial = serial_mm_init(s->base, 2, s->irq, s->serial = serial_mm_init(s->base, 2, s->irq,
omap_clk_getrate(s->fclk) / 16, omap_clk_getrate(s->fclk) / 16,
chr ?: qemu_chr_open("null", "null", NULL), 1, chr ?: qemu_chr_new("null", "null", NULL), 1,
1); 1);
#else #else
s->serial = serial_mm_init(s->base, 2, s->irq, s->serial = serial_mm_init(s->base, 2, s->irq,
omap_clk_getrate(s->fclk) / 16, omap_clk_getrate(s->fclk) / 16,
chr ?: qemu_chr_open("null", "null", NULL), 1, chr ?: qemu_chr_new("null", "null", NULL), 1,
0); 0);
#endif #endif
} }
...@@ -538,7 +538,7 @@ static USBDevice *usb_serial_init(const char *filename) ...@@ -538,7 +538,7 @@ static USBDevice *usb_serial_init(const char *filename)
filename++; filename++;
snprintf(label, sizeof(label), "usbserial%d", index++); snprintf(label, sizeof(label), "usbserial%d", index++);
cdrv = qemu_chr_open(label, filename, NULL); cdrv = qemu_chr_new(label, filename, NULL);
if (!cdrv) if (!cdrv)
return NULL; return NULL;
...@@ -561,7 +561,7 @@ static USBDevice *usb_braille_init(const char *unused) ...@@ -561,7 +561,7 @@ static USBDevice *usb_braille_init(const char *unused)
USBDevice *dev; USBDevice *dev;
CharDriverState *cdrv; CharDriverState *cdrv;
cdrv = qemu_chr_open("braille", "braille", NULL); cdrv = qemu_chr_new("braille", "braille", NULL);
if (!cdrv) if (!cdrv)
return NULL; return NULL;
......
...@@ -202,7 +202,7 @@ static int con_init(struct XenDevice *xendev) ...@@ -202,7 +202,7 @@ static int con_init(struct XenDevice *xendev)
con->chr = serial_hds[con->xendev.dev]; con->chr = serial_hds[con->xendev.dev];
} else { } else {
snprintf(label, sizeof(label), "xencons%d", con->xendev.dev); snprintf(label, sizeof(label), "xencons%d", con->xendev.dev);
con->chr = qemu_chr_open(label, output, NULL); con->chr = qemu_chr_new(label, output, NULL);
} }
xenstore_store_pv_console_info(con->xendev.dev, con->chr); xenstore_store_pv_console_info(con->xendev.dev, con->chr);
......
...@@ -616,7 +616,7 @@ static int slirp_guestfwd(SlirpState *s, const char *config_str, ...@@ -616,7 +616,7 @@ static int slirp_guestfwd(SlirpState *s, const char *config_str,
fwd = g_malloc(sizeof(struct GuestFwd)); fwd = g_malloc(sizeof(struct GuestFwd));
snprintf(buf, sizeof(buf), "guestfwd.tcp.%d", port); snprintf(buf, sizeof(buf), "guestfwd.tcp.%d", port);
fwd->hd = qemu_chr_open(buf, p, NULL); fwd->hd = qemu_chr_new(buf, p, NULL);
if (!fwd->hd) { if (!fwd->hd) {
error_report("could not open guest forwarding device '%s'", buf); error_report("could not open guest forwarding device '%s'", buf);
g_free(fwd); g_free(fwd);
......
...@@ -2603,7 +2603,7 @@ CharDriverState *qemu_chr_open_opts(QemuOpts *opts, ...@@ -2603,7 +2603,7 @@ CharDriverState *qemu_chr_open_opts(QemuOpts *opts,
return chr; return chr;
} }
CharDriverState *qemu_chr_open(const char *label, const char *filename, void (*init)(struct CharDriverState *s)) CharDriverState *qemu_chr_new(const char *label, const char *filename, void (*init)(struct CharDriverState *s))
{ {
const char *p; const char *p;
CharDriverState *chr; CharDriverState *chr;
......
...@@ -80,7 +80,7 @@ struct CharDriverState { ...@@ -80,7 +80,7 @@ struct CharDriverState {
QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename); QemuOpts *qemu_chr_parse_compat(const char *label, const char *filename);
CharDriverState *qemu_chr_open_opts(QemuOpts *opts, CharDriverState *qemu_chr_open_opts(QemuOpts *opts,
void (*init)(struct CharDriverState *s)); void (*init)(struct CharDriverState *s));
CharDriverState *qemu_chr_open(const char *label, const char *filename, void (*init)(struct CharDriverState *s)); CharDriverState *qemu_chr_new(const char *label, const char *filename, void (*init)(struct CharDriverState *s));
void qemu_chr_fe_set_echo(struct CharDriverState *chr, bool echo); void qemu_chr_fe_set_echo(struct CharDriverState *chr, bool echo);
void qemu_chr_fe_open(struct CharDriverState *chr); void qemu_chr_fe_open(struct CharDriverState *chr);
void qemu_chr_fe_close(struct CharDriverState *chr); void qemu_chr_fe_close(struct CharDriverState *chr);
......
...@@ -1828,7 +1828,7 @@ static int serial_parse(const char *devname) ...@@ -1828,7 +1828,7 @@ static int serial_parse(const char *devname)
exit(1); exit(1);
} }
snprintf(label, sizeof(label), "serial%d", index); snprintf(label, sizeof(label), "serial%d", index);
serial_hds[index] = qemu_chr_open(label, devname, NULL); serial_hds[index] = qemu_chr_new(label, devname, NULL);
if (!serial_hds[index]) { if (!serial_hds[index]) {
fprintf(stderr, "qemu: could not open serial device '%s': %s\n", fprintf(stderr, "qemu: could not open serial device '%s': %s\n",
devname, strerror(errno)); devname, strerror(errno));
...@@ -1850,7 +1850,7 @@ static int parallel_parse(const char *devname) ...@@ -1850,7 +1850,7 @@ static int parallel_parse(const char *devname)
exit(1); exit(1);
} }
snprintf(label, sizeof(label), "parallel%d", index); snprintf(label, sizeof(label), "parallel%d", index);
parallel_hds[index] = qemu_chr_open(label, devname, NULL); parallel_hds[index] = qemu_chr_new(label, devname, NULL);
if (!parallel_hds[index]) { if (!parallel_hds[index]) {
fprintf(stderr, "qemu: could not open parallel device '%s': %s\n", fprintf(stderr, "qemu: could not open parallel device '%s': %s\n",
devname, strerror(errno)); devname, strerror(errno));
...@@ -1881,7 +1881,7 @@ static int virtcon_parse(const char *devname) ...@@ -1881,7 +1881,7 @@ static int virtcon_parse(const char *devname)
qemu_opt_set(dev_opts, "driver", "virtconsole"); qemu_opt_set(dev_opts, "driver", "virtconsole");
snprintf(label, sizeof(label), "virtcon%d", index); snprintf(label, sizeof(label), "virtcon%d", index);
virtcon_hds[index] = qemu_chr_open(label, devname, NULL); virtcon_hds[index] = qemu_chr_new(label, devname, NULL);
if (!virtcon_hds[index]) { if (!virtcon_hds[index]) {
fprintf(stderr, "qemu: could not open virtio console '%s': %s\n", fprintf(stderr, "qemu: could not open virtio console '%s': %s\n",
devname, strerror(errno)); devname, strerror(errno));
...@@ -1897,7 +1897,7 @@ static int debugcon_parse(const char *devname) ...@@ -1897,7 +1897,7 @@ static int debugcon_parse(const char *devname)
{ {
QemuOpts *opts; QemuOpts *opts;
if (!qemu_chr_open("debugcon", devname, NULL)) { if (!qemu_chr_new("debugcon", devname, NULL)) {
exit(1); exit(1);
} }
opts = qemu_opts_create(qemu_find_opts("device"), "debugcon", 1); opts = qemu_opts_create(qemu_find_opts("device"), "debugcon", 1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册