3.2.5.5.9 Receiving a Query VHD Set Information Request

When the server receives a request in which OperationCode is equal to RSVD_TUNNEL_VHDSET_QUERY_INFORMATION, the request handling proceeds as follows:

If the provided input buffer is not equal to the size of the SVHDX_TUNNEL_VHDSET_QUERY_INFORMATION_REQUEST structure, then the server MUST fail the request with STATUS_BUFFER_TOO_SMALL.

If the Open.IsVHDSet is FALSE, the server MUST fail the request with STATUS_INVALID_DEVICE_REQUEST.

If VHDSetInformationType is not one of the valid information types specified in section 2.2.4.19, the server MUST fail the request with STATUS_INVALID_PARAMETER_1.

If VHDSetInformationType is SvhdxVHDSetInformationTypeSnapshotEntry and the supplied SnapshotType is not SvhdxSnapshotTypeVM or SvhdxSnapshotTypeCDP or SvhdxSnapshotTypeWriteable, the server MUST fail the request with STATUS_INVALID_PARAMETER_1.

If VHDSetInformationType is SvhdxVHDSetInformationTypeSnapshotList and the supplied SnapshotType is not SvhdxSnapshotTypeVM, the server MUST fail the request with STATUS_INVALID_PARAMETER_1.

If VHDSetInformationType is neither SvhdxVHDSetInformationTypeSnapshotEntry nor SvhdxVHDSetInformationTypeSnapshotList and SnapshotType is nonzero, the server MUST fail the request with STATUS_INVALID_PARAMETER.

The server MUST issue a query VHD set information request to the virtual SCSI disk in an implementation-specific manner.

If the virtual SCSI disk indicates an error, the server MUST return the SVHDX_TUNNEL_OPERATION_HEADER to the client initialized as below:

  • The OperationCode field MUST be set to the OperationCode value of the request.

  • The Status field MUST be set to the error returned by the Virtual SCSI disk.

  • The RequestId field MUST be set to the value received in the request.

Otherwise, the server MUST process as follows:

  • If VHDSetInformationType is SvhdxVHDSetInformationTypeSnapshotEntry, the server MUST construct a SVHDX_TUNNEL_VHDSET_QUERY_INFORMATION_SNAPSHOT_ENTRY_RESPONSE structure as specified in section 2.2.4.21, with the following values:

    • The SVHDX_TUNNEL_OPERATION_HEADER MUST be initialized as follows:

      • OperationCode MUST be set to the OperationCode value of the request.

      • Status MUST be set to STATUS_SUCCESS.

      • The RequestId field MUST be set to the value received in the request.

    • The SVHDX_TUNNEL_VHDSET_QUERY_INFORMATION_SNAPSHOT_ENTRY_RESPONSE structure MUST be initialized as follows:

      • VHDSetInformationType MUST be set to SvhdxVHDSetInformationTypeSnapshotEntry.

      • SnapshotType MUST be set to the value received from the virtual SCSI disk.

      • IsValidSnapshot MUST be set to the value received from the virtual SCSI disk.

      • SnapshotId MUST be set to the SnapshotId provided in the request.

      • ParentSnapshotId MUST be set to zero.

      • LogFileId MUST be set to zero.

    • The response MUST be sent to the client.

  • If VHDSetInformationType is SvhdxVHDSetInformationTypeSnapshotList, SvhdxVHDSetInformationTypeCdpSnapshotActiveList, or SvhdxVHDSetInformationTypeCdpSnapshotInactiveList, the server MUST construct a SVHDX_TUNNEL_VHDSET_QUERY_INFORMATION_SNAPSHOT_LIST_RESPONSE structure as specified in section 2.2.4.20, with the following values:

    • The SVHDX_TUNNEL_OPERATION_HEADER MUST be initialized as follows:

      • OperationCode MUST be set to the OperationCode value of the request.

      • Status MUST be set to STATUS_SUCCESS.

      • The RequestId field MUST be set to the value received in the request.

    • The SVHDX_TUNNEL_VHDSET_QUERY_INFORMATION_SNAPSHOT_LIST structure MUST be initialized as follows:

      • VHDSetInformationType MUST be set to SvhdxVHDSetInformationTypeSnapshotList.

      • ResponseComplete MUST be set to 0x01 if the sum of the size of the snapshot IDs received from the virtual SCSI disk, the size of SVHDX_TUNNEL_OPERATION_HEADER, and the size of the fixed part of SVHDX_TUNNEL_VHDSET_QUERY_INFORMATION_SNAPSHOT_LIST_RESPONSE is less than or equal to MaxOutputResponse.

      • NumberOfSnapshots MUST be set to the number of snapshot IDs received from the virtual SCSI disk.

      • If ResponseComplete is set to 0x01, SnapshotIds MUST be set to the value received from the virtual SCSI disk. Otherwise, the SnapshotIds field is not present.

    • The response MUST be sent to the client.

  • If VHDSetInformationType is SvhdxVHDSetInformationTypeCdpSnapshotRoot, the server MUST construct a SVHDX_TUNNEL_VHDSET_QUERY_INFORMATION_SNAPSHOT_ENTRY_RESPONSE structure as specified in section 2.2.4.21, with the following values:

    • The SVHDX_TUNNEL_OPERATION_HEADER MUST be initialized as follows:

      • OperationCode MUST be set to the OperationCode value of the request.

      • Status MUST be set to STATUS_SUCCESS.

      • The RequestId field MUST be set to the value received in the request.

    • The SVHDX_TUNNEL_VHDSET_QUERY_INFORMATION_SNAPSHOT_ENTRY_RESPONSE structure MUST be initialized as follows:

      • VHDSetInformationType MUST be set to SvhdxVHDSetInformationTypeCdpSnapshotRoot.

      • SnapshotType MUST be set to the value received from the virtual SCSI disk.

      • IsValidSnapshot MUST be set to the value received from the virtual SCSI disk.

      • SnapshotId MUST be set to the SnapshotId provided in the request.

      • ParentSnapshotId MUST be set to the value received from the virtual SCSI disk.

      • LogFileId MUST be set to the value received from the virtual SCSI disk.

    • The response MUST be sent to the client.

  • If VHDSetInformationType is SvhdxVHDSetInformationTypeOptimizeNeeded, the server MUST construct an SVHDX_TUNNEL_VHDSET_QUERY_INFORMATION_OPTIMIZE_RESPONSE structure as specified in section 2.2.4.22, with the following values:

    • The SVHDX_TUNNEL_OPERATION_HEADER MUST be initialized as follows:

      • OperationCode MUST be set to the OperationCode value of the request.

      • Status MUST be set to STATUS_SUCCESS.

The response MUST be sent to the client.