Top | ![]() |
![]() |
![]() |
![]() |
A plugin for operations with loop devices. All sizes passed in/out to/from the functions are in bytes.
gboolean bd_loop_init ();
Initializes the plugin. **This function is called automatically by the library's initialization functions.**
void
bd_loop_close ();
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
);
gchar * bd_loop_get_loop_name (const gchar *file
,GError **error
);
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] |
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] |
gboolean bd_loop_teardown (const gchar *loop
,GError **error
);