[libvirt] [sandbox PATCH v4 03/21] Image: Add Hooking Mechanism

2015-08-28 Thread Eren Yagdiran
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: Eren Yagdiran erenyagdi...@gmail.com + +from abc import ABCMeta

[libvirt] [sandbox PATCH v4 10/21] Image: Add get_command function to Source

2015-08-28 Thread Eren Yagdiran
Provide a way to know how a template can be started depending on the used source DockerSource will need to parse the topmost config file in order to find the igniter command --- virt-sandbox-image/sources/DockerSource.py | 14 ++ virt-sandbox-image/sources/Source.py | 4

[libvirt] [sandbox PATCH v4 07/21] Image: Add download function

2015-08-28 Thread Eren Yagdiran
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: Eren Yagdiran erenyagdi...@gmail.com +# + +from Source import Source +import urllib2 +import sys +import

[libvirt] [sandbox PATCH v4 02/21] Fix virt-sandbox-image

2015-08-28 Thread Eren Yagdiran
-image/virt-sandbox-image.py +++ b/virt-sandbox-image/virt-sandbox-image.py @@ -1,8 +1,10 @@ #!/usr/bin/python -Es # # Authors: Daniel P. Berrange berra...@redhat.com +# Eren Yagdiran erenyagdi...@gmail.com # # Copyright (C) 2013 Red Hat, Inc. +# Copyright (C) 2015 Universitat Polit

[libvirt] [sandbox PATCH v4 12/21] Image: Add check_connect function

2015-08-28 Thread Eren Yagdiran
Check if user-specified connect argument is valid --- virt-sandbox-image/virt-sandbox-image.py | 6 ++ 1 file changed, 6 insertions(+) diff --git a/virt-sandbox-image/virt-sandbox-image.py b/virt-sandbox-image/virt-sandbox-image.py index d6b682f..c46abd4 100755 ---

[libvirt] [sandbox PATCH v4 16/21] Image: Add Volume Support

2015-08-28 Thread Eren Yagdiran
Volumes let user to map host-paths into sandbox. Docker containers need volumes for data persistence. --- virt-sandbox-image/sources/DockerSource.py | 12 virt-sandbox-image/sources/Source.py | 4 virt-sandbox-image/virt-sandbox-image.py | 22 ++ 3

[libvirt] [sandbox PATCH v4 04/21] Image: virt-sandbox-image default dir constants

2015-08-28 Thread Eren Yagdiran
Conflicts: virt-sandbox-image/virt-sandbox-image.py --- virt-sandbox-image/virt-sandbox-image.py | 8 1 file changed, 8 insertions(+) diff --git a/virt-sandbox-image/virt-sandbox-image.py b/virt-sandbox-image/virt-sandbox-image.py index fa9e1c8..55aea6a 100755 ---

[libvirt] [sandbox PATCH v4 05/21] Image: Discard caching bytecode

2015-08-28 Thread Eren Yagdiran
--- virt-sandbox-image/virt-sandbox-image.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/virt-sandbox-image/virt-sandbox-image.py b/virt-sandbox-image/virt-sandbox-image.py index 55aea6a..9e98bf2 100755 --- a/virt-sandbox-image/virt-sandbox-image.py +++

[libvirt] [sandbox PATCH v4 15/21] Image: Add network support

2015-08-28 Thread Eren Yagdiran
Virt-sandbox-image will pass exact network arguments to virt-sandbox --- virt-sandbox-image/virt-sandbox-image.py | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/virt-sandbox-image/virt-sandbox-image.py b/virt-sandbox-image/virt-sandbox-image.py index

[libvirt] [sandbox PATCH v4 06/21] Image: Add check_writable and runtime resolver

2015-08-28 Thread Eren Yagdiran
These helper functions are for selecting right directories according to running user privileges --- virt-sandbox-image/virt-sandbox-image.py | 27 ++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/virt-sandbox-image/virt-sandbox-image.py

[libvirt] [sandbox PATCH v4 11/21] Image: Add run args

2015-08-28 Thread Eren Yagdiran
Commandline parameters for running a template --- virt-sandbox-image/virt-sandbox-image.py | 13 + 1 file changed, 13 insertions(+) diff --git a/virt-sandbox-image/virt-sandbox-image.py b/virt-sandbox-image/virt-sandbox-image.py index 1da5150..d6b682f 100755 ---

[libvirt] [sandbox PATCH v4 18/21] Add config for environment variables

2015-08-28 Thread Eren Yagdiran
Add the config gobject to store custom environment variables. This will allow creating custom environment variables on a sandbox with a parameter formatted like --env key1=val1 Add testcase for custom environment variables make check now includes testcase for environment variables ---

[libvirt] [sandbox PATCH v4 21/21] Image: Add custom environment support

2015-08-28 Thread Eren Yagdiran
Any custom key=value pair can be used as a custom environment variable in virt-sandbox-image. e.g virt-sandbox-image run ubuntu /var/lib/libvirt/templates -c lxc:/// -i /bin/bash -e key1=val1 --- virt-sandbox-image/sources/DockerSource.py | 10 ++ virt-sandbox-image/sources/Source.py

[libvirt] [sandbox PATCH v4 09/21] Image: Add delete function

2015-08-28 Thread Eren Yagdiran
Refactoring delete function from virt-sandbox-image to DockerSource. Delete function can delete templates by name. --- virt-sandbox-image/sources/DockerSource.py | 53 +++ virt-sandbox-image/sources/Source.py | 4 +++ virt-sandbox-image/virt-sandbox-image.py | 58

[libvirt] [sandbox PATCH v4 13/21] Image: Add get_disk function to Source

2015-08-28 Thread Eren Yagdiran
Provide a way to know which disk image to use for the sandbox depending on the used source DockerSource will need to locate the topmost disk image among all the layers images --- virt-sandbox-image/sources/DockerSource.py | 16 virt-sandbox-image/sources/Source.py | 4

[libvirt] [sandbox PATCH v4 14/21] Image: Add run function

2015-08-28 Thread Eren Yagdiran
Run an already-built template If there is no execution command specified by user, source.get_command will find the command to invoke --- virt-sandbox-image/virt-sandbox-image.py | 25 + 1 file changed, 25 insertions(+) diff --git a/virt-sandbox-image/virt-sandbox-image.py

[libvirt] [sandbox PATCH v4 08/21] Image: Refactor create function

2015-08-28 Thread Eren Yagdiran
Move the docker-related code to the DockerSource and use the Source mechanism --- virt-sandbox-image/sources/DockerSource.py | 100 + virt-sandbox-image/sources/Source.py | 4 ++ virt-sandbox-image/virt-sandbox-image.py | 76 +- 3 files

[libvirt] [sandbox PATCH v4 01/21] Add virt-sandbox-image

2015-08-28 Thread Eren Yagdiran
From: Daniel P Berrange berra...@redhat.com virt-sandbox-image.py is a python script that lets you download Docker images easily. It is a proof of concept code and consumes Docker Rest API. --- po/POTFILES.in | 1 + virt-sandbox-image/virt-sandbox-image.py | 394

[libvirt] [sandbox PATCH v4 19/21] Add environment parameter to virt-sandbox

2015-08-28 Thread Eren Yagdiran
Allow users to add custom environment variables to their sandbox. --- bin/virt-sandbox.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/bin/virt-sandbox.c b/bin/virt-sandbox.c index 195515f..e90b698 100644 --- a/bin/virt-sandbox.c +++ b/bin/virt-sandbox.c @@ -64,6 +64,7 @@

[libvirt] [sandbox PATCH v4 17/21] Image: man file for virt-sandbox-image

2015-08-28 Thread Eren Yagdiran
in subdirectories of +/var/lib/libvirt/templates, by default. + +=head1 AUTHORS + +Daniel P. Berrange d...@berrange.com + +Eren Yagdiran erenyagdi...@gmail.com + +=head1 COPYRIGHT + +Copyright (C) 2013 Red Hat, Inc. +Copyright (C) 2015 Universitat Politecnica de Catalunya. + +=head1 LICENSE + +virt-sandbox

[libvirt] [sandbox PATCH v4 00/21] *** virt-sandbox-image v4 ***

2015-08-28 Thread Eren Yagdiran
Hi, Running sandbox now has its own disk layer. virt-sandbox now using GHashMap to store key value pairs for environment variables and some minor changes. Daniel P Berrange (1): Add virt-sandbox-image Eren Yagdiran (20): Fix virt-sandbox-image Image: Add Hooking Mechanism Image: virt

[libvirt] [sandbox PATCH v4 20/21] init-common: Exporting custom environment variables

2015-08-28 Thread Eren Yagdiran
Common-init reads config file and exports custom environment variables from config file and applies them to the running sandbox. --- libvirt-sandbox/libvirt-sandbox-init-common.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/libvirt-sandbox/libvirt-sandbox-init-common.c

[libvirt] [sandbox PATCH v3 17/22] Image: man file for virt-sandbox-image

2015-08-18 Thread Eren Yagdiran
in subdirectories of +/var/lib/libvirt/templates, by default. + +=head1 AUTHORS + +Daniel P. Berrange d...@berrange.com + +Eren Yagdiran erenyagdi...@gmail.com + +=head1 COPYRIGHT + +Copyright (C) 2013 Red Hat, Inc. +Copyright (C) 2015 Universitat Politecnica de Catalunya. + +=head1 LICENSE + +virt-sandbox

[libvirt] [sandbox PATCH v3 00/22] *** Virt-sandbox-image ***

2015-08-18 Thread Eren Yagdiran
warning is now using stderr * get_disk method in Source now adds another layer with a randomized name Daniel P Berrange (1): Add virt-sandbox-image Eren Yagdiran (21): Fix virt-sandbox-image Image: Add Hooking Mechanism Image: virt-sandbox-image default dir constants Image: Discard

[libvirt] [sandbox PATCH v3 11/22] Image: Add run args

2015-08-18 Thread Eren Yagdiran
Commandline parameters for running a template --- virt-sandbox-image/virt-sandbox-image.py | 13 + 1 file changed, 13 insertions(+) diff --git a/virt-sandbox-image/virt-sandbox-image.py b/virt-sandbox-image/virt-sandbox-image.py index 1da5150..d6b682f 100755 ---

[libvirt] [sandbox PATCH v3 21/22] Add testcase for custom environment variables

2015-08-18 Thread Eren Yagdiran
make check now includes testcase for environment variables --- libvirt-sandbox/tests/test-config.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/libvirt-sandbox/tests/test-config.c b/libvirt-sandbox/tests/test-config.c index da05187..ac10bab 100644 ---

[libvirt] [sandbox PATCH v3 14/22] Image: Add run function

2015-08-18 Thread Eren Yagdiran
Run an already-built template If there is no execution command specified by user, source.get_command will find the command to invoke --- virt-sandbox-image/virt-sandbox-image.py | 25 + 1 file changed, 25 insertions(+) diff --git a/virt-sandbox-image/virt-sandbox-image.py

[libvirt] [sandbox PATCH v3 07/22] Image: Add download function

2015-08-18 Thread Eren Yagdiran
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: Eren Yagdiran erenyagdi...@gmail.com +# + +from Source import Source +import urllib2 +import sys +import

[libvirt] [sandbox PATCH v3 08/22] Image: Refactor create function

2015-08-18 Thread Eren Yagdiran
Move the docker-related code to the DockerSource and use the Source mechanism --- virt-sandbox-image/sources/DockerSource.py | 100 + virt-sandbox-image/sources/Source.py | 4 ++ virt-sandbox-image/virt-sandbox-image.py | 76 +- 3 files

[libvirt] [sandbox PATCH v3 06/22] Image: Add check_writable and runtime resolver

2015-08-18 Thread Eren Yagdiran
These helper functions are for selecting right directories according to running user privileges --- virt-sandbox-image/virt-sandbox-image.py | 27 ++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/virt-sandbox-image/virt-sandbox-image.py

[libvirt] [sandbox PATCH v3 15/22] Image: Add network support

2015-08-18 Thread Eren Yagdiran
Virt-sandbox-image will pass exact network arguments to virt-sandbox --- virt-sandbox-image/virt-sandbox-image.py | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/virt-sandbox-image/virt-sandbox-image.py b/virt-sandbox-image/virt-sandbox-image.py index

[libvirt] [sandbox PATCH v3 16/22] Image: Add Volume Support

2015-08-18 Thread Eren Yagdiran
Volumes let user to map host-paths into guest. Docker containers need volumes because its filesystem read-only by default. --- virt-sandbox-image/sources/DockerSource.py | 12 virt-sandbox-image/sources/Source.py | 4 virt-sandbox-image/virt-sandbox-image.py | 22

[libvirt] [sandbox PATCH v3 18/22] Add configuration object for environment variables

2015-08-18 Thread Eren Yagdiran
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: Eren Yagdiran erenyagdi...@gmail.com + */ + +#include config.h +#include string.h + +#include libvirt-sandbox/libvirt-sandbox-config-all.h + +/** + * SECTION: libvirt-sandbox-config-env + * @short_description

[libvirt] [sandbox PATCH v3 13/22] Image: Add get_disk function to Source

2015-08-18 Thread Eren Yagdiran
Provide a way to know which disk image to use for the sandbox depending on the used source DockerSource will need to locate the topmost disk image among all the layers images --- virt-sandbox-image/sources/DockerSource.py | 18 ++ virt-sandbox-image/sources/Source.py | 4

[libvirt] [sandbox PATCH v3 02/22] Fix virt-sandbox-image

2015-08-18 Thread Eren Yagdiran
-image/virt-sandbox-image.py +++ b/virt-sandbox-image/virt-sandbox-image.py @@ -1,8 +1,10 @@ #!/usr/bin/python -Es # # Authors: Daniel P. Berrange berra...@redhat.com +# Eren Yagdiran erenyagdi...@gmail.com # # Copyright (C) 2013 Red Hat, Inc. +# Copyright (C) 2015 Universitat Polit

[libvirt] [sandbox PATCH v3 01/22] Add virt-sandbox-image

2015-08-18 Thread Eren Yagdiran
From: Daniel P Berrange berra...@redhat.com virt-sandbox-image.py is a python script that lets you download Docker images easily. It is a proof of concept code and consumes Docker Rest API. --- po/POTFILES.in | 1 + virt-sandbox-image/virt-sandbox-image.py | 394

[libvirt] [sandbox PATCH v3 20/22] Common-init: Exporting custom environment variables

2015-08-18 Thread Eren Yagdiran
Common-init reads config file and export custom environment variables from config file and apply them to the running sandbox. --- libvirt-sandbox/libvirt-sandbox-init-common.c | 30 +++ 1 file changed, 30 insertions(+) diff --git

[libvirt] [sandbox PATCH v3 03/22] Image: Add Hooking Mechanism

2015-08-18 Thread Eren Yagdiran
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: Eren Yagdiran erenyagdi...@gmail.com + +from abc import ABCMeta

[libvirt] [sandbox PATCH v3 04/22] Image: virt-sandbox-image default dir constants

2015-08-18 Thread Eren Yagdiran
Conflicts: virt-sandbox-image/virt-sandbox-image.py --- virt-sandbox-image/virt-sandbox-image.py | 8 1 file changed, 8 insertions(+) diff --git a/virt-sandbox-image/virt-sandbox-image.py b/virt-sandbox-image/virt-sandbox-image.py index fa9e1c8..55aea6a 100755 ---

[libvirt] [sandbox PATCH v3 05/22] Image: Discard caching bytecode

2015-08-18 Thread Eren Yagdiran
--- virt-sandbox-image/virt-sandbox-image.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/virt-sandbox-image/virt-sandbox-image.py b/virt-sandbox-image/virt-sandbox-image.py index 55aea6a..9e98bf2 100755 --- a/virt-sandbox-image/virt-sandbox-image.py +++

[libvirt] [sandbox PATCH v3 22/22] Image: Add custom environment support

2015-08-18 Thread Eren Yagdiran
Any custom key=value pair can be used as a custom environment variable in virt-sandbox-image. e.g virt-sandbox-image run ubuntu /var/lib/libvirt/templates -c lxc:/// -i /bin/bash -e key1=val1 --- virt-sandbox-image/sources/DockerSource.py | 10 ++ virt-sandbox-image/sources/Source.py

[libvirt] [sandbox PATCH v3 12/22] Image: Add check_connect function

2015-08-18 Thread Eren Yagdiran
Check if user-specified connect argument is valid --- virt-sandbox-image/virt-sandbox-image.py | 6 ++ 1 file changed, 6 insertions(+) diff --git a/virt-sandbox-image/virt-sandbox-image.py b/virt-sandbox-image/virt-sandbox-image.py index d6b682f..c46abd4 100755 ---

[libvirt] [sandbox PATCH v3 19/22] Add environment parameter to virt-sandbox

2015-08-18 Thread Eren Yagdiran
Allow users to add custom environment variables to their sandbox. --- bin/virt-sandbox.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/bin/virt-sandbox.c b/bin/virt-sandbox.c index 195515f..e90b698 100644 --- a/bin/virt-sandbox.c +++ b/bin/virt-sandbox.c @@ -64,6 +64,7 @@

[libvirt] [sandbox PATCH v3 09/22] Image: Add delete function

2015-08-18 Thread Eren Yagdiran
Refactoring delete function from virt-sandbox-image to DockerSource. Delete function can delete templates by name. --- virt-sandbox-image/sources/DockerSource.py | 53 +++ virt-sandbox-image/sources/Source.py | 4 +++ virt-sandbox-image/virt-sandbox-image.py | 58

[libvirt] [sandbox PATCH v3 10/22] Image: Add get_command function to Source

2015-08-18 Thread Eren Yagdiran
Provide a way to know how a template can be started depending on the used source DockerSource will need to parse the topmost config file in order to find the igniter command --- virt-sandbox-image/sources/DockerSource.py | 14 ++ virt-sandbox-image/sources/Source.py | 4

[libvirt] [sandbox PATCH v2 10/19] Image: Add get_disk function to Source

2015-08-04 Thread Eren Yagdiran
Provide a way to know which disk image to use for the sandbox depending on the used source DockerSource will need to locate the topmost disk image among all the layers images --- virt-sandbox-image/sources/DockerSource.py | 9 + virt-sandbox-image/sources/Source.py | 4 2

[libvirt] [sandbox PATCH v2 19/19] Image: Add custom environment support

2015-08-04 Thread Eren Yagdiran
Any custom key=value pair can be used as a custom environment variable in virt-sandbox-image. e.g virt-sandbox-image run ubuntu /var/lib/libvirt/templates -c lxc:/// -i /bin/bash -e key1=val1 --- virt-sandbox-image/sources/DockerSource.py | 10 ++ virt-sandbox-image/sources/Source.py

[libvirt] [sandbox PATCH v2 06/19] Image: Add delete function

2015-08-04 Thread Eren Yagdiran
Refactoring delete function from virt-sandbox-image to DockerSource. Delete function can delete templates by name. --- virt-sandbox-image/sources/DockerSource.py | 53 +++ virt-sandbox-image/sources/Source.py | 4 ++ virt-sandbox-image/virt-sandbox-image.py | 59

[libvirt] [sandbox PATCH v2 07/19] Image: Add get_command function to Source

2015-08-04 Thread Eren Yagdiran
Provide a way to know how a template can be started depending on the used source DockerSource will need to parse the topmost config file in order to find the igniter command --- virt-sandbox-image/sources/DockerSource.py | 14 ++ virt-sandbox-image/sources/Source.py | 4

[libvirt] [sandbox PATCH v2 14/19] Image: man file for virt-sandbox-image

2015-08-04 Thread Eren Yagdiran
in subdirectories of +/var/lib/libvirt/templates, by default. + +=head1 AUTHORS + +Daniel P. Berrange d...@berrange.com + +Eren Yagdiran erenyagdi...@gmail.com + +=head1 COPYRIGHT + +Copyright (C) 2013 Red Hat, Inc. +Copyright (C) 2015 Universitat Politecnica de Catalunya. + +=head1 LICENSE + +virt-sandbox

[libvirt] [sandbox PATCH v2 13/19] Image: Add Volume Support

2015-08-04 Thread Eren Yagdiran
Volumes let user to map host-paths into guest. Docker containers need volumes because its filesystem read-only by default. --- virt-sandbox-image/sources/DockerSource.py | 12 virt-sandbox-image/sources/Source.py | 4 virt-sandbox-image/virt-sandbox-image.py | 22

[libvirt] [sandbox PATCH v2 08/19] Image: Add run args

2015-08-04 Thread Eren Yagdiran
Commandline parameters for running a template --- virt-sandbox-image/virt-sandbox-image.py | 13 + 1 file changed, 13 insertions(+) diff --git a/virt-sandbox-image/virt-sandbox-image.py b/virt-sandbox-image/virt-sandbox-image.py index ea7ab02..feee849 100755 ---

[libvirt] [sandbox PATCH v2 15/19] Add configuration object for environment variables

2015-08-04 Thread Eren Yagdiran
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: Eren Yagdiran erenyagdi...@gmail.com + */ + +#include config.h +#include string.h + +#include libvirt-sandbox/libvirt-sandbox-config-all.h + +/** + * SECTION: libvirt-sandbox-config-env + * @short_description

[libvirt] [sandbox PATCH v2 11/19] Image: Add run function

2015-08-04 Thread Eren Yagdiran
Run an already-built template If there is no execution command specified by user, source.get_command will find the command to invoke --- virt-sandbox-image/virt-sandbox-image.py | 24 1 file changed, 24 insertions(+) diff --git a/virt-sandbox-image/virt-sandbox-image.py

[libvirt] [sandbox PATCH v2 00/19] *** Virt-sandbox-image ***

2015-08-04 Thread Eren Yagdiran
): Add virt-sandbox-image Eren Yagdiran (18): Fix virt-sandbox-image Image: Add Hooking Mechanism Image: Add download function Image: Refactor create function Image: Add delete function Image: Add get_command function to Source Image: Add run args Image: Add check_connect function

[libvirt] [sandbox PATCH v2 12/19] Image: Add network support

2015-08-04 Thread Eren Yagdiran
Virt-sandbox-image will pass exact network arguments to virt-sandbox --- virt-sandbox-image/virt-sandbox-image.py | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/virt-sandbox-image/virt-sandbox-image.py b/virt-sandbox-image/virt-sandbox-image.py index

[libvirt] [sandbox PATCH v2 09/19] Image: Add check_connect function

2015-08-04 Thread Eren Yagdiran
Check if user-specified connect argument is valid --- virt-sandbox-image/virt-sandbox-image.py | 6 ++ 1 file changed, 6 insertions(+) diff --git a/virt-sandbox-image/virt-sandbox-image.py b/virt-sandbox-image/virt-sandbox-image.py index feee849..4c19fa8 100755 ---

[libvirt] [sandbox PATCH v2 17/19] Common-init: Exporting custom environment variables

2015-08-04 Thread Eren Yagdiran
Common-init reads config file and export custom environment variables from config file and apply them to the running sandbox. --- libvirt-sandbox/libvirt-sandbox-init-common.c | 30 +++ 1 file changed, 30 insertions(+) diff --git

[libvirt] [sandbox PATCH v2 16/19] Add environment parameter to virt-sandbox

2015-08-04 Thread Eren Yagdiran
Allow users to add custom environment variables to their sandbox. --- bin/virt-sandbox.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/bin/virt-sandbox.c b/bin/virt-sandbox.c index 195515f..e90b698 100644 --- a/bin/virt-sandbox.c +++ b/bin/virt-sandbox.c @@ -64,6 +64,7 @@

[libvirt] [sandbox PATCH v2 05/19] Image: Refactor create function

2015-08-04 Thread Eren Yagdiran
Move the docker-related code to the DockerSource and use the Source mechanism --- virt-sandbox-image/sources/DockerSource.py | 100 + virt-sandbox-image/sources/Source.py | 4 ++ virt-sandbox-image/virt-sandbox-image.py | 70 3 files

[libvirt] [sandbox PATCH v2 01/19] Add virt-sandbox-image

2015-08-04 Thread Eren Yagdiran
From: Daniel P Berrange berra...@redhat.com virt-sandbox-image.py is a python script that lets you download Docker images easily. It is a proof of concept code and consumes Docker Rest API. --- po/POTFILES.in | 1 + virt-sandbox-image/virt-sandbox-image.py | 394

[libvirt] [sandbox PATCH v2 02/19] Fix virt-sandbox-image

2015-08-04 Thread Eren Yagdiran
-image/virt-sandbox-image.py +++ b/virt-sandbox-image/virt-sandbox-image.py @@ -1,8 +1,10 @@ #!/usr/bin/python -Es # # Authors: Daniel P. Berrange berra...@redhat.com +# Eren Yagdiran erenyagdi...@gmail.com # # Copyright (C) 2013 Red Hat, Inc. +# Copyright (C) 2015 Universitat Polit

[libvirt] [sandbox PATCH v2 04/19] Image: Add download function

2015-08-04 Thread Eren Yagdiran
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: Eren Yagdiran erenyagdi...@gmail.com +* +''' +#!/usr/bin/python + +from

[libvirt] [sandbox PATCH v2 18/19] Add testcase for custom environment variables

2015-08-04 Thread Eren Yagdiran
make check now includes testcase for environment variables --- libvirt-sandbox/tests/test-config.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/libvirt-sandbox/tests/test-config.c b/libvirt-sandbox/tests/test-config.c index da05187..ac10bab 100644 ---

[libvirt] [sandbox PATCH v2 03/19] Image: Add Hooking Mechanism

2015-08-04 Thread Eren Yagdiran
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: Eren Yagdiran erenyagdi...@gmail.com

[libvirt] [sandbox PATCH 11/11] Image: Add run function

2015-07-23 Thread Eren Yagdiran
Run an already-built template If there is no execution command specified by user, source.get_command will find the command to invoke --- virt-sandbox-image/virt-sandbox-image.py | 20 1 file changed, 20 insertions(+) diff --git a/virt-sandbox-image/virt-sandbox-image.py

[libvirt] [sandbox PATCH 07/11] Image: Add get_command function to Source

2015-07-23 Thread Eren Yagdiran
Provide a way to know how a template can be started depending on the used source DockerSource will need to parse the topmost config file in order to find the igniter command --- virt-sandbox-image/sources/DockerSource.py | 14 ++ virt-sandbox-image/sources/Source.py | 4

[libvirt] [sandbox PATCH 10/11] Image: Add get_disk function to Source

2015-07-23 Thread Eren Yagdiran
Provide a way to know which disk image to use for the sandbox depending on the used source DockerSource will need to locate the topmost disk image among all the layers images --- virt-sandbox-image/sources/DockerSource.py | 9 + virt-sandbox-image/sources/Source.py | 2 ++ 2 files

[libvirt] [sandbox PATCH 00/11] Virt-sandbox-image

2015-07-23 Thread Eren Yagdiran
and running Docker images by consuming Docker Registry API. Daniel P Berrange (1): Add virt-sandbox-image Eren Yagdiran (10): Fix virt-sandbox-image Image: Add Hooking Mechanism Image: Add download function Image: Refactor create function Image: Add delete function Image: Add

[libvirt] [sandbox PATCH 08/11] Image: Add run args

2015-07-23 Thread Eren Yagdiran
Commandline parameters for running a template --- virt-sandbox-image/virt-sandbox-image.py | 13 + 1 file changed, 13 insertions(+) diff --git a/virt-sandbox-image/virt-sandbox-image.py b/virt-sandbox-image/virt-sandbox-image.py index c320105..81b825c 100644 ---

[libvirt] [sandbox PATCH 04/11] Image: Add download function

2015-07-23 Thread Eren Yagdiran
Refactor download function from virt-sandbox-image to use the newly introduced Source abstract class. The docker-specific download code is moved to a new DockerSource class. --- virt-sandbox-image/sources/DockerSource.py | 193 +++ virt-sandbox-image/sources/Source.py

[libvirt] [sandbox PATCH 05/11] Image: Refactor create function

2015-07-23 Thread Eren Yagdiran
Move the docker-related code to the DockerSource and use the Source mechanism --- virt-sandbox-image/sources/DockerSource.py | 95 ++ virt-sandbox-image/sources/Source.py | 5 ++ virt-sandbox-image/virt-sandbox-image.py | 72 +- 3 files

[libvirt] [sandbox PATCH 09/11] Image: Add check_driver function

2015-07-23 Thread Eren Yagdiran
Check if user-specified driver argument is valid --- virt-sandbox-image/virt-sandbox-image.py | 6 ++ 1 file changed, 6 insertions(+) diff --git a/virt-sandbox-image/virt-sandbox-image.py b/virt-sandbox-image/virt-sandbox-image.py index 81b825c..fd02567 100644 ---

[libvirt] [sandbox PATCH 02/11] Fix virt-sandbox-image

2015-07-23 Thread Eren Yagdiran
-image/virt-sandbox-image.py +++ b/virt-sandbox-image/virt-sandbox-image.py @@ -1,8 +1,10 @@ #!/usr/bin/python -Es # # Authors: Daniel P. Berrange berra...@redhat.com +# Eren Yagdiran erenyagdi...@gmail.com # # Copyright (C) 2013 Red Hat, Inc. +# Copyright (C) 2015 Universitat Polit

[libvirt] [sandbox PATCH 06/11] Image: Add delete function

2015-07-23 Thread Eren Yagdiran
Refactoring delete function from virt-sandbox-image to DockerSource. Delete function can delete templates by name. --- virt-sandbox-image/sources/DockerSource.py | 53 +++ virt-sandbox-image/sources/Source.py | 3 ++ virt-sandbox-image/virt-sandbox-image.py | 59

[libvirt] [sandbox PATCH 01/11] Add virt-sandbox-image

2015-07-23 Thread Eren Yagdiran
From: Daniel P Berrange berra...@redhat.com virt-sandbox-image.py is a python script that lets you download Docker images easily. It is a proof of concept code and consumes Docker Rest API. --- po/POTFILES.in | 1 + virt-sandbox-image/virt-sandbox-image.py | 397

[libvirt] [sandbox PATCH 03/11] Image: Add Hooking Mechanism

2015-07-23 Thread Eren Yagdiran
@@ -1,5 +1,5 @@ #!/usr/bin/python -Es -# +# -*- coding: utf-8 -*- # Authors: Daniel P. Berrange berra...@redhat.com # Eren Yagdiran erenyagdi...@gmail.com # @@ -38,6 +38,34 @@ default_template_dir = /var/lib/libvirt/templates debug = True verbose = True +sys.dont_write_bytecode

[libvirt] [sandbox PATCH 06/10] Add gvir_sandbox_config_has_disks function

2015-06-26 Thread Eren Yagdiran
From: Cédric Bosdonnat cbosdon...@suse.com 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(+)

[libvirt] [sandbox PATCH 00/10] Patches for Libvirt-sandbox

2015-06-26 Thread Eren Yagdiran
/disk/by-tag The common functions for modifying directories are moved under Init-util. {Common,Qemu} inits are using them. Cédric Bosdonnat (2): Add gvir_sandbox_config_has_disks function qemu: use devtmpfs rather than tmpfs to auto-populate /dev Eren Yagdiran (8): Add an utility function

[libvirt] [sandbox PATCH 10/10] Common-builder: /dev/disk/by-tag/thetag to /dev/vdN

2015-06-26 Thread Eren Yagdiran
Common builder counts the disks devices and populates disks.cfg according to that.Disk devices are always come first than host-based images.In builder-machine, mounts of the host-based images will be mounted later. --- libvirt-sandbox/libvirt-sandbox-builder-machine.c | 6 +-

[libvirt] [sandbox PATCH 05/10] Add disk support to machine builder

2015-06-26 Thread Eren Yagdiran
Use the new disk configuration in the container builder to provide disks in qemu sandboxes. The disks are virtio devices, but those shouldn't be known by the user. --- libvirt-sandbox/libvirt-sandbox-builder-machine.c | 38 --- 1 file changed, 34 insertions(+), 4 deletions(-)

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

2015-06-26 Thread Eren Yagdiran
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: Eren Yagdiran erenyagdi...@gmail.com + */ + +#include config.h +#include string.h + +#include libvirt-sandbox/libvirt-sandbox.h + +/** + * SECTION: libvirt-sandbox-config-disk + * @short_description

[libvirt] [sandbox PATCH 04/10] Add disk support to the container builder

2015-06-26 Thread Eren Yagdiran
Use the new disk configuration in the container builder to provide disks in lxc containers sandboxes. --- .../libvirt-sandbox-builder-container.c| 33 +- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git

[libvirt] [sandbox PATCH 03/10] Add disk parameter to virt-sandbox

2015-06-26 Thread Eren Yagdiran
Allow users to add disk images to their sandbox. Only disk images are supported so far, but the parameter is intentionally designed for future changes. --- bin/virt-sandbox.c | 37 + 1 file changed, 37 insertions(+) diff --git a/bin/virt-sandbox.c

[libvirt] [sandbox PATCH 09/10] Common-init: Building symlink from disks.cfg

2015-06-26 Thread Eren Yagdiran
Similar to the existing mounts.cfg, the mapping between the device and the tag is passed by a new disks.cfg file. Common-init reads disks.cfg and maps the tags to corresponding devices --- libvirt-sandbox/libvirt-sandbox-init-common.c | 54 ++- 1 file changed, 52

[libvirt] [sandbox PATCH 01/10] Add an utility function for guessing filetype from file extension

2015-06-26 Thread Eren Yagdiran
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: Eren Yagdiran

[libvirt] [sandbox PATCH 08/10] Init-util : Common directory functions for init-common and init-qemu

2015-06-26 Thread Eren Yagdiran
02110-1301 USA + * + * Author: Eren Yagdiran erenyagdi...@gmail.com + */ + +#include config.h +#include string.h +#include errno.h +#include sys/stat.h +#include stdlib.h +#include stdio.h + +#include libvirt-sandbox-init-util.h + +int gvir_sandbox_init_util_mkdir(const char *dir, int mode, int debug

[libvirt] [sandbox PATCH 07/10] qemu: use devtmpfs rather than tmpfs to auto-populate /dev

2015-06-26 Thread Eren Yagdiran
From: Cédric Bosdonnat cbosdon...@suse.com When using devtmpfs we don't need to care about the device nodes creation: it's less risk to forget some. It also eases the creation of the devices in the init-qemu. --- libvirt-sandbox/libvirt-sandbox-init-qemu.c | 94 + 1

[libvirt] [sandbox PATCH 08/10] Init-util : Common directory functions for init-common and init-qemu

2015-06-25 Thread Eren Yagdiran
along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: Eren Yagdiran erenyagdi...@gmail.com + */ + +#include config.h +#include string.h +#include errno.h +#include sys/stat.h +#include stdlib.h

[libvirt] [sandbox PATCH 03/10] Add disk parameter to virt-sandbox

2015-06-25 Thread Eren Yagdiran
Allow users to add disk images to their sandbox. Only disk images are supported so far, but the parameter is intentionally designed for future changes. --- bin/virt-sandbox.c | 37 + 1 file changed, 37 insertions(+) diff --git a/bin/virt-sandbox.c

[libvirt] [sandbox PATCH 00/10] Patches for Libvirt-sandbox

2015-06-25 Thread Eren Yagdiran
/disk/by-tag The common functions for modifying directories are moved under Init-util. {Common,Qemu} inits are using them. Cédric Bosdonnat (2): Add gvir_sandbox_config_has_disks function qemu: use devtmpfs rather than tmpfs to auto-populate /dev Eren Yagdiran (8): Add an utility function

[libvirt] [sandbox PATCH 10/10] Common-builder: /dev/disk/by-tag/thetag to /dev/vdN

2015-06-25 Thread Eren Yagdiran
Common builder counts the disks devices and populates disks.cfg according to that.Disk devices are always come first than host-based images.In builder-machine, mounts of the host-based images will be mounted later. --- libvirt-sandbox/libvirt-sandbox-builder-machine.c | 6 +-

[libvirt] [sandbox PATCH 05/10] Add disk support to machine builder

2015-06-25 Thread Eren Yagdiran
Use the new disk configuration in the container builder to provide disks in qemu sandboxes. The disks are virtio devices, but those shouldn't be known by the user. --- libvirt-sandbox/libvirt-sandbox-builder-machine.c | 38 --- 1 file changed, 34 insertions(+), 4 deletions(-)

[libvirt] [sandbox PATCH 04/10] Add disk support to the container builder

2015-06-25 Thread Eren Yagdiran
Use the new disk configuration in the container builder to provide disks in lxc containers sandboxes. --- .../libvirt-sandbox-builder-container.c| 37 +- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git

[libvirt] [sandbox PATCH 07/10] qemu: use devtmpfs rather than tmpfs to auto-populate /dev

2015-06-25 Thread Eren Yagdiran
From: Cédric Bosdonnat cbosdon...@suse.com When using devtmpfs we don't need to care about the device nodes creation: it's less risk to forget some. It also eases the creation of the devices in the init-qemu. --- libvirt-sandbox/libvirt-sandbox-init-qemu.c | 94 + 1

[libvirt] [sandbox PATCH 06/10] Add gvir_sandbox_config_has_disks function

2015-06-25 Thread Eren Yagdiran
From: Cédric Bosdonnat cbosdon...@suse.com 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(+)

[libvirt] [sandbox PATCH 00/10] Patches for Libvirt-sandbox

2015-06-25 Thread Eren Yagdiran
/disk/by-tag The common functions for modifying directories are moved under Init-util. {Common,Qemu} inits are using them. Cédric Bosdonnat (2): Add gvir_sandbox_config_has_disks function qemu: use devtmpfs rather than tmpfs to auto-populate /dev Eren Yagdiran (8): Add an utility function

[libvirt] [sandbox PATCH 09/10] Common-init: Building symlink from disks.cfg

2015-06-25 Thread Eren Yagdiran
Similar to the existing mounts.cfg, the mapping between the device and the tag is passed by a new disks.cfg file. Common-init reads disks.cfg and maps the tags to corresponding devices --- libvirt-sandbox/libvirt-sandbox-init-common.c | 51 +-- 1 file changed, 49

[libvirt] [sandbox PATCH 01/10] Add an utility function for guessing filetype from file extension

2015-06-25 Thread Eren Yagdiran
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: Eren Yagdiran

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

2015-06-25 Thread Eren Yagdiran
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Author: Eren Yagdiran erenyagdi...@gmail.com + */ + +#include config.h +#include string.h + +#include libvirt-sandbox/libvirt-sandbox.h + +/** + * SECTION: libvirt-sandbox-config-disk + * @short_description

  1   2   >