Revision 37f88dc6 lib/hypervisor/hv_kvm.py
b/lib/hypervisor/hv_kvm.py | ||
---|---|---|
393 | 393 |
if not kvm_nics: |
394 | 394 |
kvm_cmd.extend(['-net', 'none']) |
395 | 395 |
else: |
396 |
nic_type = hvparams[constants.HV_NIC_TYPE] |
|
397 |
if nic_type == constants.HT_NIC_PARAVIRTUAL: |
|
398 |
nic_model = "model=virtio" |
|
399 |
else: |
|
400 |
nic_model = "model=%s" % nic_type |
|
401 |
|
|
396 | 402 |
for nic_seq, nic in enumerate(kvm_nics): |
397 |
nic_val = "nic,macaddr=%s,model=virtio" % nic.mac
|
|
403 |
nic_val = "nic,macaddr=%s,%s" % (nic.mac, nic_model)
|
|
398 | 404 |
script = self._WriteNetScript(instance, nic_seq, nic) |
399 | 405 |
kvm_cmd.extend(['-net', nic_val]) |
400 | 406 |
kvm_cmd.extend(['-net', 'tap,script=%s' % script]) |
Also available in: Unified diff