Read/write path determining method and apparatus
First Claim
1. A read/write path determining method for use by a physical host comprising a hardware layer, a host running on the hardware layer, and a virtual machine running on the host, wherein the host comprises a block device and a virtual block device, and the method comprises:
- obtaining, by the host, a first read/write request of the virtual machine, wherein the first read/write request comprises a first virtual address;
determining whether to enable an advanced storage service;
in response to determining that the advanced storage service is not enabled, searching for the first virtual address in an address translation information set comprising a correspondence between a virtual address and information about a physical block device, wherein the information about the physical block device comprises a read/write identifier; and
if the address translation information set comprises the first virtual address, and the first read/write request is a read request, processing the first read/write request by using a block device corresponding to the first virtual address;
orif the address translation information set comprises the first virtual address, the first read/write request is a write request, and a first read/write identifier corresponding to the first virtual address indicates readable and writable, processing the first read/write request by using the block device;
orif the address translation information set comprises the first virtual address, the first read/write request is a write request, and a first read/write identifier corresponding to the first virtual address indicates read-only, processing the first read/write request by using the virtual block device;
orif the address translation information set does not comprise the first virtual address, processing the first read/write request by using the virtual block device.
1 Assignment
0 Petitions
Accused Products
Abstract
The present disclosure discloses a read/write path determining method and apparatus. The method is used by a physical host. The method includes: obtaining, by the host, a first read/write request of the virtual machine, where the first read/write request includes a first virtual address, searching for the first virtual address in an address translation information set, and determining to process the first read/write request by using the block device or the virtual block device according to the address translation information set and the first virtual address. According to the method and apparatus, an appropriate read/write path is determined according to a read/write request and an address translation information set, so that both storage performance and a storage function can be considered.
-
Citations
19 Claims
-
1. A read/write path determining method for use by a physical host comprising a hardware layer, a host running on the hardware layer, and a virtual machine running on the host, wherein the host comprises a block device and a virtual block device, and the method comprises:
-
obtaining, by the host, a first read/write request of the virtual machine, wherein the first read/write request comprises a first virtual address; determining whether to enable an advanced storage service; in response to determining that the advanced storage service is not enabled, searching for the first virtual address in an address translation information set comprising a correspondence between a virtual address and information about a physical block device, wherein the information about the physical block device comprises a read/write identifier; and if the address translation information set comprises the first virtual address, and the first read/write request is a read request, processing the first read/write request by using a block device corresponding to the first virtual address;
orif the address translation information set comprises the first virtual address, the first read/write request is a write request, and a first read/write identifier corresponding to the first virtual address indicates readable and writable, processing the first read/write request by using the block device;
orif the address translation information set comprises the first virtual address, the first read/write request is a write request, and a first read/write identifier corresponding to the first virtual address indicates read-only, processing the first read/write request by using the virtual block device;
orif the address translation information set does not comprise the first virtual address, processing the first read/write request by using the virtual block device. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
-
-
10. A read/write path determining apparatus for use in a physical host having a virtual machine configured to run on the physical host, the apparatus comprising:
-
a storage backend module, configured to; obtain a first read/write request of the virtual machine, wherein the first read/write request comprises a first virtual address, determine whether to enable an advanced storage service; and in response to determining that the advanced storage service is not enabled, search for the first virtual address in an address translation information set comprising a correspondence between a virtual address and information about a physical block device, wherein the information about the physical block device comprises a read/write identifier; a block device, configured to process the first read/write request; if the address translation information set comprises the first virtual address, and the first read/write request is a read request, or if the address translation information set comprises the first virtual address, the first read/write request is a write request, and a first read/write identifier corresponding to the first virtual address indicates readable and writable; and a virtual block device, configured to process the first read/write request; if the address translation information set comprises the first virtual address, the first read/write request is a write request, and a first read/write identifier corresponding to the first virtual address indicates read-only, or if the address translation information set does not comprise the first virtual address. - View Dependent Claims (11, 12, 13, 14, 15, 16, 17, 18)
-
-
19. A physical host, comprising:
-
a hardware layer; a host running on the hardware layer and a virtual machine running on the host, and the host comprises a read/write path determining apparatus comprising; a storage backend module, configured to; obtain a first read/write request of the virtual machine, wherein the first read/write request comprises a first virtual address, determine whether to enable an advanced storage service; and in response to determining that the advanced storage service is not enabled, search for the first virtual address in an address translation information set comprising a correspondence between a virtual address and information about a physical block device, wherein the information about the physical block device comprises a read/write identifier; a block device, configured to process the first read/write request; if the address translation information set comprises the first virtual address, and the first read/write request is a read request, or if the address translation information set comprises the first virtual address, the first read/write request is a write request, and a first read/write identifier corresponding to the first virtual address indicates readable and writable; and a virtual block device, configured to process the first read/write request; if the address translation information set comprises the first virtual address, the first read/write request is a write request, and a first read/write identifier corresponding to the first virtual address indicates read-only, or if the address translation information set does not comprise the first virtual address.
-
Specification