mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-30 01:43:23 +00:00
util: vhost user: support for bootindex
Problem Description: When we set boot order for a vhost-user network interface, we found the boot index doesn't work. Cause of the Problem: In the function qemuBuildVhostuserCommandLine(), it forcely set the arg bootindex of function qemuBuildNicDevStr() to 0. Thus, the bootindex parameter got missing. Solution: Trans the arg bootindex down. Signed-off-by: Gao Haifeng <gaohaifeng.gao@huawei.com> Signed-off-by: Zhang Bo <oscar.zhangbo@huawei.com>
This commit is contained in:
parent
c630b48006
commit
39ac323063
@ -7763,7 +7763,8 @@ static int
|
|||||||
qemuBuildVhostuserCommandLine(virCommandPtr cmd,
|
qemuBuildVhostuserCommandLine(virCommandPtr cmd,
|
||||||
virDomainDefPtr def,
|
virDomainDefPtr def,
|
||||||
virDomainNetDefPtr net,
|
virDomainNetDefPtr net,
|
||||||
virQEMUCapsPtr qemuCaps)
|
virQEMUCapsPtr qemuCaps,
|
||||||
|
int bootindex)
|
||||||
{
|
{
|
||||||
virBuffer chardev_buf = VIR_BUFFER_INITIALIZER;
|
virBuffer chardev_buf = VIR_BUFFER_INITIALIZER;
|
||||||
virBuffer netdev_buf = VIR_BUFFER_INITIALIZER;
|
virBuffer netdev_buf = VIR_BUFFER_INITIALIZER;
|
||||||
@ -7810,7 +7811,7 @@ qemuBuildVhostuserCommandLine(virCommandPtr cmd,
|
|||||||
virCommandAddArg(cmd, "-netdev");
|
virCommandAddArg(cmd, "-netdev");
|
||||||
virCommandAddArgBuffer(cmd, &netdev_buf);
|
virCommandAddArgBuffer(cmd, &netdev_buf);
|
||||||
|
|
||||||
if (!(nic = qemuBuildNicDevStr(def, net, -1, 0, 0, qemuCaps))) {
|
if (!(nic = qemuBuildNicDevStr(def, net, -1, bootindex, 0, qemuCaps))) {
|
||||||
virReportError(VIR_ERR_INTERNAL_ERROR,
|
virReportError(VIR_ERR_INTERNAL_ERROR,
|
||||||
"%s", _("Error generating NIC -device string"));
|
"%s", _("Error generating NIC -device string"));
|
||||||
goto error;
|
goto error;
|
||||||
@ -7855,8 +7856,12 @@ qemuBuildInterfaceCommandLine(virCommandPtr cmd,
|
|||||||
virNetDevBandwidthPtr actualBandwidth;
|
virNetDevBandwidthPtr actualBandwidth;
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|
||||||
|
|
||||||
|
if (!bootindex)
|
||||||
|
bootindex = net->info.bootIndex;
|
||||||
|
|
||||||
if (actualType == VIR_DOMAIN_NET_TYPE_VHOSTUSER)
|
if (actualType == VIR_DOMAIN_NET_TYPE_VHOSTUSER)
|
||||||
return qemuBuildVhostuserCommandLine(cmd, def, net, qemuCaps);
|
return qemuBuildVhostuserCommandLine(cmd, def, net, qemuCaps, bootindex);
|
||||||
|
|
||||||
if (actualType == VIR_DOMAIN_NET_TYPE_HOSTDEV) {
|
if (actualType == VIR_DOMAIN_NET_TYPE_HOSTDEV) {
|
||||||
/* NET_TYPE_HOSTDEV devices are really hostdev devices, so
|
/* NET_TYPE_HOSTDEV devices are really hostdev devices, so
|
||||||
@ -7865,9 +7870,6 @@ qemuBuildInterfaceCommandLine(virCommandPtr cmd,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!bootindex)
|
|
||||||
bootindex = net->info.bootIndex;
|
|
||||||
|
|
||||||
/* Currently nothing besides TAP devices supports multiqueue. */
|
/* Currently nothing besides TAP devices supports multiqueue. */
|
||||||
if (net->driver.virtio.queues > 0 &&
|
if (net->driver.virtio.queues > 0 &&
|
||||||
!(actualType == VIR_DOMAIN_NET_TYPE_NETWORK ||
|
!(actualType == VIR_DOMAIN_NET_TYPE_NETWORK ||
|
||||||
|
Loading…
Reference in New Issue
Block a user