- self._cmd += ['-netdev',
- 'tap,id=' + self._net1 + queue_str +
- ',script=no,downscript=no,' +
- 'ifname=tap' + if1 + ',vhost=on',
- '-device',
- 'virtio-net-pci,mac=' +
- S.getValue('GUEST_NET1_MAC')[self._number] +
- ',netdev=' + self._net1 +
- ',csum=off,gso=off,' +
- 'guest_tso4=off,guest_tso6=off,guest_ecn=off' +
- mq_vector_str,
- '-netdev',
- 'tap,id=' + self._net2 + queue_str +
- ',script=no,downscript=no,' +
- 'ifname=tap' + if2 + ',vhost=on',
- '-device',
- 'virtio-net-pci,mac=' +
- S.getValue('GUEST_NET2_MAC')[self._number] +
- ',netdev=' + self._net2 +
- ',csum=off,gso=off,' +
- 'guest_tso4=off,guest_tso6=off,guest_ecn=off' +
- mq_vector_str,
- ]
+ # setup requested number of interfaces
+ for nic in range(len(self._nics)):
+ index = start_index + nic
+ ifi = str(index)
+ self._cmd += ['-netdev', 'type=tap,id=' +
+ self._nics[nic]['device'] + queue_str +
+ ',script=no,downscript=no,' +
+ 'ifname=tap' + ifi + ',vhost=on',
+ '-device',
+ 'virtio-net-pci,mac=' +
+ self._nics[nic]['mac'] + ',netdev=' +
+ self._nics[nic]['device'] +
+ ',csum=off,gso=off,' +
+ 'guest_tso4=off,guest_tso6=off,guest_ecn=off' +
+ mq_vector_str,
+ ]