Skip to content

Commit

Permalink
lvm: Clarify the global config functionallity in libblockdev
Browse files Browse the repository at this point in the history
Make sure users understand that these function don't work with
the global LVM lvm.conf config file.
  • Loading branch information
vojtechtrefny committed Oct 17, 2024
1 parent d4aaeb7 commit 1cc99c5
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 10 deletions.
18 changes: 14 additions & 4 deletions src/lib/plugin_apis/lvm.api
Original file line number Diff line number Diff line change
Expand Up @@ -1474,10 +1474,17 @@ gboolean bd_lvm_thsnapshotcreate (const gchar *vg_name, const gchar *origin_name

/**
* bd_lvm_set_global_config:
* @new_config: (nullable): string representation of the new global LVM
* configuration to set or %NULL to reset to default
* @new_config: (nullable): string representation of the new global libblockdev LVM
* configuration to set or %NULL to reset to default
* @error: (out) (optional): place to store error (if any)
*
*
* Note: This function sets configuration options for LVM calls internally
* in libblockdev, it doesn't change the global lvm.conf config file.
* Calling this function with `backup {backup=0 archive=0}` for example
* means `--config=backup {backup=0 archive=0}"` will be added to all
* calls libblockdev makes.
*
* Returns: whether the new requested global config @new_config was successfully
* set or not
*
Expand All @@ -1489,8 +1496,11 @@ gboolean bd_lvm_set_global_config (const gchar *new_config, GError **error);
* bd_lvm_get_global_config:
* @error: (out) (optional): place to store error (if any)
*
* Returns: a copy of a string representation of the currently set LVM global
* configuration
* Returns: (transfer full): a copy of a string representation of the currently
* set libblockdev LVM global configuration
*
* Note: This function does not change the global `lvm.conf` config
* file, see %bd_lvm_set_global_config for details.
*
* Tech category: %BD_LVM_TECH_GLOB_CONF no mode (it is ignored)
*/
Expand Down
16 changes: 13 additions & 3 deletions src/plugins/lvm-dbus.c
Original file line number Diff line number Diff line change
Expand Up @@ -3418,10 +3418,17 @@ gboolean bd_lvm_thsnapshotcreate (const gchar *vg_name, const gchar *origin_name

/**
* bd_lvm_set_global_config:
* @new_config: (nullable): string representation of the new global LVM
* configuration to set or %NULL to reset to default
* @new_config: (nullable): string representation of the new global libblockdev LVM
* configuration to set or %NULL to reset to default
* @error: (out) (optional): place to store error (if any)
*
*
* Note: This function sets configuration options for LVM calls internally
* in libblockdev, it doesn't change the global lvm.conf config file.
* Calling this function with `backup {backup=0 archive=0}` for example
* means `--config=backup {backup=0 archive=0}"` will be added to all
* calls libblockdev makes.
*
* Returns: whether the new requested global config @new_config was successfully
* set or not
*
Expand Down Expand Up @@ -3451,7 +3458,10 @@ gboolean bd_lvm_set_global_config (const gchar *new_config, GError **error G_GNU
* @error: (out) (optional): place to store error (if any)
*
* Returns: (transfer full): a copy of a string representation of the currently
* set LVM global configuration
* set libblockdev LVM global configuration
*
* Note: This function does not change the global `lvm.conf` config
* file, see %bd_lvm_set_global_config for details.
*
* Tech category: %BD_LVM_TECH_GLOB_CONF no mode (it is ignored)
*/
Expand Down
16 changes: 13 additions & 3 deletions src/plugins/lvm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2536,10 +2536,17 @@ gboolean bd_lvm_thsnapshotcreate (const gchar *vg_name, const gchar *origin_name

/**
* bd_lvm_set_global_config:
* @new_config: (nullable): string representation of the new global LVM
* configuration to set or %NULL to reset to default
* @new_config: (nullable): string representation of the new global libblockdev LVM
* configuration to set or %NULL to reset to default
* @error: (out) (optional): place to store error (if any)
*
*
* Note: This functions sets configuration options for LVM calls internally
* in libblockdev, it doesn't change the global lvm.conf config file.
* Calling this function with `backup {backup=0 archive=0}` for example
* means `--config=backup {backup=0 archive=0}"` will be added to all
* calls libblockdev makes.
*
* Returns: whether the new requested global config @new_config was successfully
* set or not
*
Expand Down Expand Up @@ -2569,7 +2576,10 @@ gboolean bd_lvm_set_global_config (const gchar *new_config, GError **error G_GNU
* @error: (out) (optional): place to store error (if any)
*
* Returns: (transfer full): a copy of a string representation of the currently
* set LVM global configuration
* set libblockdev LVM global configuration
*
* Note: This function does not change the global `lvm.conf` config
* file, see %bd_lvm_set_global_config for details.
*
* Tech category: %BD_LVM_TECH_GLOB_CONF no mode (it is ignored)
*/
Expand Down

0 comments on commit 1cc99c5

Please sign in to comment.