Create static PG::_write_log() function

Signed-off-by: David Zafman <david.zafman@inktank.com>
Error messages lost because stderr is closed

Use cout instead of cerr for command errors
Use cerr for debug mode because stderr is avail
Output map_epoch in debug mode
Fix a message and only for debug mode

Signed-off-by: David Zafman <david.zafman@inktank.com>
osd: data loss: pg export/import/remove

Implement remove feature (intermediate)
Just adding --type remove instead of new command name.

Feature: #4201

Signed-off-by: David Zafman <david.zafman@inktank.com>
Reorganization for import/export

Change local names to be clearer
Break real_log() into common function get_log()
Move infos_oid, biginfo_oid and log_oid to globals for general use

Signed-off-by: David Zafman <david.zafman@inktank.com>
Initial "export" implementation of info/log only

Signed-off-by: David Zafman <david.zafman@inktank.com>
Initial import of just info and log
Add epoch to export and import
Try to write out info and log to create new pg.
Prepend the size for epoch, info and log
Add corruption checking to import
Limit maximum read amount
Add optional --file for export/import
Switch to debug flag as global instead of passing around
For import make sure command run with sudo
Export files
Partial version of import which doesn't yet write out object files
Fix-up diagnostic output to check debug flag and use of stdout
Fix handling of error message from PG::read_log
Import export hobject_t instead of generated file name
Export omap
Add import of omap code
Still not writing object data or object omap
Disable import writing of info/log for development