
On Thu, Dec 08, 2016 at 01:51:10PM +0100, Michal Privoznik wrote:
On 18.11.2016 23:51, Mehdi Abaakouk wrote:
From: Mehdi Abaakouk <sileht@redhat.com>
I don't think this is a good idea. For instance, for the following XML:
<interface type='vhostuser'> <mac address='52:54:00:ee:96:6b'/> <source type='unix' path='/tmp/vhost0.sock' mode='server'/> <model type='virtio'/> </interface>
this code would produce ifname of "vhost0.sock", which is obviously wrong. Moreover, tests are failing with this change. Not only that, for auto-filling values in XML we have so called post parse callbacks. Historically we put everything into XML parsing code and it ended up being this one big mess. So we worked hard to split it and although we are not there 100%, we are getting there slowly.
I agree I have proposed that to start a discussion, but I don't really like it. It work in my case because openvswitch vhostuser unix-socket path is hardcoded to /var/run/openvswitch/<ovs-interface-name>. But if you vhostuser unix-socket have been created outside openvswitch that obviously doesn't pick a good name, and it's even not really useful to set a default name. Perhaps should I move this logic to virnetdevopenvswitch.c. I means virNetDevOpenvswitchInterfaceStats() should take a look to the source path when the ifname is unset, WDT ?
vhostuser_path = NULL;
if (STREQ(vhostuser_mode, "server")) { @@ -9842,6 +9851,7 @@ virDomainNetDefParseXML(virDomainXMLOptionPtr xmlopt, VIR_FREE(localaddr); VIR_FREE(localport); virNWFilterHashTableFree(filterparams); + virStringFreeListCount(tokens, ntokens);
Ah, due to me not reviewing the patches early, this function was renamed in c2a5a4e7ea930.
return def;
Michal
-- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
-- Mehdi Abaakouk mail: sileht@sileht.net irc: sileht