Add OpParam pCommit

Add a new parameter to be used in OpCodes signalling
that the instance to be created is already present
as a reserved instance and should now be committed.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Niklas Hambuechen <niklash@google.com>
Extend OpInstanceCreate by pCommit

Add a new parameter to the instance creation OpCode
signaling that the instance is now to be committed.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Niklas Hambuechen <niklash@google.com>
Support replacing an instance on creation

In general, it makes sense to insist that a newly added instance has a
UUID that is not in use. Upon committing forthcoming instances,
however, the expectation is that the instance is already present in a
forthcoming variant. Add a flag to AddInstance to support this use
case.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Niklas Hambuechen <niklash@google.com>
Support replacing a disk in the configuration

When an instance is committed, the, so far forthcoming, disks
will be replaced by the actual ones. This requires AddInstanceDisk
to be able to replace existing disks. So add support for this.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Niklas Hambuechen <niklash@google.com>
Add a function to change disks to real

Add a function recursively removing the forthcoming
flag of a list of disk objects. In this way, when disks
are committed, all parameters can be preserved.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Niklas Hambuechen <niklash@google.com>
Support committing instances

Extend LUInstanceCreate to also be able to commit an already
reserved instance.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Niklas Hambuechen <niklash@google.com>
Add a --commit option

...so that command-line tools can specify that an instance
is to be committed.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Niklas Hambuechen <niklash@google.com>
Support the forthcoming flag in instance generation

In GenericInstanceCreate, verify that the forthcoming and commit
Options are not used simultaneously, and then pass on the commit
flag.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Niklas Hambuechen <niklash@google.com>
Support --commit in gnt-instance add

...by just passing it through to GenericInstanceCreate.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Niklas Hambuechen <niklash@google.com>
Document gnt-instance add --commit

The --commit option was added to "gnt-instance add" to transform
a forthcoming instance into a real one. Document that new option
in the man page as well.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Niklas Hambuechen <niklash@google.com>