error('Need libiscsi for iscsi-direct storage driver')
endif
- if not get_option('storage_lvm').disabled()
+ if not get_option('storage_lvm').disabled() and host_machine.system() == 'linux'
lvm_enable = true
- lvm_progs = [
- 'pvcreate', 'vgcreate', 'lvcreate',
- 'pvremove', 'vgremove', 'lvremove',
- 'lvchange', 'vgchange', 'vgscan',
- 'pvs', 'vgs', 'lvs',
- ]
- foreach name : lvm_progs
- set_variable(
- '@0@_prog'.format(name),
- find_program(name, required: get_option('storage_lvm'), dirs: libvirt_sbin_path)
- )
- if not get_variable('@0@_prog'.format(name)).found()
- lvm_enable = false
- endif
- endforeach
-
- if lvm_enable
- use_storage = true
- conf.set('WITH_STORAGE_LVM', 1)
-
- foreach name : lvm_progs
- conf.set_quoted(name.to_upper(), get_variable('@0@_prog'.format(name)).full_path())
- endforeach
- endif
+ use_storage = true
+ conf.set('WITH_STORAGE_LVM', 1)
+ elif get_option('storage_lvm').enabled()
+ error('Linux host needed for LVM storage driver')
endif
if not get_option('storage_mpath').disabled() and host_machine.system() == 'linux' and devmapper_dep.found()
g_autoptr(virCommand) cmd = NULL;
int ret;
- cmd = virStorageBackendLogicalChangeCmd(VGCHANGE, def, on);
+ cmd = virStorageBackendLogicalChangeCmd("vgchange", def, on);
virObjectUnlock(pool);
ret = virCommandRun(cmd, NULL);
{
g_autoptr(virCommand) cmd = NULL;
- cmd = virCommandNewArgList(PVREMOVE, path, NULL);
+ cmd = virCommandNewArgList("pvremove", path, NULL);
if (virCommandRun(cmd, NULL) < 0)
VIR_INFO("Failed to pvremove logical device '%s'", path);
}
* Initialize the physical volume because vgcreate is not
* clever enough todo this for us :-(
*/
- pvcmd = virCommandNewArgList(PVCREATE, path, NULL);
+ pvcmd = virCommandNewArgList("pvcreate", path, NULL);
return virCommandRun(pvcmd, NULL);
}
};
g_autoptr(virCommand) cmd = NULL;
- cmd = virCommandNewArgList(LVS,
+ cmd = virCommandNewArgList("lvs",
"--separator", "#",
"--noheadings",
"--units", "b",
* that might be hanging around, so if this fails for some reason, the
* worst that happens is that scanning doesn't pick everything up
*/
- vgcmd = virCommandNew(VGSCAN);
+ vgcmd = virCommandNew("vgscan");
if (virCommandRun(vgcmd, NULL) < 0)
VIR_WARN("Failure when running vgscan to refresh physical volumes");
- pvcmd = virCommandNewArgList(PVS,
+ pvcmd = virCommandNewArgList("pvs",
"--noheadings",
"-o", "pv_name,vg_name",
NULL, NULL);
VIR_STORAGE_POOL_BUILD_NO_OVERWRITE,
cleanup);
- vgcmd = virCommandNewArgList(VGCREATE, def->source.name, NULL);
+ vgcmd = virCommandNewArgList("vgcreate", def->source.name, NULL);
for (i = 0; i < def->source.ndevice; i++) {
const char *path = def->source.devices[i].path;
if (virStorageBackendLogicalFindLVs(pool, NULL) < 0)
return -1;
- cmd = virCommandNewArgList(VGS,
+ cmd = virCommandNewArgList("vgs",
"--separator", ":",
"--noheadings",
"--units", "b",
virCheckFlags(0, -1);
/* first remove the volume group */
- cmd = virCommandNewArgList(VGREMOVE,
+ cmd = virCommandNewArgList("vgremove",
"-f", def->source.name,
NULL);
if (virCommandRun(cmd, NULL) < 0)
virWaitForDevices();
- lvchange_cmd = virCommandNewArgList(LVCHANGE, "-aln", vol->target.path, NULL);
- lvremove_cmd = virCommandNewArgList(LVREMOVE, "-f", vol->target.path, NULL);
+ lvchange_cmd = virCommandNewArgList("lvchange", "-aln", vol->target.path, NULL);
+ lvremove_cmd = virCommandNewArgList("lvremove", "-f", vol->target.path, NULL);
if (virCommandRun(lvremove_cmd, NULL) < 0) {
if (virCommandRun(lvchange_cmd, NULL) < 0) {
return -1;
}
- cmd = virCommandNewArgList(LVCREATE,
+ cmd = virCommandNewArgList("lvcreate",
"--name", vol->name,
NULL);
virCommandAddArg(cmd, "-L");