<div dir="ltr"><br><br><br>> > So, qemu-ga doesn't understand that there can't be more than one<br>> > device with same MAC addr. So, I think we are left with the following<br>> > options:<br>><br>
> Actually that's wrong. You *can* have 2 completely different physical<br>> NICs with the same MAC address.<br>><br>> > (i) Modify qemu-guest-agent to return addresses belonging to same<br>> > MAC address grouped under one interface only.<br>
><br>> You would not want to group based on MAC address - you explicitly just<br>> want to normalize by stripping the legacy aliases suffixes.<div><br></div><div>Actually, the order in which the qemu-agent returns the value isn't always:</div>
<div><br></div><div>ethX   </div><div>ethX:0</div><div>ethX:1</div><div>ethY</div><div>ethY:0</div><div>ethY:2<br></div><div><br></div><div>It can be:</div><div><br></div><div><div>ethX   </div><div>ethY:2<br></div><div>ethX:0</div>
<div>ethY:0<br></div><div>ethX:1</div><div>ethY<br></div></div><div><br></div><div>which, after stripping, will just be left with:</div><div><br></div><div>ethX</div><div>ethY</div><div>ethX</div><div>ethY</div><div>ethX</div>
<div>ethY</div><div><br></div><div>whereas, we would want:</div><div><br></div><div><div>ethX</div><div>ethX</div><div>ethX</div><div>ethY</div><div>ethY</div><div>ethY</div></div><div><br></div><div>Hence, grouping either by the stripped down interface name or</div>
<div>by the MAC address will be required. So that all IP addresses</div><div>related to a single NIC are not distributed in the output.</div><div><br></div><div>><br>> > OR<br>> > (ii) Let the reply be as it is now. Strip the ":0", ":1" from the response<br>
> > of guest agent (Is this really necessary?) . We'll have to parse the JSON<br>> > multiple times and fill the virDomainInterface structs by grouping them<br>> > according to the MAC addresses.<br>
><br>> I think we need to do (ii) regardless to cope with existing deployed<br>> QEMU agent versions.<br>><br>> We should also recommend to QEMU developers to fix the agent to not expose<br>> these legacy device alias names.<br>
><br>><br>> Daniel<br>> --<br>> |: <a href="http://berrange.com">http://berrange.com</a>      -o-    <a href="http://www.flickr.com/photos/dberrange/">http://www.flickr.com/photos/dberrange/</a> :|<br>> |: <a href="http://libvirt.org">http://libvirt.org</a>              -o-             <a href="http://virt-manager.org">http://virt-manager.org</a> :|<br>
> |: <a href="http://autobuild.org">http://autobuild.org</a>       -o-         <a href="http://search.cpan.org/~danberr/">http://search.cpan.org/~danberr/</a> :|<br>> |: <a href="http://entangle-photo.org">http://entangle-photo.org</a>       -o-       <a href="http://live.gnome.org/gtk-vnc">http://live.gnome.org/gtk-vnc</a> :|<br>
<br><br><br><br>--<br>Nehal J Wani<br>UG3, BTech CS+MS(CL)<br>IIIT-Hyderabad<br><a href="http://commandlinewani.blogspot.com">http://commandlinewani.blogspot.com</a></div></div>