Do not happily NBD "map" non-existing images, do not try to benchmark them too
parent
2a0b881685
commit
0757ba630a
|
@ -247,6 +247,12 @@ static int sec_setup(struct thread_data *td)
|
||||||
vitastor_c_uring_wait_events(bsd->cli);
|
vitastor_c_uring_wait_events(bsd->cli);
|
||||||
}
|
}
|
||||||
td->files[0]->real_file_size = vitastor_c_inode_get_size(bsd->watch);
|
td->files[0]->real_file_size = vitastor_c_inode_get_size(bsd->watch);
|
||||||
|
if (!vitastor_c_inode_get_num(bsd->watch) ||
|
||||||
|
!td->files[0]->real_file_size)
|
||||||
|
{
|
||||||
|
td_verror(td, EINVAL, "image does not exist");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bsd->trace = o->trace ? true : false;
|
bsd->trace = o->trace ? true : false;
|
||||||
|
|
|
@ -190,6 +190,12 @@ public:
|
||||||
}
|
}
|
||||||
watch = cli->st_cli.watch_inode(image_name);
|
watch = cli->st_cli.watch_inode(image_name);
|
||||||
device_size = watch->cfg.size;
|
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
|
// Initialize NBD
|
||||||
int sockfd[2];
|
int sockfd[2];
|
||||||
|
|
Loading…
Reference in New Issue