Skip to content

Commit

Permalink
Force command line based libblockdev LVM plugin
Browse files Browse the repository at this point in the history
We need to be able to skip pvcreate when creating a shared VG and
that is not possible with LVM DBusD.
  • Loading branch information
vojtechtrefny committed Aug 31, 2023
1 parent 8447b50 commit 29d412f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions blivet/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,20 @@ def log_bd_message(level, msg):
from gi.repository import GLib
from gi.repository import BlockDev as blockdev
if arch.is_s390():
_REQUESTED_PLUGIN_NAMES = set(("lvm", "btrfs", "swap", "crypto", "loop", "mdraid", "mpath", "dm", "s390", "nvdimm"))
_REQUESTED_PLUGIN_NAMES = set(("btrfs", "swap", "crypto", "loop", "mdraid", "mpath", "dm", "s390", "nvdimm"))
else:
_REQUESTED_PLUGIN_NAMES = set(("lvm", "btrfs", "swap", "crypto", "loop", "mdraid", "mpath", "dm", "nvdimm"))
_REQUESTED_PLUGIN_NAMES = set(("btrfs", "swap", "crypto", "loop", "mdraid", "mpath", "dm", "nvdimm"))

# nvme plugin is not generally available
if hasattr(blockdev.Plugin, "NVME"):
_REQUESTED_PLUGIN_NAMES.add("nvme")

_requested_plugins = blockdev.plugin_specs_from_names(_REQUESTED_PLUGIN_NAMES)
# XXX force non-dbus LVM plugin
lvm_plugin = blockdev.PluginSpec()
lvm_plugin.name = blockdev.Plugin.LVM
lvm_plugin.so_name = "libbd_lvm.so.3"
_requested_plugins.append(lvm_plugin)
try:
succ_, avail_plugs = blockdev.try_reinit(require_plugins=_requested_plugins, reload=False, log_func=log_bd_message)
except GLib.GError as err:
Expand Down

0 comments on commit 29d412f

Please sign in to comment.