mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-05-02 17:20:30 +00:00
filter by content type when using vdisk_list
except for migration, where it would be subtly backwards-incompatible. Since there is a scan_volids call for migration, we can't default to filtering in scan_volids just yet. Also allows to get rid of the existing filtering hack in rescan(). Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
This commit is contained in:
parent
d4be7f31b5
commit
d0ff75d9b4
@ -2156,7 +2156,7 @@ sub destroy_vm {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if ($purge_unreferenced) { # also remove unreferenced disk
|
if ($purge_unreferenced) { # also remove unreferenced disk
|
||||||
my $vmdisks = PVE::Storage::vdisk_list($storecfg, undef, $vmid);
|
my $vmdisks = PVE::Storage::vdisk_list($storecfg, undef, $vmid, undef, 'images');
|
||||||
PVE::Storage::foreach_volid($vmdisks, sub {
|
PVE::Storage::foreach_volid($vmdisks, sub {
|
||||||
my ($volid, $sid, $volname, $d) = @_;
|
my ($volid, $sid, $volname, $d) = @_;
|
||||||
eval { PVE::Storage::vdisk_free($storecfg, $volid) };
|
eval { PVE::Storage::vdisk_free($storecfg, $volid) };
|
||||||
@ -6070,10 +6070,11 @@ my $restore_destroy_volumes = sub {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# FIXME For PVE 7.0, remove $content_type and always use 'images'
|
||||||
sub scan_volids {
|
sub scan_volids {
|
||||||
my ($cfg, $vmid) = @_;
|
my ($cfg, $vmid, $content_type) = @_;
|
||||||
|
|
||||||
my $info = PVE::Storage::vdisk_list($cfg, undef, $vmid);
|
my $info = PVE::Storage::vdisk_list($cfg, undef, $vmid, undef, $content_type);
|
||||||
|
|
||||||
my $volid_hash = {};
|
my $volid_hash = {};
|
||||||
foreach my $storeid (keys %$info) {
|
foreach my $storeid (keys %$info) {
|
||||||
@ -6166,14 +6167,8 @@ sub rescan {
|
|||||||
|
|
||||||
my $cfg = PVE::Storage::config();
|
my $cfg = PVE::Storage::config();
|
||||||
|
|
||||||
# FIXME: Remove once our RBD plugin can handle CT and VM on a single storage
|
|
||||||
# see: https://pve.proxmox.com/pipermail/pve-devel/2018-July/032900.html
|
|
||||||
foreach my $stor (keys %{$cfg->{ids}}) {
|
|
||||||
delete($cfg->{ids}->{$stor}) if ! $cfg->{ids}->{$stor}->{content}->{images};
|
|
||||||
}
|
|
||||||
|
|
||||||
print "rescan volumes...\n";
|
print "rescan volumes...\n";
|
||||||
my $volid_hash = scan_volids($cfg, $vmid);
|
my $volid_hash = scan_volids($cfg, $vmid, 'images');
|
||||||
|
|
||||||
my $updatefn = sub {
|
my $updatefn = sub {
|
||||||
my ($vmid) = @_;
|
my ($vmid) = @_;
|
||||||
|
Loading…
Reference in New Issue
Block a user