]> 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)
committerCole Robinson <crobinso@redhat.com>
Tue, 28 Apr 2015 15:06:37 +0000 (11:06 -0400)
commit5b3d68730d86fbb9a6866b43681b914884a5e31c
treeb817a70775b9fca9dc8ea2a8605b91d29e342166
parent67ca910eec689a4b85c2159937cc3f5adb3d6137
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>
(cherry picked from commit b3ea0a8fb86a8024538c68ca1d43a2bbc0192a0f)
src/qemu/qemu_driver.c