mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-05 05:45:46 +00:00
* src/virsh.c docs/virsh.pod virsh.1: added a ttyconsole command,
this should fix bug #239687 Daniel
This commit is contained in:
parent
cf5000d9b0
commit
1d7164058c
@ -1,3 +1,8 @@
|
|||||||
|
Thu Jul 26 10:37:31 CEST 2007 Daniel Veillard <veillard@redhat.com>
|
||||||
|
|
||||||
|
* src/virsh.c docs/virsh.pod virsh.1: added a ttyconsole command,
|
||||||
|
this should fix bug #239687
|
||||||
|
|
||||||
Wed Jul 25 19:16:43 EST 2007 Daniel P. berrange <berrange@redhat.com>
|
Wed Jul 25 19:16:43 EST 2007 Daniel P. berrange <berrange@redhat.com>
|
||||||
|
|
||||||
* scripts/coverage-report.pl: Ignore data from inlined macros
|
* scripts/coverage-report.pl: Ignore data from inlined macros
|
||||||
|
@ -318,6 +318,11 @@ Moves a domain out of the suspended state. This will allow a previously
|
|||||||
suspended domain to now be eligible for scheduling by the the underlying
|
suspended domain to now be eligible for scheduling by the the underlying
|
||||||
hypervisor.
|
hypervisor.
|
||||||
|
|
||||||
|
=item B<ttyconsole> I<domain-id>
|
||||||
|
|
||||||
|
Output the device used for the TTY console of the domain. If the information
|
||||||
|
is not available the processus will provide an exit code of 1.
|
||||||
|
|
||||||
=item B<undefine> I<domain-id>
|
=item B<undefine> I<domain-id>
|
||||||
|
|
||||||
Undefine the configuration for an inactive domain. Since it's not running
|
Undefine the configuration for an inactive domain. Since it's not running
|
||||||
@ -335,7 +340,8 @@ and I<cpulist> is a comma separated list of physical CPU numbers.
|
|||||||
|
|
||||||
=item B<vncdisplay> I<domain-id>
|
=item B<vncdisplay> I<domain-id>
|
||||||
|
|
||||||
Output the IP address and port number for the VNC display.
|
Output the IP address and port number for the VNC display. If the information
|
||||||
|
is not available the processus will provide an exit code of 1.
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
|
64
src/virsh.c
64
src/virsh.c
@ -2739,6 +2739,69 @@ cmdVNCDisplay(vshControl * ctl, vshCmd * cmd)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* "ttyconsole" command
|
||||||
|
*/
|
||||||
|
static vshCmdInfo info_ttyconsole[] = {
|
||||||
|
{"syntax", "ttyconsole <domain>"},
|
||||||
|
{"help", gettext_noop("tty console")},
|
||||||
|
{"desc", gettext_noop("Output the device for the TTY console.")},
|
||||||
|
{NULL, NULL}
|
||||||
|
};
|
||||||
|
|
||||||
|
static vshCmdOptDef opts_ttyconsole[] = {
|
||||||
|
{"domain", VSH_OT_DATA, VSH_OFLAG_REQ, gettext_noop("domain name, id or uuid")},
|
||||||
|
{NULL, 0, 0, NULL}
|
||||||
|
};
|
||||||
|
|
||||||
|
static int
|
||||||
|
cmdTTYConsole(vshControl * ctl, vshCmd * cmd)
|
||||||
|
{
|
||||||
|
xmlDocPtr xml = NULL;
|
||||||
|
xmlXPathObjectPtr obj = NULL;
|
||||||
|
xmlXPathContextPtr ctxt = NULL;
|
||||||
|
virDomainPtr dom;
|
||||||
|
int ret = FALSE;
|
||||||
|
char *doc;
|
||||||
|
|
||||||
|
if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
if (!(dom = vshCommandOptDomain(ctl, cmd, "domain", NULL)))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
doc = virDomainGetXMLDesc(dom, 0);
|
||||||
|
if (!doc)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
|
xml = xmlReadDoc((const xmlChar *) doc, "domain.xml", NULL,
|
||||||
|
XML_PARSE_NOENT | XML_PARSE_NONET |
|
||||||
|
XML_PARSE_NOWARNING);
|
||||||
|
free(doc);
|
||||||
|
if (!xml)
|
||||||
|
goto cleanup;
|
||||||
|
ctxt = xmlXPathNewContext(xml);
|
||||||
|
if (!ctxt)
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
|
obj = xmlXPathEval(BAD_CAST "string(/domain/devices/console/@tty)", ctxt);
|
||||||
|
if ((obj == NULL) || (obj->type != XPATH_STRING) ||
|
||||||
|
(obj->stringval == NULL) || (obj->stringval[0] == 0)) {
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
vshPrint(ctl, "%s\n", (const char *)obj->stringval);
|
||||||
|
|
||||||
|
cleanup:
|
||||||
|
if (obj)
|
||||||
|
xmlXPathFreeObject(obj);
|
||||||
|
if (ctxt)
|
||||||
|
xmlXPathFreeContext(ctxt);
|
||||||
|
if (xml)
|
||||||
|
xmlFreeDoc(xml);
|
||||||
|
virDomainFree(dom);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* "attach-device" command
|
* "attach-device" command
|
||||||
*/
|
*/
|
||||||
@ -3428,6 +3491,7 @@ static vshCmdDef commands[] = {
|
|||||||
{"setmaxmem", cmdSetmaxmem, opts_setmaxmem, info_setmaxmem},
|
{"setmaxmem", cmdSetmaxmem, opts_setmaxmem, info_setmaxmem},
|
||||||
{"setvcpus", cmdSetvcpus, opts_setvcpus, info_setvcpus},
|
{"setvcpus", cmdSetvcpus, opts_setvcpus, info_setvcpus},
|
||||||
{"suspend", cmdSuspend, opts_suspend, info_suspend},
|
{"suspend", cmdSuspend, opts_suspend, info_suspend},
|
||||||
|
{"ttyconsole", cmdTTYConsole, opts_ttyconsole, info_ttyconsole},
|
||||||
{"undefine", cmdUndefine, opts_undefine, info_undefine},
|
{"undefine", cmdUndefine, opts_undefine, info_undefine},
|
||||||
{"uri", cmdURI, NULL, info_uri},
|
{"uri", cmdURI, NULL, info_uri},
|
||||||
{"vcpuinfo", cmdVcpuinfo, opts_vcpuinfo, info_vcpuinfo},
|
{"vcpuinfo", cmdVcpuinfo, opts_vcpuinfo, info_vcpuinfo},
|
||||||
|
9
virsh.1
9
virsh.1
@ -129,7 +129,7 @@
|
|||||||
.\" ========================================================================
|
.\" ========================================================================
|
||||||
.\"
|
.\"
|
||||||
.IX Title "VIRSH 1"
|
.IX Title "VIRSH 1"
|
||||||
.TH VIRSH 1 "2007-07-23" "perl v5.8.8" "Virtualization Support"
|
.TH VIRSH 1 "2007-07-26" "perl v5.8.8" "Virtualization Support"
|
||||||
.SH "NAME"
|
.SH "NAME"
|
||||||
virsh \- management user interface
|
virsh \- management user interface
|
||||||
.SH "SYNOPSIS"
|
.SH "SYNOPSIS"
|
||||||
@ -406,6 +406,10 @@ anymore.
|
|||||||
Moves a domain out of the suspended state. This will allow a previously
|
Moves a domain out of the suspended state. This will allow a previously
|
||||||
suspended domain to now be eligible for scheduling by the the underlying
|
suspended domain to now be eligible for scheduling by the the underlying
|
||||||
hypervisor.
|
hypervisor.
|
||||||
|
.IP "\fBttyconsole\fR \fIdomain-id\fR" 4
|
||||||
|
.IX Item "ttyconsole domain-id"
|
||||||
|
Output the device used for the \s-1TTY\s0 console of the domain. If the information
|
||||||
|
is not available the processus will provide an exit code of 1.
|
||||||
.IP "\fBundefine\fR \fIdomain-id\fR" 4
|
.IP "\fBundefine\fR \fIdomain-id\fR" 4
|
||||||
.IX Item "undefine domain-id"
|
.IX Item "undefine domain-id"
|
||||||
Undefine the configuration for an inactive domain. Since it's not running
|
Undefine the configuration for an inactive domain. Since it's not running
|
||||||
@ -420,7 +424,8 @@ Pin domain VCPUs to host physical CPUs. The \fIvcpu\fR number must be provided
|
|||||||
and \fIcpulist\fR is a comma separated list of physical \s-1CPU\s0 numbers.
|
and \fIcpulist\fR is a comma separated list of physical \s-1CPU\s0 numbers.
|
||||||
.IP "\fBvncdisplay\fR \fIdomain-id\fR" 4
|
.IP "\fBvncdisplay\fR \fIdomain-id\fR" 4
|
||||||
.IX Item "vncdisplay domain-id"
|
.IX Item "vncdisplay domain-id"
|
||||||
Output the \s-1IP\s0 address and port number for the \s-1VNC\s0 display.
|
Output the \s-1IP\s0 address and port number for the \s-1VNC\s0 display. If the information
|
||||||
|
is not available the processus will provide an exit code of 1.
|
||||||
.RE
|
.RE
|
||||||
.RS 4
|
.RS 4
|
||||||
.SH "DEVICES COMMANDS"
|
.SH "DEVICES COMMANDS"
|
||||||
|
Loading…
Reference in New Issue
Block a user