There's no need to set the default pool in set_pool_image_name - this
is done later, in a way that doesn't ignore --pool if --dest-pool
is not specified.
This means --pool and --image can be used with import, just like
the rest of the commands. Without this change, --dest and --dest-pool
had to be used, and --pool would be silently ignored for rbd import.
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
if (orig_pool)
return;
- if (!orig_img) {
- *new_pool = strdup("rbd");
+ if (!orig_img)
return;
- }
sep = strchr(orig_img, '/');
if (!sep) {
- *new_pool= strdup("rbd");
*new_img = strdup(orig_img);
goto done_img;
}
return EXIT_FAILURE;
}
- if (opt_cmd == OPT_IMPORT && !destname)
- destname = imgname_from_path(path);
+ if (opt_cmd == OPT_IMPORT && !destname) {
+ destname = imgname;
+ if (!destname)
+ destname = imgname_from_path(path);
+ }
if (opt_cmd != OPT_LIST && opt_cmd != OPT_IMPORT && opt_cmd != OPT_UNMAP && opt_cmd != OPT_SHOWMAPPED &&
!imgname) {