[libvirt] [PATCH 11/19] util: new functions virNetDev(Save|Read|Set)NetConfig()

Laine Stump laine at laine.org
Fri Mar 24 04:52:02 UTC 2017


On 03/21/2017 07:21 AM, Michal Privoznik wrote:
> On 03/17/2017 03:40 PM, Michal Privoznik wrote:
>>
>> As discussed on IRC, I can write the code to save/parse the JSON here.
>> You've done your part. However, I'm not sure I will manage to make it
>> happen today, but maybe beginning of the next week if that is okay with
>> you.
> 
> And as promised, here's my code:
> 
> https://github.com/zippy2/libvirt/commit/4e0538298f91ce62153a9e11f9eb6b198f318864

Thanks for doing that. Made it *much* easier to pick out which were the
useful functions and how to use them. I modified what you did a bit and
squashed it into this patch. (I made the file reader able to read both
the old and new version of the file, for those cases where a libvirt
upgrade is done while a domain is active).

Since you had ACKed everything in the series except this one, I pushed 1
- 10 (after making the changes you suggested) and am reposting the
remainder of the series starting with this one (only for completeness in
case you want to test it yourself - I've only made the minor changes you
suggested to the other patches (and I have tested the scenarios I can
think of and it's doing the right thing).

> Caution: I haven't tested it and frankly found it quite difficult to get
> right. The parsing that was there too big for my small brain. So perhaps
> in the parser I've exchanged adminMAC and MAC? You'll see when you test it.

Yep, you did swap them, but that's fine. It's easy to understand why you
would swap them. There are some cases where line 1 of the file would be
the adminMAC, and some cases where it would be MAC (for backward
compatibility with hostdev and macvtap vf and non-vf). Now that it's
JSON, that confusion is a thing of the past. I'm glad you insisted on
fixing this now rather than continuing to propagate it :-)




More information about the libvir-list mailing list