mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +00:00
qemu: process: report useful error if alias formatting fails
When retrieving the paths for PTY devices the alias gets formatted into a static string. If it doesn't fit we wouldn't report an error.
This commit is contained in:
parent
507ea951c7
commit
6692ba731b
@ -1879,8 +1879,12 @@ qemuProcessLookupPTYs(virDomainDefPtr def,
|
||||
|
||||
if (snprintf(id, sizeof(id), "%s%s",
|
||||
chardevfmt ? "char" : "",
|
||||
chr->info.alias) >= sizeof(id))
|
||||
chr->info.alias) >= sizeof(id)) {
|
||||
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
|
||||
_("failed to format device alias "
|
||||
"for PTY retrieval"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
path = (const char *) virHashLookup(paths, id);
|
||||
if (path == NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user