27 lines
962 B
C
27 lines
962 B
C
|
#pragma once
|
||
|
|
||
|
#include "utils.h"
|
||
|
#include "disk.h"
|
||
|
|
||
|
#include <stdbool.h>
|
||
|
#include <stdint.h>
|
||
|
|
||
|
#define BACKING_POOL_DIR "/var/lib/sandbox/backings"
|
||
|
#define MAX_BACKING_LENGTH 256
|
||
|
|
||
|
/// @brief Checks whether the given backing id is valid.
|
||
|
/// @param backing_id The backing id to check.
|
||
|
/// @return True if the backing id is valid, false otherwise.
|
||
|
bool is_valid_backing_id(const char* backing_id);
|
||
|
|
||
|
/// @brief Gets the path of the given backing.
|
||
|
/// @param backing_id The backing id.
|
||
|
/// @param out_path The pointer to the output path string. The caller is responsible for freeing the memory.
|
||
|
/// @return The result of the operation.
|
||
|
Result get_backing_path(const char* backing_id, char** out_path);
|
||
|
|
||
|
/// @brief Checks whether the given backing exists in the pool.
|
||
|
/// @param backing_id The backing id.
|
||
|
/// @param out_exists The pointer to the output boolean.
|
||
|
/// @return The result of the operation.
|
||
|
Result backing_exists(const char* backing_id, bool* out_exists);
|