mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-02 23:16:05 +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;
|
||||
}
|
||||
|
||||
# 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 {
|
||||
my ($conf) = @_;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user