mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-06 20:32:44 +00:00
New method to check if VM uses local resources
This commit is contained in:
parent
1ef75254a1
commit
64e1340181
@ -1614,6 +1614,27 @@ sub config_list {
|
|||||||
return $res;
|
return $res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# test if VM uses local resources (to prevent migration)
|
||||||
|
sub check_local_resources {
|
||||||
|
my ($conf, $noerr) = @_;
|
||||||
|
|
||||||
|
my $loc_res = 0;
|
||||||
|
# fixme:
|
||||||
|
die "implement me";
|
||||||
|
$loc_res = 1 if $conf->{hostusb};
|
||||||
|
$loc_res = 1 if $conf->{hostpci};
|
||||||
|
$loc_res = 1 if $conf->{serial};
|
||||||
|
$loc_res = 1 if $conf->{parallel};
|
||||||
|
|
||||||
|
foreach $k (keys %$conf) {
|
||||||
|
$loc_res = 1 if $k =~ m/^(usb|pci)\d+$/;
|
||||||
|
}
|
||||||
|
|
||||||
|
die "VM uses local resources\n" if $loc_res && !$noerr;
|
||||||
|
|
||||||
|
return $loc_res;
|
||||||
|
}
|
||||||
|
|
||||||
sub check_lock {
|
sub check_lock {
|
||||||
my ($conf) = @_;
|
my ($conf) = @_;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user