Console/channel devices have their pty devices assigned when the emulator is
actually started. If time is spent in guest preparation, someone attempts
to open the console/channel, the libvirt crashes in virChrdevLockFilePath().
The patch attempts to fix the crash by adding a check before attempting to
open.
Signed-off-by: Shivaprasad G Bhat <sbhat@linux.vnet.ibm.com>
switch (source->type) {
case VIR_DOMAIN_CHR_TYPE_PTY:
path = source->data.file.path;
+ if (!path) {
+ virReportError(VIR_ERR_OPERATION_FAILED, "%s",
+ _("PTY device is not yet assigned"));
+ return -1;
+ }
break;
case VIR_DOMAIN_CHR_TYPE_UNIX:
path = source->data.nix.path;