3.2.4.4.1.8 IVolumeClient::MarkActivePartition (Opnum 10)

The MarkActivePartition method marks a specified partition as the active partition of the disk. This is a synchronous task.

 HRESULT MarkActivePartition(
   [in] LdmObjectId regionId,
   [in] hyper regionLastKnownState,
   [out] TASK_INFO* tinfo
 );

regionId: Specifies the OID of the partition to activate.

regionLastKnownState: Partition's last known modification sequence number.

tinfo: Pointer to a TASK_INFO structure that the client can use to track the request's progress.

Return Values: The method MUST return 0 or a nonerror HRESULT on success, or an implementation-specific nonzero error code on failure (as specified in [MS-ERREF] section 2.1; see also section 2.2.1 for HRESULT values predefined by the Disk Management Remote Protocol).

Upon receiving this message, the server MUST validate parameters:

  1. Verify that the disk region specified by regionId is in the list of storage objects, and check whether regionLastKnownState matches the LastKnownState field of the object.

  2. Verify that tinfo is not NULL.

If parameter validation fails, the server MUST fail the operation immediately, returning an appropriate error as its response to the client.

Otherwise, the server MUST process the message as follows:

  1. Mark the partition specified by regionId as active in the partition table of its disk.

  2. If another partition was marked active on the disk, clear the active flag from it. Only one partition can be active on a given disk at any given time.

  3. Wait for the partition activation to either succeed or fail.

  4. Fill in the tinfo output parameter.

    TASK_INFO member

    Required for this operation

    TASK_INFO::id

    Required.

    TASK_INFO::storageId

    Not required.

    TASK_INFO::createTime

    Not required.<39>

    TASK_INFO::clientID

    Not required.<40>

    TASK_INFO::percentComplete

    Required for any task that returns REQ_IN_PROGRESS.

    TASK_INFO::status

    Required.

    TASK_INFO::type

    Required if PercentageComplete is being used.

    TASK_INFO::error

    Required.

    TASK_INFO::tflag

    Not required.<41>

  5. Return a response to the client that contains tinfo and the status of the operation.

If the operation is successful, the server MUST make the following changes to the list of storage objects before returning the response:

  1. Modify the disk region object that corresponds to the specified partition to account for the change of the active flag.

  2. Modify the disk region object that corresponds to the former active partition on the disk to account for the change of the active flag.