| Top |
A plugin for operations with loop devices. All sizes passed in/out to/from the functions are in bytes.
gboolean
bd_loop_init (void);
Initializes the plugin. **This function is called automatically by the library's initialization functions.**
void
bd_loop_close (void);
Cleans up after the plugin. **This function is called automatically by the library's functions that unload it.**
gchar * bd_loop_get_backing_file (const gchar *dev_name,GError **error);
dev_name |
name of the loop device to get backing file for (e.g. "loop0") |
|
error |
place to store error (if any). |
[out] |
path of the device's backing file or NULL if none
is found
Tech category: BD_LOOP_TECH_LOOP-BD_LOOP_TECH_MODE_QUERY.
[transfer full]
gchar * bd_loop_get_loop_name (const gchar *file,GError **error);
file |
path of the backing file to get loop name for |
|
error |
place to store error (if any). |
[out] |
name of the loop device associated with the given file
Tech category: BD_LOOP_TECH_LOOP-BD_LOOP_TECH_MODE_QUERY.
[transfer full]
gboolean bd_loop_setup (const gchar *file,guint64 offset,guint64 size,gboolean read_only,gboolean part_scan,const gchar **loop_name,GError **error);
file |
file to setup as a loop device |
|
offset |
offset of the start of the device (in |
|
size |
maximum size of the device (or 0 to leave unspecified) |
|
read_only |
||
part_scan |
whether to enforce partition scan on the newly created device or not |
|
loop_name |
if not |
[allow-none][out] |
error |
place to store error (if any). |
[out] |
whether the file
was successfully setup as a loop device or not
Tech category: BD_LOOP_TECH_LOOP-BD_LOOP_TECH_MODE_CREATE
gboolean bd_loop_setup_from_fd (gint fd,guint64 offset,guint64 size,gboolean read_only,gboolean part_scan,const gchar **loop_name,GError **error);
fd |
file descriptor for a file to setup as a new loop device |
|
offset |
offset of the start of the device (in file given by |
|
size |
maximum size of the device (or 0 to leave unspecified) |
|
read_only |
||
part_scan |
whether to enforce partition scan on the newly created device or not |
|
loop_name |
if not |
[allow-none][out] |
error |
place to store error (if any). |
[out] |
whether an new loop device was successfully setup for fd
or not
Tech category: BD_LOOP_TECH_LOOP-BD_LOOP_TECH_MODE_CREATE
gboolean bd_loop_teardown (const gchar *loop,GError **error);
loop |
path or name of the loop device to tear down |
|
error |
place to store error (if any). |
[out] |
whether the loop
device was successfully torn down or not
Tech category: BD_LOOP_TECH_LOOP-BD_LOOP_TECH_MODE_DESTROY
gboolean bd_loop_get_autoclear (const gchar *loop,GError **error);
whether the autoclear flag is set on the loop
device or not (if FALSE, error
may be set)
Tech category: BD_LOOP_TECH_LOOP-BD_LOOP_TECH_MODE_QUERY
gboolean bd_loop_set_autoclear (const gchar *loop,gboolean autoclear,GError **error);
loop |
path or name of the loop device |
|
autoclear |
whether to set or unset the autoclear flag |
|
error |
place to store error (if any). |
[out] |
whether the autoclear flag was successfully set on the loop
device or not
Tech category: BD_LOOP_TECH_LOOP-BD_LOOP_TECH_MODE_MODIFY
gboolean bd_loop_is_tech_avail (BDLoopTech tech,guint64 mode,GError **error);
tech |
the queried tech |
|
mode |
a bit mask of queried modes of operation (BDLoopTechMode) for |
|
error |
place to store error (details about why the |
[out] |