-
Notifications
You must be signed in to change notification settings - Fork 128
support xen-pv #543
support xen-pv #543
Conversation
hypervisor/xenpv/xenpv.go
Outdated
| }() | ||
| } | ||
|
|
||
| func (xc *XenPvContext) connectConsole(vmid string, domId xl.Domid) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could it be possible to merge it into vm_console.go?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can only add another unix socket to pass console data, seems like pv doesn't have direct way to get console from unix socket.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that adding ConnectConsole() io.Reader to the driver interface is a possible way to merge the code. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@laijs
Good point!
Commit two adds ConsoleReader to the driver interface, please check.
43faa09 to
3296e84
Compare
hypervisor/vm_console.go
Outdated
| ctx.Log(TRACE, "connected to %s", ctx.ConsoleSockName) | ||
|
|
||
| tc, err := telnet.NewConn(conn) | ||
| tc, err := telnet.NewConn(reader) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seams that the above code(L62-L69) should all be moved in to DCtx.ConsoleReader() (those who are using ctx.ConsoleSockName).
DCtx.ConsoleReader() for xenpv doesn't returns a telnet socket, you cannot use telnet.NewConn() for it.
Signed-off-by: Gao feng <omarapazanadi@gmail.com>
For the hypervisor whose console doesn't export as unix socket. Signed-off-by: Gao feng <omarapazanadi@gmail.com>
Signed-off-by: Gao feng <omarapazanadi@gmail.com>
|
@laijs |
|
hmm.... looks we need submit change request to official xenlight go binding in the future |
support xen-pv
Env:
xen: 4.9
qemu: 2.10.0
guest kernel: 4.12.4
Todo:
a: Use one xenlight library for xen pv and hvm.
b: use vm_console to handle pv domain console output (done)
c: fix some weird problems in some wrong case.
1, host dom name will be (null) and fail to create xenpv domain(fixed)
2,hyperd panic when fail to create xenpv domain (fixed)
3,hyperd hang (disappear after fix bug 2)
Signed-off-by: Gao feng omarapazanadi@gmail.com