[libvirt] [PATCH] conf: Do not load domain if the domain with same already exists

Osier Yang jyang at redhat.com
Wed Aug 17 02:50:45 UTC 2011


于 2011年08月16日 22:58, Eric Blake 写道:
> On 08/16/2011 09:05 AM, Osier Yang wrote:
>> We don't allow to define domain with same name and different UUID,
>> or with same UUID, so it's reasonable to not load the domain config
>> if there is domain with same name already exists.
>>
>> Otherwise it can cause problem like:
>>
>> 1) % cp /etc/libvirt/qemu/dom.xml /etc/libvirt/qemu/dom_diffuuid.xml
> > 2) remove the line with "uuid" in the "dom_diffuuid.xml"
>
> This is invalid. Users should not be mucking with /etc/libvirt, but 
> rather going through libvirt APIs. Is there any way, using only 
> libvirt APIs, where /etc/libvirt can end up with a domain without a 
> uuid? If not, then NACK to this patch, and instead fix the test 
> scenario that was driving this patch to quit going behind libvirt's back.
>
>> There will be 11 domains listed with the same name, as if there is
>> no UUID specified in domain XML, libvirt will generate one for it,
>> which will be definitely different with the original one.
>
> Libvirt should have already generated a uuid for all domains already 
> in /etc/libvirt; if there is no way for /etc/libvirt to have a domain 
> without a uuid in /etc/libvirt short of going behind libvirt's back, 
> then doing a name lookup won't buy us any safety.
>

I don't see a way to cause a domain has no UUID though libvirt
APIs, so self NACK this.

Thanks
Osier




More information about the libvir-list mailing list