HvGetMemoryBalance function

The HvGetMemoryBalance function queries the state of the memory pool of a child partition.

Syntax


HV_STATUS  HvGetMemoryBalance(
  _In_   HV_PARTITION_ID PartitionId,
  _In_   HV_PROXIMITY_DOMAIN_INFO ProximityDomainInfo,
  _Out_  PUINT64 PagesAvailable,
  _Out_  PUINT64 PagesInUse
);

Parameters

PartitionId [in]

An HV_PARTITION_ID value that identifies the partition from which to query the state of the partition's memory pool. HV_PARTITION_ID is defined as an unsigned 64-bit (UINT64) value.

ProximityDomainInfo [in]

An HV_PROXIMITY_DOMAIN_INFO structure that specifies the ACPI proximity domain information of the NUMA node from which to query the memory balance. The proximity domain specifier is described in Resource Management Proximity Domains Data Types.

PagesAvailable [out]

A pointer to a variable that HvGetMemoryBalance fills with the number of guest physical address (GPA) pages that are available.

PagesInUse [out]

A pointer to a variable that HvGetMemoryBalance fills with the number of guest physical address (GPA) pages that are in use.

Return value

HvGetMemoryBalance returns one of the following values. In addition to these values, HvGetMemoryBalance can also return one of the values that are specified in Common Hypercall Status Codes.

Return codeDescription
HV_STATUS_SUCCESS

HvGetMemoryBalance successfully queried the state of the child partition's memory pool.

HV_STATUS_ACCESS_DENIED

Neither of the following items is true:

  • The caller is the parent of the specified partition, and the caller's partition privilege flag AccessMemoryPool is enabled.

  • The caller is the root partition, and the specified partition is the root partition.

HV_STATUS_INVALID_PARTITION_ID

The specified partition is invalid.

HV_STATUS_INVALID_PARAMETER

The ProximityDomainInfo parameter specifies an invalid flag bit or an invalid domain identifier.

 

Remarks

HvGetMemoryBalance has the following restrictions:

  • The caller must possess the AccessMemoryPool privilege.

  • The caller must either be the parent of the partition that is specified by PartitionId or the root partition that specifies its own partition identifier.

Native Interface

HvGetMemoryBalance

Call Code = 0x004A

Input Parameters

0

PartitionId (8 bytes)

8

ProximityDomainInfo (8 bytes)

Output Parameters

0

PagesAvailable (8 bytes)

8

PagesInUse (8 bytes)

 

Requirements

Version

HvGetMemoryBalance is available in version 1.0 and later versions of the hypervisor.

Header

Hvgdk.h (include Hvgdk.h)

IRQL

Any level

See also

HV_PROXIMITY_DOMAIN_INFO

 

 

Send comments about this topic to Microsoft

Build date: 11/16/2013

Show:
© 2014 Microsoft. All rights reserved.