mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-12 15:52:55 +00:00
Fix xenstore serial console path for HVM guests
The console path in xenstore is /local/domain/<id>/console/tty for PV guests (PV console) and /local/domain/<id>/serial/0/tty (serial console) for HVM guests. Similar to Xen's in-tree console client, read the correct path for PV vs HVM.
This commit is contained in:
parent
88ed9ec001
commit
beeea90a37
@ -1761,6 +1761,9 @@ xenDaemonDomainFetch(virConnectPtr conn,
|
|||||||
|
|
||||||
id = xenGetDomIdFromSxpr(root, priv->xendConfigVersion);
|
id = xenGetDomIdFromSxpr(root, priv->xendConfigVersion);
|
||||||
xenUnifiedLock(priv);
|
xenUnifiedLock(priv);
|
||||||
|
if (sexpr_lookup(root, "domain/image/hvm"))
|
||||||
|
tty = xenStoreDomainGetSerialConsolePath(conn, id);
|
||||||
|
else
|
||||||
tty = xenStoreDomainGetConsolePath(conn, id);
|
tty = xenStoreDomainGetConsolePath(conn, id);
|
||||||
vncport = xenStoreDomainGetVNCPort(conn, id);
|
vncport = xenStoreDomainGetVNCPort(conn, id);
|
||||||
xenUnifiedUnlock(priv);
|
xenUnifiedUnlock(priv);
|
||||||
|
@ -852,6 +852,25 @@ char * xenStoreDomainGetConsolePath(virConnectPtr conn, int domid) {
|
|||||||
return virDomainDoStoreQuery(conn, domid, "console/tty");
|
return virDomainDoStoreQuery(conn, domid, "console/tty");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* xenStoreDomainGetSerailConsolePath:
|
||||||
|
* @conn: the hypervisor connection
|
||||||
|
* @domid: id of the domain
|
||||||
|
*
|
||||||
|
* Return the path to the pseudo TTY on which the guest domain's
|
||||||
|
* serial console is attached.
|
||||||
|
*
|
||||||
|
* Returns the path to the serial console. It is the callers
|
||||||
|
* responsibilty to free() the return string. Returns NULL
|
||||||
|
* on error
|
||||||
|
*
|
||||||
|
* The caller must hold the lock on the privateData
|
||||||
|
* associated with the 'conn' parameter.
|
||||||
|
*/
|
||||||
|
char * xenStoreDomainGetSerialConsolePath(virConnectPtr conn, int domid) {
|
||||||
|
return virDomainDoStoreQuery(conn, domid, "serial/0/tty");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* xenStoreDomainGetNetworkID:
|
* xenStoreDomainGetNetworkID:
|
||||||
|
@ -45,6 +45,8 @@ int xenStoreDomainGetVNCPort(virConnectPtr conn,
|
|||||||
int domid);
|
int domid);
|
||||||
char * xenStoreDomainGetConsolePath(virConnectPtr conn,
|
char * xenStoreDomainGetConsolePath(virConnectPtr conn,
|
||||||
int domid);
|
int domid);
|
||||||
|
char * xenStoreDomainGetSerialConsolePath(virConnectPtr conn,
|
||||||
|
int domid);
|
||||||
char * xenStoreDomainGetNetworkID(virConnectPtr conn,
|
char * xenStoreDomainGetNetworkID(virConnectPtr conn,
|
||||||
int id,
|
int id,
|
||||||
const char *mac);
|
const char *mac);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user