]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Don't crash in qemuDomainOpenChannel()
authorMartin Kletzander <mkletzan@redhat.com>
Mon, 2 Mar 2015 14:42:41 +0000 (15:42 +0100)
committerMartin Kletzander <mkletzan@redhat.com>
Tue, 3 Mar 2015 08:26:59 +0000 (09:26 +0100)
commitb3ea0a8fb86a8024538c68ca1d43a2bbc0192a0f
treeb1ac3348c850027dedca815f220f3e67acf06a84
parent567bd0fa57025efe8eda8f39e48d957842e39d43
qemu: Don't crash in qemuDomainOpenChannel()

The problem here was that when opening a channel, we were checking
whether the channel given is alias (can't be NULL for running domain) or
it's name, which can be NULL (for example with spicevmc).  In case of
such domain qemuDomainOpenChannel() made the daemon crash.
STREQ_NULLABLE() is safe to use since the code in question is wrapped in
"if (name)" and is more readable, so use that instead of checking for
non-NULL "vm->def->channels[i]->target.name".

Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
src/qemu/qemu_driver.c