mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-06-25 11:15:39 +00:00
replace file_size_info by volume_size_info.
Currently we only find a volume size by using qemu-img info (in file_size_info). This doesn't works with "virtual" storage like sheepdog,rbd,iscsidirect,nexenta. This also doesn't work with classic iscsi direct plugin. So, we need to define a method for each plugin. Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
This commit is contained in:
parent
373ea5798a
commit
2a7993d9ef
@ -1868,7 +1868,6 @@ sub disksize {
|
|||||||
} else {
|
} else {
|
||||||
eval {
|
eval {
|
||||||
$storeid = $timeoutid = PVE::Storage::parse_volume_id($volid);
|
$storeid = $timeoutid = PVE::Storage::parse_volume_id($volid);
|
||||||
$path = PVE::Storage::path($storecfg, $volid);
|
|
||||||
};
|
};
|
||||||
if (my $err = $@) {
|
if (my $err = $@) {
|
||||||
warn $err;
|
warn $err;
|
||||||
@ -1887,7 +1886,7 @@ sub disksize {
|
|||||||
|
|
||||||
my ($size, $format, $used);
|
my ($size, $format, $used);
|
||||||
|
|
||||||
($size, $format, $used) = PVE::Storage::file_size_info($path, 1);
|
($size, $format, $used) = PVE::Storage::volume_size_info($storecfg, $volid, 1);
|
||||||
|
|
||||||
if (!defined($format)) {
|
if (!defined($format)) {
|
||||||
# got timeout
|
# got timeout
|
||||||
|
Loading…
Reference in New Issue
Block a user