char *
qemuBuildNicDevStr(virDomainDef *def,
virDomainNetDef *net,
- unsigned int bootindex G_GNUC_UNUSED,
size_t vhostfdSize,
virQEMUCaps *qemuCaps)
{
char *
qemuBuildPCIHostdevDevStr(const virDomainDef *def,
virDomainHostdevDef *dev,
- unsigned int bootIndex G_GNUC_UNUSED,
virQEMUCaps *qemuCaps G_GNUC_UNUSED)
{
g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
static int
qemuBuildHostdevCommandLine(virCommand *cmd,
const virDomainDef *def,
- virQEMUCaps *qemuCaps,
- unsigned int *bootHostdevNet)
+ virQEMUCaps *qemuCaps)
{
size_t i;
virDomainHostdevSubsysMediatedDev *mdevsrc = &subsys->u.mdev;
g_autofree char *devstr = NULL;
g_autofree char *vhostfdName = NULL;
- unsigned int bootIndex = hostdev->info->bootIndex;
int vhostfd = -1;
if (hostdev->mode != VIR_DOMAIN_HOSTDEV_MODE_SUBSYS)
/* PCI */
case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI:
- /* bootNet will be non-0 if boot order was set and no other
- * net devices were encountered
- */
- if (hostdev->parentnet && bootIndex == 0) {
- bootIndex = *bootHostdevNet;
- *bootHostdevNet = 0;
- }
-
/* Ignore unassigned devices */
if (hostdev->info->type == VIR_DOMAIN_DEVICE_ADDRESS_TYPE_UNASSIGNED)
continue;
return -1;
virCommandAddArg(cmd, "-device");
- devstr = qemuBuildPCIHostdevDevStr(def, hostdev, bootIndex, qemuCaps);
+ devstr = qemuBuildPCIHostdevDevStr(def, hostdev, qemuCaps);
if (!devstr)
return -1;
virCommandAddArg(cmd, devstr);
virCommand *cmd,
virDomainNetDef *net,
virQEMUCaps *qemuCaps,
- unsigned int bootindex,
virNetDevVPortProfileOp vmop,
bool standalone,
size_t *nnicindexes,
size_t i;
g_autoptr(virJSONValue) hostnetprops = NULL;
-
- if (!bootindex)
- bootindex = net->info.bootIndex;
-
if (qemuDomainValidateActualNetDef(net, qemuCaps) < 0)
return -1;
if (qemuCommandAddExtDevice(cmd, &net->info) < 0)
goto cleanup;
- if (!(nic = qemuBuildNicDevStr(def, net, bootindex,
- net->driver.virtio.queues, qemuCaps)))
+ if (!(nic = qemuBuildNicDevStr(def, net, net->driver.virtio.queues, qemuCaps)))
goto cleanup;
virCommandAddArgList(cmd, "-device", nic, NULL);
} else if (!requireNicdev) {
virNetDevVPortProfileOp vmop,
bool standalone,
size_t *nnicindexes,
- int **nicindexes,
- unsigned int *bootHostdevNet)
+ int **nicindexes)
{
size_t i;
int last_good_net = -1;
virErrorPtr originalError = NULL;
virDomainDef *def = vm->def;
- if (def->nnets) {
- unsigned int bootNet = 0;
-
- /* convert <boot dev='network'/> to bootindex since we didn't emit -boot n */
- for (i = 0; i < def->os.nBootDevs; i++) {
- if (def->os.bootDevs[i] == VIR_DOMAIN_BOOT_NET) {
- bootNet = i + 1;
- break;
- }
- }
-
- for (i = 0; i < def->nnets; i++) {
- virDomainNetDef *net = def->nets[i];
+ for (i = 0; i < def->nnets; i++) {
+ virDomainNetDef *net = def->nets[i];
- if (qemuBuildInterfaceCommandLine(driver, vm, logManager, secManager, cmd, net,
- qemuCaps, bootNet, vmop,
- standalone, nnicindexes,
- nicindexes) < 0)
- goto error;
+ if (qemuBuildInterfaceCommandLine(driver, vm, logManager, secManager, cmd, net,
+ qemuCaps, vmop,
+ standalone, nnicindexes,
+ nicindexes) < 0)
+ goto error;
- last_good_net = i;
- /* if this interface is a type='hostdev' interface and we
- * haven't yet added a "bootindex" parameter to an
- * emulated network device, save the bootindex - hostdev
- * interface commandlines will be built later on when we
- * cycle through all the hostdevs, and we'll use it then.
- */
- if (virDomainNetGetActualType(net) == VIR_DOMAIN_NET_TYPE_HOSTDEV &&
- *bootHostdevNet == 0) {
- *bootHostdevNet = bootNet;
- }
- bootNet = 0;
- }
+ last_good_net = i;
}
return 0;
char uuid[VIR_UUID_STRING_BUFLEN];
g_autoptr(virCommand) cmd = NULL;
g_autoptr(virQEMUDriverConfig) cfg = virQEMUDriverGetConfig(driver);
- unsigned int bootHostdevNet = 0;
qemuDomainObjPrivate *priv = vm->privateData;
virDomainDef *def = vm->def;
virQEMUCaps *qemuCaps = priv->qemuCaps;
if (qemuBuildNetCommandLine(driver, vm, logManager, secManager, cmd,
qemuCaps, vmop, standalone,
- nnicindexes, nicindexes, &bootHostdevNet) < 0)
+ nnicindexes, nicindexes) < 0)
return NULL;
if (qemuBuildSmartcardCommandLine(logManager, secManager, cmd, cfg, def, qemuCaps,
chardevStdioLogd) < 0)
return NULL;
- if (qemuBuildHostdevCommandLine(cmd, def, qemuCaps, &bootHostdevNet) < 0)
+ if (qemuBuildHostdevCommandLine(cmd, def, qemuCaps) < 0)
return NULL;
if (migrateURI)