| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The "-o #" replaces the report/compact_output_cols setting
set in lvm.conf in case it's needed for individual report
commands directly on command line:
$ lvs vg
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert LV Tags
lvol0 vg -wi-a----- 4.00m
$ lvs vg -o#name,vg_name,pool_lv,origin,data_percent,metadata_percent
LV VG Attr LSize Move Log Cpy%Sync Convert LV Tags
lvol0 vg -wi-a----- 4.00m
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
$ lvs
LV VG Attr LSize
root fedora -wi-ao---- 19.00g
swap fedora -wi-ao---- 500.00m
lvol0 vg -wi-a----- 4.00m
All alternatives of the the field name is recognized
(just like we already do for the "-o +"):
$ lvs -o-lv_attr
LV VG LSize
root fedora 19.00g
swap fedora 500.00m
lvol0 vg 4.00m
$ lvs -o-attr
LV VG LSize
root fedora 19.00g
swap fedora 500.00m
lvol0 vg 4.00m
$ lvs -o-lvattr
LV VG LSize
root fedora 19.00g
swap fedora 500.00m
lvol0 vg 4.00m
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
$ lvs vg
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert LV Tags
lvol0 vg -wi-a----- 4.00m
Remove fields which should not be displayed at all directly on cmd line:
$ lvs vg -o-tags,pool_lv,origin,data_percent,metadata_percent
LV VG Attr LSize Move Log Cpy%Sync Convert
lvol0 vg -wi-a----- 4.00m
The "-o -" and "-o +" can be combined:
$ lvs vg -o-tags,pool_lv,origin,data_percent,metadata_percent -o+layout,role
LV VG Attr LSize Move Log Cpy%Sync Convert Layout Role
lvol0 vg -wi-a----- 4.00m linear public
When "-o -" and "-o +" is combined, it's evaluated from left to right so
if the same field appears in both lists, it's properly canceled out if
such situation happens (here the "vg_size" that appears in both "-o +"
and "-o -"):
$ lvs vg -o+vg_size -o-vg_size,tags,pool_lv,origin,data_percent,metadata_percent -o+layout,role
LV VG Attr LSize Move Log Cpy%Sync Convert Layout Role
lvol0 vg -wi-a----- 4.00m linear public
|
|
|
|
|
|
|
|
|
|
|
| |
Making the "-o" option groupable allows for definition of more
field switches and formatting besides the "-o+" we already have.
Also, besides making "-o" groupable, use string lists to store
lists of options temporarily while processing all instances of
the "-o" group. This will make it easier to concatenate all
the option lists defined on command line as well as removing
entries or putting these options in groups we need.
|
| |
|
|
|
|
|
|
| |
The str_list_destroy function may be called to cleanup memory when
the list is not used anymore and the list itself was not allocated
from the memory pool.
|
|
|
|
|
| |
The str_list_to_str and str_to_str_list are helper functions to
convert string list to a single string and vice versa.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
lvmetad is used
When lvmetad is used and lvmcache update function (lvmcache_update_vgname_and_id)
was called to update existing lvmcache records, a condition was met
which made to retun from the update function immediately, effectively
making it NOOP.
It seems there's no reason for such condition and lvmcache should be
update appropriately even when lvmetad used as lvmcache may be reused,
most notably in lvm shell.
It's possible this is a remnant of the lvmetad development code which
didn't get removed for some reason and the bug didn't get spotted
because lvm shell is not used often (the condition dates back to 2012
or so).
Example, lvmetad and lvm shell used:
lvm> pvs
PV VG Fmt Attr PSize PFree
/dev/sda vg lvm2 a-- 124.00m 124.00m
Before this patch:
==================
lvm> vgremove vg
Volume group "vg" successfully removed
lvm> pvs
With this patch applied:
========================
lvm> vgremove vg
Volume group "vg" successfully removed
lvm> pvs
PV VG Fmt Attr PSize PFree
/dev/sda lvm2 --- 128.00m 128.00m
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The lvmcache info might be resued, most notably in lvm shell.
We need to be sure that even lvmcache_info marked as invalid
is removed from the lvmcache so it does not confuse any subsequent
code/commands executed later on.
Problematic example with the lvm shell:
lvm> pvs
PV VG Fmt Attr PSize PFree
/dev/sda lvm2 --- 128.00m 128.00m
Before this patch (/dev/sda still displayed in a way):
======================================================
lvm> pvremove /dev/sda
Labels on physical volume "/dev/sda" successfully wiped
(without lvmetad)
lvm> pvs
No physical volume label read from /dev/sda
(with lvmetad)
lvm> pvs
PV VG Fmt Attr PSize PFree
/dev/sda lvm2 --- 128.00m 128.00m
With this patch applied:
========================
lvm> pvremove /dev/sda
Labels on physical volume "/dev/sda" successfully wiped
(without lvmetad)
lvm> pvs
(with lvmetad)
lvm> pvs
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Older pthread library was missing 'trick'
in pthread_cleanup_pop() which lead to
compilation error:
error: label at end of compound statement
Use explicit ';' to fix it.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make lvm2_disable_dmeventd_monitoring() more explicit.
As memlock_inc_daemon() is also used by clvmd, which
does changes dmeventd and suspend ignore state at
some stages - make updates of these 2 variable
tied to the call of lvm2_disable_dmeventd_monitoring().
Once this call is made dmeventd monitoring
and suspended devices are ignored.
TODO: all lvm-global settings should really be moved
to command context.
|
|
|
|
|
|
| |
On some error path we could have left filter set to some value.
Not a big issue - but lets make reporting correct as soon
as we can.
|
| |
|
|
|
|
|
|
|
| |
With kernel -rc6 it's passing our raid tests again - so enable
it in tests.
Note: related only to Fedora rawhide kernels...
|
| |
|
| |
|
|
|
|
| |
Avoid using #ifdef code and use 'cmd' instead of 'die'.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implementing exit when 'dmeventd' is idle.
Default idle timeout set to 1 hour - after this time period
dmeventd will cleanly exit.
On systems with 'systemd' - service is automatically started with
next contact on dmeventd communication socket/fifo.
On other systems - new dmeventd starts again when lvm2 command detects
its missing and monitoring is needed.
|
| |
|
|
|
|
|
| |
Send signal to itself to mark plugin as 'finished' as
the watching rule is no longer usable.
|
|
|
|
|
|
|
| |
Add support to unmonitor device when monitor recognizes there is
nothing to monitor anymore.
TODO: possibly API change with return value could be also used.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Redesign threading code:
- plugin registration runs within its new created thread for
improved parallel usage.
- wait task is created just once and used during whole plugin lifetime.
- event thread is based over 'events' filter being set - when
filter is 0, such thread is 'unused'.
- event loop is simplified.
- timeout thread is never signaling 'processing' thread.
- pending of events filter cnange is properly reported and
running event thread is signalled when possible.
- helgrind is not reporting problems.
|
| |
|
|
|
|
|
|
| |
Move _get_device_status() in code.
Use dm_task_no_flush() function when reading status.
(e.g. none blocking for thins pool)
|
|
|
|
|
|
| |
Don't hold lock when creating message (allocating memory).
Thread cannot dissapear as it's only the same thread which
may clean it.
|
|
|
|
| |
Function is never called without device.uuid.
|
| |
|
|
|
|
|
|
|
| |
Need here to keep control device opened while there is 'any' dso
plugin loaded - otherwise there would a race closing controlfd
inside lvm2 plugin while some other monitoring thread would
tried to execute another WAITEVENT task.
|
|
|
|
|
|
|
|
|
|
| |
Move all DSO related function in front, so they could be easily
referenced from rest of code.
Add proper error paths with logging and error reporting.
Drop mutex locking when releasing DSO - since DSO is always
allocated and released in main 'event' processing thread.
|
|
|
|
|
| |
When dmevend notices problems, but continues to operate normally
change log level to warning.
|
|
|
|
| |
Whenever user tries to register 0 mask report this as EINVAL.
|
|
|
|
|
|
| |
Use dm_make_percent for percentage calculation like lvm2 command.
Use a single call for resize.
|
|
|
|
|
| |
Add #ifdef-ed code to have ability to even remove unusable device.
For now purely experimental.
|
|
|
|
|
|
|
| |
Improve test for invalid snapshot.
Use dm_make_percent() to manipulate with exactly same percentage
as lvm2 command is using.
|
|
|
|
| |
Don't use --config - this requires reload of lvm.conf
|
|
|
|
| |
Fix raid logging introduced with last updating commit.
|
|
|
|
|
| |
Fix debug message and report exit when really doing it.
Also add missing '_' to static function.
|
| |
|
|
|
|
|
| |
Support hold of control device open.
Useful for daemons so the control device is not frequently reopenned.
|
| |
|
|
|
|
|
|
| |
When our daemon is locked into memory - avoid
communication with dmeventd and also skip
suspended devices.
|
|
|
|
|
|
|
| |
Add internal memlock_count_daemon().
Function can be used to recognize it's being executed
from daemon restricted execution inside /lib code.
|
|
|
|
| |
Simplify code reporting warning about incorrect thresholds.
|
|
|
|
| |
In the man page and the lvmetad help output.
|
| |
|