restore_vma_archive: do not overwrite global signal handlers
perls 'local' must be either used in front of each $SIG{...}
assignments or they must be put in a list, else it affects only the
first variable and the rest are *not* in local context.
This may cause weird behaviour where daemons seemingly do not get
terminating signals delivered correctly and thus may not shutdown
gracefully anymore.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
API/clone: do not overwrite global signal handlers
perls 'local' must be either used in front of each $SIG{...}
assignments or they must be put in a list, else it affects only the
first variable and the rest are *not* in local context.
This may cause weird behaviour where daemons seemingly do not get
terminating signals delivered correctly and thus may not shutdown
gracefully anymore.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Wed, 14 Jun 2017 13:52:19 +0000 (15:52 +0200)]
remove legacy sparsecp
sparsecp gets only used in qmextract, which is part of the old backup
method (pre PVE 2.3).
Do not remove qmextract for now people could still have backups from
< PVE 2.3 around.
They could be restored manually, but we shouldn't make restoring
complicated. Thus replace sparsecp with `cp sparse=always`.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Thomas Lamprecht [Wed, 14 Jun 2017 13:52:18 +0000 (15:52 +0200)]
remove unused obsolete vmtar
This was used by the pre-VMA backup methods, as the new backup
process was introduced in PVE 2.3 (04.03.2013) and this would be only
used for creating new backups it can be removed safely.
Fixes Debian stretch build on the ARM64 architecture.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Philip Abernethy [Mon, 21 Aug 2017 09:47:18 +0000 (11:47 +0200)]
Fix #1125. Check for KVM support before starting VM
Moved the check to the beginning of the function.
VMs configured to use KVM won't start if KVM is not available.
VMs not configured to use KVM will start regardless.
Philip Abernethy [Mon, 21 Aug 2017 09:47:16 +0000 (11:47 +0200)]
Refactor HyperV enlightenments
Fixes a typo in the function name and removes the $nokvm parameter, as it's only
used to immideately exit the function. Instead calling the function
conditionally.
and only transfer state and switch direction if there
actually are any replicated volumes.
once we add support for live-migration with replicated
volumes, adding a set-replication-state command to the
tunnel and using that probably makes sense.
Thomas Lamprecht [Wed, 12 Jul 2017 05:34:51 +0000 (07:34 +0200)]
use machine version in vga default type selection
If we get an VM machine older than 2.9 we use the old selection
expression for the VGA type. This allows to live migrate VMs to PVE
5.0 from beta 1 and PVE 4.4 again.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
QemuServer::lspci() iterates over /sys/bus/pci/devices which
doesn't guarantee any order which means functions sometimes
ended up in the wrong order and it was never clear which
one would get the additional options such as x-vga passed
to them.
Emmanuel Kasper [Thu, 1 Jun 2017 08:26:38 +0000 (10:26 +0200)]
Add ImportDisk module to import external disk images into a VM
Each disk passed as paramater is add as 'unused[n]' in the vm.conf
(the default) or ide[n]|scsi[n]|sata[n]
We rely on qemu-img(1) convert heuristics to detect the file type,
as this works in most case.
fix burst length parameter names and pass them to qemu
bps_max_length & friends were wrongly named and were only
passed to qemu when hot-applying changes. They can only
be passed via the command line with their new names. For
consistency let's rename them all, that way they're all in
one place.
We cannot look for ports on "any" wildcard address while
letting qemu bind to "localhost", this may lead to a qemu
process occupying ::1 while the next search successfully
finds the same port available for IPv4's '*' address.
Instead, we now lookup the IP of the desired family for
'localhost'. Note that while we could simply be hardcoding
::1 or 127.0.0.1, with this code we are protocol agnostic.
Tobias Böhm [Mon, 15 May 2017 14:16:12 +0000 (16:16 +0200)]
Fix #1384: add missing decrement to calculation of socket-id
For calculation of "current_core" the input variable id is decremented.
For calculation of "current_socket" this decrement was missing resulting
in a wrong value when "cores" is set to 1.
by mocking de/activate vmstate volumes. these were broken by 3a8deb551f2c7648865437961b3593d11bf0591b, which introduced
activating/deactivating vmstate volumes for KRBD
Fix #1361: create disk: stricter parsing of storage:size
This fixes paths such as
/dev/disk/by-id/some-ID:0.5
being interpreted as a request to create a 0.5G-sized disk
in the storage named '/dev/disk/by-id/some-ID'.
The commit changes the configuration before the VM is actually
migrated, so it is possible to have a wrong configuration when
migration fails for some reason. Also, I am quite unsure if
this automatic target change is really wanted. The patch also
contains wrong refereces to $self->{opts}->{node}.