]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: ensure vhostuser FD is initialized to -1
authorDaniel P. Berrangé <berrange@redhat.com>
Fri, 27 Sep 2019 16:34:44 +0000 (17:34 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Mon, 30 Sep 2019 12:08:43 +0000 (13:08 +0100)
commit227925a2e52810ec9cacffdb194053fd5c07617b
tree3178120ecb0267383b2304631cd252470712a79d
parent7a46bd52023b7298cb065de13756f97e41bba482
qemu: ensure vhostuser FD is initialized to -1

The video private data was not initializing the vhostuser FD
causing us to attempt to close FD 0 many times over.

Fixes

  commit ca60ecfa8cc1bd85baf7137dd1864d5f00f019f0
  Author: Marc-André Lureau <marcandre.lureau@redhat.com>
  Date:   Mon Sep 23 14:44:36 2019 +0400

      qemu: add qemuDomainVideoPrivate

Since the test suite does not invoke qemuExtDevicesStart(), no
vhost_user_fd will be present when generating test XML. To deal
with this we can must a fake FD number. While the current XML
is using FD == 0, we pick a very interesting number that's unlikely
to be a real FD, so that we're more likely to see any mistakes
closing the invalid FD.

Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
src/qemu/qemu_domain.c
tests/qemuxml2argvdata/vhost-user-gpu-secondary.x86_64-latest.args
tests/qemuxml2argvdata/vhost-user-vga.x86_64-latest.args
tests/qemuxml2argvdata/virtio-options.args
tests/qemuxml2argvtest.c