Ok, seems that I might have found a bit better solution to this.
Actually libvirt uses term 'model', and in xml it is written as
<model type='e1000'/> or <model type='virtio'/> so it's
not really a
driver name reference.
So, the proper change could be using different param name for this kind
of matching.
<eth id="phy1" label="testnet">
<params>
<param name="libvirt_model" value="virtio"/>
</params>
</eth>
This way we would split driver matching for physical devices and libvirt
on-fly device attaching.
Should not be hard to implement.
Tell me your thoughts, please.
Thanks,
Jan
Fri, Apr 17, 2015 at 09:27:11AM CEST, jtluka(a)redhat.com wrote:
Yes this is definitely problem of libvirt! However I think this will
take really long time to get fixed in libvirt. The patch is not a big
deal IMO and can be removed when libvirt fixes this. Also it does not
change the prior behavior.
-Jan
Fri, Apr 17, 2015 at 08:08:36AM CEST, olichtne(a)redhat.com wrote:
>Isn't this a problem on libvirts side?
>
>I'm fine with applying this patch (maybe mark it as a workaround) but
>we should try to get this fixed in libvirt as well. What do you think?
>
>-Ondrej
>
>On Thu, Apr 16, 2015 at 06:34:20PM +0200, Jan Tluka wrote:
>> The proper driver name for virtio devices is virtio_net. However libvirt
>> does not accept it as value for model option therefore we have to treat
>> it internally.
>>
>> Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
>> ---
>> lnst/Controller/VirtUtils.py | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/lnst/Controller/VirtUtils.py b/lnst/Controller/VirtUtils.py
>> index 25a6f39..19deee3 100644
>> --- a/lnst/Controller/VirtUtils.py
>> +++ b/lnst/Controller/VirtUtils.py
>> @@ -90,6 +90,9 @@ class VirtDomainCtl:
>>
>> def attach_interface(self, hw_addr, net_name, driver="virtio"):
>> try:
>> + if driver == "virtio_net":
>> + driver = "virtio"
>> +
>> device_xml = self._net_device_template.format(hw_addr,
>> net_name,
>> driver)
>> --
>> 1.9.3
>>
>> _______________________________________________
>> LNST-developers mailing list
>> LNST-developers(a)lists.fedorahosted.org
>>
https://lists.fedorahosted.org/mailman/listinfo/lnst-developers
_______________________________________________
LNST-developers mailing list
LNST-developers(a)lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/lnst-developers