On 2012年12月05日 19:03, Jiri Denemark wrote:
On Wed, Dec 05, 2012 at 18:54:42 +0800, Osier Yang wrote:
...
>> However, the mainly reason I choosed to use a sub-list of domain names
>> is for future extenstion, I.E. Assuming there are other disk setting
>> (you never known how many they will be), we have to guarantee they are
>> same among guests in future. Looking up the disk def with domain and
>> disk path gives us much flexibility IMHO.
>>
>
> So the point of the argument is: the trade between the flexibility and
> the uncomfortable locks.
OK, I guess we can store more info in the sharedDisks list (either today or
later when we need it), we may even store the domain list there, but we don't
definitely want to go through all the domains to get the required details.
I think it should be just a few guests share the disk in practice,
which means in practice the sharedDisks->disks[i]->ndomains should
be short. And that's the other reason why I can live with the
locks. Though in theory, it can be all domains (assuming it's large
number) share the disk.
The other question is: Aren't we already go through all domain objects
in many places?
Regards,
Osier