diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2010-06-08 08:03:41 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2010-06-08 08:03:41 +0100 |
commit | 7b4dea5546ccfc984b33ab0e184bc054c02bd9f2 (patch) | |
tree | 25a7e58fa856298b165b1d1d8bf4246ec3ecca6e /tools/blktap2/drivers/tapdisk-diff.c | |
parent | f867b85581b3722c211e8a6bd082e9d39c79b02c (diff) | |
download | xen-7b4dea5546ccfc984b33ab0e184bc054c02bd9f2.tar.gz xen-7b4dea5546ccfc984b33ab0e184bc054c02bd9f2.tar.bz2 xen-7b4dea5546ccfc984b33ab0e184bc054c02bd9f2.zip |
blktap2: Fix tapdisk disktype issues.
Stop coercing drivers/disktype code into the tool stack. Make both
blktapctrl and tap-ctl transfer type/path pairs as "<type>:<path>"
strings. Remove the message.disktype integer altogether.
Signed-off-by: Daniel Stodden <daniel.stodden@citrix.com>
Signed-off-by: Jake Wires <jake.wires@citrix.com>
Diffstat (limited to 'tools/blktap2/drivers/tapdisk-diff.c')
-rw-r--r-- | tools/blktap2/drivers/tapdisk-diff.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/tools/blktap2/drivers/tapdisk-diff.c b/tools/blktap2/drivers/tapdisk-diff.c index 2c4994888d..1d2ba8e682 100644 --- a/tools/blktap2/drivers/tapdisk-diff.c +++ b/tools/blktap2/drivers/tapdisk-diff.c @@ -38,6 +38,7 @@ #include "scheduler.h" #include "tapdisk-vbd.h" #include "tapdisk-server.h" +#include "tapdisk-disktype.h" #include "libvhd.h" #define POLL_READ 0 @@ -670,11 +671,11 @@ static int tapdisk_stream_open(struct tapdisk_stream *s, const char *arg) { int err, type; - char *path; + const char *path; - err = tapdisk_parse_disk_type(arg, &path, &type); - if (err) - return err; + type = tapdisk_disktype_parse_params(arg, &path); + if (type < 0) + return type; tapdisk_stream_initialize(s); @@ -716,7 +717,8 @@ main(int argc, char *argv[]) { int c, err, type1; const char *arg1 = NULL, *arg2 = NULL; - char *path1; + const disk_info_t *info; + const char *path1; err = 0; @@ -741,9 +743,10 @@ main(int argc, char *argv[]) if (!arg1 || !arg2) goto fail_usage; - err = tapdisk_parse_disk_type(arg1, &path1, &type1); - if (err) - return err; + type1 = tapdisk_disktype_parse_params(arg1, &path1); + if (type1 < 0) + return type1; + if (type1 != DISK_TYPE_VHD) { printf("error: first VDI is not VHD\n"); return EINVAL; |