mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-01-11 05:17:59 +03:00
serialcon: Don't open a console with name=None
Can crash libvirt on f16, which is what happens when a user tries to open dom-0 console
This commit is contained in:
parent
006ba306f7
commit
ce94126b70
@ -183,11 +183,14 @@ class LibvirtConsoleConnection(ConsoleConnection):
|
||||
if self.stream:
|
||||
self.close()
|
||||
|
||||
self.stream = self.conn.vmm.newStream(libvirt.VIR_STREAM_NONBLOCK)
|
||||
|
||||
name = dev and dev.alias.name or None
|
||||
logging.debug("Opening console stream for dev=%s alias=%s",
|
||||
dev, name)
|
||||
if not name:
|
||||
raise RuntimeError(_("Cannot open a device with no alias name"))
|
||||
|
||||
self.stream = self.conn.vmm.newStream(libvirt.VIR_STREAM_NONBLOCK)
|
||||
|
||||
self.vm.open_console(name, self.stream)
|
||||
|
||||
self.stream.eventAddCallback((libvirt.VIR_STREAM_EVENT_READABLE |
|
||||
|
Loading…
Reference in New Issue
Block a user