[libvirt] XenStore fix

Jonas Eriksson jonas.j.eriksson at ericsson.com
Tue Jul 28 18:07:19 UTC 2009


On Tue, Jul 28, 2009 at 09:54:53AM +0100 Daniel P. Berrange wrote:
> On Tue, Jul 28, 2009 at 08:30:12AM +0200, Jonas Eriksson wrote:
> > Hi,
> > 
> > I have been examining a bug where libvirtd (and virsh) does not show
> > all virtual machines on a xen host. This proved to be because of this
> > program flow:
> > 1. virConnectNumOfDomains -> .. -> xenUnifiedNumOfDomains
> >    -> xenHypervisorNumOfDomains => 3
> > 2. virConnectListDomains(max=3) -> .. -> xenUnifiedListDomains(max=3)
> >    -> xenStoreNumOfDomains(max=3) => { 0, 2, 7 }
> 
> That in itself is a nice indication of trouble - xenUnifiedNumOfDomains
> and xenUnifiedListDomains should both follow the exact same logic. At
> least part of your problem is due to one using the HV first, while the
> other uses XenStore - they need to be consistent

I agree that both xenUnifiedNumOfDomains and
xenUnifiedListDomains really should use the same logic. We should
however not forget that my fix addresses the case when
xenStoreNumOfDomains and xenStoreListDomains gets confused due to
old data left in XenStore by verifying the data agains other
parts of XenStore.

In some other thread an implementation like this were suggested:
>  - Get list of domain IDs from XenStore.
>  - Remove any domain IDs from this list that don't exist in the HyperVisor
This would mean that this functionality should be implemented in
the Xen unified driver, correct? Plus, in order to get the same
logic in both numOfDomains as listDomains, we would have to
implement the same thing there.

As for the discussion about rouge VMs, I must admit that I found
it to be a bit strange. Either we can trust XenStore, which will
mean that it should not be any problems in verifying that the
data is valid through XenStore as well, or am I missing some case
here? If we cannot trust XenStore, should it be used at all?

Best regards,
Jonas

--
Jonas Eriksson
Consultant at AS/EAB/FLJ/IL
Combitech AB
Älvsjö, Sweden




More information about the libvir-list mailing list