break;
case VIR_DOMAIN_NET_TYPE_VDPA:
- if ((vdpafd = qemuInterfaceVDPAConnect(net)) < 0)
+ if ((vdpafd = qemuVDPAConnect(net->data.vdpa.devicepath)) < 0)
return -1;
netpriv->vdpafd = qemuFDPassNew(net->info.alias, priv);
return g_steal_pointer(&data);
}
+
+
+/* qemuVDPAConnect:
+ * @devicepath: the path to the vdpa device
+ *
+ * returns: file descriptor of the vdpa device
+ */
+int
+qemuVDPAConnect(const char *devicepath)
+{
+ int fd;
+
+ if ((fd = open(devicepath, O_RDWR)) < 0) {
+ virReportSystemError(errno,
+ _("Unable to open '%1$s' for vdpa device"),
+ devicepath);
+ return -1;
+ }
+
+ return fd;
+}
const char * qemuAudioDriverTypeToString(virDomainAudioType type);
virDomainAudioType qemuAudioDriverTypeFromString(const char *str);
+int qemuVDPAConnect(const char *devicepath) G_NO_INLINE;
}
-/* qemuInterfaceVDPAConnect:
- * @net: pointer to the VM's interface description
- *
- * returns: file descriptor of the vdpa device
- *
- * Called *only* called if actualType is VIR_DOMAIN_NET_TYPE_VDPA
- */
-int
-qemuInterfaceVDPAConnect(virDomainNetDef *net)
-{
- int fd;
-
- if ((fd = open(net->data.vdpa.devicepath, O_RDWR)) < 0) {
- virReportSystemError(errno,
- _("Unable to open '%1$s' for vdpa device"),
- net->data.vdpa.devicepath);
- return -1;
- }
-
- return fd;
-}
-
-
/*
* Returns: -1 on error, 0 on success. Populates net->privateData->slirp if
* the slirp helper is needed.
int qemuInterfacePrepareSlirp(virQEMUDriver *driver,
virDomainNetDef *net);
-
-int qemuInterfaceVDPAConnect(virDomainNetDef *net) G_NO_INLINE;
#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"
}
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);
int
-qemuInterfaceVDPAConnect(virDomainNetDef *net G_GNUC_UNUSED)
+qemuVDPAConnect(const char *devicepath G_GNUC_UNUSED)
{
if (fcntl(1732, F_GETFD) != -1)
abort();