374 | 374 |
} else
|
375 | 375 |
return TRUE;
|
376 | 376 |
case BD_LVM_TECH_VDO:
|
377 | |
if (mode & BD_LVM_TECH_MODE_MODIFY) {
|
378 | |
g_set_error (error, BD_LVM_ERROR, BD_LVM_ERROR_TECH_UNAVAIL,
|
379 | |
"Modifying existing LVM VDO devices is not supported by this plugin implementation.");
|
380 | |
return FALSE;
|
381 | |
|
382 | |
} else
|
383 | |
return check_dbus_deps (&avail_dbus_deps, DBUS_DEPS_LVMDBUSD_MASK, dbus_deps, DBUS_DEPS_LAST, &deps_check_lock, error) &&
|
384 | |
check_features (&avail_features, FEATURES_VDO_MASK, features, FEATURES_LAST, &deps_check_lock, error) &&
|
385 | |
check_module_deps (&avail_module_deps, MODULE_DEPS_VDO_MASK, module_deps, MODULE_DEPS_LAST, &deps_check_lock, error);
|
|
377 |
return check_dbus_deps (&avail_dbus_deps, DBUS_DEPS_LVMDBUSD_MASK, dbus_deps, DBUS_DEPS_LAST, &deps_check_lock, error) &&
|
|
378 |
check_features (&avail_features, FEATURES_VDO_MASK, features, FEATURES_LAST, &deps_check_lock, error) &&
|
|
379 |
check_module_deps (&avail_module_deps, MODULE_DEPS_VDO_MASK, module_deps, MODULE_DEPS_LAST, &deps_check_lock, error);
|
386 | 380 |
default:
|
387 | 381 |
/* everything is supported by this implementation of the plugin */
|
388 | 382 |
return check_dbus_deps (&avail_dbus_deps, DBUS_DEPS_LVMDBUSD_MASK, dbus_deps, DBUS_DEPS_LAST, &deps_check_lock, error);
|
|
808 | 802 |
g_free (obj_id);
|
809 | 803 |
}
|
810 | 804 |
|
|
805 |
static void call_vdopool_method_sync (const gchar *vg_name, const gchar *pool_name, const gchar *method, GVariant *params, GVariant *extra_params, const BDExtraArg **extra_args, gboolean lock_config, GError **error) {
|
|
806 |
gchar *obj_id = g_strdup_printf ("%s/%s", vg_name, pool_name);
|
|
807 |
|
|
808 |
call_lvm_obj_method_sync (obj_id, VDO_POOL_INTF, method, params, extra_params, extra_args, lock_config, error);
|
|
809 |
g_free (obj_id);
|
|
810 |
}
|
|
811 |
|
811 | 812 |
static GVariant* get_lv_property (const gchar *vg_name, const gchar *lv_name, const gchar *property, GError **error) {
|
812 | 813 |
gchar *lv_spec = NULL;
|
813 | 814 |
GVariant *ret = NULL;
|
|
3477 | 3478 |
*
|
3478 | 3479 |
* Tech category: %BD_LVM_TECH_VDO-%BD_LVM_TECH_MODE_MODIFY
|
3479 | 3480 |
*/
|
3480 | |
gboolean bd_lvm_vdo_enable_compression (const gchar *vg_name UNUSED, const gchar *pool_name UNUSED, const BDExtraArg **extra UNUSED, GError **error) {
|
3481 | |
return bd_lvm_is_tech_avail (BD_LVM_TECH_VDO, BD_LVM_TECH_MODE_MODIFY, error);
|
|
3481 |
gboolean bd_lvm_vdo_enable_compression (const gchar *vg_name, const gchar *pool_name, const BDExtraArg **extra, GError **error) {
|
|
3482 |
call_vdopool_method_sync (vg_name, pool_name, "EnableCompression", NULL, NULL, extra, TRUE, error);
|
|
3483 |
|
|
3484 |
return (*error == NULL);
|
3482 | 3485 |
}
|
3483 | 3486 |
|
3484 | 3487 |
/**
|
|
3493 | 3496 |
*
|
3494 | 3497 |
* Tech category: %BD_LVM_TECH_VDO-%BD_LVM_TECH_MODE_MODIFY
|
3495 | 3498 |
*/
|
3496 | |
gboolean bd_lvm_vdo_disable_compression (const gchar *vg_name UNUSED, const gchar *pool_name UNUSED, const BDExtraArg **extra UNUSED, GError **error) {
|
3497 | |
return bd_lvm_is_tech_avail (BD_LVM_TECH_VDO, BD_LVM_TECH_MODE_MODIFY, error);
|
|
3499 |
gboolean bd_lvm_vdo_disable_compression (const gchar *vg_name, const gchar *pool_name, const BDExtraArg **extra, GError **error) {
|
|
3500 |
call_vdopool_method_sync (vg_name, pool_name, "DisableCompression", NULL, NULL, extra, TRUE, error);
|
|
3501 |
|
|
3502 |
return (*error == NULL);
|
3498 | 3503 |
}
|
3499 | 3504 |
|
3500 | 3505 |
/**
|
|
3509 | 3514 |
*
|
3510 | 3515 |
* Tech category: %BD_LVM_TECH_VDO-%BD_LVM_TECH_MODE_MODIFY
|
3511 | 3516 |
*/
|
3512 | |
gboolean bd_lvm_vdo_enable_deduplication (const gchar *vg_name UNUSED, const gchar *pool_name UNUSED, const BDExtraArg **extra UNUSED, GError **error) {
|
3513 | |
return bd_lvm_is_tech_avail (BD_LVM_TECH_VDO, BD_LVM_TECH_MODE_MODIFY, error);
|
|
3517 |
gboolean bd_lvm_vdo_enable_deduplication (const gchar *vg_name, const gchar *pool_name, const BDExtraArg **extra, GError **error) {
|
|
3518 |
call_vdopool_method_sync (vg_name, pool_name, "EnableDeduplication", NULL, NULL, extra, TRUE, error);
|
|
3519 |
|
|
3520 |
return (*error == NULL);
|
3514 | 3521 |
}
|
3515 | 3522 |
|
3516 | 3523 |
/**
|
|
3525 | 3532 |
*
|
3526 | 3533 |
* Tech category: %BD_LVM_TECH_VDO-%BD_LVM_TECH_MODE_MODIFY
|
3527 | 3534 |
*/
|
3528 | |
gboolean bd_lvm_vdo_disable_deduplication (const gchar *vg_name UNUSED, const gchar *pool_name UNUSED, const BDExtraArg **extra UNUSED, GError **error) {
|
3529 | |
return bd_lvm_is_tech_avail (BD_LVM_TECH_VDO, BD_LVM_TECH_MODE_MODIFY, error);
|
|
3535 |
gboolean bd_lvm_vdo_disable_deduplication (const gchar *vg_name, const gchar *pool_name, const BDExtraArg **extra, GError **error) {
|
|
3536 |
call_vdopool_method_sync (vg_name, pool_name, "DisableDeduplication", NULL, NULL, extra, TRUE, error);
|
|
3537 |
|
|
3538 |
return (*error == NULL);
|
3530 | 3539 |
}
|
3531 | 3540 |
|
3532 | 3541 |
/**
|