Bug 1070225

Summary: [RFE] Enhance lvs output when fields are invalid
Product: [Fedora] Fedora Reporter: Zdenek Kabelac <zkabelac>
Component: lvm2Assignee: Peter Rajnoha <prajnoha>
Status: NEW --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: agk, bmarzins, bmr, dwysocha, heinzm, jonathan, lvm-team, msnitzer, prajnoha, zkabelac
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Zdenek Kabelac 2014-02-26 12:39:13 UTC
Description of problem:

When lvs  finds invalid percentage output in snapshot, it could give much better output.  Here is an example of current output:

"lvm" lvs -a -o +devices >> "/tmp/lvmdump.pTiSOI/lvmdump-a/lvs" 2>> "/tmp/lvmdump.pTiSOI/lvmdump-a/lvmdump.log"
  Percentage too large.
  dm_report_object: report function failed for field data_percent

  LV          VG      Attr       LSize   Pool Origin Data%  Move Log Cpy%Sync Convert Devices       
  root        rhel    -wi-ao----  10.31g                                              /dev/vda2(307)                                                                                                                              
  swap        rhel    -wi-ao----   1.20g                                              /dev/vda2(0)  
  origin      snapper owi-a-s--- 300.00m                                              /dev/vdc1(0)  
  verify_snap snapper swi-a-s--- 100.00m      origin


It's not quite straightforward to see what went wrong and
also even some fields are missing because some previous field failed
(i.e. missing device list)

lvm2 should do a better job here.


Version-Release number of selected component (if applicable):
2.02.105

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Peter Rajnoha 2015-09-24 10:16:03 UTC
Looking at the condition when the "Percentage too large." is issued, the value must have had more than 7 characters, while 1 is reserved for the '\0' at the end of the string, 1 for the decimal point, 2 are reserved for tenths and hundredths and the rest for the integer part (3 digits). So the value must have been more than 999 for some reason, probably error case.

So if percentage is not in sane 0%-100% range for a field, we could just report DM_PERCENT_INVALID as raw value with "Invalid" keyword displayed probably...