Example #1
0
static
DWORD
VmAfdCliSetMachineID(
    PVM_AFD_CLI_CONTEXT pContext
    )
{
    DWORD dwError = 0;

    if (!pContext)
    {
        dwError = ERROR_INVALID_PARAMETER;
        BAIL_ON_VMAFD_ERROR(dwError);
    }

    dwError = VmAfdSetMachineIDA(
                    pContext->pszServerName,
                    pContext->pszMachineId);
    BAIL_ON_VMAFD_ERROR(dwError);

    printf("Machine Id [%s] was updated successfully\n", pContext->pszMachineId);

cleanup:

    return dwError;

error:

    printf("Failed to set Machine Id [%s]. Error [%d]\n",
            pContext->pszMachineId,
            dwError);

    goto cleanup;
}
Example #2
0
void client::SetMachineID(std::string id)
{
    DWORD dwError = 0;

    dwError = VmAfdSetMachineIDA(
                  ServerName.c_str(),
                  id.c_str());
    BAIL_ON_ERROR(dwError);

error:
    THROW_IF_NEEDED(dwError);
}