libcontainer: intelrdt: add user-friendly diagnostics for Intel RDT operation errors
libcontainer: intelrdt: add user-friendly diagnostics for Intel RDT operation errors

Linux kernel v4.15 introduces better diagnostics for Intel RDT operation
errors. If any error returns when making new directories or writing to
any of the control file in resctrl filesystem, reading file
/sys/fs/resctrl/info/last_cmd_status could provide more information that
can be conveyed in the error returns from file operations.

Some examples:
  echo "L3:0=f3;1=ff" > /sys/fs/resctrl/container_id/schemata
  -bash: echo: write error: Invalid argument
  cat /sys/fs/resctrl/info/last_cmd_status
  mask f3 has non-consecutive 1-bits

  echo "MB:0=0;1=110" > /sys/fs/resctrl/container_id/schemata
  -bash: echo: write error: Invalid argument
  cat /sys/fs/resctrl/info/last_cmd_status
  MB value 0 out of range [10,100]

  cd /sys/fs/resctrl
  mkdir 1 2 3 4 5 6 7 8
  mkdir: cannot create directory '8': No space left on device
  cat /sys/fs/resctrl/info/last_cmd_status
  out of CLOSIDs

See 'last_cmd_status' for more details in kernel documentation:
https://www.kernel.org/doc/Documentation/x86/intel_rdt_ui.txt

In runc, we could append the diagnostics information to the error
message of Intel RDT operation errors to provide more user-friendly
information.

Signed-off-by: Xiaochen Shen <3291a03eb0af8107f6343bd0c24499cda05a2e47@intel.com>

justincormack/runc,dqminh/runc,justincormack/runc,estesp/runc,mikebrow/runc,laijs/runc,mikebrow/runc,mheon/runc,adrianreber/runc,estesp/runc,mYmNeo/runc,kolyshkin/runc,dqminh/runc,opencontainers/runc,xiaochenshen/runc,opencontainers/runc,crosbymichael/runc,justincormack/runc,laijs/runc,rhatdan/runc,opencontainers/runc,kolyshkin/runc,crosbymichael/runc,dqminh/runc,rhatdan/runc,opencontainers/runc,rhatdan/runc,mheon/runc,xiaochenshen/runc,crosbymichael/runc,xiaochenshen/runc,kolyshkin/runc,mheon/runc,dqminh/runc,kolyshkin/runc,rhatdan/runc,laijs/runc,adrianreber/runc,adrianreber/runc,mikebrow/runc,estesp/runc,mYmNeo/runc,mYmNeo/runc