Re: [PATCH 1/7] hyperv: implement domainSetAutostart

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday, 9 October 2020 10:31:50 CEST Matt Coleman wrote:
> +static int
> +hypervDomainSetAutostart(virDomainPtr domain, int autostart)
> +{
> +    int result = -1;
> +    char uuid_string[VIR_UUID_STRING_BUFLEN];
> +    hypervPrivate *priv = domain->conn->privateData;
> +    Msvm_VirtualSystemSettingData *vssd = NULL;
> +    hypervInvokeParamsListPtr params = NULL;
> +    g_auto(virBuffer) eprQuery = VIR_BUFFER_INITIALIZER;
> +    virHashTablePtr autostartParam = NULL;
> +    hypervWmiClassInfoListPtr embeddedParamClass = NULL;
> +    const char *methodName = NULL, *embeddedParamName = NULL;
> +    g_autofree char *enabledValue = NULL, *disabledValue = NULL;
> +
> +    if (priv->wmiVersion == HYPERV_WMI_VERSION_V1) {
> +        methodName = "ModifyVirtualSystem";
> +        embeddedParamName = "SystemSettingData";
> +        embeddedParamClass = Msvm_VirtualSystemGlobalSettingData_WmiInfo;
> +        enabledValue = g_strdup("2");
> +        disabledValue = g_strdup("0");
> +    } else if (priv->wmiVersion == HYPERV_WMI_VERSION_V2) {
> +        methodName = "ModifySystemSettings";
> +        embeddedParamName = "SystemSettings";
> +        embeddedParamClass = Msvm_VirtualSystemSettingData_WmiInfo;
> +        enabledValue = g_strdup("4");
> +        disabledValue = g_strdup("2");
> +    }

It looks like 'enabledValue' and 'disabledValue' can be static strings
(like 'methodName' and 'embeddedParamName').

-- 
Pino Toscano

Attachment: signature.asc
Description: This is a digitally signed message part.


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux