Commit Graph

298 Commits

Author SHA1 Message Date
Fabian Grünbichler
4826847217 bump version to 3.0-10
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-05-05 11:41:48 +02:00
Fabian Grünbichler
6177da17aa bump version to 3.0-9
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-05-05 11:25:16 +02:00
Fabian Grünbichler
4bb2d4061a d/control: break older pve-container
since the changed locking exposes a bug that requires fixing on the
pve-container side.
2020-05-05 11:24:44 +02:00
Fabian Grünbichler
3599eb3341 d/control: break older qemu-server
since we renamed lock_config_mode to lock_config_shared

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-05-05 11:18:38 +02:00
Fabian Grünbichler
9cdd44001a lock_config: rename lock_config_mode -> lock_config_shared
and pull the actual lock_file_full handling into a helper, to make the
public interface clearer:

lock_config -> standard exclusive lock with 10s timeout
lock_config_full -> exclusive lock with configurable timeout
lock_config_shared -> shared lock with configurable timeout

the latter only has a single user (qemu-server's clone API call)
currently.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Tested-by: Fabian Ebner <f.ebner@proxmox.com>
2020-05-05 11:11:57 +02:00
Fabian Grünbichler
990d9675c5 snapshot_delete: check for concurrent modifications at each step
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Tested-by: Fabian Ebner <f.ebner@proxmox.com>
2020-05-05 11:11:57 +02:00
Fabian Ebner
c261973c52 snapshot_rollback: make sure newer replication snapshots are deleted
Commit a1dfeff3a8 changed the behavior
for Replication::prepare with last_sync=0, so use last_sync=1 instead.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-05-05 11:11:37 +02:00
Fabian Grünbichler
82a0485717 snapshot_rollback: flock earlier
to protect checks against concurrent modifications

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Tested-by: Fabian Ebner <f.ebner@proxmox.com>
2020-05-05 11:11:29 +02:00
Fabian Ebner
97b9ccec08 fix 2682: make sure configuration file is up-to-date for lock_config-variants
See [0] for the details. The call tree for the variants is
lock_config -> lock_config_full -> lock_config_mode
so it is sufficient to adapt lock_config_mode.

[0]: https://bugzilla.proxmox.com/show_bug.cgi?id=2682

Suggested-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-05-05 11:11:29 +02:00
Fabian Ebner
093c4c6e09 Avoid duplication by using lock_config_mode
No functional change is intended.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-05-05 11:11:19 +02:00
Fabian Grünbichler
dc52f2dce8 bump version to 3.0-8
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-05-04 14:11:12 +02:00
Alwin Antreich
e8ca21371f Fix: #2124 add zstd support
Signed-off-by: Alwin Antreich <a.antreich@proxmox.com>
2020-05-04 14:08:16 +02:00
Fabian Grünbichler
6f69f21de7 bump version to 3.0-7
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-04-09 09:40:26 +02:00
Fabian Grünbichler
3d5b0326e5 d/control: depend on pve-storage with new storage_migrate
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-04-09 09:39:42 +02:00
Fabian Ebner
95a9508eba Add update_volume_ids
This function is intened to be used after doing a migration where some
of the volume IDs changed.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-04-09 09:39:42 +02:00
Fabian Ebner
36cff88657 Use new storage_migrate interface
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-04-09 09:39:31 +02:00
Thomas Lamprecht
e90f586aab replicaiton: log rate and transport type
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-08 13:27:34 +02:00
Thomas Lamprecht
45b4c97f0f replication: dont declare variable in post-if scope
If a variable is defined and assigned in a conditional statement, it
is not defined behavior in Perl.

For more information about this behaviour see
https://perldoc.perl.org/perlsyn.html#Statement-Modifiers

> NOTE: The behaviour of a my, state, or our modified with a
> statement modifier conditional or loop construct (for example,
> `my $x if ...`) is undefined.
> The value of the my variable may be undef, any previously assigned
> value, or possibly anything else.
> Don't rely on it. Future versions of perl might do something
> different from the version of perl you try it out on. Here be
> dragons."

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-04-08 13:20:07 +02:00
Fabian Grünbichler
8d5dd71cbf bump version to 3.0-6
and add versioned breaks for foreach_volume changes

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2020-03-30 09:21:20 +02:00
Fabian Ebner
261d47a451 foreach_volume(_full): generalize and implement function
Introduce a parameter $opts to allow for better control of which
keys/volumes to use for the iteration and ability to reverse the order.
Also, allow extra parameters for the function.

Removes the '__snapshot'-prefix for future use from outside the module.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-03-27 14:15:22 +01:00
Fabian Ebner
8db0144048 Add foreach_unused_volume
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-03-27 14:10:02 +01:00
Fabian Ebner
4e6382ab58 Add interfaces for volume-related helpers
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2020-03-27 14:10:02 +01:00
Thomas Lamprecht
1224970141 bump version to 3.0-5
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-12 11:10:06 +01:00
Dominik Csapak
b2b16cee39 make GuestHelpers a subclass of Exporter
or else the Exports will not work

found by hotplugging nics with current master from qemu-server
which resulted in a
'undefined subroutine &PVE::QemuServer::safe_string_ne'

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2020-03-12 11:09:00 +01:00
Thomas Lamprecht
e292f76997 bump version to 3.0-4
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-10 14:03:53 +01:00
Thomas Lamprecht
1245ad854c get_backup_volumes: clarifcation and indentation improvements to comment
Aaron clarified that one documented element actually slipped through
and won't be returned.

Also firx the mixed tab/space indentation, for such comments we can
be pretty liberal and I just went with the two spaces per level, as
some part already had that.

Clarify that both array and hash are refs.

[0]: https://pve.proxmox.com/pipermail/pve-devel/2020-March/042070.html

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-10 12:17:03 +01:00
Aaron Lauterer
b2a2affa3f abstractconfig: add prototype for get_backup_volumes
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2020-03-10 12:13:07 +01:00
Thomas Lamprecht
67b3581e64 config: add missing use GuestHelpers module
import the typesafe_ne method when we're at it
2020-03-10 09:48:22 +01:00
Thomas Lamprecht
47d7954c59 config: return early if $opt is not partial fast pluggable
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-03-10 09:43:56 +01:00
Oguz Bektas
866f5834fd abstractconfig: add partial_fast_plug
allows partial fast plugging of functions as defined in the
$partial_fast_plug_option in qemuserver (and possibly lxc later on)

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2020-03-10 09:00:05 +01:00
Oguz Bektas
24d90d8d10 guesthelpers: move/add safe comparison functions from lxc and qemu
move the safe_string_ne and safe_num_ne functions to guesthelpers to
remove duplicate code.

add the new safe_boolean_ne and typesafe_ne helper functions

also add them in @EXPORT_OK

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
2020-03-10 09:00:05 +01:00
Thomas Lamprecht
ab44df53f7 fix some typos
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-02-08 16:03:49 +01:00
Thomas Lamprecht
9420142c33 trivial whitespace fix
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-02-07 16:22:47 +01:00
Thomas Lamprecht
fde98d5e11 config trait: allow to pass lock to create_and_lock_config
allows us to reuse this for clone, where we want to create a "clone"
locked config for the target guest.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2020-01-23 11:01:56 +01:00
Thomas Lamprecht
fb73d112aa grammar fix: s/does not exists/does not exist/g
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-12-13 12:08:06 +01:00
Wolfgang Bumiller
727080edd9 avoid cyclic reference in closure
otherwise this leaks memory

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-11-19 09:46:46 +01:00
Fabian Grünbichler
73427ae3cd bump version to 3.0-3
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-18 12:02:17 +01:00
Fabian Grünbichler
efd0b53cf1 d/control: add more missing build-dependencies
pve-cluster is used by the test cases

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-11-18 12:01:39 +01:00
Fabian Grünbichler
9e61323e46 d/control: add (build-)depends on libpve-cluster-perl
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-11-18 12:01:39 +01:00
Fabian Grünbichler
0c85474f68 use PVE::SSHInfo
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-11-18 12:01:39 +01:00
Fabian Grünbichler
96c08a9dcd use PVE::DataCenterConfig
to make sure that the corresponding cfs_read_file works() works.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2019-11-18 12:01:39 +01:00
Thomas Lamprecht
7a6a1a4b37 bump version to 3.0-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-10-18 21:12:04 +02:00
Thomas Lamprecht
4a8a1c83d8 d/control: break pve-manager (<< 6.0-10) due to vzdump parser move
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-10-18 21:11:54 +02:00
Thomas Lamprecht
6df4b6a8ea tests: remove some redundant trailing commas
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-10-18 21:05:53 +02:00
Thomas Lamprecht
c24919a9d7 cleanup_pending: refactor and fix $force
pull out $conf->{pending} in a intermediate variable.

While for now only a force key could be in a pending delete value it
still is completely wrong to say the whole hash value is thus $force.

Fix that by omitting that intermediate variable completely and copy
over directly from the source hash.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-10-18 20:32:30 +02:00
Thomas Lamprecht
28f1f21ca2 add cleanup_pending tests
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-10-18 20:29:20 +02:00
Thomas Lamprecht
975e60d986 tests: add map_expect_to_param_id feature for checking side-effects
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-10-18 20:28:59 +02:00
Thomas Lamprecht
e33cb61565 tests: add checks for remove_from_pending_delete
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-10-18 19:45:58 +02:00
Thomas Lamprecht
464a42c487 refactor/cleanup remove_from_pending_delete sligthly
return $conf for tests, use intermediate variable for
$conf->{pending}, which besides shorter lines avoids also the
autovification of $config stuff.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-10-18 19:44:42 +02:00
Thomas Lamprecht
6f38ab5aec tests: add checks for add_to_pending_delete
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-10-18 19:35:06 +02:00