mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
xen_console: support the new extended xenstore protocol
Since CS 21994 on xen-unstable.hg and CS 466608f3a32e1f9808acdf832a5843af37e5fcec on qemu-xen-unstable.git, few changes have been introduced to the PV console xenstore protocol, as described by the document docs/misc/console.txt under xen-unstable.hg. From the Qemu point of view, very few modifications are needed to correctly support the protocol: read from xenstore the "output" node that tell us what the output of the PV console is going to be. In case the output is a tty, write to xenstore the device name. Changes in v2: - fix error paths: free malloc'ed strings and close the xenstore connection before returning; - remove useless snprintf in xenstore_store_pv_console_info if i == 0. Changes in v3: - replace xs_daemon_open/xs_daemon_close with xs_open/xs_close. Changes in v4: - add a compatibility implementation of xs_open/xs_close. Changes in v5: - fix code style. [agraf] fix build error due to missing stub Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Signed-off-by: Alexander Graf <agraf@suse.de>
This commit is contained in:
parent
9fbe478444
commit
0f51726adc
5 changed files with 87 additions and 6 deletions
|
@ -179,8 +179,9 @@ static void xencons_send(struct XenConsole *con)
|
|||
static int con_init(struct XenDevice *xendev)
|
||||
{
|
||||
struct XenConsole *con = container_of(xendev, struct XenConsole, xendev);
|
||||
char *type, *dom;
|
||||
char *type, *dom, label[32];
|
||||
int ret = 0;
|
||||
const char *output;
|
||||
|
||||
/* setup */
|
||||
dom = xs_get_domain_path(xenstore, con->xendev.dom);
|
||||
|
@ -194,11 +195,14 @@ static int con_init(struct XenDevice *xendev)
|
|||
goto out;
|
||||
}
|
||||
|
||||
if (!serial_hds[con->xendev.dev])
|
||||
xen_be_printf(xendev, 1, "WARNING: serial line %d not configured\n",
|
||||
con->xendev.dev);
|
||||
else
|
||||
con->chr = serial_hds[con->xendev.dev];
|
||||
output = xenstore_read_str(con->console, "output");
|
||||
/* output is a pty by default */
|
||||
if (output == NULL) {
|
||||
output = "pty";
|
||||
}
|
||||
snprintf(label, sizeof(label), "xencons%d", con->xendev.dev);
|
||||
con->chr = qemu_chr_open(label, output, NULL);
|
||||
xenstore_store_pv_console_info(con->xendev.dev, con->chr);
|
||||
|
||||
out:
|
||||
qemu_free(type);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue