3.2.5.5.14 Receiving a Query Virtual Disk changes request

When the server receives a request with an OperationCode equal to RSVD_TUNNEL_QUERY_VIRTUAL_DISK_CHANGES, the request handling proceeds as follows:

If the input buffer is less than (size of SVHDX_TUNNEL_OPERATION_HEADER + size of SVHDX_TUNNEL_QUERY_VIRTUAL_DISK_CHANGES_REQUEST), the server MUST fail the request with STATUS_BUFFER_TOO_SMALL.

If SnapshotType is not SvhdxSnapshotTypeVM, the server MUST fail the request with STATUS_INVALID_PARAMETER.

The server MUST search for a snapshot in Open.SnapshotList where Snapshot.SnapshotId is equal to TargetSnapshotId. If no matching entry is found, the server MUST fail the request and return an error in an implementation-specific manner.

The server MUST search for a snapshot in Open.SnapshotList where Snapshot.SnapshotId is equal to LimitSnapshotId. If no matching entry is found, the server MUST fail the request and return an error in an implementation-specific manner.

If Snapshot.ChangeTracking, identified using TargetSnapshotId, or Snapshot.ChangeTracking, identified using LimitSnapshotId, is FALSE, the server MUST fail the request and return an error in an implementation-specific manner.

The server MUST issue a get virtual disk changes request to the virtual SCSI disk in an implementation-specific manner.

The server MUST construct an SVHDX_TUNNEL_OPERATION_HEADER structure as specified in section 2.2.4.11, with the following values:

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

  • The Status field MUST be set to status returned by virtual SCSI disk.

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

If the Status is not zero, the server MUST return SVHDX_TUNNEL_OPERATION_HEADER to the client, and no further processing is done.

Otherwise the server MUST append an SVHDX_TUNNEL_QUERY_VIRTUAL_DISK_CHANGES_REPLY structure to the SVHDX_TUNNEL_OPERATION_HEADER in response, as specified in section 2.2.4.38, with the following values:

  • The ProcessedByteLength field MUST be set to the total byte length of the virtual disk region that was processed. This MUST be ByteLength from the SVHDX_TUNNEL_QUERY_VIRTUAL_DISK_CHANGES_REQUEST or a smaller value, if the provided buffer was not large enough to contain all the information that was available about the requested virtual disk region.

  • The RangeCount field MUST be set to the number of changed regions in the virtual disk region that was processed. This is also equal to the number of entries in the Ranges field.

  • The Reserved field MUST be set to zero.

  • The Ranges field is filled with an array of SVHDX_VIRTUAL_DISK_CHANGED_RANGE structures returned from the virtual SCSI disk in an implementation-specific manner, each initialized as follows:

    • The ByteOffset field MUST be set to the byte offset indicating the beginning of the changed range.

    • The ByteLength field MUST be set to the byte length of the changed range.

    • The Reserved field MUST be set to zero.

The server MUST send the response to the client.