[PATCH V3 0/2] bug fix: add an icon distros list.
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
V2 -> V3
rebase to master
V1 -> V2
get this icon distros dinamically
clean pep8 for osinfo.py
ShaoHe Feng (2):
bug fix: add an icon distros list.
pep8 clean for osinfo.py
Makefile.am | 1 +
src/kimchi/osinfo.py | 43 +++++++++++++++++++++++++++++--------------
2 files changed, 30 insertions(+), 14 deletions(-)
--
1.8.4.2
10 years, 9 months
[PATCH V2 1/2] bug fix: add an icon distros list.
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
Now I create template with rhel iso, but when I create a VM from this
template, the template info displays differently with other templates.
That's because icon-rhel is missing for it is RED HAT trademark.
But this make us uncomfortable.
If the icon is missing we should display the default icon
Now there are only 7 icons, include the default icon icon-vm.
$ ls ui/images/*.png
ui/images/icon-centos.png ui/images/icon-gentoo.png
ui/images/icon-debian.png ui/images/icon-opensuse.png
ui/images/icon-fedora.png ui/images/icon-ubuntu.png
ui/images/icon-vm.png
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
---
src/kimchi/osinfo.py | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/osinfo.py b/src/kimchi/osinfo.py
index 106cc0e..905c63a 100644
--- a/src/kimchi/osinfo.py
+++ b/src/kimchi/osinfo.py
@@ -18,12 +18,16 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
import copy
+import glob
import os
from distutils.version import LooseVersion
+from kimchi.config import paths
+
+
SUPPORTED_ARCHS = {'x86': ('i386', 'x86_64'), 'power': ('ppc', 'ppc64')}
@@ -55,6 +59,8 @@ modern_version_bases = {'x86': {'debian': '6.0', 'ubuntu': '7.10',
'rhel': '6.0', 'fedora': '16', 'gentoo': '0'},
'power': {'rhel': '7.0', 'fedora': '19'}}
+icon_available_distros = [icon[5:-4] for icon in glob.glob1('%s/images/'
+ % paths.ui_dir, 'icon-*.png')]
isolinks = {
'debian': {
@@ -100,15 +106,18 @@ def lookup(distro, version):
arch = _get_arch()
if distro in modern_version_bases[arch]:
- params['icon'] = 'images/icon-%s.png' % distro
if LooseVersion(version) >= LooseVersion(
modern_version_bases[arch][distro]):
params.update(template_specs[arch]['modern'])
else:
params.update(template_specs[arch]['old'])
else:
- params['icon'] = 'images/icon-vm.png'
params['os_distro'] = params['os_version'] = "unknown"
params.update(template_specs[arch]['old'])
+ if distro in icon_available_distros:
+ params['icon'] = 'images/icon-%s.png' % distro
+ else:
+ params['icon'] = 'images/icon-vm.png'
+
return params
--
1.8.4.2
10 years, 9 months
[PATCHv2] Allocate enough space for logical volume
by lvroyce@linux.vnet.ibm.com
From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
When creating storage volume, allocation is specified with 0
because previous format is qcow2.
As we use raw format in logcial pool now,
we need to specify allocation in xml.
Signed-off-by: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
---
src/kimchi/vmtemplate.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/kimchi/vmtemplate.py b/src/kimchi/vmtemplate.py
index d3bd52e..f227ee6 100644
--- a/src/kimchi/vmtemplate.py
+++ b/src/kimchi/vmtemplate.py
@@ -211,10 +211,11 @@ class VMTemplate(object):
'format': fmt,
'path': '%s/%s' % (storage_path, volume)}
+ info['allocation'] = 0 if fmt == 'qcow2' else info['capacity']
info['xml'] = """
<volume>
<name>%(name)s</name>
- <allocation>0</allocation>
+ <allocation unit="G">%(allocation)s</allocation>
<capacity unit="G">%(capacity)s</capacity>
<target>
<format type='%(format)s'/>
--
1.8.1.2
10 years, 9 months
[PATCH 0/2] Fix help Makefile
by Crístian Viana
Tested on Fedora 20.
Crístian Viana (2):
fix: Build new DITA pages when running "make"
Build help index page only once
ui/pages/help/Makefile.am | 6 ++++--
ui/pages/help/gen-index.py | 20 ++++++++++++--------
2 files changed, 16 insertions(+), 10 deletions(-)
--
1.8.5.3
10 years, 9 months
[PATCH] bug fix: add an icon distros list.
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
Now I create template with rhel iso, but when I create a VM from this
template, the template info displays differently with other templates.
That's because icon-rhel is missing for it is RED HAT trademark.
But this make us uncomfortable.
If the icon is missing we should display the default icon
Now there are only 7 icons, include the default icon icon-vm.
$ ls ui/images/*.png
ui/images/icon-centos.png ui/images/icon-gentoo.png
ui/images/icon-debian.png ui/images/icon-opensuse.png
ui/images/icon-fedora.png ui/images/icon-ubuntu.png
ui/images/icon-vm.png
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
---
src/kimchi/osinfo.py | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/osinfo.py b/src/kimchi/osinfo.py
index 106cc0e..2eac63e 100644
--- a/src/kimchi/osinfo.py
+++ b/src/kimchi/osinfo.py
@@ -55,6 +55,8 @@ modern_version_bases = {'x86': {'debian': '6.0', 'ubuntu': '7.10',
'rhel': '6.0', 'fedora': '16', 'gentoo': '0'},
'power': {'rhel': '7.0', 'fedora': '19'}}
+icon_available_distros = ['debian', 'centos', 'fedora',
+ 'gentoo', 'opensuse', 'ubuntu']
isolinks = {
'debian': {
@@ -100,15 +102,18 @@ def lookup(distro, version):
arch = _get_arch()
if distro in modern_version_bases[arch]:
- params['icon'] = 'images/icon-%s.png' % distro
if LooseVersion(version) >= LooseVersion(
modern_version_bases[arch][distro]):
params.update(template_specs[arch]['modern'])
else:
params.update(template_specs[arch]['old'])
else:
- params['icon'] = 'images/icon-vm.png'
params['os_distro'] = params['os_version'] = "unknown"
params.update(template_specs[arch]['old'])
+ if distro in icon_available_distros:
+ params['icon'] = 'images/icon-%s.png' % distro
+ else
+ params['icon'] = 'images/icon-vm.png'
+
return params
--
1.8.4.2
10 years, 9 months
[PATCHv7 0/7] Support storage volume ref_cnt
by lvroyce@linux.vnet.ibm.com
From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
tested:
1. sudo make check
2. from UI: list storage volumes and unrefered volume ref_cnt is 0,
ref_cnt for refered ones are 1.
Available volumes will be tracked by volume reference count.
Add this field to storage volume,
so that storage volume/pool action validation can rely on it.
Royce Lv (7):
Export list vms functionality
Fix vm disk path when it does not have source element
Add volume ref_cnt: update api.md
Add volume ref_cnt: Update controller and json schema
Add volume ref_cnt: Add model and mockmodel implementation
Add volume ref_cnt: Update test
Multiple pep8 fixes
docs/API.md | 3 +++
src/kimchi/API.json | 25 +++++++++++++++++++++++++
src/kimchi/control/storagevolumes.py | 1 +
src/kimchi/i18n.py | 4 ++++
src/kimchi/mockmodel.py | 10 +++++++---
src/kimchi/model/debugreports.py | 2 +-
src/kimchi/model/storagevolumes.py | 30 ++++++++++++++++++++++++++++++
src/kimchi/model/templates.py | 2 +-
src/kimchi/model/vms.py | 6 +++++-
src/kimchi/model/vmstorages.py | 23 +++++++++++++----------
tests/test_model.py | 4 ++++
tests/test_rest.py | 2 ++
12 files changed, 96 insertions(+), 16 deletions(-)
--
1.8.1.2
10 years, 9 months
[RFC][PATCH V2 0/3] Issue #322
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
V1 -> V2
use debug to log the open exception trace stack.
It is complex to check the permission for qemu user.
There are too many access controlling mechanisms in
Linux, such as ACL, traditional ugo+-rwx, SELinux and AppArmor. It's not
possible to enumerate and check every access mechanisms if it allows
QEMU to access a file.
So now I'm simply trying to access the file with qemu user and see if it's OK
It is simple and avoid handling corner case.
Also I can try to start a simple guest with the given iso.
ShaoHe Feng (3):
add a method to probe the permission as qemu user
qemu user tests: probe the username of qemu process started by libvirt
Don't allow templates to be created with ISOs that won't be usable.
Makefile.am | 1 +
src/kimchi/i18n.py | 5 ++++
src/kimchi/kvmusertests.py | 62 +++++++++++++++++++++++++++++++++++++++++++
src/kimchi/model/templates.py | 13 ++++++++-
src/kimchi/utils.py | 26 ++++++++++++++++++
5 files changed, 106 insertions(+), 1 deletion(-)
create mode 100644 src/kimchi/kvmusertests.py
--
1.8.4.2
10 years, 9 months
[PATCH] [UI] Window Widget Enhancement - Allow onClose Listener
by Hongliang Wang
Sometimes we want to trigger some action when window is being closed.
For example, we register some listeners in one window, and we want to
unregister them after this window is closed, in this case we can take
advantage of this feature.
Signed-off-by: Hongliang Wang <hlwang(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.window.js | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/ui/js/src/kimchi.window.js b/ui/js/src/kimchi.window.js
index b32ab60..c2af63e 100644
--- a/ui/js/src/kimchi.window.js
+++ b/ui/js/src/kimchi.window.js
@@ -17,6 +17,7 @@
*/
kimchi.window = (function() {
var _windows = [];
+ var _listeners = {};
var open = function(settings) {
var settings = jQuery.type(settings) === 'object' ? settings : {
url: settings
@@ -29,6 +30,7 @@ kimchi.window = (function() {
}
_windows.push(windowID);
+ _listeners[windowID] = settings['close'];
var windowNode = $('<div></div>', {
id: windowID,
'class': settings['class'] ? settings['class'] + ' bgmask' : 'bgmask'
@@ -37,9 +39,6 @@ kimchi.window = (function() {
$(windowNode).css(settings['style'] || '');
$(windowNode).appendTo('body').on('click', '.window .close', function() {
- if (settings.close) {
- settings.close();
- }
kimchi.window.close();
});
@@ -52,7 +51,14 @@ kimchi.window = (function() {
};
var close = function() {
- $('#' + _windows.pop()).fadeOut(100, function() {
+ var windowID = _windows.pop();
+ if(_listeners[windowID]) {
+ _listeners[windowID]();
+ _listeners[windowID] = null;
+ }
+ delete _listeners[windowID];
+
+ $('#' + windowID).fadeOut(100, function() {
$(this).remove();
});
};
--
1.8.1.4
10 years, 9 months
[PATCH] Bug fix: Kimchi could not start guest with iscsi lun assigned as disk
by Rodrigo Trujillo
There is an error in Kimchi when you try to start a guest created based
on a template that is using an iscsi storage pool. A lun should be used
as disk, but the iscsi case was not being expected and kimchi assigned
an .img file to the guest, raising error in the starting.
This patch fixed this problem.
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo(a)linux.vnet.ibm.com>
---
src/kimchi/vmtemplate.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/kimchi/vmtemplate.py b/src/kimchi/vmtemplate.py
index f380170..9825159 100644
--- a/src/kimchi/vmtemplate.py
+++ b/src/kimchi/vmtemplate.py
@@ -24,6 +24,7 @@ import urlparse
from kimchi import osinfo
+from kimchi.config import READONLY_POOL_TYPE
from kimchi.exception import InvalidParameter, IsoFormatError
from kimchi.isoinfo import IsoImage
from kimchi.utils import check_url_path, pool_name_from_uri
@@ -271,7 +272,7 @@ class VMTemplate(object):
# Current implementation just allows to create disk in one single
# storage pool, so we cannot mix the types (scsi volumes vs img file)
- if self._get_storage_type() == 'scsi':
+ if self._get_storage_type() in READONLY_POOL_TYPE:
params['disks'] = self._get_scsi_disks_xml(kwargs.get('volumes'))
else:
params['disks'] = self._get_disks_xml(vm_uuid)
--
1.8.5.3
10 years, 9 months