libvirt-sandbox-config-mount-host-bind.c 3.14 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
/*
 * libvirt-sandbox-config-mount-host-bind.c: libvirt sandbox configuration
 *
 * Copyright (C) 2011-2012 Red Hat, Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 *
 * Author: Daniel P. Berrange <berrange@redhat.com>
 */

#include <config.h>
#include <string.h>

26
#include "libvirt-sandbox/libvirt-sandbox-config-all.h"
27 28

/**
29
 * SECTION: libvirt-sandbox-config-mount-host-bind
30 31 32 33 34 35 36 37 38 39 40 41 42
 * @short_description: Bindsystem attachment configuration details
 * @include: libvirt-sandbox/libvirt-sandbox.h
 * @see_aloso: #GVirSandboxConfig
 *
 * Provides an object to store information about a bindsystem attachment in the sandbox
 *
 * The GVirSandboxConfigMount object stores information required to attach
 * a host bindsystem to the application sandbox. The sandbox starts off with
 * a complete view of the host bindsystem. This object allows a specific
 * area of the host bindsystem to be hidden and replaced with alternate
 * content.
 */

43 44
#define GVIR_SANDBOX_CONFIG_MOUNT_HOST_BIND_GET_PRIVATE(obj)            \
    (G_TYPE_INSTANCE_GET_PRIVATE((obj), GVIR_SANDBOX_TYPE_CONFIG_MOUNT_HOST_BIND, GVirSandboxConfigMountHostBindPrivate))
45 46 47 48 49 50

struct _GVirSandboxConfigMountHostBindPrivate
{
    gboolean unused;
};

51
G_DEFINE_TYPE_WITH_PRIVATE(GVirSandboxConfigMountHostBind, gvir_sandbox_config_mount_host_bind, GVIR_SANDBOX_TYPE_CONFIG_MOUNT_FILE);
52 53


54
static void gvir_sandbox_config_mount_host_bind_class_init(GVirSandboxConfigMountHostBindClass *klass G_GNUC_UNUSED)
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
{
}


static void gvir_sandbox_config_mount_host_bind_init(GVirSandboxConfigMountHostBind *config)
{
    config->priv = GVIR_SANDBOX_CONFIG_MOUNT_HOST_BIND_GET_PRIVATE(config);
}


/**
 * gvir_sandbox_config_mount_host_bind_new:
 * @targetdir: (transfer none): the target directory
 *
 * Create a new custom mount mapped to the directory @targetdir
 *
 * Returns: (transfer full): a new sandbox mount object
 */
GVirSandboxConfigMountHostBind *gvir_sandbox_config_mount_host_bind_new(const gchar *source,
                                                                        const gchar *targetdir)
{
    return GVIR_SANDBOX_CONFIG_MOUNT_HOST_BIND(g_object_new(GVIR_SANDBOX_TYPE_CONFIG_MOUNT_HOST_BIND,
                                                            "source", source,
                                                            "target", targetdir,
                                                            NULL));
}
81 82 83 84 85 86 87 88 89

/*
 * Local variables:
 *  c-indent-level: 4
 *  c-basic-offset: 4
 *  indent-tabs-mode: nil
 *  tab-width: 8
 * End:
 */