OpenVZ-legacy
  1. OpenVZ-legacy

ploop.ovzl

Public
AuthorCommitMessageCommit dateIssues
Kir KolyshkinKir Kolyshkin
e45cc833ca0Released ploop 1.11Changelog: see https://openvz.org/Download/ploop/1.11/changes Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Igor SukhihKir KolyshkinIgor Sukhih
e184e72af0aFix 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@992231PSBM-25910
Igor SukhihKir KolyshkinIgor Sukhih
ec575adb4bfFix 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@992198PSBM-25910
Kir KolyshkinKir Kolyshkin
73080e7ab23Fix 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 KolyshkinKir Kolyshkin
3745dd1add7get_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 KolyshkinKir Kolyshkin
cfdc29a1015get_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 KolyshkinKir Kolyshkin
3fe94ed11demake_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 KolyshkinKir Kolyshkin
3a7ec3177b1Makefile: add ability to add local rulesIf Makefile.local is available, it is included. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Igor SukhihKir KolyshkinIgor Sukhih
945dc56a692do_create_snapshot: pass guid in args directlyUsing 'struct ploop_snapshot_param' is redundant. Reference: ploop@991158
Kir KolyshkinKir Kolyshkin
98ebf9b41c9ploop_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 KolyshkinKir 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 KolyshkinKir Kolyshkin
ec2c76754ebmake_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 KolyshkinKir Kolyshkin
f4434072309fsync_safe(): use SYSEXIT_FSYNCIt's more appropriate here. Reference: ploop@942606 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Igor SukhihKir KolyshkinIgor Sukhih
95c602da880Fix 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 KolyshkinKir Kolyshkin
70924fee50eploop_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 KolyshkinKir Kolyshkin
eb4840c940eparse_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 KolyshkinKir Kolyshkin
88d4fe813a9tools: 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 KolyshkinKir Kolyshkin
a50f95a715etools: introduce and use parse_uuid()To avoid code repetition Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
b641ec45868ploop 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 KolyshkinKir Kolyshkin
6ff747bbf1dploop check dd.xml: add -u UUID option... and document it. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
834fb44ae65ploop 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 SukhihKir KolyshkinIgor Sukhih
f5e47191b58check_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 SukhihKir KolyshkinIgor Sukhih
55d5f6f25fbe2fsck: 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 SukhihKir KolyshkinIgor Sukhih
65c51b187deAdd 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 SukhihKir KolyshkinIgor Sukhih
716ed9286c9ploop_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 KolyshkinKir Kolyshkin
b4d96b599c5ploop_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 KolyshkinKir Kolyshkin
1f5e8279c48check_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 KolyshkinKir Kolyshkin
32c13c9f711check_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 SukhihKir KolyshkinIgor Sukhih
fd00205b749ploop_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 SukhihKir KolyshkinIgor Sukhih
93e6c75f72dploop_mount_image: skip merge temporary snapshot... if component_name is used Reference: ploop@983109
Igor SukhihKir KolyshkinIgor Sukhih
ea0cf1021eaUse 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 SukhihKir KolyshkinIgor Sukhih
68e34cba43ais_snapshot_in_use: missed inuse assigmentReference: ploop@982424
Igor SukhihKir KolyshkinIgor Sukhih
cd30cd874a7Introduce 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 SukhihKir KolyshkinIgor Sukhih
9c2d9fe770aploop 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 SukhihKir KolyshkinIgor Sukhih
2a8950ab722is_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 SukhihKir KolyshkinIgor Sukhih
4288d02b387is_snapshot_in_use: report snapshot is busy ploop_get_dev_by_delta() failureReference: ploop@980305 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Igor SukhihKir KolyshkinIgor Sukhih
b743cb82ebfsnapshot.c: move snapshot related code ploop.c -> snapshot.cReference: ploop@979426 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Igor SukhihKir KolyshkinIgor Sukhih
785f4da6ddftools/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@979419PSBM-24755
Igor SukhihKir KolyshkinIgor Sukhih
15b42f9299bvalidate_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@979416PSBM-24755
Igor SukhihKir KolyshkinIgor Sukhih
2a6030a8eb1display snapshot type on create/deleteReference: ploop@979415
Igor SukhihKir KolyshkinIgor Sukhih
7567c361a7fploop_switch_snapshot: deny to switch to temporary snapshot (8/10)Reference: PSBM-24755 "Temporary snapshots & their auto merge" Reference: ploop@979414PSBM-24755
Igor SukhihKir KolyshkinIgor Sukhih
ffca7c5505bauto merge temporary snnapshot on mount & snapshot-create action (7/10)Reference: PSBM-24755 "Temporary snapshots & their auto merge" Reference: ploop@979413PSBM-24755
Igor SukhihKir KolyshkinIgor Sukhih
9ef8ac67f7fmerge temporary snapshot (6/10)Added functionality to merge all not in use temporary snapshots Reference: PSBM-24755 "Temporary snapshots & their auto merge" Reference: ploop@979412PSBM-24755
Igor SukhihKir KolyshkinIgor Sukhih
d07f5e4b197ploop_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@979410PSBM-24755
Igor SukhihKir KolyshkinIgor Sukhih
f9f3bc09509ploop_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@979404PSBM-24755
Kir KolyshkinKir Kolyshkin
4b58886db8eploop_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 SukhihKir KolyshkinIgor Sukhih
7747cc3db8fCreate 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 SukhihKir KolyshkinIgor Sukhih
6636e97739edo_create_snapshot: minor cleanup enhancementHandle DiskDescriptor.xml.tmp cleanup Reference: ploop@979398
Igor SukhihKir KolyshkinIgor Sukhih
9de895fd5ddPrepare 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 SukhihKir KolyshkinIgor Sukhih
46aea1fe3d2Add 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@979393PSBM-24755