On Fri, Nov 26, 2010 at 5:12 PM, Miguel Di Ciurcio Filho <[email protected]> wrote: > The current syntax when defining a NIC uses a pair of arguments, like this: > > -net tap,vlan=0 -net nic,vlan=0,model=virtio > > When using this pair, internally KVM will create a VLANState structure to send > ethernet frames between the guest NIC and the host tap device. This is > suboptimal and is going to be removed in the future. Plus, this combination > breaks vhost-net support. > > The new syntax does not need the vlan craziness anymore, creating a direct 1:1 > relationship between the backend device and the frontend device. > > -netdev tap,id=netdev0 -device > virtio-net-pci,mac=52:54:00:56:6c:55,netdev=netdev0 > > The current code does not verify if vhost_net is available before starting an > instance. All this tests are done verifying the KVM version installed on the > node. >
Oh, nice, I was just thinking about this patch today! > Signed-off-by: Miguel Di Ciurcio Filho <[email protected]> > --- > lib/hypervisor/hv_kvm.py | 29 ++++++++++++++++++++++------- > 1 files changed, 22 insertions(+), 7 deletions(-) > > diff --git a/lib/hypervisor/hv_kvm.py b/lib/hypervisor/hv_kvm.py > index 9816b35..942debb 100644 > --- a/lib/hypervisor/hv_kvm.py > +++ b/lib/hypervisor/hv_kvm.py > @@ -721,6 +721,7 @@ class KVMHypervisor(hv_base.BaseHypervisor): > > kvm_cmd, kvm_nics, up_hvp = kvm_runtime > up_hvp = objects.FillDict(conf_hvp, up_hvp) > + _, _, v_min, _ = self._GetKVMVersion() > > # We know it's safe to run as a different user upon migration, so we'll > use > # the latest conf, from conf_hvp. > @@ -737,19 +738,33 @@ class KVMHypervisor(hv_base.BaseHypervisor): > tap_extra = "" > nic_type = up_hvp[constants.HV_NIC_TYPE] > if nic_type == constants.HT_NIC_PARAVIRTUAL: > - nic_model = "model=virtio" > + # From version 0.12.0, kvm uses a new sintax for network > configuration. > + if int(v_min) >= 12: So when kvm releases 1.0.0 we start failing? No, we have to have a "complete" version check! :) For the rest, looks good! :) Thanks, Guido
