Re: [et-mgmt-tools] [PATCH] Check the making domain's mac address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tatsuro Enokura wrote:
> Hi,
> 
> Would you give me a comment on this patch?
> If not, please apply it.
> 
> Tatsuro Enokura wrote:
>> The virt-install command can specify the making domain's vnif
>> MAC address. The MAC address must be unique on the system,
>> but the virt-install command doesn't check that
>> the MAC address is unique among the running domains and host.
>>
>> The attached patch resolve this issue in the following way:
>>
>>   1) Get the running Domain's vnif MAC address.
>>   2) Get the host's NIC MAC address.
>>   3) Check the making domain's MAC address with 1) and 2) 's data.
> 
> Signed-off-by: Tatsuro Enokura <fj1826dm@xxxxxxxxxxxxxxxxx>
> 
> Thanks,
> Tatsuro Enokura
> 

Hi there!

Actually, you really don't need to build up a list of mac addresses and
iterate over them. A much easier way is simply to get the XML for a
domain and then use an xpath expression something like

	if ctx.xpathEval("count(/domain/devices/interface/mac/@address='%s')" %
macaddr) > 0:
	# handle the case where the macaddr conflicts with an existing domain

If you can rewrite the patch along these lines I'll be happy to take it.

Thanks,
--Hugh

-- 
Red Hat Virtualization Group http://redhat.com/virtualization
Hugh Brock           | virt-manager http://virt-manager.org
hbrock@xxxxxxxxxx    | virtualization library http://libvirt.org


[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux