Commits
Author | Commit | Message | Commit date | Issues | |
---|---|---|---|---|---|
Kir Kolyshkin | e45cc833ca0 | Released ploop 1.11Changelog: see https://openvz.org/Download/ploop/1.11/changes Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Igor Sukhih | e184e72af0a | Fix GPT partition alignment on ploop initNot aligned GPT partition created on 'ploop init'. Incorrect 'end' parameter passed to parted, it should be 'size-1'. Reference: PSBM-25910 Reference: ploop@992231 | PSBM-25910 | ||
Igor Sukhih | ec575adb4bf | Fix alignment on GPT partition resizeResize creates GPT partition not alligned to cluster blocksize. Align end of partition to blocksize (use 1 MB if not specified). Reference: PSBM-25910 Reference: ploop@992198 | PSBM-25910 | ||
Kir Kolyshkin | 73080e7ab23 | Fix uuid strings size, use defineI was not able to figure out why any char uuid[] declaration use size of 61, while it should be 39. Define UUID_SIZE as 39 and use it whenever needed. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 3745dd1add7 | get_partition_device_name(): fix chmod argumentAs we are creating /dev/ploopNNNp1 device, we probably want to chmod() it but not /dev/ploopNNN which already exists. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | cfdc29a1015 | get_partition_device_name(): don't ignore chmod() errorchmod() should not fail at all here, but if it is, that means something really bad is happening, so we should tell about it earlier rather than fail some time later. This reverts part of commit 0be611c (aka r975730), restoring back a part of commit 532c80d (aka r943725). Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 3fe94ed11de | make_fs(): fix out of bounds writeThis is a fix to commit ec2c767 (aka r990063). Reported by Coverity, CID 1195049 Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 3a7ec3177b1 | Makefile: add ability to add local rulesIf Makefile.local is available, it is included. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Igor Sukhih | 945dc56a692 | do_create_snapshot: pass guid in args directlyUsing 'struct ploop_snapshot_param' is redundant. Reference: ploop@991158 | |||
Kir Kolyshkin | 98ebf9b41c9 | ploop_create_temporary_snapshot(): fix NULL derefChecking for param == NULL after dereferencing it doesn't make sense. Same for assigning the parameters and then checking if those are NULL. Move initialization later in the code, closer to the place where these are used. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 0a7eaa57d2d | [style] tools/grow.c: use ploop_close_dd()As we use ploop_open_dd() earlier. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | ec2c76754eb | make_fs(): add -i to mkfsRecent vzctl commit ef320d3 (aka r987982, see also PSBM-19156) introduced a way to calculate disk space required depending on the number of inodes specified by vzctl {create|set} --diskinodes option. Internally it relies on the fact that mkfs creates 1 inode per 16K disk space, but the value might be changed in /etc/mke2fs.conf. Therefore, let's specify it here explicitly to not screw up above ... | PSBM-19156 | ||
Kir Kolyshkin | f4434072309 | fsync_safe(): use SYSEXIT_FSYNCIt's more appropriate here. Reference: ploop@942606 Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Igor Sukhih | 95c602da880 | Fix vzctl snapshot-list -o deviceIt is broken by commit ea0cf10/ploop@983108. Restore original ploop_get_dev() functionality, using component_name if specified. Reference: PSBM-25748 "vzctl snapshot-list -o device broken" Reference: ploop@990362 Reported-by: Kir Kolyshkin <kir@openvz.org> | PSBM-25748 | ||
Kir Kolyshkin | 70924fee50e | ploop_check: fix for ro fs caseThere is nothing wrong in having non-top-level images on a read only file system. Unfortunately, since commit f5e47191 this is no longer possible: Error in ploop_check (check.c:224): ploop_check: can't open /media/ephemeral0/vz/private/3221/root.hdd/root.hdd: Read-only file system So, ploop mount doesn't work at all. To fix, let's check if an image is on read-only filesystem, and do a rea... | |||
Kir Kolyshkin | eb4840c940e | parse_uuid: add {} if necessaryWhen working with ploop from a command line, one usually copy-pastes (rather than types) UUIDs. The problem is, when selecting a UUID in a terminal by double clicking on it, curly brackets are not selected, so one either have to add those manually, or select UUID using click and drag which is way slower and more error-prone, leading to frustration, lower serotonine levels, and in rare cases eve... | |||
Kir Kolyshkin | 88d4fe813a9 | tools: use parse_guid() everywhereIn this case, we will error out much earlier, and it some cases the error message is way more clear (for example, not "Can't find UUID" but "Invalid UUID"). Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | a50f95a715e | tools: introduce and use parse_uuid()To avoid code repetition Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | b641ec45868 | ploop check: fix -b optionOption -b requires an argument, and getopt() must be aware of that. Before this patch: $ ./tools/ploop check -b Segmentation fault After: $ ./tools/ploop check -b check: option requires an argument -- 'b' Usage: ploop check [-u UUID] DiskDescriptor.xml Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 6ff747bbf1d | ploop check dd.xml: add -u UUID option... and document it. Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 834fb44ae65 | ploop check dd.xml: fix by using check_deltas()Recently ploop check form with DiskDescriptor.xml was introduced. Its implementation copied some code from check_deltas() which is now evolving separately. Another problem is ploop check was checking all deltas, whether they were used in a current configuration or not. Fix both issues by switching to check_deltas(). One side effect is we are losing an ability to set various flags. This is pro... | |||
Igor Sukhih | f5e47191b58 | check_deltas: open delta rw to perform auto fixingNon top delta could be in inconsistent state and require fixing, so open all delta 'rw' on ploop mount action Reference: PSBM-25252 Reference: ploop@986717 Reviewed-by: mpatlasov@parallels.com Signed-off-by: Kir Kolyshkin <kir@openvz.org> | PSBM-25252 | ||
Igor Sukhih | 55d5f6f25fb | e2fsck: return fsck exit code to callerAdded fsck_rc member to 'struct ploop_mount_param'. It will allow for the caller to analyze fsck exit code. Reference: PSBM-25464 Reference: ploop@986561 Signed-off-by: Kir Kolyshkin <kir@openvz.org> | PSBM-25464 | ||
Igor Sukhih | 65c51b187de | Add ploop_is_mounted()Add a way to get ploop status without lock, to avoid lock waiting in case way too long running operation is in progress. [kir@openvz.org: dynload.h patching] Reference: ploop@985158 Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Igor Sukhih | 716ed9286c9 | ploop_resize_image: add missing gpt size syncFix missing gpt table size sync logic in case device size has changed. Test case: * ploop init -s 10G img * ploop grow -s 20G DiskDescriptor.xml * ploop resize -s 11G DiskDescriptor.xml Running: /usr/libexec/resize2fs -p /dev/ploop42338p1 11530240k The containing partition (or device) is only 2620928 (4k) blocks. Reference: PSBM-24505 Reference: ploop@985120 Signed-off-by: Kir Kolyshkin <kir@... | PSBM-24505 | ||
Kir Kolyshkin | b4d96b599c5 | ploop_create_temporary_snapshot(): fix messageLog message is a sentence, it should start with Uppercased letter. Reference: ploop@983788 Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 1f5e8279c48 | check_snapshot_mount(): simplify error path1. Assign ret at declaration 2. Do ploop_free_array() in one place 3. No need to check ret for non-zero Reference: ploop@983787 Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Kir Kolyshkin | 32c13c9f711 | check_snapshot_mount(): fix typosFix typos in comments and an error message added in commit ploop@983110 aka fd00205 Reference: ploop@983786 Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Igor Sukhih | fd00205b749 | ploop_merge_snapshot_by_guid: deny snapshot deleting if mountedPloop images could be mounted many times by using component_name, this introduce to us two resrictions on snapshot delete: 1) if snapshot is mounted it can not be deleted as far as it used 2) If upper(child) snapshot is mounted the snapshot can not be deleted as far as image which will be eleted is used So jut display errror message that snapshot cannot be merged Reference: ploop@983110 | |||
Igor Sukhih | 93e6c75f72d | ploop_mount_image: skip merge temporary snapshot... if component_name is used Reference: ploop@983109 | |||
Igor Sukhih | ea0cf1021ea | Use component name in find device logic only on mount/umountAll ploop action performed on main ploop device (without component_name). The only mount/umount use component_name to mount/umount snapshots. Reference: ploop@983108 | |||
Igor Sukhih | 68e34cba43a | is_snapshot_in_use: missed inuse assigmentReference: ploop@982424 | |||
Igor Sukhih | cd30cd874a7 | Introduce two locking schemas for temporary snapshotsTemporary snapshot locked in ploop_create_temporary_snapshot(..., int *holder_fd) the snapshot is locked until caller not closed holder_fd It is hard to use that schema in bash script. This patch introduces lock by ploop device, in case holder_fd is not passed the snapshot is in locked state until device is mounted. Reference: ploop@982200 | |||
Igor Sukhih | 9c2d9fe770a | ploop tsnapshot: allow to specify mount point #ploop tsnapshot -u <uuid> -c <component_name> [-m MOUNT_POINT] DiskDescriptor.xml Reference: PSBM-24755 "Temporary snapshots & their auto merge" Reference: ploop@981721 Signed-off-by: Kir Kolyshkin <kir@openvz.org> | PSBM-24755 | ||
Igor Sukhih | 2a8950ab722 | is_snapshot_in_use: use open_count to check locking stateThe temporary snapshot do open /dev/ploopN to lock the snapshot. This patch introduces logic to handle /sys/block/ploopN/pstate/open_count reference counter on auto merge, Snapshot is locked if: count >= 2 count == 1 and not mounted Reference: PSBM-24755 "Temporary snapshots & their auto merge" Reference: ploop@981711 Signed-off-by: Kir Kolyshkin <kir@openvz.org> | PSBM-24755 | ||
Igor Sukhih | 4288d02b387 | is_snapshot_in_use: report snapshot is busy ploop_get_dev_by_delta() failureReference: ploop@980305 Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Igor Sukhih | b743cb82ebf | snapshot.c: move snapshot related code ploop.c -> snapshot.cReference: ploop@979426 Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Igor Sukhih | 785f4da6ddf | tools/ploop: create temporary snapshot (10/10)ploop tsnapshot -u <uuid> -c <component_name> [-m <MOUNT_POINT>] DiskDescriptor.xml Reference: PSBM-24755 "Temporary snapshots & their auto merge" Reference: ploop@979419 | PSBM-24755 | ||
Igor Sukhih | 15b42f9299b | validate_disk_descriptor: validate top delta (9/10)Top delta can't be a temporary snapshot Reference: PSBM-24755 "Temporary snapshots & their auto merge" Reference: ploop@979416 | PSBM-24755 | ||
Igor Sukhih | 2a6030a8eb1 | display snapshot type on create/deleteReference: ploop@979415 | |||
Igor Sukhih | 7567c361a7f | ploop_switch_snapshot: deny to switch to temporary snapshot (8/10)Reference: PSBM-24755 "Temporary snapshots & their auto merge" Reference: ploop@979414 | PSBM-24755 | ||
Igor Sukhih | ffca7c5505b | auto merge temporary snnapshot on mount & snapshot-create action (7/10)Reference: PSBM-24755 "Temporary snapshots & their auto merge" Reference: ploop@979413 | PSBM-24755 | ||
Igor Sukhih | 9ef8ac67f7f | merge temporary snapshot (6/10)Added functionality to merge all not in use temporary snapshots Reference: PSBM-24755 "Temporary snapshots & their auto merge" Reference: ploop@979412 | PSBM-24755 | ||
Igor Sukhih | d07f5e4b197 | ploop_merge_snapshot_by_guid: umount snapshots on merge (5/10)To not fail merging temporary snapshot, do umount all snapshots that were mounted by guid. Reference: PSBM-24755 "Temporary snapshots & their auto merge" Reference: ploop@979410 | PSBM-24755 | ||
Igor Sukhih | f9f3bc09509 | ploop_get_dev_by_delta: search device by basedelta & topdelta pair (4/10)Will be used to release mounted snapshot on snapshot merge action. Reference: PSBM-24755 "Temporary snapshots & their auto merge" Reference: ploop@979404 | PSBM-24755 | ||
Kir Kolyshkin | 4b58886db8e | ploop_find_dev, ploop_get_dev_by_delta: fix argsFor some reason, the first two arguments of these two functions were mixed up. It all worked though, because of double error effect. This also presumably makes ploop_get_devs() working (currently there are no users of this function). Signed-off-by: Kir Kolyshkin <kir@openvz.org> | |||
Igor Sukhih | 7747cc3db8f | Create temporary snapshot (3/10)Temporary snapshot marked as <Temporary> in DiskDescriptor.xml after snapshot have created it mounted and snapshot device is opened to lock snapshot from auto merge. The caller should close holder_fd and merge snapshot. * API struct ploop_tsnapshot_param { char *guid; char *target; char device[64]; }; int ploop_create_temporary_snapshot(struct ploop_disk_images_data *di,... | PSBM-24755 | ||
Igor Sukhih | 6636e97739e | do_create_snapshot: minor cleanup enhancementHandle DiskDescriptor.xml.tmp cleanup Reference: ploop@979398 | |||
Igor Sukhih | 9de895fd5dd | Prepare ploop_create_snapshot to process temporary flag (2/10)* make ploop_create_snapshot() as wrapper on do_create_snapshot() * move ploop_create_snapshot to lib/snapshot.c Reference: ploop@979395 | |||
Igor Sukhih | 46aea1fe3d2 | Add temporary snapshot flag to DiskDescriptor.xml (1/10)Add ability to read/write <Temporary> xml tag Reference: PSBM-24755 "Temporary snapshots & their auto merge" Reference:ploop@979393 | PSBM-24755 |