mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-08-07 14:53:38 +00:00
tree-wide: fix various typos in comments
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
375dda9457
commit
8770febbef
@ -794,7 +794,7 @@ my $check_vm_modify_config_perm = sub {
|
|||||||
|
|
||||||
foreach my $opt (@$key_list) {
|
foreach my $opt (@$key_list) {
|
||||||
# some checks (e.g., disk, serial port, usb) need to be done somewhere
|
# some checks (e.g., disk, serial port, usb) need to be done somewhere
|
||||||
# else, as there the permission can be value dependend
|
# else, as there the permission can be value dependent
|
||||||
next if PVE::QemuServer::is_valid_drivename($opt);
|
next if PVE::QemuServer::is_valid_drivename($opt);
|
||||||
next if $opt eq 'cdrom';
|
next if $opt eq 'cdrom';
|
||||||
next if $opt =~ m/^(?:unused|serial|usb|hostpci)\d+$/;
|
next if $opt =~ m/^(?:unused|serial|usb|hostpci)\d+$/;
|
||||||
@ -2566,7 +2566,7 @@ __PACKAGE__->register_method({
|
|||||||
if ($node ne 'localhost' && $node ne PVE::INotify::nodename()) {
|
if ($node ne 'localhost' && $node ne PVE::INotify::nodename()) {
|
||||||
(undef, $family) = PVE::Cluster::remote_node_ip($node);
|
(undef, $family) = PVE::Cluster::remote_node_ip($node);
|
||||||
my $sshinfo = PVE::SSHInfo::get_ssh_info($node);
|
my $sshinfo = PVE::SSHInfo::get_ssh_info($node);
|
||||||
# NOTE: kvm VNC traffic is already TLS encrypted or is known unsecure
|
# NOTE: kvm VNC traffic is already TLS encrypted or is known insecure
|
||||||
$remcmd = PVE::SSHInfo::ssh_info_to_command($sshinfo, defined($serial) ? '-t' : '-T');
|
$remcmd = PVE::SSHInfo::ssh_info_to_command($sshinfo, defined($serial) ? '-t' : '-T');
|
||||||
} else {
|
} else {
|
||||||
$family = PVE::Tools::get_host_address_family($node);
|
$family = PVE::Tools::get_host_address_family($node);
|
||||||
@ -2794,7 +2794,7 @@ __PACKAGE__->register_method({
|
|||||||
|
|
||||||
my $conf = PVE::QemuConfig->load_config($vmid, $node); # VM exists ?
|
my $conf = PVE::QemuConfig->load_config($vmid, $node); # VM exists ?
|
||||||
|
|
||||||
# Note: VNC ports are acessible from outside, so we do not gain any
|
# Note: VNC ports are accessible from outside, so we do not gain any
|
||||||
# security if we verify that $param->{port} belongs to VM $vmid. This
|
# security if we verify that $param->{port} belongs to VM $vmid. This
|
||||||
# check is done by verifying the VNC ticket (inside VNC protocol).
|
# check is done by verifying the VNC ticket (inside VNC protocol).
|
||||||
|
|
||||||
@ -4067,7 +4067,7 @@ __PACKAGE__->register_method({
|
|||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Aquire exclusive lock lock for $newid
|
# Acquire exclusive lock lock for $newid
|
||||||
my $lock_target_vm = sub {
|
my $lock_target_vm = sub {
|
||||||
return PVE::QemuConfig->lock_config_full($newid, 1, $clonefn);
|
return PVE::QemuConfig->lock_config_full($newid, 1, $clonefn);
|
||||||
};
|
};
|
||||||
|
@ -1184,7 +1184,7 @@ our $cmddef = {
|
|||||||
|
|
||||||
unlock => [ __PACKAGE__, 'unlock', ['vmid']],
|
unlock => [ __PACKAGE__, 'unlock', ['vmid']],
|
||||||
|
|
||||||
# TODO: evluate dropping below aliases for 8.0, if no usage is left
|
# TODO: evaluate dropping below aliases for 8.0, if no usage is left
|
||||||
importdisk => { alias => 'disk import' },
|
importdisk => { alias => 'disk import' },
|
||||||
'move-disk' => { alias => 'disk move' },
|
'move-disk' => { alias => 'disk move' },
|
||||||
move_disk => { alias => 'disk move' },
|
move_disk => { alias => 'disk move' },
|
||||||
|
@ -403,7 +403,7 @@ sub mux_input {
|
|||||||
my $cmdid = $obj->{'return'};
|
my $cmdid = $obj->{'return'};
|
||||||
die "received response without command id\n" if !$cmdid;
|
die "received response without command id\n" if !$cmdid;
|
||||||
|
|
||||||
# skip results fro previous commands
|
# skip results from previous commands
|
||||||
return if $cmdid < $curcmd->{id};
|
return if $cmdid < $curcmd->{id};
|
||||||
|
|
||||||
if ($curcmd->{id} ne $cmdid) {
|
if ($curcmd->{id} ne $cmdid) {
|
||||||
|
@ -423,7 +423,7 @@ sub scan_local_volumes {
|
|||||||
if (defined($snaprefs)) {
|
if (defined($snaprefs)) {
|
||||||
$local_volumes->{$volid}->{snapshots} = 1;
|
$local_volumes->{$volid}->{snapshots} = 1;
|
||||||
|
|
||||||
# we cannot migrate shapshots on local storage
|
# we cannot migrate snapshots on local storage
|
||||||
# exceptions: 'zfspool' or 'qcow2' files (on directory storage)
|
# exceptions: 'zfspool' or 'qcow2' files (on directory storage)
|
||||||
|
|
||||||
die "online storage migration not possible if non-replicated snapshot exists\n"
|
die "online storage migration not possible if non-replicated snapshot exists\n"
|
||||||
@ -1299,10 +1299,10 @@ sub phase2 {
|
|||||||
my $speed = ($memstat->{'pages-per-second'} // 0) * ($memstat->{'page-size'} // 0);
|
my $speed = ($memstat->{'pages-per-second'} // 0) * ($memstat->{'page-size'} // 0);
|
||||||
my $dirty_rate = ($memstat->{'dirty-pages-rate'} // 0) * ($memstat->{'page-size'} // 0);
|
my $dirty_rate = ($memstat->{'dirty-pages-rate'} // 0) * ($memstat->{'page-size'} // 0);
|
||||||
|
|
||||||
# reduce sleep if remainig memory is lower than the average transfer speed
|
# reduce sleep if remaining memory is lower than the average transfer speed
|
||||||
$usleep = 100_000 if $avglstat && $rem < $avglstat;
|
$usleep = 100_000 if $avglstat && $rem < $avglstat;
|
||||||
|
|
||||||
# also reduce loggin if we poll more frequent
|
# also reduce logging if we poll more frequent
|
||||||
my $should_log = $usleep > 100_000 ? 1 : ($i % 10) == 0;
|
my $should_log = $usleep > 100_000 ? 1 : ($i % 10) == 0;
|
||||||
|
|
||||||
my $total_h = render_bytes($total, 1);
|
my $total_h = render_bytes($total, 1);
|
||||||
@ -1402,7 +1402,7 @@ sub phase2_cleanup {
|
|||||||
$self->log('err', $err);
|
$self->log('err', $err);
|
||||||
}
|
}
|
||||||
|
|
||||||
# cleanup ressources on target host
|
# cleanup resources on target host
|
||||||
if ($self->{storage_migration}) {
|
if ($self->{storage_migration}) {
|
||||||
eval { PVE::QemuServer::qemu_blockjobs_cancel($vmid, $self->{storage_migration_jobs}) };
|
eval { PVE::QemuServer::qemu_blockjobs_cancel($vmid, $self->{storage_migration_jobs}) };
|
||||||
if (my $err = $@) {
|
if (my $err = $@) {
|
||||||
|
@ -107,8 +107,8 @@ my $OVMF = {
|
|||||||
|
|
||||||
my $cpuinfo = PVE::ProcFSTools::read_cpuinfo();
|
my $cpuinfo = PVE::ProcFSTools::read_cpuinfo();
|
||||||
|
|
||||||
# Note about locking: we use flock on the config file protect against concurent actions.
|
# Note about locking: we use flock on the config file protect against concurrent actions.
|
||||||
# Aditionaly, we have a 'lock' setting in the config file. This can be set to 'migrate',
|
# Additionally, we have a 'lock' setting in the config file. This can be set to 'migrate',
|
||||||
# 'backup', 'snapshot' or 'rollback'. Most actions are not allowed when such lock is set.
|
# 'backup', 'snapshot' or 'rollback'. Most actions are not allowed when such lock is set.
|
||||||
# But you can ignore this kind of lock with the --skiplock flag.
|
# But you can ignore this kind of lock with the --skiplock flag.
|
||||||
|
|
||||||
@ -1655,7 +1655,7 @@ sub print_drive_commandline_full {
|
|||||||
# my $file_param = $live_restore_name ? "file.file.filename" : "file";
|
# my $file_param = $live_restore_name ? "file.file.filename" : "file";
|
||||||
my $file_param = "file";
|
my $file_param = "file";
|
||||||
if ($live_restore_name) {
|
if ($live_restore_name) {
|
||||||
# non-rbd drivers require the underlying file to be a seperate block
|
# non-rbd drivers require the underlying file to be a separate block
|
||||||
# node, so add a second .file indirection
|
# node, so add a second .file indirection
|
||||||
$file_param .= ".file" if !$is_rbd;
|
$file_param .= ".file" if !$is_rbd;
|
||||||
$file_param .= ".filename";
|
$file_param .= ".filename";
|
||||||
@ -3074,7 +3074,7 @@ sub vmstatus {
|
|||||||
$qmpclient->queue_cmd($vmid, $machinecb, 'query-machines');
|
$qmpclient->queue_cmd($vmid, $machinecb, 'query-machines');
|
||||||
$qmpclient->queue_cmd($vmid, $versioncb, 'query-version');
|
$qmpclient->queue_cmd($vmid, $versioncb, 'query-version');
|
||||||
# this fails if ballon driver is not loaded, so this must be
|
# this fails if ballon driver is not loaded, so this must be
|
||||||
# the last commnand (following command are aborted if this fails).
|
# the last command (following command are aborted if this fails).
|
||||||
$qmpclient->queue_cmd($vmid, $ballooncb, 'query-balloon');
|
$qmpclient->queue_cmd($vmid, $ballooncb, 'query-balloon');
|
||||||
|
|
||||||
my $status = 'unknown';
|
my $status = 'unknown';
|
||||||
@ -4672,7 +4672,7 @@ sub qemu_cpu_hotplug {
|
|||||||
$retry++;
|
$retry++;
|
||||||
sleep 1;
|
sleep 1;
|
||||||
}
|
}
|
||||||
#update conf after each succesfull cpu unplug
|
#update conf after each successful cpu unplug
|
||||||
$conf->{vcpus} = scalar(@{$currentrunningvcpus});
|
$conf->{vcpus} = scalar(@{$currentrunningvcpus});
|
||||||
PVE::QemuConfig->write_config($vmid, $conf);
|
PVE::QemuConfig->write_config($vmid, $conf);
|
||||||
}
|
}
|
||||||
@ -4703,7 +4703,7 @@ sub qemu_cpu_hotplug {
|
|||||||
sleep 1;
|
sleep 1;
|
||||||
$retry++;
|
$retry++;
|
||||||
}
|
}
|
||||||
#update conf after each succesfull cpu hotplug
|
#update conf after each successful cpu hotplug
|
||||||
$conf->{vcpus} = scalar(@{$currentrunningvcpus});
|
$conf->{vcpus} = scalar(@{$currentrunningvcpus});
|
||||||
PVE::QemuConfig->write_config($vmid, $conf);
|
PVE::QemuConfig->write_config($vmid, $conf);
|
||||||
}
|
}
|
||||||
@ -5963,7 +5963,7 @@ sub vm_start_nolock {
|
|||||||
if (my $cpulimit = $conf->{cpulimit}) {
|
if (my $cpulimit = $conf->{cpulimit}) {
|
||||||
$systemd_properties{CPUQuota} = int($cpulimit * 100);
|
$systemd_properties{CPUQuota} = int($cpulimit * 100);
|
||||||
}
|
}
|
||||||
$systemd_properties{timeout} = 10 if $statefile; # setting up the scope shoul be quick
|
$systemd_properties{timeout} = 10 if $statefile; # setting up the scope should be quick
|
||||||
|
|
||||||
my $run_qemu = sub {
|
my $run_qemu = sub {
|
||||||
PVE::Tools::run_fork sub {
|
PVE::Tools::run_fork sub {
|
||||||
@ -6652,7 +6652,7 @@ sub check_restore_permissions {
|
|||||||
check_bridge_access($rpcenv, $user, $conf);
|
check_bridge_access($rpcenv, $user, $conf);
|
||||||
check_mapping_access($rpcenv, $user, $conf);
|
check_mapping_access($rpcenv, $user, $conf);
|
||||||
}
|
}
|
||||||
# vzdump restore implementaion
|
# vzdump restore implementation
|
||||||
|
|
||||||
sub tar_archive_read_firstfile {
|
sub tar_archive_read_firstfile {
|
||||||
my $archive = shift;
|
my $archive = shift;
|
||||||
@ -6716,7 +6716,7 @@ sub restore_file_archive {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# hepler to remove disks that will not be used after restore
|
# helper to remove disks that will not be used after restore
|
||||||
my $restore_cleanup_oldconf = sub {
|
my $restore_cleanup_oldconf = sub {
|
||||||
my ($storecfg, $vmid, $oldconf, $virtdev_hash) = @_;
|
my ($storecfg, $vmid, $oldconf, $virtdev_hash) = @_;
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ sub get_cloudinit_format {
|
|||||||
# No format specified, default based on ostype because windows'
|
# No format specified, default based on ostype because windows'
|
||||||
# cloudbased-init only supports configdrivev2, whereas on linux we need
|
# cloudbased-init only supports configdrivev2, whereas on linux we need
|
||||||
# to use mac addresses because regular cloudinit doesn't map 'ethX' to
|
# to use mac addresses because regular cloudinit doesn't map 'ethX' to
|
||||||
# the new predicatble network device naming scheme.
|
# the new predictable network device naming scheme.
|
||||||
if (defined(my $ostype = $conf->{ostype})) {
|
if (defined(my $ostype = $conf->{ostype})) {
|
||||||
return 'configdrive2'
|
return 'configdrive2'
|
||||||
if PVE::QemuServer::Helpers::windows_version($ostype);
|
if PVE::QemuServer::Helpers::windows_version($ostype);
|
||||||
|
@ -102,7 +102,7 @@ sub get_current_qemu_machine {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# returns a string with major.minor+pve<VERSION>, patch version-part is ignored
|
# returns a string with major.minor+pve<VERSION>, patch version-part is ignored
|
||||||
# as it's seldom ressembling a real QEMU machine type, so it would be '0' 99% of
|
# as it's seldom resembling a real QEMU machine type, so it would be '0' 99% of
|
||||||
# the time anyway.. This explicitly separates pveversion from the machine.
|
# the time anyway.. This explicitly separates pveversion from the machine.
|
||||||
sub extract_version {
|
sub extract_version {
|
||||||
my ($machine_type, $kvmversion) = @_;
|
my ($machine_type, $kvmversion) = @_;
|
||||||
|
@ -278,7 +278,7 @@ sub qemu_memory_hotplug {
|
|||||||
eval { qemu_objectdel($vmid, "mem-$name"); };
|
eval { qemu_objectdel($vmid, "mem-$name"); };
|
||||||
die $err;
|
die $err;
|
||||||
}
|
}
|
||||||
#update conf after each succesful module hotplug
|
# update conf after each successful module hotplug
|
||||||
$newmem->{current} = $current_size;
|
$newmem->{current} = $current_size;
|
||||||
$conf->{memory} = print_memory($newmem);
|
$conf->{memory} = print_memory($newmem);
|
||||||
PVE::QemuConfig->write_config($vmid, $conf);
|
PVE::QemuConfig->write_config($vmid, $conf);
|
||||||
@ -307,7 +307,7 @@ sub qemu_memory_hotplug {
|
|||||||
$retry++;
|
$retry++;
|
||||||
}
|
}
|
||||||
$current_size -= $dimm_size;
|
$current_size -= $dimm_size;
|
||||||
#update conf after each succesful module unplug
|
# update conf after each successful module unplug
|
||||||
$newmem->{current} = $current_size;
|
$newmem->{current} = $current_size;
|
||||||
$conf->{memory} = print_memory($newmem);
|
$conf->{memory} = print_memory($newmem);
|
||||||
|
|
||||||
@ -724,7 +724,7 @@ sub hugepages_reset {
|
|||||||
sub hugepages_update_locked {
|
sub hugepages_update_locked {
|
||||||
my ($code, @param) = @_;
|
my ($code, @param) = @_;
|
||||||
|
|
||||||
my $timeout = 60; #could be long if a lot of hugepages need to be alocated
|
my $timeout = 60; #could be long if a lot of hugepages need to be allocated
|
||||||
|
|
||||||
my $lock_filename = "/var/lock/hugepages.lck";
|
my $lock_filename = "/var/lock/hugepages.lck";
|
||||||
|
|
||||||
|
@ -740,7 +740,7 @@ my $PCIID_RESERVATION_FILE = "${RUNDIR}/pci-id-reservations";
|
|||||||
my $PCIID_RESERVATION_LOCK = "${PCIID_RESERVATION_FILE}.lock";
|
my $PCIID_RESERVATION_LOCK = "${PCIID_RESERVATION_FILE}.lock";
|
||||||
|
|
||||||
# a list of PCI ID to VMID reservations, the validity is protected against leakage by either a PID,
|
# a list of PCI ID to VMID reservations, the validity is protected against leakage by either a PID,
|
||||||
# for succesfully started VM processes, or a expiration time for the initial time window between
|
# for successfully started VM processes, or a expiration time for the initial time window between
|
||||||
# reservation and actual VM process start-up.
|
# reservation and actual VM process start-up.
|
||||||
my $parse_pci_reservation_unlocked = sub {
|
my $parse_pci_reservation_unlocked = sub {
|
||||||
my $pci_ids = {};
|
my $pci_ids = {};
|
||||||
@ -855,7 +855,7 @@ sub reserve_pci_usage {
|
|||||||
$reservation_list->{$id} = { vmid => $vmid };
|
$reservation_list->{$id} = { vmid => $vmid };
|
||||||
if (defined($pid)) { # VM started up, we can reserve now with the actual PID
|
if (defined($pid)) { # VM started up, we can reserve now with the actual PID
|
||||||
$reservation_list->{$id}->{pid} = $pid;
|
$reservation_list->{$id}->{pid} = $pid;
|
||||||
} elsif (defined($timeout)) { # tempoaray reserve as we don't now the PID yet
|
} elsif (defined($timeout)) { # temporary reserve as we don't now the PID yet
|
||||||
$reservation_list->{$id}->{time} = $ctime + $timeout + 5;
|
$reservation_list->{$id}->{time} = $ctime + $timeout + 5;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ sub qemu_objectdel {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
# dies if a) VM not running or not exisiting b) Version query failed
|
# dies if a) VM not running or not existing b) Version query failed
|
||||||
# So, any defined return value is valid, any invalid state can be caught by eval
|
# So, any defined return value is valid, any invalid state can be caught by eval
|
||||||
sub runs_at_least_qemu_version {
|
sub runs_at_least_qemu_version {
|
||||||
my ($vmid, $major, $minor, $extra) = @_;
|
my ($vmid, $major, $minor, $extra) = @_;
|
||||||
|
@ -695,7 +695,7 @@ sub archive_pbs {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
# get list early so we die on unkown drive types before doing anything
|
# get list early so we die on unknown drive types before doing anything
|
||||||
my $devlist = _get_task_devlist($task);
|
my $devlist = _get_task_devlist($task);
|
||||||
|
|
||||||
$self->enforce_vm_running_for_backup($vmid);
|
$self->enforce_vm_running_for_backup($vmid);
|
||||||
|
Loading…
Reference in New Issue
Block a user