https://bugs.winehq.org/show_bug.cgi?id=39415
--- Comment #1 from François Gouget fgouget@codeweavers.com --- One way to handle this would be to add a table like this: PK Class # User, VMHost, VM, etc. PK Object # User name / Hostname / VM name, etc. PK Property # Name of a property of the above object Value # Value for that property
The point of the Class column is to avoid collisions between the properties of the w1064 VM and those of a malicious w1064 user: the class would ensure they resolve to ('VM', 'w1064', ...) and ('User', 'w1064', ...) respectively.
Then the API to access those should provide automatic fallbacks so if a the SleepAfterRevert property is not specified at the VM-level, either the VM-host one or the global one is used:
my $Props = GetProperties(['VM', 'w1064'], ['VMHost', 'vm2'], ['Global', 'VMHosts']); print $Props->{SleepAfterRevert}, "\n";
Should the need arise for array properties (maybe to store user preferences like VMs to run the tests on) the convention could be to suffix the property name with ":array" and then ":N" for each entry (colons would otherwise be forbidden in property names).
GetProperties() would likely provide access to a singleton object that loads all of a given object's properties at once and then caches them for a few seconds so that iterating over VMs (for instance) does not cause the VMHost properties to be reloaded each time (this assumes the Perl ORM does not provide such functionality).
Of course a SetProperty() method would update the cache appropriately, but of course that does not help other processes, hence the short-duration case.
Interestingly this new table would have no link to the other TestBot tables, making this a good testing ground for Perl ORM tests.