qemu: make vdpa connect function more generic

qemuInterfaceVDPAConnect() was a helper function for connecting to the
vdpa device file. But in order to support other vdpa devices besides
network interfaces (e.g. vdpa block devices) make this function a bit
more generic.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Jonathon Jongsma
2023-05-30 15:33:46 -05:00
parent 6cf7dbeff8
commit 0ebb416d7e
6 changed files with 26 additions and 29 deletions

View File

@@ -18,8 +18,8 @@
#include <config.h>
#include "qemu/qemu_command.h"
#include "qemu/qemu_hotplug.h"
#include "qemu/qemu_interface.h"
#include "qemu/qemu_process.h"
#include "testutilsqemu.h"
#include "conf/domain_conf.h"
@@ -94,7 +94,7 @@ qemuProcessKillManagedPRDaemon(virDomainObj *vm G_GNUC_UNUSED)
}
int
qemuInterfaceVDPAConnect(virDomainNetDef *net G_GNUC_UNUSED)
qemuVDPAConnect(const char *devicepath G_GNUC_UNUSED)
{
/* need a valid fd or sendmsg won't work. Just open /dev/null */
return open("/dev/null", O_RDONLY);

View File

@@ -255,7 +255,7 @@ virNetDevBandwidthSetRootQDisc(const char *ifname G_GNUC_UNUSED,
int
qemuInterfaceVDPAConnect(virDomainNetDef *net G_GNUC_UNUSED)
qemuVDPAConnect(const char *devicepath G_GNUC_UNUSED)
{
if (fcntl(1732, F_GETFD) != -1)
abort();