unsigned int queues = net->driver.virtio.queues;
char *nic = NULL;
- if (!qemuDomainSupportsNetdev(def, qemuCaps, net)) {
+ if (!qemuDomainSupportsNicdev(def, net)) {
virReportError(VIR_ERR_INTERNAL_ERROR,
- "%s", _("Netdev support unavailable"));
+ "%s", _("Nicdev support unavailable"));
goto error;
}
/* Possible combinations:
*
* 1. Old way: -net nic,model=e1000,vlan=1 -net tap,vlan=1
- * 2. Semi-new: -device e1000,vlan=1 -net tap,vlan=1
- * 3. Best way: -netdev type=tap,id=netdev1 -device e1000,id=netdev1
+ * 2. New way: -netdev type=tap,id=netdev1 -device e1000,id=netdev1
*
- * NB, no support for -netdev without use of -device
+ * NB: The backend and frontend are reversed above
*/
- if (qemuDomainSupportsNetdev(def, qemuCaps, net)) {
+
+ if (qemuDomainSupportsNicdev(def, net)) {
if (!(host = qemuBuildHostNetStr(net, driver,
',', vlan,
tapfdName, tapfdSize,
vhostfdName, vhostfdSize)))
goto cleanup;
virCommandAddArgList(cmd, "-netdev", host, NULL);
- }
- if (qemuDomainSupportsNicdev(def, net)) {
+
if (!(nic = qemuBuildNicDevStr(def, net, vlan, bootindex,
vhostfdSize, qemuCaps)))
goto cleanup;
if (!(nic = qemuBuildNicStr(net, "nic,", vlan)))
goto cleanup;
virCommandAddArgList(cmd, "-net", nic, NULL);
- }
- if (!qemuDomainSupportsNetdev(def, qemuCaps, net)) {
+
if (!(host = qemuBuildHostNetStr(net, driver,
',', vlan,
tapfdName, tapfdSize,
virDomainNetDefPtr net = def->nets[i];
int vlan;
- /* VLANs are not used with -netdev, so don't record them */
- if (qemuDomainSupportsNetdev(def, qemuCaps, net))
+ /* VLANs are not used with -netdev and -device, so don't record them */
+ if (qemuDomainSupportsNicdev(def, net))
vlan = -1;
else
vlan = i;
return 0;
}
- /* If qemu doesn't support vhost-net mode (including the -netdev command
- * option), don't try to open the device.
+ /* If qemu doesn't support vhost-net mode (including the -netdev and
+ * -device command options), don't try to open the device.
*/
if (!(virQEMUCapsGet(qemuCaps, QEMU_CAPS_VHOST_NET) &&
- qemuDomainSupportsNetdev(def, qemuCaps, net))) {
+ qemuDomainSupportsNicdev(def, net))) {
if (net->driver.virtio.name == VIR_DOMAIN_NET_BACKEND_TYPE_VHOST) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
"%s", _("vhost-net is not supported with "