aboutsummaryrefslogtreecommitdiffstats
path: root/tools/blktap/lib
diff options
context:
space:
mode:
authorJake Wires <jwires@xensource.com>2007-02-16 20:31:27 -0800
committerJake Wires <jwires@xensource.com>2007-02-16 20:31:27 -0800
commitb3fb1294fa32a22a3fab69cf85a8e45fb9721609 (patch)
treedc90f970fdac210b9f4695b8bb4ed60c8ddf2a98 /tools/blktap/lib
parent3bddff4a583360d8fdd7f58f8be55802795bafdf (diff)
downloadxen-b3fb1294fa32a22a3fab69cf85a8e45fb9721609.tar.gz
xen-b3fb1294fa32a22a3fab69cf85a8e45fb9721609.tar.bz2
xen-b3fb1294fa32a22a3fab69cf85a8e45fb9721609.zip
[TAPDISK] add tapdisk support for image chaining
Enables tapdisk to chain an arbitrary number of VDIs, propagating reads of holes in children to their parent images. Introduces two new functions to the tapdisk interface to facilitate this. Modifies the QCoW plugin to take advantage of these changes, thus providing support for arbitrarily long chains of QCoW image types.
Diffstat (limited to 'tools/blktap/lib')
-rw-r--r--tools/blktap/lib/blktaplib.h13
-rw-r--r--tools/blktap/lib/xs_api.c8
2 files changed, 14 insertions, 7 deletions
diff --git a/tools/blktap/lib/blktaplib.h b/tools/blktap/lib/blktaplib.h
index 12f4950133..0ba3c04ec8 100644
--- a/tools/blktap/lib/blktaplib.h
+++ b/tools/blktap/lib/blktaplib.h
@@ -91,8 +91,9 @@ struct blkif;
typedef struct {
blkif_request_t req;
- struct blkif *blkif;
- int count;
+ struct blkif *blkif;
+ int submitting;
+ int secs_pending;
int16_t status;
} pending_req_t;
@@ -116,7 +117,7 @@ typedef struct blkif {
void *prv; /* device-specific data */
void *info; /*Image parameter passing */
- pending_req_t pending_list[MAX_REQUESTS];
+ pending_req_t pending_list[MAX_REQUESTS];
int devnum;
int fds[2];
int be_id;
@@ -141,6 +142,11 @@ int blkif_init(blkif_t *blkif, long int handle, long int pdev,
void free_blkif(blkif_t *blkif);
void __init_blkif(void);
+typedef struct busy_state {
+ int seg_idx;
+ blkif_request_t *req;
+} busy_state_t;
+
typedef struct tapdev_info {
int fd;
char *mem;
@@ -148,6 +154,7 @@ typedef struct tapdev_info {
blkif_back_ring_t fe_ring;
unsigned long vstart;
blkif_t *blkif;
+ busy_state_t busy;
} tapdev_info_t;
typedef struct domid_translate {
diff --git a/tools/blktap/lib/xs_api.c b/tools/blktap/lib/xs_api.c
index eded38afdc..539d0e3c51 100644
--- a/tools/blktap/lib/xs_api.c
+++ b/tools/blktap/lib/xs_api.c
@@ -311,8 +311,8 @@ int unregister_xenbus_watch(struct xs_handle *h, struct xenbus_watch *watch)
}
if (!xs_unwatch(h, watch->node, token))
- DPRINTF("XENBUS Failed to release watch %s: %i\n",
- watch->node, er);
+ DPRINTF("XENBUS Failed to release watch %s\n",
+ watch->node);
list_del(&watch->list);
@@ -351,9 +351,9 @@ int xs_fire_next_watch(struct xs_handle *h)
node = res[XS_WATCH_PATH];
token = res[XS_WATCH_TOKEN];
-
+
w = find_watch(token);
- if (w)
+ if (w)
w->callback(h, w, node);
free(res);