diff --git a/src/conf/virchrdev.c b/src/conf/virchrdev.c index 5f28f2978bf6deffa847ed2e51e07a1c959800a5..701b326fb26e77e978232de4cc42c04a73e749bb 100644 --- a/src/conf/virchrdev.c +++ b/src/conf/virchrdev.c @@ -350,6 +350,11 @@ int virChrdevOpen(virChrdevsPtr devs, 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;