OpenVZ-legacy
  1. OpenVZ-legacy

ploop.ovzl

Public
AuthorCommitMessageCommit dateIssues
Kir KolyshkinKir Kolyshkin
85558e2cd73Released ploop 1.5Changelog: see http://wiki.openvz.org/Download/ploop/1.5/changes Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
4bae85113a2lib/merge.c: fix a compiler warningmerge.c: In function 'ploop_merge_snapshot': merge.c:771: warning: 'ret' may be used uninitialized in this function Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
d2df1b55181Fix a (bogus?) compiler warningWhen trying to compile with -O2 (gcc 4.7.0, Fedora 17) I get the following warning (which I believe is bogus): balloon.c: In function ‘do_ploop_discard’: balloon.c:888:7: warning: ‘ret’ may be used uninitialized in this function [-Wmaybe-uninitialized] balloon.c:808:10: note: ‘ret’ was declared here Note that gcc tells that * the function is do_ploop_discard() * the location of the 'ret' decl...
Kir KolyshkinKir Kolyshkin
c44e441f4c2setver.sh: add ability to specify -U or -FSo from now on -i, -U and -F has the same meaning as to rpm (install, build, freshen). Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
2b84f3483bbAutoconvert to new shapshots dd.xml schemaCommit f2d36d8 changed the snapshots DiskDescriptor.xml schema to have constant TopGUID. This patch tries to make old schema automatically converted to the new one, with an appropriate message to a user, when writing the file. This should fix "Shapshot is in old format" message. http://bugzilla.openvz.org/2360 Reported-by: Kalin Bogatzevski <kalin@bul.net> Signed-off-by: Kir Kolyshkin <kir@op...
Kir KolyshkinKir Kolyshkin
e727478a63bploop info: fix options processing1 Do not rely on optind == 1, use explicit 1 instead 2 Check that we have exactly 1 argument, not more Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
f14467bc83dploop start,stop,clear: check that -d is providedand error out if it's not. Otherwise we get this: # ploop stop Can't open device: Bad address Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Igor SukhihKir KolyshkinIgor Sukhih
cfbf4961657Block device size should be multiple of cluster blocksize* Added check for correct size * Round up device size value specified by a user on create and resize Reference: PSBM-15189 Reference: ploop@801425PSBM-15189
Kir KolyshkinKir Kolyshkin
6511319abb6tools/ploop-stat.c: don't ignore write() return valueCertain versions of gcc (4.4.6) and glibc (2.12), combined with certain values in CFLAGS ("-O2 -Wall -Werror -D_FORTIFY_SOURCE=2", which comes from RPM_OPT_FLAGS supplied by rpmbuild) result in certain compilation errors, like these: cc1: warnings being treated as errors ploop-stat.c: In function 'main': ploop-stat.c:117: error: ignoring return value of 'write', declared with attribute warn_un...
Kir KolyshkinKir Kolyshkin
16cab25b7b1Makefile.inc: honor RPM_OPT_FLAGSUsable for RPM building. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
891bb5a40c3tools/Makefile: use CFLAGS for linkingCFLAGS might contain stuff needed for linking, such as -m32. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
acf62dbf8e3Fix a few 'result unused' compiler warningsLike this one, emitted by clang: balloon.c:426:3: error: expression result unused [-Werror,-Wunused-value] ioctl_device(fd, PLOOP_IOC_BALLOON, &b_ctl); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
1fe441f49f7ploop_send(): fix an uninitialised variablepcopy.c: In function 'ploop_send': pcopy.c:293: error: 'mntfd' may be used uninitialized in this function Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
5d1a1a8bb9bploop.spec: add %{?_smp_mflags} to makeEnabling SMP build Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
901a9730e17read_line_quiet(): fix returning errnoSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Konstantin BukharovKir KolyshkinKonstantin Bukharov
9137ea48c07Add lsof output when ploop fs umount fail[kir@openvz.org: improvements] Reference: ploop@799196 Reference: PSBM-14931 Signed-off-by: Kir Kolyshkin <kir@openvz.org>PSBM-14931
Kir KolyshkinKir Kolyshkin
154bdee6cd7do_umount(): improve an error messageSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
c897a8211fbploop_find_dev(): use read_line_quiet() for image fileSame as with previous patch, but for image file. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
3b428e77bf9ploop_find_dev(): use read_line_quiet()Doing stat() and then read_line() could fail with EEXIST because the file is being removed while we try to read it. Switch to read_line_quiet() and handle EEXIST ourselves. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
f13d4ffd443Introduce read_line_quiet()Same as read_line() but 1 it doesn't print an error message 2 it returns errno value To be used by the following patches. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Igor SukhihKir KolyshkinIgor Sukhih
36d54dfe909ploop_find_dev(): remove an unneeded consistency checkCheck of consistency between /sys/block/%s/dev and /dev/%s was redundant, remove it. [kir@openvz.org: patch splitting, changelog] Reference: ploop@799559
Kir KolyshkinKir Kolyshkin
482886e2126setver.sh: do not try to install rpm if build failedSigned-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
bc423e412dfploop.spec: use 'conflicts' not 'requires' for vzkernelCommit e644ed7 added requirement for vzkernel not less than a specific version. In fact, it should be not a requirement but a conflict, since ploop have a problem working with older kernels. Fix accordingly. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
57feac74ed4Replace ploop_{alloc,read}_diskdescriptor() with ploop_read_disk_descr()Commit c0608b3 introduced read_dd() function to be used by tools, which simplifies code using it a lot (see also commit 631f468). This commit does the same for the whole library, changing the external APT as well. In fact, outside of the library, there is no use of separate calls to allocate and read a disk descriptor. Even in the library itself, there is a single place in ploop_create_image()...
Kir KolyshkinKir Kolyshkin
555e204eca0ploop_get_info(): make it internalThis is a followup to commit 4985d91. From now on, ploop_get_info_by_descr() is to be used. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
e921fce16adadd_delta(): prevent multiple mountsCommit e644ed7 switched code to cookie-based registration, and if ploop cookie feature is supported by the kernel, [un]register_ploop_dev() are not doing anything. As a side effect, ploop_find_dev() check in register_ploop_dev() is not performed, and it is now possible to mount same image a few times (given that mount is read-only and NOT via dd.xml): # ploop mount -m mnt -r root.hdd Adding ...
Igor SukhihKir KolyshkinIgor Sukhih
4dafe4063fdAdd 'ploop list' commandScan /sys/block/ploop* and list all configured ploop devices in the following format: device base_delta cookie Ignore all errors, added for debug purpoes [kir@openvz.org: patch merging, rm ploop_err(), export read_line()] Reference: ploop@795206, ploop@795341, ploop@795364. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
aa42d69706fadd_delta(): introduce ret and goto outSlight refactoring to simplify the next patch Reference: ploop@797707 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
97c1e0373d9create_balloon_file(): remove fstype argumentIt was never used Reference: ploop@797706 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
b2e552dc0celib/ploop.c: mark a few char * args as constReference: ploop@797705 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
022a6907e22add_delta(): no need to close unopened fdReference: ploop@797704 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
ecee0b2ebc2lib/delta_sysfs.c: error message fixes1. Do not print function name 2. Print full file name 3. Unify (start with "Can't") Reference: ploop@797607 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
221828320c3ploop_find_top_delta_name_and_format(): do not print errorsErrors are printed by the called functions, no need to print two errors. While at it, make minor formatting changes to the code. Reference: ploop@797606 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
eb9ef739cb5MINOR read_line(): better error messagesReference: ploop@797605 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
7d2655537e7find_delta_names(): only open/read format file if neededPrevious code was opening/reading format file even if it was not required. Move the check for format argument != NULL earlier to the code so we do not open/read format file if not needed. Reference: ploop@797604 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
5e162cddb3fget_dev_num(), get_dev_start(): make first argument constReference: ploop@797603 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
9a23e45d749delta_sysfs.c: use read_line() where possibleIt greatly simplifies and shortens the code. Reference: ploop@797602 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
698d20d882fploop_get_delta_attr(): make attr parameter constReference: ploop@797601 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
e644ed7baa9Cookie-based ploop image registrationGenerally, we don't want to allow multiple mounts of the same image. Mounting the same image read/write is forbidden by the kernel, but mounting it read-only is fine from the kernel point of view. Still, We need to take care about it in userspace, because otherwise we'll have a conflict during unmount -- if an image is mounted two times and we ask to unmount it, it's not clear which device (an...
Kir KolyshkinKir Kolyshkin
6d202682df0ploop_mount_image(): fix a messageMessage "Image %s already used by device %s" is way better than "Image %s already mounted to %s", just because we don't want to mix between device and mount point. Besides, the same message is used in register_ploop_dev(). Reference: ploop@797655 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
4aeb62ae18aploop_mount(): check that mntpnt is dirNoticed while reading through source code that we only check param->target for existence, not that it's a directory. So, without this patch, the following happens: # touch mnt3 # ploop mount -r root.hdd -m mnt3 Adding delta dev=/dev/ploop0 img=root.hdd (ro) Error in ploop_mount_fs (ploop.c:967): Can't mount file system dev=/dev/ploop0p1 target=mnt3: Not a directory And then there's no rol...
Kir KolyshkinKir Kolyshkin
3193c2e2516get_dev_num(), get_dev_start(): fix file name in an error messageWhen printing "Unexpected format of" error message, print full file name. Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
b74f56222f6ploop_find_dev_by_delta(): add global lockReference: ploop@793010 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
7299f37b8adploop_find_dev_by_delta(): describe itReference: ploop@793010 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
978b6bdb4cdploop_find_dev_by_delta(): treat failed read_line() as errorIf reading image file name from /sys/block/$DEVICE/pdelta/0/image fails, treat it as error -- so tell about it it and return an error. Reference: ploop@793010 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
36b7563df64ploop_find_dev_by_delta(): check for error from stat()If stat /sys/block/$DEVICE/pdelta/0/image fails, check errno and if it's not ENOENT then we have a problem -- so tell about it it and return an error. Reference: ploop@793010 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
8da2267ce7bploop_find_dev_by_delta(): compare image file nameUse realpath() to get the real delta file name, and then compare it to /sys/block/$DEVICE/pdelta/0/image rather than doing stat() on both. Reference: ploop@793010 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
f99fe7839f6[style] ploop_find_dev_by_delta(): minor refactoringReference: ploop@793010 Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
be70c3f538d[style] Add space after returnreturn-1; looks ugly Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Kir KolyshkinKir Kolyshkin
16a8dc0bd12[style] lib/ploop.h: whitespace nitpicksSigned-off-by: Kir Kolyshkin <kir@openvz.org>