1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

cov: validation

Add internal error for missing vg.
This commit is contained in:
Zdenek Kabelac 2024-04-25 23:51:58 +02:00
parent c6a37ddca4
commit 57ab219d9b

View File

@ -627,6 +627,11 @@ static int _pvmove_setup_single(struct cmd_context *cmd,
unsigned exclusive; unsigned exclusive;
int r = ECMD_FAILED; int r = ECMD_FAILED;
if (!vg) {
log_error(INTERNAL_ERROR "Missing volume group.");
return r;
}
pp->found_pv = 1; pp->found_pv = 1;
pp->setup_result = ECMD_FAILED; pp->setup_result = ECMD_FAILED;
@ -761,6 +766,11 @@ static int _pvmove_read_single(struct cmd_context *cmd,
struct logical_volume *lv; struct logical_volume *lv;
int ret = ECMD_FAILED; int ret = ECMD_FAILED;
if (!vg) {
log_error(INTERNAL_ERROR "Missing volume group.");
return ret;
}
pp->found_pv = 1; pp->found_pv = 1;
if (!(lv = find_pvmove_lv(vg, pv_dev(pv), PVMOVE))) { if (!(lv = find_pvmove_lv(vg, pv_dev(pv), PVMOVE))) {