Do not happily NBD "map" non-existing images, do not try to benchmark them too

This commit is contained in:
Vitaliy Filippov
2022-01-23 23:03:42 +03:00
parent 2a0b881685
commit 0757ba630a
2 changed files with 12 additions and 0 deletions
+6
View File
@@ -190,6 +190,12 @@ public:
}
watch = cli->st_cli.watch_inode(image_name);
device_size = watch->cfg.size;
if (!watch->cfg.num || !device_size)
{
// Image does not exist
fprintf(stderr, "Image %s does not exist\n", image_name.c_str());
exit(1);
}
}
// Initialize NBD
int sockfd[2];