restoreconfig: add ability to restore/reload single target or storage_object
restoreconfig: add ability to restore/reload single target or storage_object

Problem:
-------
Right now, if any target or storage_object is failed to load as part of
target service bringup or manual restoreconfig, may be because of an issue from
the backend, then there is no way to reload that single storage_object or target,
we need to reload/restart all the targets/storage_objects present in the node
just to load one single target/storage_object, this interrupts on going
I/O (via this path) for all the volumes hosted within the node.

Solution:
--------
Add a capability to reload single target or storage_object without touching other
targets or storage_objects hosted in the node.

usage:

$ targetcli
targetcli shell version 2.1.fb49
Copyright 2011-2013 by Datera, Inc and others
For help on commands, type 'help'.

/> help
[...]

AVAILABLE COMMANDS
  The following commands are available in the current path:

[...]
    - restoreconfig [savefile] [clear_existing] [target] [storage_object]
[...]

Ex 1. reload single storage_object
$ targetcli restoreconfig /etc/target/saveconfig.json clear_existing \
    storage_object=blockx

Ex 2. reload single target
$ targetcli restoreconfig /etc/target/saveconfig.json clear_existing \
    target=iqn.2016-12.org.gluster-block:xxx

Ex 3. reload a given target and storage_object
$ targetcli restoreconfig /etc/target/saveconfig.json clear_existing \
    target=iqn.2016-12.org.gluster-block:xxx storage_object=blockx

Signed-off-by: Prasanna Kumar Kalever <a78d8f98557446023f5b3ba9944d7be259a978a3@redhat.com>

cvubrugier/rtslib-fb