[PATCH 0/6] Refactore isoinfo.py
by Aline Manera
From: Aline Manera <alinefm(a)br.ibm.com>
Aline Manera (6):
isoinfo: Add ignore_list paramter to main program
isoinfo: Use absolute path only for local ISO files
Move IsoFormatError() from isoinfo.py to exception.py
Move ISO path validation to IsoImage()
isoinfo: Move _probe_iso() to IsoImage()
pep8 cleanup for isoinfo.py
Makefile.am | 1 +
src/kimchi/exception.py | 4 ++
src/kimchi/isoinfo.py | 138 +++++++++++++++++++++++-----------------------
src/kimchi/model.py | 11 ++--
src/kimchi/scan.py | 5 +-
src/kimchi/vmtemplate.py | 8 ++-
6 files changed, 87 insertions(+), 80 deletions(-)
--
1.7.10.4
10 years, 11 months
[PATCH V6 0/1] Open 8000 and 8001 port by default for distro packages
by taget@linux.vnet.ibm.com
From: Eli Qiao <taget(a)linux.vnet.ibm.com>
V6 -V5 changes:
1.Keep specific condition for RHEL6 when starting kimchid service
2.Remove full path of firewall-cmd in postrm
V5 - V4 changes:
1. Add cover-letter. (Aline)
2. Move clean up rules into if condition. (Aline)
3. Use with_systemd condition to check if use firewalld rules. (Aline)
4. Fix typo (Aline)
V4 - V3 changes:
1 Fix typo in firewalld.xml (Rodrigo)
V3 - V2 changes:
1.Rename kimchid.xml to firewalld.xml (Mark)
2.Remove firewalld from serivce require (Mark)
3.Fix typo
V2 - V1 changes:
1.Add firewalld sevice configure file kimchid.xml to help open iptables port (Mark)
2.Add Ubuntu iptables rule (Royce)
Eli Qiao (1):
spec: Open 8000 and 8001 port by default
contrib/DEBIAN/control.in | 3 ++-
contrib/DEBIAN/postinst | 2 ++
contrib/DEBIAN/postrm | 2 ++
contrib/kimchi.spec.fedora.in | 22 ++++++++++++++++++++++
contrib/kimchi.spec.suse.in | 10 ++++++++--
src/Makefile.am | 1 +
src/firewalld.xml | 7 +++++++
7 files changed, 44 insertions(+), 3 deletions(-)
create mode 100644 src/firewalld.xml
10 years, 11 months
[PATCH] plugin: fix dynamic import mechanism
by Zhou Zheng Sheng
The current kimchi plugin subsystem implement a dynamic discovery and
import mechanism. It uses the Python builtin function __import__() to
actually import a plugin module by name. However it turns out it only
works when we start kimchi from the project source directory, not work
when it is started from the installed path.
This is because the __import__() accepts a "global" arugment and it
needs "__name__", "__path__" and "__package__" in this "global" dict to
determine the package context [1][2]. When in kimchi/utils.py it runs
"import plugins.XXX", it actually fetch the "__package__" from utils.py,
which is "kimchi", then it imports "kimchi.plugins.XXX" under the hood
[3].
The current import_module() function calls __import__() without giving a
global dict. When kimchid is started from /usr/bin, without the package
context, __import__() can not find "plugins.sample".
This patch provides the full package context to __import__() to mimic
the standard "import" statement behavior.
[1] http://docs.python.org/2/library/functions.html#__import__
[2] http://hg.python.org/cpython/file/990d7647ea51/Python/import.c
[3] http://docs.python.org/2/reference/simple_stmts.html#import
Signed-off-by: Zhou Zheng Sheng <zhshzhou(a)linux.vnet.ibm.com>
---
src/kimchi/utils.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/kimchi/utils.py b/src/kimchi/utils.py
index f7eda93..b6d84fd 100644
--- a/src/kimchi/utils.py
+++ b/src/kimchi/utils.py
@@ -83,4 +83,4 @@ def import_class(class_path):
def import_module(module_name):
- return __import__(module_name, fromlist=[''])
+ return __import__(module_name, globals(), locals(), [''])
--
1.7.11.7
10 years, 11 months
[PATCH v5 0/5] Support Creating iSCSI storage pool
by Zhou Zheng Sheng
This patch series is about creating iSCSI storage pool.
After this patch, you can create an ISCSI storage pool as the following.
curl -u root -H 'Content-type: application/json' \
-H 'Accept: application/json' \
-d '{"source": {
"target": "iqn.2013-01.example.com.targetname",
"host": "192.168.X.X",
"port": 326X,
"auth": {"username": "testUser", "password": "123456"}},
"type": "iscsi",
"name": "testIscsiPool"}' \
http://127.0.0.1:8000/storagepools
Note the "port" and "auth" is optional.
Thanks the reviewers. I took most of reviewer advices and submit this
v4 patch series.
Tested the patch over LIO iSCSI target and libvirt-1.1.4-1.fc19.
http://linux-iscsi.org/wiki/ISCSI
v4 -> v5
Rebase to master and solve conflicts of file list in Makefile and
import statements in .py files.
Zhou Zheng Sheng (5):
storagepool: refactor _get_pool_xml()
storagepool: rename and consolidate arguments of creating (back-end)
storagepool: rename and consolidate arguments of creating (front-end)
storagepool: Support Creating iSCSI storagepool in model.py
test_model: test creating iSCSI storage pool
Makefile.am | 2 +
contrib/DEBIAN/control.in | 3 +-
contrib/kimchi.spec.fedora.in | 1 +
contrib/kimchi.spec.suse.in | 1 +
docs/API.md | 28 ++--
src/kimchi/API.json | 69 ++++++++++
src/kimchi/Makefile.am | 1 +
src/kimchi/iscsi.py | 89 ++++++++++++
src/kimchi/model.py | 226 +++++++++++++++++++++++++------
tests/Makefile.am | 1 +
tests/test_model.py | 91 +++++++------
tests/test_storagepool.py | 156 +++++++++++++++++++++
ui/js/src/kimchi.storagepool_add_main.js | 13 +-
13 files changed, 590 insertions(+), 91 deletions(-)
create mode 100644 src/kimchi/iscsi.py
create mode 100644 tests/test_storagepool.py
--
1.7.11.7
10 years, 11 months
Re: [Kimchi-devel] Your message to Kimchi-devel awaits moderator approval
by Shu Ming
It seems that the size of this patch exceed the limit. Can the
moderator help on this?
2014/1/3 18:49, kimchi-devel-bounces(a)ovirt.org :
> Your mail to 'Kimchi-devel' with the subject
>
> [PATCH V1 2/2] Remove the legacy files
>
> Is being held until the list moderator can review it for approval.
>
> The reason it is being held:
>
> Message body is too big: 202740 bytes with a limit of 40 KB
>
> Either the message will get posted to the list, or you will receive
> notification of the moderator's decision. If you would like to cancel
> this posting, please visit the following URL:
>
> http://lists.ovirt.org/mailman/confirm/kimchi-devel/73683eeb30377f7cd4acf...
>
10 years, 11 months
[PATCH V1 0/2] Removal of of developer UI
by Shu Ming
[RFC] Removal of of developer UI
The translation of the legacy messages is to be done
Shu Ming (2):
Remove the legacy files from automake and package configurations
Remove the legacy files
contrib/kimchi.spec.fedora.in | 3 -
contrib/kimchi.spec.suse.in | 3 -
po/POTFILES.in | 1 -
ui/css/Makefile.am | 2 +-
ui/css/dev.base.css | 3999 -----------------------------------------
ui/css/dev.jquery-ui.css | 1173 ------------
ui/css/dev.main.css | 131 --
ui/css/dev.style.css | 164 --
ui/images/Makefile.am | 2 +-
ui/images/bg-footer-noise.jpg | Bin 6916 -> 0 bytes
ui/images/chosen-sprite.png | Bin 646 -> 0 bytes
ui/images/gauze.png | Bin 6045 -> 0 bytes
ui/images/gtk-directory.png | Bin 2759 -> 0 bytes
ui/images/image-missing.png | Bin 2856 -> 0 bytes
ui/images/jq-global-nav.png | Bin 6738 -> 0 bytes
ui/images/jq-nav-icons.png | Bin 9804 -> 0 bytes
ui/js/Makefile.am | 1 -
ui/js/dev.main.js | 464 -----
ui/pages/Makefile.am | 1 -
ui/pages/dev-ui.html.tmpl | 170 --
20 files changed, 2 insertions(+), 6112 deletions(-)
delete mode 100644 ui/css/dev.base.css
delete mode 100644 ui/css/dev.jquery-ui.css
delete mode 100644 ui/css/dev.main.css
delete mode 100644 ui/css/dev.style.css
delete mode 100644 ui/images/bg-footer-noise.jpg
delete mode 100644 ui/images/chosen-sprite.png
delete mode 100644 ui/images/gauze.png
delete mode 100644 ui/images/gtk-directory.png
delete mode 100644 ui/images/image-missing.png
delete mode 100644 ui/images/jq-global-nav.png
delete mode 100644 ui/images/jq-nav-icons.png
delete mode 100644 ui/js/dev.main.js
delete mode 100644 ui/pages/dev-ui.html.tmpl
--
1.8.1.4
10 years, 11 months
[PATCH] Add jquery widget dropDown button
by zhoumeina
This patch is working for make dropDown button a jquery
widget.
We can create a dropdown button simply with:
$('#buttonId').dropdownButton();
And in html:
<div id="buttonId">
<span class="text">$_("Button label")</span><span class="arrow"></span>
<div>
<button><span class="text">$_("dropdownbutton1")</span></button>
<button><span class="text">$_("dropdownbutton2")</span></button>
</div>
</div>
If we need some other style, you can add it to html, and bind action in js.
Not a perfect widget, but a beginning.
Signed-off-by: zhoumeina <zhoumein(a)linux.vnet.ibm.com>
---
ui/js/widgets/button-dropDown.js | 42 ++++++++++++++++++++++++++++++++++++++
1 files changed, 42 insertions(+), 0 deletions(-)
create mode 100644 ui/js/widgets/button-dropDown.js
diff --git a/ui/js/widgets/button-dropDown.js b/ui/js/widgets/button-dropDown.js
new file mode 100644
index 0000000..49259e3
--- /dev/null
+++ b/ui/js/widgets/button-dropDown.js
@@ -0,0 +1,42 @@
+/*
+ * Project Kimchi
+ *
+ * Copyright IBM, Corp. 2013
+ *
+ * Authors:
+ * zhoumeina <zhoumein(a)linux.vnet.ibm.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+(function($) {
+ $.widget('kimchi.dropdownButton', {
+ options: {
+ key: 0,
+ value: 0
+ },
+
+ _create : function() {
+ this.actionDiv = this.element;
+ this.actionDiv.addClass('btn dropdown popable');
+ this.actionDiv.find('div').addClass('popover');
+ this.actionDiv.find('button').addClass('button-big');
+ },
+
+ _setOption : function(key,value) {},
+
+ destroy : function() {
+ // call the base destroy function
+ $.Widget.prototype.destroy.call(this);
+ }
+ });
+}(jQuery));
\ No newline at end of file
--
1.7.1
10 years, 11 months
[PATCH V3 0/2] Add ISCSI storage pool UI support
by zhoumeina
v2-v3 Modify this patchset according to backend changes
Include create storage pool UI and translation files.
zhoumeina (2):
Add UI support of iscsi
Add the ISCSI translation po files
po/en_US.po | 55 ++++++++++++++++++----
po/kimchi.pot | 50 ++++++++++++++++---
po/pt_BR.po | 51 +++++++++++++++++---
po/zh_CN.po | 51 +++++++++++++++++---
ui/css/theme-default/form.css | 5 ++
ui/js/src/kimchi.storagepool_add_main.js | 77 +++++++++++++++++++++++++----
ui/js/src/kimchi.utils.js | 5 ++
ui/pages/i18n.html.tmpl | 7 ++-
ui/pages/storagepool-add.html.tmpl | 48 +++++++++++++++----
9 files changed, 293 insertions(+), 56 deletions(-)
mode change 100644 => 100755 po/kimchi.pot
10 years, 11 months
[PATCH] network improvment: add vms field
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
Add vms field for network GET method
update API.md
add a function to get all vms attach to a network
update model
add vms field for Network Resource property
update controller
Now get the info of default network:
$ curl -u <user>:<password> -H 'Content-type: application/json' -H 'Accept:
application/json' -X GET http://localhost:8000/networks/default
{
"subnet":"192.168.122.0/24",
"connection":"nat",
"name":"default",
"autostart":true,
"state":"active",
"interface":"virbr0",
"dhcp":{
"start":"192.168.122.2",
"end":"192.168.122.254"
},
"vms":[
"rhel6",
"opensuse12"
]
}
we can see, there are two vms attched to this network
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
---
docs/API.md | 1 +
src/kimchi/controller.py | 1 +
src/kimchi/model.py | 15 +++++++++++++++
3 files changed, 17 insertions(+)
diff --git a/docs/API.md b/docs/API.md
index 9edc551..a3e6c8a 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -348,6 +348,7 @@ A interface represents available interface on host.
* active: The Network is ready for use
* inactive: The Network is not available
* autostart: Network autostart onboot
+ * vms: all vms attached to this network
* subnet: Network segment in slash-separated format with ip address and prefix
* dhcp: DHCP services on the virtual network is enabled.
* start: start boundary of a pool of addresses to be provided to DHCP clients.
diff --git a/src/kimchi/controller.py b/src/kimchi/controller.py
index 2940278..63b0820 100644
--- a/src/kimchi/controller.py
+++ b/src/kimchi/controller.py
@@ -459,6 +459,7 @@ class Network(Resource):
@property
def data(self):
return {'name': self.ident,
+ 'vms': self.info['vms'],
'autostart': self.info['autostart'],
'connection': self.info['connection'],
'interface': self.info['interface'],
diff --git a/src/kimchi/model.py b/src/kimchi/model.py
index a6790b8..015eb46 100644
--- a/src/kimchi/model.py
+++ b/src/kimchi/model.py
@@ -546,6 +546,11 @@ class Model(object):
xpath = "/domain/devices/disk[@device='disk']/source/@file"
return xmlutils.xpath_get_text(xml, xpath)
+ def _vm_get_networks(self, dom):
+ xml = dom.XMLDesc(0)
+ xpath = "/domain/devices/interface[@type='network']/source/@network"
+ return xmlutils.xpath_get_text(xml, xpath)
+
def vm_delete(self, name):
if self._vm_exists(name):
conn = self.conn.get()
@@ -844,6 +849,15 @@ class Model(object):
conn = self.conn.get()
return sorted(conn.listNetworks() + conn.listDefinedNetworks())
+ def _get_vms_attach_to_a_network(self, network):
+ vms = []
+ conn = self.conn.get()
+ for dom in conn.listAllDomains():
+ networks = self._vm_get_networks(dom)
+ if network in networks:
+ vms.append(dom.name())
+ return vms
+
def network_lookup(self, name):
network = self._get_network(name)
xml = network.XMLDesc(0)
@@ -872,6 +886,7 @@ class Model(object):
'interface': interface,
'subnet': subnet,
'dhcp': dhcp,
+ 'vms': self._get_vms_attach_to_a_network(name),
'autostart': network.autostart() == 1,
'state': network.isActive() and "active" or "inactive"}
--
1.8.4.2
10 years, 11 months
[RESEND PATCH V5 0/1] Open 8000 and 8001 port by default for distro packages
by taget@linux.vnet.ibm.com
From: Eli Qiao <taget(a)linux.vnet.ibm.com>
V5 - V4 changes:
1. Add cover-letter. (Aline)
2. Move clean up rules into if condition. (Aline)
3. Use with_systemd condition to check if use firewalld rules. (Aline)
4. Fix typo (Aline)
V4 - V3 changes:
1 Fix typo in firewalld.xml (Rodrigo)
V3 - V2 changes:
1.Rename kimchid.xml to firewalld.xml (Mark)
2.Remove firewalld from serivce require (Mark)
3.Fix typo
V2 - V1 changes:
1.Add firewalld sevice configure file kimchid.xml to help open iptables port (Mark)
2.Add Ubuntu iptables rule (Royce)
Eli Qiao (1):
spec: Open 8000 and 8001 port by default
contrib/DEBIAN/control.in | 3 ++-
contrib/DEBIAN/postinst | 2 ++
contrib/DEBIAN/postrm | 2 ++
contrib/kimchi.spec.fedora.in | 24 +++++++++++++++++++++---
contrib/kimchi.spec.suse.in | 10 ++++++++--
src/Makefile.am | 1 +
src/firewalld.xml | 7 +++++++
7 files changed, 43 insertions(+), 6 deletions(-)
create mode 100644 src/firewalld.xml
10 years, 11 months