On 12/29/2010 05:36 PM, Matthias Bolte wrote:
---
As we're currently in feature freeze this patch is meant to be
applied after the next release.
And we're now out of feature freeze, so I'm reviewing this...
+
+static int
+esxDomainSetAutostart(virDomainPtr domain, int autostart)
+{
+ int result = -1;
+ esxPrivate *priv = domain->conn->privateData;
+ esxVI_ObjectContent *virtualMachine = NULL;
+ esxVI_HostAutoStartManagerConfig *spec = NULL;
+ esxVI_AutoStartPowerInfo *powerInfo = NULL;
+
+ if (esxVI_EnsureSession(priv->primary) < 0) {
+ return -1;
+ }
+
+ if (esxVI_LookupVirtualMachineByUuid(priv->primary, domain->uuid,
+ NULL, &virtualMachine,
+ esxVI_Occurrence_RequiredItem) < 0 ||
+ esxVI_HostAutoStartManagerConfig_Alloc(&spec) < 0) {
+ goto cleanup;
+ }
+
+ if (autostart) {
+ /* Enable autostart in general */
+ if (esxVI_AutoStartDefaults_Alloc(&spec->defaults) < 0) {
+ goto cleanup;
+ }
+
+ spec->defaults->enabled = esxVI_Boolean_True;
+ }
Can enabling the general autostart capability result in changing the
default of an unrelated domain with no specific autostart preference to
change over to doing autostart, as an unintended side effect of changing
the given domain to have mandatory autostart? I'm hoping that the
answer is that enabling the global autostart capability doesn't change
the autostart behavior of any domains, in which case this patch looks fine.
Conditional ACK, based on the answer to that behavior question.
--
Eric Blake eblake(a)redhat.com +1-801-349-2682
Libvirt virtualization library
http://libvirt.org