const char *vhostfd_field = "S:vhostfd";
g_autofree char *vhostfd_arg = NULL;
bool vhost = false;
+ size_t nfds;
+ GSList *n;
+
+ if (netpriv->tapfds) {
+ nfds = 0;
+ for (n = netpriv->tapfds; n; n = n->next) {
+ virBufferAsprintf(&buf, "%s:", qemuFDPassGetPath(n->data));
+ nfds++;
+ }
- for (i = 0; i < tapfdSize; i++)
- virBufferAsprintf(&buf, "%s:", tapfd[i]);
+ if (nfds > 1)
+ tapfd_field = "s:fds";
+ } else {
+ for (i = 0; i < tapfdSize; i++)
+ virBufferAsprintf(&buf, "%s:", tapfd[i]);
- if (tapfdSize > 1)
- tapfd_field = "s:fds";
+ if (tapfdSize > 1)
+ tapfd_field = "s:fds";
+ }
virBufferTrim(&buf, ":");
tapfd_arg = virBufferContentAndReset(&buf);
- if (vhostfdSize > 0) {
+ if (netpriv->vhostfds) {
+ vhost = true;
+
+ nfds = 0;
+ for (n = netpriv->vhostfds; n; n = n->next) {
+ virBufferAsprintf(&buf, "%s:", qemuFDPassGetPath(n->data));
+ nfds++;
+ }
+
+ if (nfds > 1)
+ vhostfd_field = "s:vhostfds";
+ } else if (vhostfdSize > 0) {
vhost = true;
for (i = 0; i < vhostfdSize; i++)
size_t i;
g_autoptr(virJSONValue) hostnetprops = NULL;
qemuDomainNetworkPrivate *netpriv = QEMU_DOMAIN_NETWORK_PRIVATE(net);
+ GSList *n;
if (qemuDomainValidateActualNetDef(net, qemuCaps) < 0)
return -1;
vhostfd[i] = -1;
}
+ for (n = netpriv->tapfds; n; n = n->next) {
+ if (qemuFDPassTransferCommand(n->data, cmd) < 0)
+ return -1;
+ }
+
+ for (n = netpriv->vhostfds; n; n = n->next) {
+ if (qemuFDPassTransferCommand(n->data, cmd) < 0)
+ return -1;
+ }
+
if (qemuFDPassTransferCommand(netpriv->vdpafd, cmd) < 0)
return -1;
g_autoptr(virConnect) conn = NULL;
virErrorPtr save_err = NULL;
bool teardownlabel = false;
+ GSList *n;
/* If appropriate, grab a physical device from the configured
* network's pool of devices, or resolve bridge device name
qemuDomainObjEnterMonitor(driver, vm);
+ for (n = netpriv->tapfds; n; n = n->next) {
+ if (qemuFDPassTransferMonitor(n->data, priv->mon) < 0) {
+ qemuDomainObjExitMonitor(vm);
+ goto cleanup;
+ }
+ }
+
+ for (n = netpriv->vhostfds; n; n = n->next) {
+ if (qemuFDPassTransferMonitor(n->data, priv->mon) < 0) {
+ qemuDomainObjExitMonitor(vm);
+ goto cleanup;
+ }
+ }
+
if (qemuFDPassTransferMonitor(netpriv->vdpafd, priv->mon) < 0) {
qemuDomainObjExitMonitor(vm);
goto cleanup;
qemuMonitorRemoveNetdev(priv->mon, netdev_name) < 0)
VIR_WARN("Failed to remove network backend for netdev %s",
netdev_name);
+
+ for (n = netpriv->tapfds; n; n = n->next)
+ qemuFDPassTransferMonitorRollback(n->data, priv->mon);
+
+ for (n = netpriv->vhostfds; n; n = n->next)
+ qemuFDPassTransferMonitorRollback(n->data, priv->mon);
+
qemuDomainObjExitMonitor(vm);
virErrorRestore(&originalError);
goto cleanup;