1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 20:25:52 +03:00
Commit Graph

3987 Commits

Author SHA1 Message Date
Peter Rajnoha
3649fa9e41 Fix Makefile to take into account dmsetup's reconfiguration. 2009-09-11 15:52:22 +00:00
Dave Wysochanski
e2ac2ad9bc Update lvm2app unit test vgtest - fix remove bug.
We now must commit to disk after lvm_vg_remove().
2009-09-04 19:17:46 +00:00
Dave Wysochanski
46b50a2520 Fix path to test/api/vgtest in nightly testsuite. 2009-09-04 14:26:16 +00:00
Dave Wysochanski
e83484c216 Remove 'test' interative api unit tests from 'TARGET' line.
The test/api directory TARGET line will be reserved for non-interactive
unit tests.  Building the interactive test can still be done with "make test"
from the test/api dir.
2009-09-04 13:49:02 +00:00
Dave Wysochanski
25eac61778 Add lvm2app.sh to nightly testsuite.
More tests to come but for now just call into vgtest.
Fix warning in vgtest.c
2009-09-04 12:54:23 +00:00
Dave Wysochanski
b0081c3778 Restore umask when device node creation fails.
Author: Florian Zumbiehl <florz@florz.de>
Acked-by: Dave Wysochanski <dwysocha@redhat.com>
2009-09-03 21:51:26 +00:00
Dave Wysochanski
2433909e20 Add daemons/cmirrord files to git - somehow got messed up with cvs rename.
When clogd was renamed to cmirrord, somehow git got the remove of the old
files but not the add of the new files.  This patch adds the new files.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
2009-09-04 20:44:58 +02:00
Dave Wysochanski
5e9891477a Fix path to test/api/vgtest in nightly testsuite. 2009-09-04 14:26:16 +00:00
Dave Wysochanski
e5ee502092 Remove 'test' interative api unit tests from 'TARGET' line.
The test/api directory TARGET line will be reserved for non-interactive
unit tests.  Building the interactive test can still be done with "make test"
from the test/api dir.
2009-09-04 13:49:02 +00:00
Dave Wysochanski
4071b6a401 Add lvm2app.sh to nightly testsuite.
More tests to come but for now just call into vgtest.
Fix warning in vgtest.c
2009-09-04 12:54:23 +00:00
Dave Wysochanski
5f1c57d008 Restore umask when device node creation fails.
Author: Florian Zumbiehl <florz@florz.de>
Acked-by: Dave Wysochanski <dwysocha@redhat.com>
2009-09-03 21:51:26 +00:00
Petr Rockai
428743a380 Do not override the distclean target in liblvm's Makefile, it annoys make and
the make.tmpl-included distclean should work better anyway.
2009-09-03 18:19:07 +00:00
Dave Wysochanski
b153cf3169 Update lvm2app vgtest to take vgname and devices as parameters. 2009-09-03 17:13:46 +00:00
Dave Wysochanski
a5609e3086 Update lvm_vg_write() to handle the deferred commit of lvm_vg_write().
Now that we've refactored the internal library functions that do the
vg_remove, we can handle the deferred commit of a lvm_vg_remove() inside
lvm_vg_write().  This makes the VG create/remove API more consistent in
terms of disk commits - they now both require an lvm_vg_write() to commit
the create or remove to disk.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>


Author: Dave Wysochanski <dwysocha@redhat.com>
2009-09-02 21:40:10 +00:00
Dave Wysochanski
43a1ea4e2f Update vg_remove_single_* functions to use the removed_pvs list.
Now that we've split vg_remove_single into two routines, in the first routine
that only manipulates memory, we move the PVs from the vg->pvs list to the
vg->removed_pvs list.  Then later, we iterate through this list to write the
removed PVs to disk, which removes them from the volume group and places them
into the internal ORPHAN VG.

Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>


Author: Dave Wysochanski <dwysocha@redhat.com>
2009-09-02 21:39:49 +00:00
Dave Wysochanski
d50795ed09 Split vg_remove_single into 2 functions - the second part commits to disk.
Split vg_remove_single into vg_remove_check (mandatory checks before
vgremove) and vg_remove (do actual remove by committing to disk).

In liblvm, we'd like to provide an consistent API that allows multiple
changes in memory, then let lvm_vg_write() control the commit to disk.  In
some cases (for example, lvresize calls fsadm) this may not be possible.
However, since we are using an object model and dividing things into small
operations, the most logical model seems to be the lvm_vg_write model, and
handling the special cases as they arrive.  So as best as possible
we move towards this end.

A possible optimization would be to consolidate vg_remove (committing)
code with vgreduce code.  A second possible optimization is making vgreduce
of the last device equivalent to vgremove.  Today, lvm_vg_reduce fails if
vgreduce is called with the last device, but from an object model perspective
we could view this as equivalent to vgremove and allow it.  My gut feel is
we do not want to do this though.


Author: Dave Wysochanski <dwysocha@redhat.com>
2009-09-02 21:39:29 +00:00
Dave Wysochanski
940077d030 Rename internal library function vg_remove to vg_remove_mdas.
Later patches should consolidate the vgremove / vgreduce functions but for
now let's clarify what vg_remove actually does by changing the name.


Author: Dave Wysochanski <dwysocha@redhat.com>
2009-09-02 21:39:07 +00:00
Dave Wysochanski
3de6df8410 Enforce an alphabetical lock ordering for vgname locks.
Add a new constraint that vgname locks must be obtained in
alphabetical order.  At this point, we have test coverage for
the 3 commands affected - vgsplit, vgmerge, and vgrename.
Tests have been updated to cover these commands.
Going forward any command or library call that must obtain
more than one vgname lock must do so in alphabetical order.
Future patches will update lvm2app to enforce this ordering.


Author: Dave Wysochanski <dwysocha@redhat.com>
2009-09-02 21:34:11 +00:00
Dave Wysochanski
b40b65fb3c Update vgrename to take into account vgname lock ordering.
Should be no functional change.


Author: Dave Wysochanski <dwysocha@redhat.com>
2009-09-02 21:29:40 +00:00
Dave Wysochanski
90aa7de640 Refactor vgrename into vg_rename_old and vg_rename_new.
Should be no functional change.
Will allow us to reorder lock obtaining if needed.


Author: Dave Wysochanski <dwysocha@redhat.com>
2009-09-02 21:29:23 +00:00
Dave Wysochanski
3d9c2d86b0 Change vgmerge behavior to open/lock first vg based on alphabetical ordering.
This enforces our alphabetical lock ordering rules for vgmerge.


Author: Dave Wysochanski <dwysocha@redhat.com>
2009-09-02 21:28:43 +00:00
Dave Wysochanski
7c86e3909c Refactor vgmerge - combine _vgmerge_to and _vgmerge_from into _vgmerge_vg_read.
These functions are identical so should be no functional change.


Author: Dave Wysochanski <dwysocha@redhat.com>
2009-09-02 21:28:27 +00:00
Dave Wysochanski
af9ded781d Refactor vgmerge - create _vgmerge_from and _vgmerge_to.
These functions are really identical but for clarity I made them separate
functions in this patch.

Should be no functional change.


Author: Dave Wysochanski <dwysocha@redhat.com>
2009-09-02 21:28:10 +00:00
Dave Wysochanski
115bc65bae Refactor vgmerge - introduce lock_vg_from_first flag.
Should be no functional change.


Author: Dave Wysochanski <dwysocha@redhat.com>
2009-09-02 21:27:55 +00:00
Dave Wysochanski
ae4ca998a3 Change vgsplit behavior to open/lock first vg based on alphabetical ordering.
If the destination vgname comes before the source vgname, we must open the
destination first because of the locking rules.  Thus, do a strcmp and set
the flag based on the comparison.


Author: Dave Wysochanski <dwysocha@redhat.com>
2009-09-02 21:27:39 +00:00
Dave Wysochanski
eb7c87e90d Refactor vgsplit - reorder _vgsplit_from and _vgsplit_to based on flag.
Slight functional change.  If we open the destination first, we cannot
know the 'fmt'.  In this case we use the default metadata type unless
the user has specified -M on the cmdline.  If not, in most cases this
is fine since we use the LVM2 default metadata type.  However, if the
user is specifying a non-default metadata type (e.g. lvm1) and the order
of the names is such that we have to open the destination (vg_to) first,
we have a problem.  So in this case, we require the use of -M and vgsplit
will fail with an error if not.  I've updated the man page to recommend
the usage of -M in this case.


Author: Dave Wysochanski <dwysocha@redhat.com>
2009-09-02 21:27:22 +00:00
Dave Wysochanski
392b185173 Refactor vgsplit: _vgsplit_from or _vgsplit_to failure cleanup depends on order.
Should be no functional change.


Author: Dave Wysochanski <dwysocha@redhat.com>
2009-09-02 21:27:05 +00:00
Dave Wysochanski
d1c45aa74f Refactor vgsplit - create _vgsplit_from function to open source vg.
Should be no functional change and allows future reorder of source and dest
vgs.


Author: Dave Wysochanski <dwysocha@redhat.com>
2009-09-02 21:26:50 +00:00
Dave Wysochanski
501fda8056 Refactor vgsplit - create _vgsplit_to function which creates or opens dest vg.
Move the creating/opening of the destination vg into its own function so later
we can reorder the source / destination vg opening based on the alphabetical
lock order rule.

Should be no functional change but code is a bit tricky.


Author: Dave Wysochanski <dwysocha@redhat.com>
2009-09-02 21:26:34 +00:00
Dave Wysochanski
ab2d981a97 Refactor vgsplit - add 'lock_vg_from_first' flag.
Introduce 'lock_vg_from_first' flag to retain which vg was locked first.
Should be no functional change.


Author: Dave Wysochanski <dwysocha@redhat.com>
2009-09-02 21:26:18 +00:00
Dave Wysochanski
9cc31e6dff Refactor vgsplit - remove bad2 label.
No functional change.


Author: Dave Wysochanski <dwysocha@redhat.com>
2009-09-02 21:26:01 +00:00
Dave Wysochanski
5bad8ac847 Refactor vgsplit to move existing_vg logic in a separate 'if' statement.
This will aid in future refactorings and allow for us to reorder the source
and destination vg based on alphabetical names.
Should be no functional change.


Author: Dave Wysochanski <dwysocha@redhat.com>
2009-09-02 21:25:44 +00:00
Dave Wysochanski
73e48198f0 Fix vgsplit test to require -M on ordering of vgnames. 2009-09-02 19:38:53 +00:00
Alasdair Kergon
5d311afba2 clogd->cmirrord 2009-09-02 19:32:37 +00:00
Dave Wysochanski
5863975c29 Add alphabetical vgname ordering tests for vgsplit, vgmerge, vgrename. 2009-09-02 18:31:11 +00:00
Alasdair Kergon
2bda19e999 rename clogd dir to cmirrord 2009-09-02 17:36:46 +00:00
Petr Rockai
74aa6b5620 Implement write lock prioritisation for file locking and make it default. 2009-09-02 14:47:39 +00:00
Fabio M. Di Nitto
c99b9fa946 Fix cmirrod build directory while we wait to do a proper rename of the
directory and move files.
2009-09-02 11:49:03 +00:00
Fabio M. Di Nitto
f8d076d827 Drop clogd Makefile from CVS since it's always autogenerated from Makefile.in
at configure time.
2009-09-01 19:13:38 +00:00
Fabio M. Di Nitto
8c222979e5 Fix --with-clvmd=all to deal with the case where no cluster managers are available.
Also simplify the check by removing an unnecessary variable and update
configure messages.
2009-09-01 19:11:45 +00:00
Fabio M. Di Nitto
ac7d720725 Remove unwanted Makefiles and don't purge lvm2.po that's
under RCS.
2009-09-01 18:11:14 +00:00
Christine Caulfield
b45e346f7a Add some code to clvmd to look in the corosync confdb to see what cluster
interface it should be using, it can still be overriden with -I.

If corosync isn't running or there is no information then the usual
checking will happen.

This code only builds if corosync is available.
2009-09-01 09:48:01 +00:00
Alasdair Kergon
66fd45290c change clogd to cmirrord
make pidfile locn configurable
2009-08-28 20:51:40 +00:00
Alasdair Kergon
a946372e50 Rewrite clvmd configuration code. 2009-08-28 19:22:05 +00:00
Jonathan Earl Brassow
226e79e7b7 cluster log daemon (clogd): Adjust for kernel CTR arg reordering
We have moved the internally generated mirror-device-size
parameter from the end of the CTR string to the begining.
This change adjusts for that.
2009-08-28 05:27:09 +00:00
Milan Broz
3c0cfa8f3c Fix global locking in PV reporting commands (2.02.49). 2009-08-24 11:37:20 +00:00
Milan Broz
c2d4398d47 Fix uuid warning in pvcreate to use terminated (and dash formatted) UUID string.
# pvcreate -u udwxr7-BoKY-EeKM-r033-xK6o-4og7-F13sGi /dev/sdc
   uuid udwxr7BoKYEeKMr033xK6o4og7F13sGi|��� already in use on "/dev/sdb1"
 is now
# pvcreate -u udwxr7-BoKY-EeKM-r033-xK6o-4og7-F13sGi /dev/sdc
   uuid udwxr7-BoKY-EeKM-r033-xK6o-4og7-F13sGi already in use on "/dev/sdb1"
2009-08-20 07:03:02 +00:00
Mike Snitzer
3d37e976bf Fix pvcreate on a partition (regressed in 2.02.51).
Eliminate busy loop during pvcreate of a "normal" partition.
_md_sysfs_attribute_snprintf() would busy loop if the device it was
given was not a blkext-based MD partition.

Rather than being cute with a busy-loop prone 'goto check_md_major' in
_md_sysfs_attribute_snprintf(): explicitly check if the provided device
is a blkext-based partition (blkext_major()); and then check that the
get_primary_dev() determined parent is an MD device (md_major()).
2009-08-19 15:34:33 +00:00
Peter Rajnoha
c7a3cc0a9b Use new blkid instead of vol_id in udev rules.
Thanks to Daniel Mierswa for reminding us.
2009-08-14 14:37:46 +00:00
Jonathan Earl Brassow
afa8ea4078 Cluster log server (clogd): Add new build files.
Might be a good idea to add the new files to the repository.  :(
2009-08-13 20:51:41 +00:00