Revision fbe27e2b lib/hypervisor/hv_kvm.py

b/lib/hypervisor/hv_kvm.py
86 86
    constants.HV_SECURITY_DOMAIN: hv_base.NO_CHECK,
87 87
    constants.HV_KVM_FLAG:
88 88
      hv_base.ParamInSet(False, constants.HT_KVM_FLAG_VALUES),
89
    constants.HV_VHOST_NET: hv_base.NO_CHECK,
89 90
    }
90 91

  
91 92
  _MIGRATION_STATUS_RE = re.compile('Migration\s+status:\s+(\w+)',
......
611 612
      kvm_cmd.extend(["-runas", hvp[constants.HV_SECURITY_DOMAIN]])
612 613

  
613 614
    if not kvm_nics:
614
      kvm_cmd.extend(['-net', 'none'])
615
      kvm_cmd.extend(["-net", "none"])
615 616
    else:
617
      tap_extra = ""
616 618
      nic_type = hvparams[constants.HV_NIC_TYPE]
617 619
      if nic_type == constants.HT_NIC_PARAVIRTUAL:
618 620
        nic_model = "model=virtio"
621
        if hvparams[constants.HV_VHOST_NET]:
622
          tap_extra = ",vhost=on"
619 623
      else:
620 624
        nic_model = "model=%s" % nic_type
621 625

  
622 626
      for nic_seq, nic in enumerate(kvm_nics):
623 627
        nic_val = "nic,vlan=%s,macaddr=%s,%s" % (nic_seq, nic.mac, nic_model)
624 628
        script = self._WriteNetScript(instance, nic_seq, nic)
625
        kvm_cmd.extend(['-net', nic_val])
626
        kvm_cmd.extend(['-net', 'tap,vlan=%s,script=%s' % (nic_seq, script)])
629
        tap_val = "tap,vlan=%s,script=%s%s" % (nic_seq, script, tap_extra)
630
        kvm_cmd.extend(["-net", nic_val])
631
        kvm_cmd.extend(["-net", tap_val])
627 632
        temp_files.append(script)
628 633

  
629 634
    if incoming:

Also available in: Unified diff