Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/xapi-project/blktap
Browse files Browse the repository at this point in the history
  • Loading branch information
martinjorge committed Sep 30, 2015
2 parents de6b9fb + 8ab7496 commit 8d1841a
Show file tree
Hide file tree
Showing 46 changed files with 2,469 additions and 42 deletions.
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
SUBDIRS = lvm
SUBDIRS += $(MAYBE_part)
SUBDIRS += vhd
SUBDIRS += thin
SUBDIRS += control
SUBDIRS += drivers
SUBDIRS += include
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.0
3.2.0
16 changes: 16 additions & 0 deletions WHATS_NEW
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
Version 3.2.0 - 24th Sep 2015
================================
Added code to ask lvm blocks on demand (xlvhd thin-provisioning)

Version 3.1.1 - 24th Sep 2015
================================
CA-148438: Expose mem_mode flag in statistics file
CA-161450: Stats between tapdisk and NBD
CA-161451: Stats between tapdisk and blktap
CA-165117: Stats between tapdisk and blkfront
CA-161449: Stats between tapdisk and vdi traffic
CA-170614: Harden the nbdserver code in tapdisk3
CP-12399: Prevent tapback from plugging non-blktap2 devices
CA-169052: Work arounds for NULL uuid in VHD header
CA-153279: don't complain if there's no tapdisk to signal

Version 3.1.0 - 23th Sep 2015
================================
Coverity integration
Expand Down
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,6 @@ control/Makefile
drivers/Makefile
include/Makefile
tapback/Makefile
thin/Makefile
])
AC_OUTPUT
4 changes: 2 additions & 2 deletions control/tap-ctl-create.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

int
tap_ctl_create(const char *params, char **devname, int flags, int parent_minor,
char *secondary, int timeout)
char *secondary, int timeout, int alloc_quantum)
{
int err, id, minor;

Expand All @@ -49,7 +49,7 @@ tap_ctl_create(const char *params, char **devname, int flags, int parent_minor,
goto destroy;

err = tap_ctl_open(id, minor, params, flags, parent_minor, secondary,
timeout);
timeout, alloc_quantum);
if (err)
goto detach;

Expand Down
4 changes: 3 additions & 1 deletion control/tap-ctl-open.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@

int
tap_ctl_open(const int id, const int minor, const char *params, int flags,
const int prt_minor, const char *secondary, int timeout)
const int prt_minor, const char *secondary, int timeout,
int alloc_quantum)
{
int err;
tapdisk_message_t message;
Expand All @@ -41,6 +42,7 @@ tap_ctl_open(const int id, const int minor, const char *params, int flags,
message.u.params.devnum = minor;
message.u.params.prt_devnum = prt_minor;
message.u.params.req_timeout = timeout;
message.u.params.alloc_quantum = alloc_quantum;
message.u.params.flags = flags;

err = snprintf(message.u.params.path,
Expand Down
36 changes: 28 additions & 8 deletions control/tap-ctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,13 +252,16 @@ tap_cli_create_usage(FILE *stream)
"[-r turn on read caching into leaf node] [-2 <path> "
"use secondary image (in mirror mode if no -s)] [-s "
"fail over to the secondary image on ENOSPC] "
"[-t request timeout in seconds] [-D no O_DIRECT]\n");
"[-t request timeout in seconds] [-D no O_DIRECT] "
"[-T enable thin provisioning] "
"[-q allocation quantum in MBytes]\n");

}

static int
tap_cli_create(int argc, char **argv)
{
int c, err, flags, prt_minor, timeout;
int c, err, flags, prt_minor, timeout, alloc_quantum;
char *args, *devname, *secondary;

args = NULL;
Expand All @@ -267,9 +270,10 @@ tap_cli_create(int argc, char **argv)
prt_minor = -1;
flags = 0;
timeout = 0;
alloc_quantum = 0;

optind = 0;
while ((c = getopt(argc, argv, "a:RDd:e:r2:st:h")) != -1) {
while ((c = getopt(argc, argv, "a:RDd:e:r2:st:Tq:h")) != -1) {
switch (c) {
case 'a':
args = optarg;
Expand Down Expand Up @@ -300,6 +304,12 @@ tap_cli_create(int argc, char **argv)
case 't':
timeout = atoi(optarg);
break;
case 'T':
flags |= TAPDISK_MESSAGE_FLAG_THIN;
break;
case 'q':
alloc_quantum = atoi(optarg);
break;
case '?':
goto usage;
case 'h':
Expand All @@ -312,7 +322,7 @@ tap_cli_create(int argc, char **argv)
goto usage;

err = tap_ctl_create(args, &devname, flags, prt_minor, secondary,
timeout);
timeout, alloc_quantum);
if (!err)
printf("%s\n", devname);

Expand Down Expand Up @@ -717,14 +727,16 @@ tap_cli_open_usage(FILE *stream)
"[-r turn on read caching into leaf node] [-2 <path> "
"use secondary image (in mirror mode if no -s)] [-s "
"fail over to the secondary image on ENOSPC] "
"[-t request timeout in seconds] [-D no O_DIRECT]\n");
"[-t request timeout in seconds] [-D no O_DIRECT] "
"[-T enable thin provisioning] "
"[-q allocation quantum in MBytes]\n");
}

static int
tap_cli_open(int argc, char **argv)
{
const char *args, *secondary;
int c, pid, minor, flags, prt_minor, timeout;
int c, pid, minor, flags, prt_minor, timeout, alloc_quantum;

flags = 0;
pid = -1;
Expand All @@ -733,9 +745,11 @@ tap_cli_open(int argc, char **argv)
timeout = 0;
args = NULL;
secondary = NULL;
alloc_quantum = 0;


optind = 0;
while ((c = getopt(argc, argv, "a:RDm:p:e:r2:st:h")) != -1) {
while ((c = getopt(argc, argv, "a:RDm:p:e:r2:st:Tq:h")) != -1) {
switch (c) {
case 'p':
pid = atoi(optarg);
Expand Down Expand Up @@ -769,6 +783,12 @@ tap_cli_open(int argc, char **argv)
case 't':
timeout = atoi(optarg);
break;
case 'T':
flags |= TAPDISK_MESSAGE_FLAG_THIN;
break;
case 'q':
alloc_quantum = atoi(optarg);
break;
case '?':
goto usage;
case 'h':
Expand All @@ -781,7 +801,7 @@ tap_cli_open(int argc, char **argv)
goto usage;

return tap_ctl_open(pid, minor, args, flags, prt_minor, secondary,
timeout);
timeout, alloc_quantum);

usage:
tap_cli_open_usage(stderr);
Expand Down
1 change: 1 addition & 0 deletions drivers/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ libtapdisk_la_SOURCES += td-stats.c
libtapdisk_la_SOURCES += td-stats.h

libtapdisk_la_LIBADD = ../vhd/lib/libvhd.la
libtapdisk_la_LIBADD += ../thin/libtapdiskthin.la
libtapdisk_la_LIBADD += -laio
libtapdisk_la_LIBADD += -lxenctrl

Expand Down
Loading

0 comments on commit 8d1841a

Please sign in to comment.