Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Xen 3.0 Virtualization Interface Guide
Prev Home Next

8.2.2 Block ring interface

The block interface is defined by the structures passed over the shared memory interface. These structures are either requests (from the frontend to the backend) or responses (from the backend to the frontend).

The request structure is defined as follows:

typedef struct blkif_request {
    uint8_t        operation;    /* BLKIF_OP_???                         */
    uint8_t        nr_segments;  /* number of segments                   */
    blkif_vdev_t   handle;       /* only for read/write requests         */
    uint64_t       id;           /* private guest value, echoed in resp  */
    blkif_sector_t sector_number;/* start sector idx on disk (r/w only)  */
    struct blkif_request_segment {
        grant_ref_t gref;        /* reference to I/O buffer frame        */
        /* @first_sect: first sector in frame to transfer (inclusive).   */
        /* @last_sect: last sector in frame to transfer (inclusive).     */
        uint8_t     first_sect, last_sect;
    } seg[BLKIF_MAX_SEGMENTS_PER_REQUEST];
} blkif_request_t;

The fields are as follows:

operation
operation ID: one of the operations described above
nr_segments
number of segments for scatter / gather IO described by this request
handle
identifier for a particular virtual device on this interface
id
this value is echoed in the response message for this IO; the guest may use it to identify the original request
sector_number
start sector on the virtal device for this request
frame_and_sects
This array contains structures encoding scatter-gather IO to be performed:
gref
The grant reference for the foreign I/O buffer page.
first_sect
First sector to access within the buffer page (0 to 7).
last_sect
Last sector to access within the buffer page (0 to 7).
Data will be transferred into frames at an offset determined by the value of first_sect.

Xen 3.0 Virtualization Interface Guide
Prev Home Next

 
 
  Published under the terms of the GNU General Public License Design by Interspire