[pve-devel] need advise on rbd disk editing/change (die on path not exist)
Alexandre DERUMIER
aderumier at odiso.com
Mon Jun 18 09:26:49 CEST 2012
Hi,
I found a bug when editing a disk with rbd disk
in Qemu.pm
my $create_disks = sub {
....
} else {
my $path = $rpcenv->check_volume_access($authuser, $storecfg, $vmid, $volid);
PVE::Storage::activate_volumes($storecfg, [ $volid ])
if PVE::Storage::parse_volume_id ($volid, 1);
die "image '$path' does not exists\n" if (!(-f $path || -b $path));
$res->{$ds} = $settings->{$ds};
}
As path is "virtual" (don't exist on host as real path), it's die on path does not exist.
What's the best method to implement a check disk exist ?
maybe vdisk_list and check if disk exist ?
my $dl = PVE::Storage::vdisk_list($storecfg, undef, $vmid);
More information about the pve-devel
mailing list