|
@@ -83,6 +83,7 @@ static void usage(const char *name)
|
|
" -t, --persistent don't exit on the last connection\n"
|
|
" -t, --persistent don't exit on the last connection\n"
|
|
" -v, --verbose display extra debugging information\n"
|
|
" -v, --verbose display extra debugging information\n"
|
|
" -x, --export-name=NAME expose export by name\n"
|
|
" -x, --export-name=NAME expose export by name\n"
|
|
|
|
+" -D, --description=TEXT with -x, also export a human-readable description\n"
|
|
"\n"
|
|
"\n"
|
|
"Exposing part of the image:\n"
|
|
"Exposing part of the image:\n"
|
|
" -o, --offset=OFFSET offset into the image\n"
|
|
" -o, --offset=OFFSET offset into the image\n"
|
|
@@ -477,7 +478,7 @@ int main(int argc, char **argv)
|
|
off_t fd_size;
|
|
off_t fd_size;
|
|
QemuOpts *sn_opts = NULL;
|
|
QemuOpts *sn_opts = NULL;
|
|
const char *sn_id_or_name = NULL;
|
|
const char *sn_id_or_name = NULL;
|
|
- const char *sopt = "hVb:o:p:rsnP:c:dvk:e:f:tl:x:T:";
|
|
|
|
|
|
+ const char *sopt = "hVb:o:p:rsnP:c:dvk:e:f:tl:x:T:D:";
|
|
struct option lopt[] = {
|
|
struct option lopt[] = {
|
|
{ "help", no_argument, NULL, 'h' },
|
|
{ "help", no_argument, NULL, 'h' },
|
|
{ "version", no_argument, NULL, 'V' },
|
|
{ "version", no_argument, NULL, 'V' },
|
|
@@ -503,6 +504,7 @@ int main(int argc, char **argv)
|
|
{ "verbose", no_argument, NULL, 'v' },
|
|
{ "verbose", no_argument, NULL, 'v' },
|
|
{ "object", required_argument, NULL, QEMU_NBD_OPT_OBJECT },
|
|
{ "object", required_argument, NULL, QEMU_NBD_OPT_OBJECT },
|
|
{ "export-name", required_argument, NULL, 'x' },
|
|
{ "export-name", required_argument, NULL, 'x' },
|
|
|
|
+ { "description", required_argument, NULL, 'D' },
|
|
{ "tls-creds", required_argument, NULL, QEMU_NBD_OPT_TLSCREDS },
|
|
{ "tls-creds", required_argument, NULL, QEMU_NBD_OPT_TLSCREDS },
|
|
{ "image-opts", no_argument, NULL, QEMU_NBD_OPT_IMAGE_OPTS },
|
|
{ "image-opts", no_argument, NULL, QEMU_NBD_OPT_IMAGE_OPTS },
|
|
{ "trace", required_argument, NULL, 'T' },
|
|
{ "trace", required_argument, NULL, 'T' },
|
|
@@ -524,6 +526,7 @@ int main(int argc, char **argv)
|
|
BlockdevDetectZeroesOptions detect_zeroes = BLOCKDEV_DETECT_ZEROES_OPTIONS_OFF;
|
|
BlockdevDetectZeroesOptions detect_zeroes = BLOCKDEV_DETECT_ZEROES_OPTIONS_OFF;
|
|
QDict *options = NULL;
|
|
QDict *options = NULL;
|
|
const char *export_name = NULL;
|
|
const char *export_name = NULL;
|
|
|
|
+ const char *export_description = NULL;
|
|
const char *tlscredsid = NULL;
|
|
const char *tlscredsid = NULL;
|
|
bool imageOpts = false;
|
|
bool imageOpts = false;
|
|
bool writethrough = true;
|
|
bool writethrough = true;
|
|
@@ -689,6 +692,9 @@ int main(int argc, char **argv)
|
|
case 'x':
|
|
case 'x':
|
|
export_name = optarg;
|
|
export_name = optarg;
|
|
break;
|
|
break;
|
|
|
|
+ case 'D':
|
|
|
|
+ export_description = optarg;
|
|
|
|
+ break;
|
|
case 'v':
|
|
case 'v':
|
|
verbose = 1;
|
|
verbose = 1;
|
|
break;
|
|
break;
|
|
@@ -937,7 +943,11 @@ int main(int argc, char **argv)
|
|
}
|
|
}
|
|
if (export_name) {
|
|
if (export_name) {
|
|
nbd_export_set_name(exp, export_name);
|
|
nbd_export_set_name(exp, export_name);
|
|
|
|
+ nbd_export_set_description(exp, export_description);
|
|
newproto = true;
|
|
newproto = true;
|
|
|
|
+ } else if (export_description) {
|
|
|
|
+ error_report("Export description requires an export name");
|
|
|
|
+ exit(EXIT_FAILURE);
|
|
}
|
|
}
|
|
|
|
|
|
server_ioc = qio_channel_socket_new();
|
|
server_ioc = qio_channel_socket_new();
|