[PATCH] Fix iso streaming functions and feature tests
by Rodrigo Trujillo
The qemu dns test function was using IP instead of full hostname. This
makes the function always return True. Also, changed the streaming
protocols checking function supported by libvirt.
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo(a)linux.vnet.ibm.com>
---
src/kimchi/featuretests.py | 3 ++-
src/kimchi/model/vms.py | 12 ++++--------
src/kimchi/vmtemplate.py | 13 ++++++++-----
3 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/src/kimchi/featuretests.py b/src/kimchi/featuretests.py
index 045f72b..a6a28fa 100644
--- a/src/kimchi/featuretests.py
+++ b/src/kimchi/featuretests.py
@@ -21,6 +21,7 @@ import cherrypy
import libvirt
import lxml.etree as ET
import os
+import socket
import subprocess
import threading
@@ -140,7 +141,7 @@ class FeatureTests(object):
@staticmethod
def qemu_iso_stream_dns():
- host = cherrypy.server.socket_host
+ host = socket.getfqdn(cherrypy.server.socket_host)
port = cherrypy.server.socket_port
cmd = ["qemu-io", "-r", "http://%s:%d/images/icon-fedora.png" %
(host, port), "-c", "'read -v 0 512'"]
diff --git a/src/kimchi/model/vms.py b/src/kimchi/model/vms.py
index 79b335c..d29b811 100644
--- a/src/kimchi/model/vms.py
+++ b/src/kimchi/model/vms.py
@@ -202,16 +202,12 @@ class VMsModel(object):
with self.objstore as session:
session.store('vm', vm_uuid, {'icon': icon})
- libvirt_stream = False
- if len(self.caps.libvirt_stream_protocols) == 0:
- libvirt_stream = True
-
graphics = params.get('graphics')
xml = t.to_vm_xml(name, vm_uuid,
- libvirt_stream=libvirt_stream,
- qemu_stream_dns=self.caps.qemu_stream_dns,
- graphics=graphics,
- volumes=vol_list)
+ libvirt_stream_protocols=self.caps.libvirt_stream_protocols,
+ qemu_stream_dns=self.caps.qemu_stream_dns,
+ graphics=graphics,
+ volumes=vol_list)
try:
conn.defineXML(xml.encode('utf-8'))
diff --git a/src/kimchi/vmtemplate.py b/src/kimchi/vmtemplate.py
index 003e524..f810df6 100644
--- a/src/kimchi/vmtemplate.py
+++ b/src/kimchi/vmtemplate.py
@@ -81,7 +81,7 @@ class VMTemplate(object):
except IsoFormatError:
raise InvalidParameter("KCHISO0001E", {'filename': iso})
- def _get_cdrom_xml(self, libvirt_stream, qemu_stream_dns):
+ def _get_cdrom_xml(self, libvirt_stream_protocols, qemu_stream_dns):
bus = self.info['cdrom_bus']
dev = "%s%s" % (self._bus_to_dev[bus],
string.lowercase[self.info['cdrom_index']])
@@ -133,7 +133,7 @@ class VMTemplate(object):
hostname = socket.gethostbyname(hostname)
url = protocol + "://" + hostname + ":" + str(port) + url_path
- if not libvirt_stream:
+ if protocol not in libvirt_stream_protocols:
return qemu_stream_cmdline % {'url': url, 'bus': bus}
params = {'protocol': protocol, 'url_path': url_path,
@@ -281,9 +281,12 @@ class VMTemplate(object):
params['disks'] = self._get_disks_xml(vm_uuid)
qemu_stream_dns = kwargs.get('qemu_stream_dns', False)
- libvirt_stream = kwargs.get('libvirt_stream', False)
- cdrom_xml = self._get_cdrom_xml(libvirt_stream, qemu_stream_dns)
- if not libvirt_stream and params.get('iso_stream', False):
+ libvirt_stream_protocols = kwargs.get('libvirt_stream_protocols', [])
+ cdrom_xml = self._get_cdrom_xml(libvirt_stream_protocols,
+ qemu_stream_dns)
+
+ if not urlparse.urlparse(self.info['cdrom']).scheme in \
+ libvirt_stream_protocols and params.get('iso_stream', False):
params['qemu-namespace'] = QEMU_NAMESPACE
params['qemu-stream-cmdline'] = cdrom_xml
else:
--
1.8.5.3
10 years, 6 months
[PATCH V3 0/4] check the python code with pyflakes
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
V2 -> V3
address zhengsheng's comment.
improve the SKIP_PYFLAKES_ERR list.
V1 -> V2
address Crístian'comment:
remove the whole statement "info = self._get_vm(name).inf"
address ming's comment:
break down the patch into small patches by the pyflakes error.
Pyflakes analyzes programs and detects various errors. It works by
parsing the source file, not importing it, so it is safe to use on
modules with side effects. It's also much faster.
This is important to improve the code quality.
ShaoHe Feng (4):
make pyflakes happly, remove the unused import module
make pyflakes happly, remove unused availables
add template_delete to rollback after create a template
run pyflakes when make check
Makefile.am | 7 +++++++
configure.ac | 7 +++++++
contrib/DEBIAN/control.in | 1 +
contrib/kimchi.spec.fedora.in | 1 +
docs/README.md | 6 +++---
src/kimchi/control/plugins.py | 2 +-
src/kimchi/featuretests.py | 2 --
src/kimchi/mockmodel.py | 5 ++---
src/kimchi/model/storagepools.py | 2 +-
src/kimchi/screenshot.py | 1 -
src/kimchi/template.py | 1 -
tests/test_model.py | 1 +
tests/test_server.py | 1 -
ui/pages/help/gen-index.py | 1 -
14 files changed, 24 insertions(+), 14 deletions(-)
--
1.8.5.3
10 years, 6 months
[PATCH 0/7] [WIP] Updates to Manage Repositories
by Adam King
This series updates HLWs original set to work with the new repo management
API set posted by Aline. There are some puts that the backend currently rejects
that I think should be accepted. I will work with Aline to determine if its the
PUT content or the backend that needs additional work.
Adam King (2):
Update form.serializeObject method to handle deep object serialization
Update grid widget to populate fields from deeply nested objects
Hongliang Wang (5):
Repository Management - Add i18n Strings
Repository Management - Add API Support
Repository Management - Add Repository Support
Repository Management - Edit Repository Support
Repository Management - Integrate into Host Tab
po/POTFILES.in | 2 +
ui/css/theme-default/host.css | 8 ++
ui/css/theme-default/repository-add.css | 39 +++++++
ui/css/theme-default/repository-edit.css | 128 +++++++++++++++++++++
ui/js/src/kimchi.api.js | 76 ++++++++++++-
ui/js/src/kimchi.form.js | 66 +++++++++--
ui/js/src/kimchi.grid.js | 17 ++-
ui/js/src/kimchi.host.js | 185 +++++++++++++++++++++++++++++++
ui/js/src/kimchi.repository_add_main.js | 84 ++++++++++++++
ui/js/src/kimchi.repository_edit_main.js | 94 ++++++++++++++++
ui/pages/i18n.html.tmpl | 19 ++++
ui/pages/repository-add.html.tmpl | 115 +++++++++++++++++++
ui/pages/repository-edit.html.tmpl | 115 +++++++++++++++++++
ui/pages/tabs/host.html.tmpl | 13 +++
14 files changed, 946 insertions(+), 15 deletions(-)
create mode 100644 ui/css/theme-default/repository-add.css
create mode 100644 ui/css/theme-default/repository-edit.css
create mode 100644 ui/js/src/kimchi.repository_add_main.js
create mode 100644 ui/js/src/kimchi.repository_edit_main.js
create mode 100644 ui/pages/repository-add.html.tmpl
create mode 100644 ui/pages/repository-edit.html.tmpl
--
1.8.1.4
10 years, 6 months
About the TTY of the sudo command
by zhshzhou@linux.vnet.ibm.com
Hi,
I see in kimchid SystemD service file we assign a TTY to it just to
avoid the sudo TTY missing error. I think in some setups other than
SystemD the admin might also decide to require TTY for sudo and modify
the sudo config, so the current solution is just a workaround for RHEL
family distroes.
Sometimes it's useful for a daemon provides a console interface on a
TTY, but kimchid is not in this type. Maybe it's better to run sudo in
a temporary PTY and avoid assigning a TTY to kimchid.
Actually I'm fine with the current solution. Just happened to see to
this problem and thought maybe we can improve it a little bit.
10 years, 6 months
[PATCH 0/3] Improve error messages
by Crístian Viana
Crístian Viana (3):
Do not show success messages
Apply Kimchi standard error message
Display the error code when displaying error msgs
ui/css/theme-default/guest-cdrom-edit.css | 5 -----
ui/css/theme-default/guest-edit.css | 24 ------------------------
ui/css/theme-default/guest-storage-add.css | 5 -----
ui/css/theme-default/login-window.css | 9 ---------
ui/css/theme-default/report-add.css | 4 ----
ui/js/src/kimchi.guest_cdrom_edit_main.js | 4 +---
ui/js/src/kimchi.guest_edit_main.js | 7 -------
ui/js/src/kimchi.guest_media_main.js | 3 ---
ui/js/src/kimchi.guest_storage_add.main.js | 4 +---
ui/js/src/kimchi.login_window.js | 2 +-
ui/js/src/kimchi.report_add_main.js | 6 ++----
ui/pages/guest-cdrom-edit.html.tmpl | 3 ---
ui/pages/guest-edit.html.tmpl | 1 -
ui/pages/guest-media.html.tmpl | 3 ---
ui/pages/guest-storage-add.html.tmpl | 3 ---
ui/pages/login-window.html.tmpl | 1 -
ui/pages/report-add.html.tmpl | 1 -
17 files changed, 5 insertions(+), 80 deletions(-)
--
1.8.5.3
10 years, 6 months
[PATCH] Doc: add work around to handle NFS root squash problem
by lvroyce@linux.vnet.ibm.com
From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Tested:
1. make
2. nfs pool and vm creation
Default NFS server export path is configured as root squash,
mapping root user to nobody.
This results:
1. Root user cannot step into mount point if export path
does not allow other to read/execute.
So create volume will fail.
2. Even with other permission open,
owner/group of volume created by root is still nobody/nogrp,
and qemu permission is denied on such img.
This work around instruct user to enable squash to given libvirt user
to address the above problems.
Signed-off-by: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
---
docs/README.md | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/docs/README.md b/docs/README.md
index 5721878..17abe78 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -146,8 +146,15 @@ new template using the "+" button in the upper right corner.
Known Issues
------------
-Kimchi is still experimental and should not be used in a production
+1. Kimchi is still experimental and should not be used in a production
environment.
+2. When you are using NFS as storage pool, check the nfs export path permission
+is configured as:
+ (1) export path need to be squashed as kvm gid and libvirt uid:
+ /my_export_path *(all_squash,anongid=<kvm-gid>, anonuid=<libvirt-uid>,rw,sync)
+ So that root user can create volume with right user/group.
+ (2) Chown of export path user as libvirt user, group as kvm group,
+ In order to make sure all mapped user can get into the mount point.
Participating
-------------
--
1.8.1.2
10 years, 6 months
[PATCH v2] Fix issue 348: NFS pool creation times out
by Christy Perez
Adding a 15 second timeout instead of two seconds. This makes kimchi
more robust in the face of NFS issues such as the one described in
Red Hat Bug 1023059.
Signed-off-by: Christy Perez <christy(a)linux.vnet.ibm.com>
---
src/kimchi/model/libvirtstoragepool.py | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/kimchi/model/libvirtstoragepool.py b/src/kimchi/model/libvirtstoragepool.py
index b8f3d42..47b239b 100644
--- a/src/kimchi/model/libvirtstoragepool.py
+++ b/src/kimchi/model/libvirtstoragepool.py
@@ -91,10 +91,9 @@ class NetfsPoolDef(StoragePoolDef):
export_path, mnt_point]
umount_cmd = ["umount", "-f", export_path]
mounted = False
- # 2 seconds looks like a reasonable time to wait for a refresh
- # in the UI and enough time to verify that the NFS server
- # is down.
- cmd_timeout = 2
+ # Due to an NFS bug (See Red Hat BZ 1023059), NFSv4 exports may take
+ # 10-15 seconds to mount the first time.
+ cmd_timeout = 15
with RollbackContext() as rollback:
rollback.prependDefer(os.rmdir, mnt_point)
--
1.8.5.3
10 years, 6 months
[PATCH] Fix issue 348: NFS pool creation times out
by Christy Perez
Adding a 15 second timeout instead of two seconds. This makes kimchi
more robust in the face of NFS issues such as the one described in
Red Hat Bug 1023059.
Signed-off-by: Christy Perez <christy(a)linux.vnet.ibm.com>
---
src/kimchi/model/libvirtstoragepool.py | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/kimchi/model/libvirtstoragepool.py b/src/kimchi/model/libvirtstoragepool.py
index b8f3d42..35666dc 100644
--- a/src/kimchi/model/libvirtstoragepool.py
+++ b/src/kimchi/model/libvirtstoragepool.py
@@ -91,10 +91,9 @@ class NetfsPoolDef(StoragePoolDef):
export_path, mnt_point]
umount_cmd = ["umount", "-f", export_path]
mounted = False
- # 2 seconds looks like a reasonable time to wait for a refresh
- # in the UI and enough time to verify that the NFS server
- # is down.
- cmd_timeout = 2
+ # Due to an NFS bug, NFSv4 exports may take 10-15 seconds to mount
+ # the first time.
+ cmd_timeout = 15
with RollbackContext() as rollback:
rollback.prependDefer(os.rmdir, mnt_point)
--
1.8.5.3
10 years, 6 months
[PATCH] Fix issue 348: NFS pool creation times out
by Christy Perez
Adding a 15 second timeout instead of two seconds. This makes kimchi
more robust in the face of NFS issues such as this one.
Signed-off-by: Christy Perez <christy(a)linux.vnet.ibm.com>
---
src/kimchi/model/libvirtstoragepool.py | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/kimchi/model/libvirtstoragepool.py b/src/kimchi/model/libvirtstoragepool.py
index b8f3d42..35666dc 100644
--- a/src/kimchi/model/libvirtstoragepool.py
+++ b/src/kimchi/model/libvirtstoragepool.py
@@ -91,10 +91,9 @@ class NetfsPoolDef(StoragePoolDef):
export_path, mnt_point]
umount_cmd = ["umount", "-f", export_path]
mounted = False
- # 2 seconds looks like a reasonable time to wait for a refresh
- # in the UI and enough time to verify that the NFS server
- # is down.
- cmd_timeout = 2
+ # Due to an NFS bug, NFSv4 exports may take 10-15 seconds to mount
+ # the first time.
+ cmd_timeout = 15
with RollbackContext() as rollback:
rollback.prependDefer(os.rmdir, mnt_point)
--
1.8.5.3
10 years, 6 months
[PATCH V2 0/4] check the python code with pyflakes
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
V2 -> V3
address zhengsheng's comment.
improve the SKIP_PYFLAKES_ERR list.
V1 -> V2
address Crístian'comment:
remove the whole statement "info = self._get_vm(name).inf"
address ming's comment:
break down the patch into small patches by the pyflakes error.
Pyflakes analyzes programs and detects various errors. It works by
parsing the source file, not importing it, so it is safe to use on
modules with side effects. It's also much faster.
This is important to improve the code quality.
ShaoHe Feng (4):
make pyflakes happly, remove the unused import module
make pyflakes happly, remove unused availables
add template_delete to rollback after create a template
run pyflakes when make check
Makefile.am | 7 +++++++
configure.ac | 7 +++++++
contrib/DEBIAN/control.in | 1 +
contrib/kimchi.spec.fedora.in | 1 +
docs/README.md | 6 +++---
src/kimchi/control/plugins.py | 2 +-
src/kimchi/featuretests.py | 2 --
src/kimchi/mockmodel.py | 5 ++---
src/kimchi/model/storagepools.py | 2 +-
src/kimchi/screenshot.py | 1 -
src/kimchi/template.py | 1 -
tests/test_model.py | 1 +
tests/test_server.py | 1 -
ui/pages/help/gen-index.py | 1 -
14 files changed, 24 insertions(+), 14 deletions(-)
--
1.8.5.3
10 years, 6 months