[RFC] discover Kimchi peers
by Sheldon
I'd like to talk about how to discover Kimchi peers.
Now I just talk about discover a peer in a same network here.
I will use a local multicast subnetwork address
<http://en.wikipedia.org/wiki/Multicast_address#Local_subnetwork> to
find peers in one network.
Choose 224.0.0.132 as the kimchi multicast address, and 8000 as the port.
For cross network that need the router support multicast, so I give up
discover a peer cross network.
I will let user add the remote peers manully.
In the whole system all peers are equal. There will not be a center
discover service.
We will define two kinds of multicast message Notify and Search.
the format as follow.
# ____________________________________________
# | head | message body | tail |
# |___________________|_________________|______|
# |sizeof(messageBody)| json message | EOL |
# |___________________|_________________|______|
the flow of discover Kimchi peers:
1. one host multicast a "search" message. in this message it tell
himself information, and ask others tell their information.
Like this:
{"search": {"domain": "kimchi-host1", "IP": "192.168.0.3", "httpport":
"8000", "httpsport": "8001"}}
this means "hello, I'm a kimchi host, this is my information, can
you tell me who you are?"
2. others received a search will response an "notify" message.
Like this:
{"notify": {"domain": "kimchi-host1", "IP": "192.168.0.3",
"httpport": "8000", "httpsport": "8001"}}
this tells others that "hi, I'm a kimchi host, I'm alive and this
is my information"
o (user) 1 is "search"
/\ --------> 2 is "notify"
| 1 _____ ________________
kimchi-host1 ------2-<---| DB |<----2-----|multicast listen |<--2--
| |____| |_______________|
|
----------------------1-------------------------------> |
|
_____ |_____
| |
| switch |
| |
|___________|
o (user) |
/\ --------- -----------------------------2----------------------- --->|
| | _____ ________________ |
kimchi-host3 ------1<---| DB |<---1------|multicast listen |<---1--|
|____| |_______________|
we need to discuss:
1. should we support beat heart?
every kimchi host will send periodic notify to tell others himself
information?
2. should we support a "quit" message?
"quit" message tell other peers, that this kimchi quit normally. others
can remove this from peers list.
But the kimchi can not send "quit" when aborting abnormally.
3. Do we store the local peers information in DB?
we can collection the local peers and send them immediately when user
need to discover the peers.
We will extend to support remote peers, these information need to be
stored in DB.
--
Thanks and best regards!
Sheldon Feng(???)<shaohef(a)linux.vnet.ibm.com>
IBM Linux Technology Center
10 years, 3 months
[PATCH V3 0/4] vmiface update support
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
V2 -> V3
just support to change persistent network configure.
V1 -> V2
add test case for running VM
We allow user change the interface from one network to another network
when VM is alive.
But we only support change the vm configure no matter vm is alive or not.
ShaoHe Feng (4):
vmiface update support: update API.md
vmiface update support: update model.
vmiface update support: update mockmodel
vmiface update support: update test case
docs/API.md | 8 ++++++++
src/kimchi/API.json | 17 +++++++++++++++++
src/kimchi/control/vm/ifaces.py | 1 +
src/kimchi/i18n.py | 1 +
src/kimchi/mockmodel.py | 12 ++++++++++++
src/kimchi/model/vmifaces.py | 21 +++++++++++++++++++++
tests/test_model.py | 10 ++++++++++
tests/test_rest.py | 8 ++++++++
8 files changed, 78 insertions(+)
--
1.9.0
10 years, 5 months
Rethink the Relationship of Template and VM
by Zhou Zheng Sheng
Hi all,
I'm working on host device passthrough. A a problem troubles me: I see
in current Kimchi code, when adding a specific SCSI or iSCSI LUN, it is
added to the template but not the VM. This is counter-intuitive, because
a template is to store the common information for lots of VMs, while a
specific LUN should only be used by just one VM. It's OK for DIR, NFS
and Logical storage pool being managed by the template, because actually
the template allocates a new specific volume for a new VM, so the
specific volume goes with the specific VM but not the template. Since we
don't define a specific DIR storage volume in the template, why we
define a concrete LUN in it?
The first problem in the current design is that we can not attach a new
LUN to a VM after the VM is created.
Another problem is that we mix the "things in common" and "things
special" in template, thus we make its responsibility complex. Static
and dynamic validations are also mixed in template.
The third problem is that if we get 10 LUNs for 10 VMs, the user has to
create 10 templates at first, then create 10 VMs from the 10 templates
respectively. It's a bit tedious.
The fourth problem is that if a LUN is used by a VM, usually it should
not be used by other VMs, so it implies that by specifying a LUN in a
template, the template should only create just one VM. What's the point
to make a template that only produces one VM?
It seems a cleaner way is putting SCSI LUN handling code in VM. Firstly,
we can assign a SCSI/iSCSI storage pool to the template. When it's time
to create a VM from the template, Kimchi lists all the available LUNs in
the storage pool and the user can just pick some LUNs. The VM override
parameters are suitable to store the LUNs information. It also makes
possible to implement some mechanisms to add/remove LUNs after a VM is
created, which is a very typical user requirement.
The same problem exists in host device passthrough. For a specific
device, it should be passthrough to a specific VM but not a template.
I'd like to collect some thoughts before my device passthrough patch V2.
In which place you'd suggest me to put device passthrough information,
template or VM?
Thanks for sharing your ideas!
--
Thanks and best regards!
Zhou Zheng Sheng / 周征晟
E-mail: zhshzhou(a)linux.vnet.ibm.com
Telephone: 86-10-82454397
10 years, 5 months
[PATCHv4 0/3] UI: manage guest disks
by lvroyce@linux.vnet.ibm.com
From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
v1>v3,
Adjust html format(Aline's comments)
Fix disk view display,
Fix align problem in select menu(hongliang's comments)
Fill default value in pool and volume box(hongliang's comments)
v3>v4,
Backend changed param from path to pool/vol,
UI change with backend.
handle option with no value.(hongliang's comments)
Royce Lv (3):
Fix select menu data append
UI: Support add guest disk
Display all disk types in storage edit view
ui/css/theme-default/guest-storage-add.css | 16 ++++
ui/js/src/kimchi.guest_edit_main.js | 5 +-
ui/js/src/kimchi.guest_storage_add.main.js | 137 ++++++++++++++++++++++++-----
ui/js/widgets/select-menu.js | 4 +-
ui/pages/guest-edit.html.tmpl | 17 +++-
ui/pages/guest-storage-add.html.tmpl | 62 +++++++++++--
6 files changed, 208 insertions(+), 33 deletions(-)
--
1.8.3.2
10 years, 5 months
[PATCHv4 0/7] Support guest disk management
by lvroyce@linux.vnet.ibm.com
From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Note:
This patchset depends on
[PATCH V9 7/7] write the template OS info to vm metadata.
v3>v4,
Rebase on shaohe's new metadata patchset.
v1>v3,
Choose bus type according to os info in metadata.
When adding a disk, specify a pool and vol name,
so that kimchi can chek ref_cnt to make sure no others
using that volume,
also volume format is filled to driver so that qcow2 image
will not recognized as raw.
Tested:
1. when no bus is specified,
kimchi chose 'ide' for cdrom and 'virtio' for disk
2. when bus is specified,
kimchi attach disk with specified bus.
3. ide does not support hot plug.
4. Disk size for qcow2 and raw is right.
Royce Lv (7):
Guest disks: Update doc to support manage guest disks
Guest disks: Update api definition and error reporting
Guest disks: Choose proper bus for device
Guest disks: Abstract vm disk functions
Guest disk: deals with disk attachment
Multiple pep8 fixes
Guest disks: Update testcase
docs/API.md | 12 ++--
src/kimchi/API.json | 37 +++++++---
src/kimchi/i18n.py | 28 ++++----
src/kimchi/mockmodel.py | 18 ++---
src/kimchi/model/storagevolumes.py | 9 +--
src/kimchi/model/vmstorages.py | 138 ++++++++++++++++++-------------------
src/kimchi/vmdisks.py | 58 ++++++++++++++++
tests/test_model.py | 75 ++++++++++++++++++++
8 files changed, 265 insertions(+), 110 deletions(-)
create mode 100644 src/kimchi/vmdisks.py
--
1.8.3.2
10 years, 5 months
[v3] Enable encryption in vm VNC console connection
by Zhou Zheng Sheng
From: Mark Wu <wudxw(a)linux.vnet.ibm.com>
The current vm VNC console connection is unencrypted. This patch enables
encrypted vm VNC console connection. But browsers doesn't
support well for the usage self-signed certs in the ssl websocket
connection. For details, please see:
https://github.com/kanaka/websockify/wiki/Encrypted-Connections
For chrome browser, the encrypted console connection should work after
you login with ssl connection. But for firefox, it does not show a
confirmation page for the user the accept the self-signed cert when
the HTTPs connection is started from a websocket.
So this patch makes use of the Web server in the websockify. The mini
Web server in the websockify can serve static contents like html, css
and js. This patch moves all novnc related html, css, font and js files
to ui/novnc, and have the websockify serve those files. When the user
clicks the VNC icon, Kimchi brings the user to
https://host:64667/vnc.html, which is served by websockify. Then
firefox would prompt a confirmation page for the self-signed cert. After
the user accept the cert, HTTPs connection started from the websocket
would succeed.
v3:
Make use of the mini Web server in the websockify.
Signed-off-by: Mark Wu <wudxw(a)linux.vnet.ibm.com>
Signed-off-by: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
---
configure.ac | 8 ++++----
contrib/kimchi.spec.fedora.in | 13 +++++++------
contrib/kimchi.spec.suse.in | 13 +++++++------
src/kimchi/vnc.py | 11 +++++++++--
ui/Makefile.am | 2 +-
ui/css/Makefile.am | 2 +-
ui/css/fonts/Makefile.am | 2 --
ui/js/Makefile.am | 2 +-
ui/js/src/kimchi.api.js | 7 ++++---
ui/{css => }/novnc/Makefile.am | 8 +++++---
ui/{css/fonts/novnc => novnc/css}/Makefile.am | 4 ++--
ui/{css/fonts/novnc => novnc/css}/Orbitron700.ttf | Bin
ui/{css/fonts/novnc => novnc/css}/Orbitron700.woff | Bin
ui/{css/novnc => novnc/css}/base.css | 0
ui/{js/novnc => novnc/js}/Makefile.am | 2 +-
ui/{js/novnc => novnc/js}/base64.js | 0
ui/{js/novnc => novnc/js}/des.js | 0
ui/{js/novnc => novnc/js}/display.js | 0
ui/{js/novnc => novnc/js}/input.js | 0
ui/{js/novnc => novnc/js}/jsunzip.js | 0
ui/{js/novnc => novnc/js}/main.js | 0
ui/{js/novnc => novnc/js}/rfb.js | 0
ui/{js/novnc => novnc/js}/util.js | 0
ui/{js/novnc => novnc/js}/web-socket-js/Makefile.am | 2 +-
ui/{js/novnc => novnc/js}/web-socket-js/README.txt | 0
ui/{js/novnc => novnc/js}/web-socket-js/WebSocketMain.swf | Bin
ui/{js/novnc => novnc/js}/web-socket-js/swfobject.js | 0
ui/{js/novnc => novnc/js}/web-socket-js/web_socket.js | 0
ui/{js/novnc => novnc/js}/websock.js | 0
ui/{js/novnc => novnc/js}/webutil.js | 0
ui/{pages/vnc_auto.html.tmpl => novnc/vnc.html} | 9 ++++-----
31 files changed, 47 insertions(+), 38 deletions(-)
rename ui/{css => }/novnc/Makefile.am (82%)
rename ui/{css/fonts/novnc => novnc/css}/Makefile.am (88%)
rename ui/{css/fonts/novnc => novnc/css}/Orbitron700.ttf (100%)
rename ui/{css/fonts/novnc => novnc/css}/Orbitron700.woff (100%)
rename ui/{css/novnc => novnc/css}/base.css (100%)
rename ui/{js/novnc => novnc/js}/Makefile.am (94%)
rename ui/{js/novnc => novnc/js}/base64.js (100%)
rename ui/{js/novnc => novnc/js}/des.js (100%)
rename ui/{js/novnc => novnc/js}/display.js (100%)
rename ui/{js/novnc => novnc/js}/input.js (100%)
rename ui/{js/novnc => novnc/js}/jsunzip.js (100%)
rename ui/{js/novnc => novnc/js}/main.js (100%)
rename ui/{js/novnc => novnc/js}/rfb.js (100%)
rename ui/{js/novnc => novnc/js}/util.js (100%)
rename ui/{js/novnc => novnc/js}/web-socket-js/Makefile.am (91%)
rename ui/{js/novnc => novnc/js}/web-socket-js/README.txt (100%)
rename ui/{js/novnc => novnc/js}/web-socket-js/WebSocketMain.swf (100%)
rename ui/{js/novnc => novnc/js}/web-socket-js/swfobject.js (100%)
rename ui/{js/novnc => novnc/js}/web-socket-js/web_socket.js (100%)
rename ui/{js/novnc => novnc/js}/websock.js (100%)
rename ui/{js/novnc => novnc/js}/webutil.js (100%)
rename ui/{pages/vnc_auto.html.tmpl => novnc/vnc.html} (83%)
diff --git a/configure.ac b/configure.ac
index 7d76f97..bc3f93e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -66,19 +66,19 @@ AC_CONFIG_FILES([
plugins/sample/ui/config/Makefile
ui/Makefile
ui/css/Makefile
- ui/css/novnc/Makefile
ui/css/fonts/Makefile
- ui/css/fonts/novnc/Makefile
ui/images/Makefile
ui/images/theme-default/Makefile
ui/js/Makefile
- ui/js/novnc/Makefile
ui/js/spice/Makefile
- ui/js/novnc/web-socket-js/Makefile
ui/libs/Makefile
ui/libs/themes/Makefile
ui/libs/themes/base/Makefile
ui/libs/themes/base/images/Makefile
+ ui/novnc/Makefile
+ ui/novnc/css/Makefile
+ ui/novnc/js/Makefile
+ ui/novnc/js/web-socket-js/Makefile
ui/pages/Makefile
ui/pages/help/Makefile
ui/pages/help/en_US/Makefile
diff --git a/contrib/kimchi.spec.fedora.in b/contrib/kimchi.spec.fedora.in
index 104c114..dd2fba7 100644
--- a/contrib/kimchi.spec.fedora.in
+++ b/contrib/kimchi.spec.fedora.in
@@ -154,8 +154,6 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/kimchi/mo/*/LC_MESSAGES/kimchi.mo
%{_datadir}/kimchi/config/ui/*.xml
%{_datadir}/kimchi/ui/css/fonts/fontawesome-webfont.*
-%{_datadir}/kimchi/ui/css/fonts/novnc/Orbitron700.*
-%{_datadir}/kimchi/ui/css/novnc/base.css
%{_datadir}/kimchi/ui/css/theme-default.min.css
%{_datadir}/kimchi/ui/images/*.png
%{_datadir}/kimchi/ui/images/*.ico
@@ -165,11 +163,7 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/kimchi/ui/js/jquery-ui.js
%{_datadir}/kimchi/ui/js/jquery.min.js
%{_datadir}/kimchi/ui/js/modernizr.custom.2.6.2.min.js
-%{_datadir}/kimchi/ui/js/novnc/*.js
%{_datadir}/kimchi/ui/js/spice/*.js
-%{_datadir}/kimchi/ui/js/novnc/web-socket-js/WebSocketMain.swf
-%{_datadir}/kimchi/ui/js/novnc/web-socket-js/swfobject.js
-%{_datadir}/kimchi/ui/js/novnc/web-socket-js/web_socket.js
%{_datadir}/kimchi/ui/libs/jquery-ui-i18n.min.js
%{_datadir}/kimchi/ui/libs/jquery-ui.min.js
%{_datadir}/kimchi/ui/libs/jquery-1.10.0.min.js
@@ -177,6 +171,13 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/kimchi/ui/libs/themes/base/images/*.png
%{_datadir}/kimchi/ui/libs/themes/base/images/*.gif
%{_datadir}/kimchi/ui/libs/themes/base/jquery-ui.min.css
+%{_datadir}/kimchi/ui/novnc/css/Orbitron700.*
+%{_datadir}/kimchi/ui/novnc/css/base.css
+%{_datadir}/kimchi/ui/novnc/js/*.js
+%{_datadir}/kimchi/ui/novnc/js/web-socket-js/WebSocketMain.swf
+%{_datadir}/kimchi/ui/novnc/js/web-socket-js/swfobject.js
+%{_datadir}/kimchi/ui/novnc/js/web-socket-js/web_socket.js
+%{_datadir}/kimchi/ui/novnc/vnc.html
%{_datadir}/kimchi/ui/pages/*.html.tmpl
%{_datadir}/kimchi/ui/pages/help/*/*.html
%{_datadir}/kimchi/ui/pages/tabs/*.html.tmpl
diff --git a/contrib/kimchi.spec.suse.in b/contrib/kimchi.spec.suse.in
index 7704822..73c59a0 100644
--- a/contrib/kimchi.spec.suse.in
+++ b/contrib/kimchi.spec.suse.in
@@ -76,8 +76,6 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/kimchi/mo/*/LC_MESSAGES/kimchi.mo
%{_datadir}/kimchi/config/ui/*.xml
%{_datadir}/kimchi/ui/css/fonts/fontawesome-webfont.*
-%{_datadir}/kimchi/ui/css/fonts/novnc/Orbitron700.*
-%{_datadir}/kimchi/ui/css/novnc/base.css
%{_datadir}/kimchi/ui/css/theme-default.min.css
%{_datadir}/kimchi/ui/images/*.png
%{_datadir}/kimchi/ui/images/*.ico
@@ -87,11 +85,7 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/kimchi/ui/js/jquery-ui.js
%{_datadir}/kimchi/ui/js/jquery.min.js
%{_datadir}/kimchi/ui/js/modernizr.custom.2.6.2.min.js
-%{_datadir}/kimchi/ui/js/novnc/*.js
%{_datadir}/kimchi/ui/js/spice/*.js
-%{_datadir}/kimchi/ui/js/novnc/web-socket-js/WebSocketMain.swf
-%{_datadir}/kimchi/ui/js/novnc/web-socket-js/swfobject.js
-%{_datadir}/kimchi/ui/js/novnc/web-socket-js/web_socket.js
%{_datadir}/kimchi/ui/libs/jquery-ui-i18n.min.js
%{_datadir}/kimchi/ui/libs/jquery-ui.min.js
%{_datadir}/kimchi/ui/libs/jquery-1.10.0.min.js
@@ -99,6 +93,13 @@ rm -rf $RPM_BUILD_ROOT
%{_datadir}/kimchi/ui/libs/themes/base/images/*.png
%{_datadir}/kimchi/ui/libs/themes/base/images/*.gif
%{_datadir}/kimchi/ui/libs/themes/base/jquery-ui.min.css
+%{_datadir}/kimchi/ui/novnc/css/Orbitron700.*
+%{_datadir}/kimchi/ui/novnc/css/base.css
+%{_datadir}/kimchi/ui/novnc/js/*.js
+%{_datadir}/kimchi/ui/novnc/js/web-socket-js/WebSocketMain.swf
+%{_datadir}/kimchi/ui/novnc/js/web-socket-js/swfobject.js
+%{_datadir}/kimchi/ui/novnc/js/web-socket-js/web_socket.js
+%{_datadir}/kimchi/ui/novnc/vnc.html
%{_datadir}/kimchi/ui/pages/*.html.tmpl
%{_datadir}/kimchi/ui/pages/help/*/*.html
%{_datadir}/kimchi/ui/pages/tabs/*.html.tmpl
diff --git a/src/kimchi/vnc.py b/src/kimchi/vnc.py
index 1f36e9a..61f9c15 100644
--- a/src/kimchi/vnc.py
+++ b/src/kimchi/vnc.py
@@ -23,7 +23,7 @@ import os
import subprocess
-from kimchi.config import config
+from kimchi.config import config, paths
WS_TOKENS_DIR = '/var/lib/kimchi/vnc-tokens'
@@ -36,9 +36,16 @@ def new_ws_proxy():
if e.errno == errno.EEXIST:
pass
+ cert = config.get('server', 'ssl_cert')
+ key = config.get('server', 'ssl_key')
+ if not (cert and key):
+ cert = '%s/kimchi-cert.pem' % paths.conf_dir
+ key = '%s/kimchi-key.pem' % paths.conf_dir
+
cmd = os.path.join(os.path.dirname(__file__), 'websockify.py')
args = ['python', cmd, config.get('display', 'display_proxy_port'),
- '--target-config', WS_TOKENS_DIR]
+ '--target-config', WS_TOKENS_DIR, '--cert', cert, '--key', key,
+ '--web', os.path.join(paths.ui_dir, 'novnc')]
p = subprocess.Popen(args, close_fds=True)
return p
diff --git a/ui/Makefile.am b/ui/Makefile.am
index b5366c5..4e0d57a 100644
--- a/ui/Makefile.am
+++ b/ui/Makefile.am
@@ -15,4 +15,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-SUBDIRS = css images js libs pages
+SUBDIRS = css images js libs pages novnc
diff --git a/ui/css/Makefile.am b/ui/css/Makefile.am
index db65799..0922a9d 100644
--- a/ui/css/Makefile.am
+++ b/ui/css/Makefile.am
@@ -15,7 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-SUBDIRS = novnc fonts
+SUBDIRS = fonts
EXTRA_DIST = theme-default
diff --git a/ui/css/fonts/Makefile.am b/ui/css/fonts/Makefile.am
index 63df038..d72bb6c 100644
--- a/ui/css/fonts/Makefile.am
+++ b/ui/css/fonts/Makefile.am
@@ -15,8 +15,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-SUBDIRS = novnc
-
fontdir = $(datadir)/kimchi/ui/css/fonts
dist_font_DATA = fontawesome-webfont.*
diff --git a/ui/js/Makefile.am b/ui/js/Makefile.am
index f4d1e6b..a29c262 100644
--- a/ui/js/Makefile.am
+++ b/ui/js/Makefile.am
@@ -15,7 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-SUBDIRS = novnc spice
+SUBDIRS = spice
EXTRA_DIST = src widgets
diff --git a/ui/js/src/kimchi.api.js b/ui/js/src/kimchi.api.js
index 1bde45c..c8c422d 100644
--- a/ui/js/src/kimchi.api.js
+++ b/ui/js/src/kimchi.api.js
@@ -318,7 +318,6 @@ var kimchi = {
type : 'GET',
dataType : 'json'
}).done(function(data, textStatus, xhr) {
- http_port = data['http_port'];
proxy_port = data['display_proxy_port'];
kimchi.requestJSON({
url : "/vms/" + encodeURIComponent(vm) + "/connect",
@@ -329,9 +328,10 @@ var kimchi = {
* Due to problems with web sockets and self-signed
* certificates, for now we will always redirect to http
*/
- url = 'http://' + location.hostname + ':' + http_port;
- url += "/vnc_auto.html?port=" + proxy_port;
+ url = 'https://' + location.hostname + ':' + proxy_port;
+ url += "/vnc.html?port=" + proxy_port;
url += "&path=?token=" + encodeURIComponent(vm);
+ url += '&encrypt=1'
window.open(url);
});
}).error(function() {
@@ -355,6 +355,7 @@ var kimchi = {
url = 'http://' + location.hostname + ':' + http_port;
url += "/spice.html?port=" + proxy_port + "&listen="
+ data.graphics.listen + "&token=" + encodeURIComponent(vm);
+ url += '&encrypt=1'
window.open(url);
});
}).error(function() {
diff --git a/ui/css/novnc/Makefile.am b/ui/novnc/Makefile.am
similarity index 82%
rename from ui/css/novnc/Makefile.am
rename to ui/novnc/Makefile.am
index 29703d6..d0aca93 100644
--- a/ui/css/novnc/Makefile.am
+++ b/ui/novnc/Makefile.am
@@ -1,7 +1,7 @@
#
# Kimchi
#
-# Copyright IBM, Corp. 2013
+# Copyright IBM, Corp. 2014
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-cssdir = $(datadir)/kimchi/ui/css/novnc
+SUBDIRS = css js
-dist_css_DATA = base.css
+htmldir = $(datadir)/kimchi/ui/novnc
+
+dist_html_DATA = vnc.html $(NULL)
diff --git a/ui/css/fonts/novnc/Makefile.am b/ui/novnc/css/Makefile.am
similarity index 88%
rename from ui/css/fonts/novnc/Makefile.am
rename to ui/novnc/css/Makefile.am
index 50f6050..23d178f 100644
--- a/ui/css/fonts/novnc/Makefile.am
+++ b/ui/novnc/css/Makefile.am
@@ -15,6 +15,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-fontdir = $(datadir)/kimchi/ui/css/fonts/novnc
+cssdir = $(datadir)/kimchi/ui/novnc/css
-dist_font_DATA = Orbitron700.*
+dist_css_DATA = base.css Orbitron700.*
diff --git a/ui/css/fonts/novnc/Orbitron700.ttf b/ui/novnc/css/Orbitron700.ttf
similarity index 100%
rename from ui/css/fonts/novnc/Orbitron700.ttf
rename to ui/novnc/css/Orbitron700.ttf
diff --git a/ui/css/fonts/novnc/Orbitron700.woff b/ui/novnc/css/Orbitron700.woff
similarity index 100%
rename from ui/css/fonts/novnc/Orbitron700.woff
rename to ui/novnc/css/Orbitron700.woff
diff --git a/ui/css/novnc/base.css b/ui/novnc/css/base.css
similarity index 100%
rename from ui/css/novnc/base.css
rename to ui/novnc/css/base.css
diff --git a/ui/js/novnc/Makefile.am b/ui/novnc/js/Makefile.am
similarity index 94%
rename from ui/js/novnc/Makefile.am
rename to ui/novnc/js/Makefile.am
index fefe6af..0c22fed 100644
--- a/ui/js/novnc/Makefile.am
+++ b/ui/novnc/js/Makefile.am
@@ -17,6 +17,6 @@
SUBDIRS = web-socket-js
-jsdir = $(datadir)/kimchi/ui/js/novnc
+jsdir = $(datadir)/kimchi/ui/novnc/js
dist_js_DATA = $(wildcard *.js) $(NULL)
diff --git a/ui/js/novnc/base64.js b/ui/novnc/js/base64.js
similarity index 100%
rename from ui/js/novnc/base64.js
rename to ui/novnc/js/base64.js
diff --git a/ui/js/novnc/des.js b/ui/novnc/js/des.js
similarity index 100%
rename from ui/js/novnc/des.js
rename to ui/novnc/js/des.js
diff --git a/ui/js/novnc/display.js b/ui/novnc/js/display.js
similarity index 100%
rename from ui/js/novnc/display.js
rename to ui/novnc/js/display.js
diff --git a/ui/js/novnc/input.js b/ui/novnc/js/input.js
similarity index 100%
rename from ui/js/novnc/input.js
rename to ui/novnc/js/input.js
diff --git a/ui/js/novnc/jsunzip.js b/ui/novnc/js/jsunzip.js
similarity index 100%
rename from ui/js/novnc/jsunzip.js
rename to ui/novnc/js/jsunzip.js
diff --git a/ui/js/novnc/main.js b/ui/novnc/js/main.js
similarity index 100%
rename from ui/js/novnc/main.js
rename to ui/novnc/js/main.js
diff --git a/ui/js/novnc/rfb.js b/ui/novnc/js/rfb.js
similarity index 100%
rename from ui/js/novnc/rfb.js
rename to ui/novnc/js/rfb.js
diff --git a/ui/js/novnc/util.js b/ui/novnc/js/util.js
similarity index 100%
rename from ui/js/novnc/util.js
rename to ui/novnc/js/util.js
diff --git a/ui/js/novnc/web-socket-js/Makefile.am b/ui/novnc/js/web-socket-js/Makefile.am
similarity index 91%
rename from ui/js/novnc/web-socket-js/Makefile.am
rename to ui/novnc/js/web-socket-js/Makefile.am
index 7d685f5..26ba1c0 100644
--- a/ui/js/novnc/web-socket-js/Makefile.am
+++ b/ui/novnc/js/web-socket-js/Makefile.am
@@ -15,7 +15,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-websocketdir = $(datadir)/kimchi/ui/js/novnc/web-socket-js
+websocketdir = $(datadir)/kimchi/ui/novnc/js/web-socket-js
dist_websocket_DATA = \
swfobject.js \
diff --git a/ui/js/novnc/web-socket-js/README.txt b/ui/novnc/js/web-socket-js/README.txt
similarity index 100%
rename from ui/js/novnc/web-socket-js/README.txt
rename to ui/novnc/js/web-socket-js/README.txt
diff --git a/ui/js/novnc/web-socket-js/WebSocketMain.swf b/ui/novnc/js/web-socket-js/WebSocketMain.swf
similarity index 100%
rename from ui/js/novnc/web-socket-js/WebSocketMain.swf
rename to ui/novnc/js/web-socket-js/WebSocketMain.swf
diff --git a/ui/js/novnc/web-socket-js/swfobject.js b/ui/novnc/js/web-socket-js/swfobject.js
similarity index 100%
rename from ui/js/novnc/web-socket-js/swfobject.js
rename to ui/novnc/js/web-socket-js/swfobject.js
diff --git a/ui/js/novnc/web-socket-js/web_socket.js b/ui/novnc/js/web-socket-js/web_socket.js
similarity index 100%
rename from ui/js/novnc/web-socket-js/web_socket.js
rename to ui/novnc/js/web-socket-js/web_socket.js
diff --git a/ui/js/novnc/websock.js b/ui/novnc/js/websock.js
similarity index 100%
rename from ui/js/novnc/websock.js
rename to ui/novnc/js/websock.js
diff --git a/ui/js/novnc/webutil.js b/ui/novnc/js/webutil.js
similarity index 100%
rename from ui/js/novnc/webutil.js
rename to ui/novnc/js/webutil.js
diff --git a/ui/pages/vnc_auto.html.tmpl b/ui/novnc/vnc.html
similarity index 83%
rename from ui/pages/vnc_auto.html.tmpl
rename to ui/novnc/vnc.html
index 0078190..1f4355c 100644
--- a/ui/pages/vnc_auto.html.tmpl
+++ b/ui/novnc/vnc.html
@@ -1,4 +1,3 @@
-#from kimchi.cachebust import href
<!DOCTYPE html>
<html>
<!--
@@ -13,15 +12,15 @@
<head>
<title>noVNC</title>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
- <link rel="stylesheet" href="$href("/css/novnc/base.css")" title="plain">
+ <link rel="stylesheet" href="css/base.css" title="plain">
<script type='text/javascript'>
- var INCLUDE_URI = "/js/novnc/";
+ var INCLUDE_URI = "js/";
</script>
<!--
<script type='text/javascript'
src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'></script>
-->
- <script src="$href("/js/novnc/util.js")"></script>
+ <script src="js/util.js"></script>
</head>
<body style="margin: 0px;">
@@ -39,6 +38,6 @@
Canvas not supported.
</canvas>
</div>
- <script src="$href("/js/novnc/main.js")"></script>
+ <script src="js/main.js"></script>
</body>
</html>
--
1.9.0
10 years, 5 months
[PATCh V12 0/7] bug fix: get user and group when VM is running
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
V11 -> V12
remove the prefix of xml directly.
remove some duplicate code
pass the node insteal of xml to get/set metadata node function
V10 -> V11
fix typo
V9 -> V10
metadata xml will be changed to hierarchical structure rather than flat.
V8 -> V9
move meta feature test to src/kimchi/model/config.py
use ElementMaker to construct a metanode.
V7 -> V8
add a feature test to probe libvirt support metadata.
add namespace for manully metadata.
V6 -> V7:
After V6 rebase, still find one error code "KCHVM0029E" does not change.
V5 -> V6:
rebase
V4 -> V5:
it is wrong to call dom.isPersistent in V4, fix it.
V3 -> V4:
work around if libvirt do not support metadata API well.
V2 -> V3:
move the virDomain.metadata and virDomain.setMetadata to model/utils.py
add testcase
V1 -> V2:
libvirt also support virDomain.metadata and virDomain.setMetadata two api.
use virDomain.metadata to get the user and group.
use virDomain.setMetadata to set the user and group.
ShaoHe Feng (7):
bug fix: call a method should be followed by "()"
add method to test libvirt metadata api are available
Add two function to set and get domain xml metadata
manually manage the metadata element
bug fix: get user and group when vm is living.
update test case to set/get user and group when VM is running
write the template OS info to vm metadata
src/kimchi/featuretests.py | 33 +++++++++++-
src/kimchi/i18n.py | 1 +
src/kimchi/model/config.py | 2 +
src/kimchi/model/utils.py | 123 +++++++++++++++++++++++++++++++++++++++++++++
src/kimchi/model/vms.py | 105 +++++++++++++++++++++++---------------
tests/test_model.py | 13 +++++
6 files changed, 235 insertions(+), 42 deletions(-)
--
1.9.0
10 years, 5 months
[PATCH 0/3] Update default tab from "Host" to "Guests"
by Crístian Viana
Crístian Viana (3):
Refactor code to trim file extension
Define the default tab more clearly
Change the default tab to "Guests"
ui/js/src/kimchi.main.js | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
--
1.9.0
10 years, 5 months
[PATCH] bug fix: Redirect 3xx responses through proxy
by Aline Manera
From: Aline Manera <alinefm(a)br.ibm.com>
When there is an redirection after POST/PUT/DELETE method, the proxy
must receive the response and redirect it properly to the correct server
and port.
The problem was identified when trying to rename a VM or template, or
even while cloning a template.
Fix it by adding new rules to nginx proxy configuration.
Signed-off-by: Aline Manera <alinefm(a)br.ibm.com>
---
src/kimchi/config.py.in | 1 +
src/nginx.conf.in | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/kimchi/config.py.in b/src/kimchi/config.py.in
index da89e3a..ac1667e 100644
--- a/src/kimchi/config.py.in
+++ b/src/kimchi/config.py.in
@@ -170,6 +170,7 @@ class KimchiConfig(dict):
'/': {'tools.trailing_slash.on': False,
'request.methods_with_bodies': ('POST', 'PUT'),
'tools.nocache.on': True,
+ 'tools.proxy.on': True,
'tools.sessions.on': True,
'tools.sessions.name': 'kimchi',
'tools.sessions.secure': True,
diff --git a/src/nginx.conf.in b/src/nginx.conf.in
index f077fef..c339e56 100644
--- a/src/nginx.conf.in
+++ b/src/nginx.conf.in
@@ -50,10 +50,12 @@ http {
add_header X-XSS-Protection "1; mode=block";
location / {
- proxy_pass http://localhost:$kimchid_port;
+ proxy_pass http://127.0.0.1:$kimchid_port;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_redirect http://127.0.0.1:$kimchid_port/ https://$host:$proxy_ssl_port/;
+
}
}
--
1.7.10.4
10 years, 5 months