feat(region,host): support multiqueues on vhost network (#14455)

Guest network add attribute num_queues, one is default.
And we can assign queues on guest create, eg:
server-create --net num-queues=4

Signed-off-by: wanyaoqi <d3lx.yq@gmail.com>

Co-authored-by: wanyaoqi <wanyaoqi@baidu.com>
This commit is contained in:
wanyaoqi
2022-06-14 02:38:09 +08:00
committed by GitHub
co-authored by wanyaoqi
parent 01399a698e
commit edeffed5fe
7 changed files with 44 additions and 5 deletions
+2
View File
@@ -242,6 +242,8 @@ func ParseNetworkConfig(desc string, idx int) (*compute.NetworkConfig, error) {
netConfig.StandbyAddrCount, _ = strconv.Atoi(p[len("standby-addr="):])
} else if utils.IsInStringArray(p, []string{"virtio", "e1000", "vmxnet3"}) {
netConfig.Driver = p
} else if strings.HasPrefix(p, "num-queues=") {
netConfig.NumQueues, _ = strconv.Atoi(p[len("num-queues="):])
} else if regutils.MatchSize(p) {
bw, err := fileutils.GetSizeMb(p, 'M', 1000)
if err != nil {