how to start lvm merge in background using blockdev in C

87 views Asked by At

I am trying to start a merge of a LVM snapshot using the blockdev API in C, similar to the “lvconvert —merge -b vg/lvsnap” OS command

The issue is that the merge starts, but it doesn’t go in background The code waits for the completion of the merge, before it can continue

Not sure what I am doing wrong, or if there is another way to resolve this?

    BDExtraArg          lv_arg = {"--background",""};
    const BDExtraArg    *extra_args[2] = {&lv_arg, NULL};
    g_autoptr(GError)   error = NULL;
    
    bd_switch_init_checks (FALSE, &error);
    bd_ensure_init (plugins, NULL, &error);
    bd_lvm_lvsnapshotmerge(vg_name,lv_snap,extra_args,&error);

Am I supposed to start this as a background thread instead?

Regards Tomas

0

There are 0 answers