Was this causing an issue in some way? I think it's only used to make sure the user doesn't specify a MAC address that conflicts with the host NIC, which is not important enough to deal with parsing ifconfig output. I'll probably just drop this function when we merge virt-manager and virtinst repos.
Moving to the upstream tracker.

(In reply to comment #1)
> Was this causing an issue in some way? I think it's only used to make sure
> the user doesn't specify a MAC address that conflicts with the host NIC,
> which is not important enough to deal with parsing ifconfig output. I'll
> probably just drop this function when we merge virt-manager and virtinst
> repos.
>
I've found this by accident while trying to use it in my project.
Public API provided by virtinst is actually quite nice and valuable (at least for me).
You can probably use my simple version which only returns MAC addresses:
def get_host_macs():
with os.popen('LC_ALL=C /sbin/ip addr') as f:
return map(lambda x: x.split()[1],
filter(lambda x: 'link/ether' in x,
f.readlines()))

(In reply to comment #3)
> (In reply to comment #1)
> > Was this causing an issue in some way? I think it's only used to make sure
> > the user doesn't specify a MAC address that conflicts with the host NIC,
> > which is not important enough to deal with parsing ifconfig output. I'll
> > probably just drop this function when we merge virt-manager and virtinst
> > repos.
> >
>
> I've found this by accident while trying to use it in my project.
>
> Public API provided by virtinst is actually quite nice and valuable (at
> least for me).
>
Is this a public project? If so, virtinst is going to cease to be a public API very soon now so you will be stranded.
https://www.redhat.com/archives/virt-tools-list/2012-February/msg00040.html
libvirt-gconfig and libvirt-designer will eventually provide the important functionality.
If this is a private project you can just keep a copy of the old code around, or even continue to use the API that will eventually exist under /usr/share/virt-manager/virtinst, though understandable there will be no API guarantees.
> You can probably use my simple version which only returns MAC addresses:
>
> def get_host_macs():
> with os.popen('LC_ALL=C /sbin/ip addr') as f:
> return map(lambda x: x.split()[1],
> filter(lambda x: 'link/ether' in x,
> f.readlines()))
Thanks for the code, however the purpose of the original code (to make sure a manually specified mac address does not conflict with the host address) is pretty obscure, and not worth calling out to an external tool to verify. And if anything we should be using libvirt interface APIs. So I'll just drop this code when the next release goes out.

(In reply to comment #4)
> (In reply to comment #3)
> > (In reply to comment #1)
> > > Was this causing an issue in some way? I think it's only used to make sure
> > > the user doesn't specify a MAC address that conflicts with the host NIC,
> > > which is not important enough to deal with parsing ifconfig output. I'll
> > > probably just drop this function when we merge virt-manager and virtinst
> > > repos.
> > >
> >
> > I've found this by accident while trying to use it in my project.
> >
> > Public API provided by virtinst is actually quite nice and valuable (at
> > least for me).
> >
>
> Is this a public project? If so, virtinst is going to cease to be a public
> API very soon now so you will be stranded.
>
> https://www.redhat.com/archives/virt-tools-list/2012-February/msg00040.html
>
> libvirt-gconfig and libvirt-designer will eventually provide the important
> functionality.
>
> If this is a private project you can just keep a copy of the old code
> around, or even continue to use the API that will eventually exist under
> /usr/share/virt-manager/virtinst, though understandable there will be no API
> guarantees.
>
It will be public but it's not a problem for me to rewrite few API calls I'm using.