From: Cédric Bosdonnat <cbosdonnat@xxxxxxxx> Add helper function to check if a config contains disk devices. --- libvirt-sandbox/libvirt-sandbox-config.c | 7 +++++++ libvirt-sandbox/libvirt-sandbox-config.h | 1 + libvirt-sandbox/libvirt-sandbox.sym | 1 + 3 files changed, 9 insertions(+) diff --git a/libvirt-sandbox/libvirt-sandbox-config.c b/libvirt-sandbox/libvirt-sandbox-config.c index 3342706..f800cf9 100644 --- a/libvirt-sandbox/libvirt-sandbox-config.c +++ b/libvirt-sandbox/libvirt-sandbox-config.c @@ -1305,6 +1305,13 @@ gboolean gvir_sandbox_config_add_disk_opts(GVirSandboxConfig *config, } +gboolean gvir_sandbox_config_has_disks(GVirSandboxConfig *config) +{ + GVirSandboxConfigPrivate *priv = config->priv; + return priv->disks != NULL; +} + + /** * gvir_sandbox_config_add_mount: * @config: (transfer none): the sandbox config diff --git a/libvirt-sandbox/libvirt-sandbox-config.h b/libvirt-sandbox/libvirt-sandbox-config.h index deaea68..ebbebf2 100644 --- a/libvirt-sandbox/libvirt-sandbox-config.h +++ b/libvirt-sandbox/libvirt-sandbox-config.h @@ -131,6 +131,7 @@ gboolean gvir_sandbox_config_add_disk_strv(GVirSandboxConfig *config, gboolean gvir_sandbox_config_add_disk_opts(GVirSandboxConfig *config, const char *disk, GError **error); +gboolean gvir_sandbox_config_has_disks(GVirSandboxConfig *config); void gvir_sandbox_config_add_mount(GVirSandboxConfig *config, GVirSandboxConfigMount *mnt); diff --git a/libvirt-sandbox/libvirt-sandbox.sym b/libvirt-sandbox/libvirt-sandbox.sym index bb717ed..e5f8660 100644 --- a/libvirt-sandbox/libvirt-sandbox.sym +++ b/libvirt-sandbox/libvirt-sandbox.sym @@ -217,4 +217,5 @@ LIBVIRT_SANDBOX_0.5.2 { gvir_sandbox_config_add_disk_strv; gvir_sandbox_config_add_disk_opts; gvir_sandbox_config_disk_get_type; + gvir_sandbox_config_has_disks; } LIBVIRT_SANDBOX_0.2.1; -- 2.1.0 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list