From: Atsushi Kumagai Date: Fri, 18 Jan 2013 07:06:01 +0000 (+0100) Subject: storage: Fix lvcreate parameter for backingStore. X-Git-Tag: v0.10.2.5~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=610aadd635d5b1a959d6d6b234839fbf30ad0b22;p=thirdparty%2Flibvirt.git 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 (cherry picked from commit ffee627a4a52bf13d787cec883054fe2e7d9465c) --- diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c index fd5cbd12d8..c21cb45e30 100644 --- a/src/storage/storage_backend_logical.c +++ b/src/storage/storage_backend_logical.c @@ -733,7 +733,7 @@ virStorageBackendLogicalCreateVol(virConnectPtr conn, } virCommandAddArgFormat(cmd, "%lluK", VIR_DIV_UP(vol->capacity, 1024)); if (vol->backingStore.path) - virCommandAddArgPair(cmd, "-s", vol->backingStore.path); + virCommandAddArgList(cmd, "-s", vol->backingStore.path, NULL); else virCommandAddArg(cmd, pool->def->source.name);