Due to QEMU moving towards a QMP configuration mechanism and away from
config file support, the LXD team are currently in the process of migrating
to using QMP to add devices to VMs (so that we can support the use of QEMU
6.0).

Currently we are using the `-S` flag to freeze CPU at startup, then using
QMP to add NIC devices via the `device_add` command, and then using the
`cont` command to start the VM guest.

This is working mostly fine, but there is one issue; the provided
"bootindex" property is not respected.

E.g.

device_add
{"addr":"00.0","bootindex":"0","bus":"qemu_pcie4","driver":"virtio-net-pci","id":"dev-lxd_eth0","mac":"00:16:3e:0c:69:e7","mq":"on","multifunction":"off","netdev":"lxd_eth0","vectors":"6"}

The device is seen within the VM guest and the VM BIOS, but its boot order
is last rather than first.

We've also tried using a non-zero bootindex of 1 and that has the same
effect.

After discussions on #qemu IRC channel, we found that running
`system_reset` after adding the devices allowed the `bootindex` property to
be respected.

So this looks like bug. Perhaps we can discuss it in one of the forthcoming
community calls?

Thanks
Tom Parrott

Reply via email to