storage: Fix lvcreate parameter for backingStore.

When virStorageBackendLogicalCreateVol() creates a snapshot for a
logical volume with backingStore element, it fails with the message
below:

  2013-01-17 03:10:18.869+0000: 1967: error : virCommandWait:2345 :
  internal error Child process (/sbin/lvcreate --name lvm-snapshot -L 51200K
  -s=/dev/lvm-pool/lvm-volume) unexpected exit status 3: /sbin/lvcreate:
  invalid option -- '='  Error during parsing of command line.

This is because virCommandAddArgPair() uses '=' to connect the two
parameters, it's unsuitable for -s option of the lvcreate.

Signed-off-by: Atsushi Kumagai <kumagai-atsushi@mxc.nes.nec.co.jp>
(cherry picked from commit ffee627a4a)
This commit is contained in:
Atsushi Kumagai 2013-01-18 08:06:01 +01:00 committed by Ján Tomko
parent 8e72362ec8
commit 610aadd635

View File

@ -733,7 +733,7 @@ virStorageBackendLogicalCreateVol(virConnectPtr conn,
} }
virCommandAddArgFormat(cmd, "%lluK", VIR_DIV_UP(vol->capacity, 1024)); virCommandAddArgFormat(cmd, "%lluK", VIR_DIV_UP(vol->capacity, 1024));
if (vol->backingStore.path) if (vol->backingStore.path)
virCommandAddArgPair(cmd, "-s", vol->backingStore.path); virCommandAddArgList(cmd, "-s", vol->backingStore.path, NULL);
else else
virCommandAddArg(cmd, pool->def->source.name); virCommandAddArg(cmd, pool->def->source.name);