[PATCH v2] [Kimchi] Fixed Memory and Max Memory values when adding a new Guest
by Socorro Stoppler
v2:
Socorro Stoppler (1):
Fixed Memory and Max Memory values when adding a new Guest
Removed showing of max memory in guest and made guest and templates
display the same way for cpu/memory for consistency
ui/pages/guest-add.html.tmpl | 10 +++++-----
ui/pages/tabs/templates.html.tmpl | 4 ++--
2 files changed, 7 insertions(+), 7 deletions(-)
--
1.9.1
v1:
Samuel Guimarães (1):
Fixed Memory and Max Memory values when adding a new Guest
ui/pages/guest-add.html.tmpl | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
--
1.9.3
8 years, 8 months
[PATCH v3] [Wok] Fixed wok logos in small screen resolutions
by sguimaraes943@gmail.com
From: Samuel Guimarães <sguimaraes943(a)gmail.com>
v3 - Removed wrong selector change in bootstrap-select files
Samuel Guimarães (1):
Fixed wok logos in small screen resolutions
ui/css/src/modules/_login.scss | 9 ++++-----
ui/css/wok.css | 11 +++++------
2 files changed, 9 insertions(+), 11 deletions(-)
--
1.9.3
8 years, 8 months
[PATCH][Wok] Move function 'get_next_clone_name' from Wok
by Rodrigo Trujillo
This function is not related to any Wok feature or resource. So moving
it to Kimchi.
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo(a)linux.vnet.ibm.com>
---
src/wok/utils.py | 41 -----------------------------------------
1 file changed, 41 deletions(-)
diff --git a/src/wok/utils.py b/src/wok/utils.py
index 7e9a928..175cf25 100644
--- a/src/wok/utils.py
+++ b/src/wok/utils.py
@@ -391,47 +391,6 @@ def remove_old_files(globexpr, hours):
wok_log.error(str(e))
-def get_next_clone_name(all_names, basename, name_suffix=''):
- """Find the next available name for a cloned resource.
-
- If any resource named "<basename>-clone-<number><name_suffix>" is found
- in "all_names", use the maximum "number" + 1; else, use 1.
-
- Arguments:
- all_names -- All existing names for the resource type. This list will
- be used to make sure the new name won't conflict with
- existing names.
- basename -- The name of the original resource.
- name_suffix -- The resource name suffix (optional). This parameter
- exist so that a resource named "foo.img" gets the name
- "foo-clone-1.img" instead of "foo.img-clone-1". If this parameter
- is used, the suffix should not be present in "basename".
-
- Return:
- A UTF-8 string in the format "<basename>-clone-<number><name_suffix>".
- """
- re_group_num = 'num'
-
- re_expr = u'%s-clone-(?P<%s>\d+)' % (basename, re_group_num)
- if name_suffix != '':
- re_expr = u'%s%s' % (re_expr, name_suffix)
-
- max_num = 0
- re_compiled = re.compile(re_expr)
-
- for n in all_names:
- match = re_compiled.match(n)
- if match is not None:
- max_num = max(max_num, int(match.group(re_group_num)))
-
- # increments the maximum "clone number" found
- new_name = u'%s-clone-%d' % (basename, max_num + 1)
- if name_suffix != '':
- new_name = new_name + name_suffix
-
- return new_name
-
-
def get_unique_file_name(all_names, name):
"""Find the next available, unique name for a file.
--
2.1.0
8 years, 8 months
[PATCH v3][Kimchi 0/3] Add new function to Kimchi and fix multiple clones
by Rodrigo Trujillo
v3:
- Add default value "1" (requested in review)
v2:
This is the v2 of patchset to fix/provide support to clone a guest
multiple times.
This patch:
- Creates a new function, moved from Wok to name clones;
- Use timestamp parameter of the function to avoid clone problems;
- Fixes backend imports;
- Adds UI.
Rodrigo Trujillo (3):
Add function 'get_next_clone_name'
Fix issue when clone a vm multiple times
Add UI support to clone a guest multiple times
mockmodel.py | 4 +--
model/storagevolumes.py | 4 +--
model/vms.py | 5 ++--
ui/js/src/kimchi.guest_main.js | 59 ++++++++++++++++++++++++++++++++----------
ui/pages/guest-clone.html.tmpl | 47 +++++++++++++++++++++++++++++++++
ui/pages/i18n.json.tmpl | 3 ++-
utils.py | 50 +++++++++++++++++++++++++++++++++++
7 files changed, 152 insertions(+), 20 deletions(-)
create mode 100644 ui/pages/guest-clone.html.tmpl
--
2.1.0
8 years, 8 months
[PATCH][Kimchi] Fix issue:#838 - Set qemu version to 2.1
by Rodrigo Trujillo
Qemu only supports memory hotplug after 2.1 version, see:
http://wiki.qemu.org/ChangeLog/2.1#x86
In order to avoid errors starting guests, it is better to set the
minimal version required (2.1) in packages specs.
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo(a)linux.vnet.ibm.com>
---
contrib/DEBIAN/control.in | 2 +-
contrib/kimchi.spec.fedora.in | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/contrib/DEBIAN/control.in b/contrib/DEBIAN/control.in
index b6acdaf..c46b5b3 100644
--- a/contrib/DEBIAN/control.in
+++ b/contrib/DEBIAN/control.in
@@ -14,7 +14,7 @@ Depends: wok,
gettext,
libvirt-bin,
nfs-common,
- qemu-kvm,
+ qemu-kvm (>= 2.1),
python-parted,
python-psutil (>= 0.6.0),
python-ethtool,
diff --git a/contrib/kimchi.spec.fedora.in b/contrib/kimchi.spec.fedora.in
index c2111f9..1bdf38c 100644
--- a/contrib/kimchi.spec.fedora.in
+++ b/contrib/kimchi.spec.fedora.in
@@ -9,7 +9,7 @@ License: LGPL/ASL2
Source0: %{name}-%{version}.tar.gz
Requires: wok
Requires: ginger-base
-Requires: qemu-kvm
+Requires: qemu-kvm >= 2.1
Requires: gettext
Requires: libvirt
Requires: libvirt-python
--
2.1.0
8 years, 8 months
[PATCH v2][Kimchi 0/3] Add new function to Kimchi and fix multiple clones
by Rodrigo Trujillo
This is the v2 of patchset to fix/provide support to clone a guest
multiple times.
This patch:
- Creates a new function, moved from Wok to name clones;
- Use timestamp parameter of the function to avoid clone problems;
- Fixes backend imports;
- Adds UI.
Rodrigo Trujillo (3):
Add function 'get_next_clone_name'
Fix issue when clone a vm multiple times
Add UI support to clone a guest multiple times
mockmodel.py | 4 +--
model/storagevolumes.py | 4 +--
model/vms.py | 5 ++--
ui/js/src/kimchi.guest_main.js | 58 ++++++++++++++++++++++++++++++++----------
ui/pages/guest-clone.html.tmpl | 47 ++++++++++++++++++++++++++++++++++
ui/pages/i18n.json.tmpl | 3 ++-
utils.py | 50 ++++++++++++++++++++++++++++++++++++
7 files changed, 151 insertions(+), 20 deletions(-)
create mode 100644 ui/pages/guest-clone.html.tmpl
--
2.1.0
8 years, 8 months
[PATCH v2] [Wok] Fixed wok logos in small screen resolutions
by sguimaraes943@gmail.com
From: Samuel Guimarães <sguimaraes943(a)gmail.com>
Fixed image alignment
Samuel Guimarães (1):
Fixed wok logos in small screen resolutions
ui/css/bootstrap.custom.css | 6 +++---
ui/css/src/modules/_login.scss | 5 ++---
ui/css/wok.css | 7 +++----
3 files changed, 8 insertions(+), 10 deletions(-)
--
1.9.3
8 years, 8 months
[PATCH] [Wok 0/2] Enhancements and new library
by sguimaraes943@gmail.com
From: Samuel Guimarães <sguimaraes943(a)gmail.com>
The first patch includes jquery.containsNC pseudo-selector for jQuery functions. This is required in order to fix Kimchi issue #809.
The second patch includes an enhancement in Wok login page, fixing Wok logos in small screens. Wok will render up to three logos per row below the login panel instead of only two.
Samuel Guimarães (2):
Added jquery.containsNC to enable case insensitive pseudo-selector in JS
Fixed wok logos in small screen resolutions
configure.ac | 1 +
ui/css/bootstrap.custom.css | 6 +++---
ui/css/src/modules/_login.scss | 3 +--
ui/css/wok.css | 5 ++---
ui/libs/Makefile.am | 2 +-
ui/libs/jquery-containsNC/LICENSE | 21 +++++++++++++++++++++
ui/libs/jquery-containsNC/Makefile.am | 22 ++++++++++++++++++++++
ui/libs/jquery-containsNC/jquery.containsNC.js | 3 +++
ui/pages/wok-ui.html.tmpl | 1 +
9 files changed, 55 insertions(+), 9 deletions(-)
create mode 100644 ui/libs/jquery-containsNC/LICENSE
create mode 100644 ui/libs/jquery-containsNC/Makefile.am
create mode 100644 ui/libs/jquery-containsNC/jquery.containsNC.js
--
1.9.3
8 years, 8 months
[PATCH][Kimchi 1/2] Fix issue when clone a vm multiple times
by Rodrigo Trujillo
When Kimchi clones a guest it uses the Wok function
"get_next_clone_name", which adds an incremental number in the new clone
name.
This approach causes a race condiction if Kimchi tries to clone a guest
multiple times, sending multiple request at once.
To avoid this problem, it is better to use timestamps in the clones
names instead of incremental numbers. Them it guarantees names will
be unique.
This patch requires timestamp support in "get_next_clone_name" wok
funtion.
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo(a)linux.vnet.ibm.com>
---
model/vms.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/model/vms.py b/model/vms.py
index 195c879..e60bf51 100644
--- a/model/vms.py
+++ b/model/vms.py
@@ -318,7 +318,7 @@ class VMModel(object):
vms_being_created.append(uri_name)
current_vm_names = self.vms.get_list() + vms_being_created
- new_name = get_next_clone_name(current_vm_names, name)
+ new_name = get_next_clone_name(current_vm_names, name, ts=True)
# create a task with the actual clone function
taskid = add_task(u'/plugins/kimchi/vms/%s/clone' % new_name,
--
2.1.0
8 years, 8 months
[PATCH][Wok] Add support to timestamps in clone naming function
by Rodrigo Trujillo
There is a potential race condiction issue when some plugin tries to use
the function get_next_clone_name(all_names, basename, name_suffix='').
If clone requests are done so fast, it is possible that the plugin does
not send all resource names in all_names parameter, then the function is
going to select the same name for 2 or more clones, which is going to
cause errors in the plugin.
Supporting timestamps in microsecond precision, plugins can avoid this
type of error coding its own race condiction fix or just using the
timestamp function option.
New name will be "basename-clone-timestamp-name-suffix".
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo(a)linux.vnet.ibm.com>
---
src/wok/utils.py | 33 +++++++++++++++++++++------------
1 file changed, 21 insertions(+), 12 deletions(-)
diff --git a/src/wok/utils.py b/src/wok/utils.py
index 7e9a928..b80a80b 100644
--- a/src/wok/utils.py
+++ b/src/wok/utils.py
@@ -31,6 +31,7 @@ import re
import sqlite3
import subprocess
import sys
+import time
import traceback
import xml.etree.ElementTree as ET
@@ -391,7 +392,7 @@ def remove_old_files(globexpr, hours):
wok_log.error(str(e))
-def get_next_clone_name(all_names, basename, name_suffix=''):
+def get_next_clone_name(all_names, basename, name_suffix='', ts=False):
"""Find the next available name for a cloned resource.
If any resource named "<basename>-clone-<number><name_suffix>" is found
@@ -406,26 +407,34 @@ def get_next_clone_name(all_names, basename, name_suffix=''):
exist so that a resource named "foo.img" gets the name
"foo-clone-1.img" instead of "foo.img-clone-1". If this parameter
is used, the suffix should not be present in "basename".
+ ts -- use timestamp, instead of incremental numbers
Return:
A UTF-8 string in the format "<basename>-clone-<number><name_suffix>".
"""
re_group_num = 'num'
- re_expr = u'%s-clone-(?P<%s>\d+)' % (basename, re_group_num)
- if name_suffix != '':
- re_expr = u'%s%s' % (re_expr, name_suffix)
+ # Use timestamps or increase clone number
+ if ts:
+ # Microsecond precision
+ ts_suffix = int(time.time() * 1000000)
+ new_name = u'%s-clone-%d' % (basename, ts_suffix)
+ else:
+ re_expr = u'%s-clone-(?P<%s>\d+)' % (basename, re_group_num)
+ if name_suffix != '':
+ re_expr = u'%s%s' % (re_expr, name_suffix)
- max_num = 0
- re_compiled = re.compile(re_expr)
+ max_num = 0
+ re_compiled = re.compile(re_expr)
- for n in all_names:
- match = re_compiled.match(n)
- if match is not None:
- max_num = max(max_num, int(match.group(re_group_num)))
+ for n in all_names:
+ match = re_compiled.match(n)
+ if match is not None:
+ max_num = max(max_num, int(match.group(re_group_num)))
+
+ # increments the maximum "clone number" found
+ new_name = u'%s-clone-%d' % (basename, max_num + 1)
- # increments the maximum "clone number" found
- new_name = u'%s-clone-%d' % (basename, max_num + 1)
if name_suffix != '':
new_name = new_name + name_suffix
--
2.1.0
8 years, 8 months