[libvirt] [sandbox PATCH 02/10] Add configuration object for disk support

Daniel P. Berrange berrange at redhat.com
Fri Jun 26 15:38:39 UTC 2015


On Fri, Jun 26, 2015 at 03:27:37PM +0200, Eren Yagdiran wrote:
> Add the config gobject, functions to store and load the new configuration
> fragments and test. This will allow creating sandboxes with attached
> disk with a parameter formatted like file:tag=/source/file.qcow2,format=qcow2
> ---
>  libvirt-sandbox/Makefile.am                   |   2 +
>  libvirt-sandbox/libvirt-sandbox-config-disk.c | 273 ++++++++++++++++++++++++
>  libvirt-sandbox/libvirt-sandbox-config-disk.h |  82 +++++++
>  libvirt-sandbox/libvirt-sandbox-config.c      | 293 ++++++++++++++++++++++++++
>  libvirt-sandbox/libvirt-sandbox-config.h      |  10 +
>  libvirt-sandbox/libvirt-sandbox.h             |   1 +
>  libvirt-sandbox/libvirt-sandbox.sym           |   4 +
>  libvirt-sandbox/tests/test-config.c           |  11 +
>  8 files changed, 676 insertions(+)
>  create mode 100644 libvirt-sandbox/libvirt-sandbox-config-disk.c
>  create mode 100644 libvirt-sandbox/libvirt-sandbox-config-disk.h
> +/**
> + * gvir_sandbox_config_add_disk_strv:
> + * @config: (transfer none): the sandbox config
> + * @disks: (transfer none)(array zero-terminated=1): the list of disks
> + *
> + * Parses @disks whose elements are in the format TYPE:TARGET=SOURCE,FORMAT=FORMAT
> + * creating #GVirSandboxConfigMount instances for each element. For
> + * example
> + *
> + * - file:hda=/var/lib/sandbox/demo/tmp.qcow2,format=qcow2
> + */

'hda' needs changing to a tag of some kind

> +/**
> + * gvir_sandbox_config_add_disk_opts:
> + * @config: (transfer none): the sandbox config
> + * @disk: (transfer none): the disk config
> + *
> + * Parses @disk in the format TYPE:TARGET=SOURCE,FORMAT=FORMAT
> + * creating #GVirSandboxConfigDisk instances for each element. For
> + * example
> + *
> + * - file:hda=/var/lib/sandbox/demo/tmp.qcow2,format=qcow2
> + */

Again


> diff --git a/libvirt-sandbox/tests/test-config.c b/libvirt-sandbox/tests/test-config.c
> index dcbe5c1..3ea2017 100644
> --- a/libvirt-sandbox/tests/test-config.c
> +++ b/libvirt-sandbox/tests/test-config.c
> @@ -58,6 +58,14 @@ int main(int argc, char **argv)
>          "host-bind:/tmp=",
>          NULL
>      };
> +    const gchar *disks[] = {
> +        "file:hda=/tmp/img.blah,format=qcow2",
> +        "file:hda=/tmp/img.qcow2",
> +        "file:hda=/tmp/img.qcow2,format=raw",
> +        "file:hda=/tmp/img.img",
> +        "file:hda=/tmp/imq",
> +        NULL
> +    };

And here


ACK, I'll make the changes before pushing.

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list