[PATCH v4 0/2] Replace storage volume 'ref_cnt' with 'used_by'
by Crístian Deives
The difference between this and the previous patchset (v3) is:
- The UI stays consistent with the previous behavior, i.e., it won't display
disks which are used by other VMs.
Crístian Deives (2):
Replace storage volume 'ref_cnt' with 'used_by'
Set 'used_by' to [] when creating some volumes
docs/API.md | 4 +--
src/kimchi/control/storagevolumes.py | 2 +-
src/kimchi/mockmodel.py | 4 +--
src/kimchi/model/diskutils.py | 18 +++++------
src/kimchi/model/storagevolumes.py | 25 +++++++--------
src/kimchi/model/vms.py | 14 ++++++---
src/kimchi/model/vmstorages.py | 50 ++++++++++++++++--------------
tests/test_model_storagevolume.py | 2 +-
tests/test_rest.py | 2 +-
ui/js/src/kimchi.guest_storage_add.main.js | 2 +-
ui/js/src/kimchi.storage_main.js | 2 +-
11 files changed, 64 insertions(+), 61 deletions(-)
--
2.4.1
9 years, 7 months
[PATCH V4 0/3] Edit guest MAC address
by Jose Ricardo Ziviani
V4:
- Disable MAC changes in a running system.
V3:
- Updated API.json to filter mac address.
- Improved UI code.
V2:
- Updated API.json to reflect only mac address as required parameter.
- Removed input text filters.
- Updated error message.
This patchset implements a new feature in Kimchi, it allows users to edit a guest MAC address.
I have a fork of kimchi in my github, so if you prefer to use their diff tool (syntax highlight) you can check this link out:
https://github.com/kimchi-project/kimchi/compare/master...jrziviani:guest...
Jose Ricardo Ziviani (3):
Implement backend code to edit MAC address of a guest
Implement frontend code to edit MAC address of a guest
Update test cases to reflect MAC address update changes
src/kimchi/API.json | 22 ++++++++--------
src/kimchi/i18n.py | 5 +++-
src/kimchi/model/vmifaces.py | 52 +++++++++++++++++++++++++------------
tests/test_model.py | 13 +++++++---
tests/test_rest.py | 12 +++++----
ui/js/src/kimchi.guest_edit_main.js | 44 +++++++++++++++++++++----------
ui/pages/guest-edit.html.tmpl | 6 +++--
7 files changed, 100 insertions(+), 54 deletions(-)
--
1.9.1
9 years, 7 months
[PATCH 0/5] [Memory HotPlug] Implements backend of memory device hotplug
by Rodrigo Trujillo
This patchset implements the backend part of memory hotplug functionality,
including:
- new feature test to check if libvirt supports memory devices
- changes the way that memory is assigned or updated in the guest xml:
* memory is now set in a basic NUMA node
- includes maxMemory element in the XML:
* which is equal the total memory of the host
* sets memory device slots. The total number of slots are equal the
maxMemory minus the memory assigned (1 slot == 1 GB )
- creates a new VM device, the memory device:
* by default, a memory device will have 1GB
* user can add the memory device with machine running or offline
- memory devices are selected according to its position in the xml (the slot)
0, 1, 2, etc
URL:
- http://localhost:8010/vms/<VM>/memdevices
- http://localhost:8010/vms/<VM>/memdevices/<MEM-DEV>
Rodrigo Trujillo (5):
[Memory HotPlug] Feature test to check support to memory devices
[Memory HotPlug] Add maxMemory and numa configuration to guest xml
[Memory HotPlug] Memory device control and model classes
[Memory HotPlug] Add parameters checking and documentation to memory
device API
[Memory HotPlug] Fix VM offline memory update and fix slots assignment
docs/API.md | 16 +++++++
src/kimchi/API.json | 14 +++++-
src/kimchi/control/vm/memdevices.py | 47 +++++++++++++++++++
src/kimchi/i18n.py | 5 ++
src/kimchi/model/config.py | 3 ++
src/kimchi/model/featuretests.py | 43 +++++++++++++++++
src/kimchi/model/vmmemdevices.py | 94 +++++++++++++++++++++++++++++++++++++
src/kimchi/model/vms.py | 77 +++++++++++++++++++++++++-----
src/kimchi/vmtemplate.py | 40 ++++++++++++----
9 files changed, 316 insertions(+), 23 deletions(-)
create mode 100644 src/kimchi/control/vm/memdevices.py
create mode 100644 src/kimchi/model/vmmemdevices.py
--
2.1.0
9 years, 7 months
[PATCH v2] Supress error messages while checking vm metadata
by Ramon Medeiros
Changes:
v2:
Improve coding to avoid code duplication
The function FeatureTests.disable_libvirt_error_logging only removes the
error message that will be displayed on the console. Libvirt also logs
errors on messages log. To avoid flood messages log with metadata
errors, it will be verified manually if the xml has the tag.
Signed-off-by: Ramon Medeiros <ramonn(a)linux.vnet.ibm.com>
---
src/kimchi/model/utils.py | 38 ++++++++++++++++++++------------------
1 file changed, 20 insertions(+), 18 deletions(-)
diff --git a/src/kimchi/model/utils.py b/src/kimchi/model/utils.py
index 0c9d519..50b0578 100644
--- a/src/kimchi/model/utils.py
+++ b/src/kimchi/model/utils.py
@@ -84,7 +84,6 @@ def _kimchi_set_metadata_node(dom, node):
def libvirt_get_kimchi_metadata_node(dom, mode="current"):
- FeatureTests.disable_libvirt_error_logging()
try:
xml = dom.metadata(libvirt.VIR_DOMAIN_METADATA_ELEMENT,
KIMCHI_META_URL,
@@ -115,36 +114,39 @@ def set_metadata_node(dom, node, metadata_support, mode="all"):
_kimchi_set_metadata_node(dom, node)
-def _kimchi_get_metadata_node(dom, tag):
+def _kimchi_get_metadata_node(xml, tag):
# some other tools will not let libvirt create a persistent
# configuration, just return empty
+ # remove the "kimchi" prefix of xml
+ for elem in xml.getiterator():
+ if not hasattr(elem.tag, 'find'):
+ continue
+ i = elem.tag.find('}')
+ if i >= 0:
+ elem.tag = elem.tag[i+1:]
+
+ objectify.deannotate(xml)
+ etree.cleanup_namespaces(xml)
+ return xml
+
+
+def get_metadata_node(dom, tag, metadata_support, mode="current"):
if not dom.isPersistent():
- return None
+ return ""
xml = dom.XMLDesc(libvirt.VIR_DOMAIN_XML_INACTIVE)
root = etree.fromstring(xml)
kimchi = root.find("metadata/{%s}kimchi" % KIMCHI_META_URL)
- # remove the "kimchi" prefix of xml
- if kimchi is not None:
- for elem in kimchi.getiterator():
- if not hasattr(elem.tag, 'find'):
- continue
- i = elem.tag.find('}')
- if i >= 0:
- elem.tag = elem.tag[i+1:]
-
- objectify.deannotate(kimchi)
- etree.cleanup_namespaces(kimchi)
- return kimchi
- return None
+ # remove the "kimchi" prefix of xml
+ if kimchi is None:
+ return ""
-def get_metadata_node(dom, tag, metadata_support, mode="current"):
if metadata_support:
kimchi = libvirt_get_kimchi_metadata_node(dom, mode)
else:
# FIXME remove this code when all distro libvirt supports metadata
# element
- kimchi = _kimchi_get_metadata_node(dom, tag)
+ kimchi = _kimchi_get_metadata_node(kimchi, tag)
if kimchi is not None:
node = kimchi.find(tag)
--
2.1.0
9 years, 7 months
[PATCH V2] Add vfio driver as default for powerkvm systems.
by Jose Ricardo Ziviani
- ppc hotplug does not work with kvm driver, it must be
vfio by default.
Signed-off-by: Jose Ricardo Ziviani <joserz(a)linux.vnet.ibm.com>
---
src/kimchi/model/vmhostdevs.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/kimchi/model/vmhostdevs.py b/src/kimchi/model/vmhostdevs.py
index 964ec49..516d48f 100644
--- a/src/kimchi/model/vmhostdevs.py
+++ b/src/kimchi/model/vmhostdevs.py
@@ -31,6 +31,7 @@ from kimchi.model.utils import get_vm_config_flag
from kimchi.model.vms import DOM_STATE_MAP, VMModel
from kimchi.rollbackcontext import RollbackContext
from kimchi.utils import kimchi_log, run_command
+import platform
class VMHostDevsModel(object):
@@ -164,6 +165,11 @@ class VMHostDevsModel(object):
driver = ('vfio' if DOM_STATE_MAP[dom.info()[0]] == "shutoff" and
self.caps.kernel_vfio else 'kvm')
+ # on powerkvm systems it must be vfio driver.
+ distro, _, _ = platform.linux_distribution()
+ if distro == 'IBM_PowerKVM':
+ driver = 'vfio'
+
# Attach all PCI devices in the same IOMMU group
dev_model = DeviceModel(conn=self.conn)
devs_model = DevicesModel(conn=self.conn)
--
1.9.1
9 years, 7 months
[RFC] Adding pynotify as dependency to solve YUM API leak
by Daniel Henrique Barboza
Hello everyone,
I've been working in a memory leak in the Host tab, in which every
reload of the tab
adds up 4Mb in the heap mem size of Kimchi. This may seem small but it
really adds up
when running kimchi from a long time and with multiple users.
The leak is being generated in the YUM API, where each new instance is
leaving objects
in the heap. AFAIK it doesn't matter if you force the python GC to clear
the object (calling
del <obj>) because the API reportedly does not clean itself properly due
to circular references
within its code. yum-updated itself runs the API in a separated,
short-lived helper to contain
the leak problems of the API.
The API is used to get the repository list and the packages to be
updated (RPM/YUM distros only).
The latter can be done by parsing yum check-update with minimal debug
level. The former is
a little trickier but can be done by reading the .repo files in
/etc/yum.repos.d.
To make the code smarter (ATM it refreshes all the repos from the rpmdb
every run of
getList() ) I would like to use pyinotify. This is a python API for
inotify, a kernel module
that sends file system notifications to user space. That way I can
refresh the repo
list only if there is any chance in the repository dir.
Thoughts?
9 years, 7 months
[PATCH] Does not list non-bootable ISOs on template creation
by Ramon Medeiros
Signed-off-by: Ramon Medeiros <ramonn(a)linux.vnet.ibm.com>
---
src/kimchi/model/storagevolumes.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/kimchi/model/storagevolumes.py b/src/kimchi/model/storagevolumes.py
index dc807e4..2081fd1 100644
--- a/src/kimchi/model/storagevolumes.py
+++ b/src/kimchi/model/storagevolumes.py
@@ -530,7 +530,7 @@ class IsoVolumesModel(object):
for volume in volumes:
res = self.storagevolume.lookup(pool_name,
volume.decode("utf-8"))
- if res['format'] == 'iso':
+ if res['format'] == 'iso' and res["bootable"] == True:
res['name'] = '%s' % volume
iso_volumes.append(res)
return iso_volumes
--
2.1.0
9 years, 7 months
[PATCH] Removing the hardcoded version of kimchi and make it depend of PACKAGE_VERSION
by Frédéric Bonnard
From: Frederic Bonnard <frediz(a)linux.vnet.ibm.com>
Hi,
Sorry, that patch got half lost last time I sent it, so here is it again fully (eventually).
This patch aims to make "dynamic" the version of kimchi in the manpage,
that is hardcoded at the moment.
It changes one line :
-.TH KIMCHI 8 "February 05, 2015" "Version 1.4.0" "Kimchi Manual"
+.TH KIMCHI 8 "February 05, 2015" "Version @PACKAGE_VERSION@" "Kimchi Manual"
Fred
Frédéric Bonnard (1):
Removing the hardcoded version of kimchi and make it depend of
PACKAGE_VERSION
configure.ac | 1 +
docs/Makefile.am | 2 +
docs/kimchid.8 | 156 ------------------------------------------------------
docs/kimchid.8.in | 156 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 159 insertions(+), 156 deletions(-)
delete mode 100644 docs/kimchid.8
create mode 100644 docs/kimchid.8.in
--
1.9.1
9 years, 7 months
[PATCH] UI: Enable virtual NIC hot plug/unplug
by Aline Manera
Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.guest_edit_main.js | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/ui/js/src/kimchi.guest_edit_main.js b/ui/js/src/kimchi.guest_edit_main.js
index 9c088aa..387dbac 100644
--- a/ui/js/src/kimchi.guest_edit_main.js
+++ b/ui/js/src/kimchi.guest_edit_main.js
@@ -1,7 +1,7 @@
/*
* Project Kimchi
*
- * Copyright IBM, Corp. 2013-2014
+ * Copyright IBM, Corp. 2013-2015
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -180,10 +180,6 @@ kimchi.guest_edit_main = function() {
var itemNode = $.parseHTML(kimchi.substitute($('#interface-tmpl').html(),data));
$(".body", "#form-guest-edit-interface").append(itemNode);
$("select", itemNode).append(networkOptions);
- if(kimchi.thisVMState === "running") {
- $("#form-guest-edit-interface .delete").remove();
- $("#form-guest-edit-interface .edit").remove();
- }
if(data.network!==""){
$("select", itemNode).val(data.network);
}
@@ -642,7 +638,6 @@ kimchi.guest_edit_main = function() {
});
if(kimchi.thisVMState === "running") {
$("#form-guest-edit-general input").prop("disabled", true);
- $("#form-guest-edit-interface .header button").remove();
} else {
$("#action-button-container").removeClass("hidden");
}
--
2.1.0
9 years, 7 months
[PATCH] Change log message if command to run is not found
by Jose Ricardo Ziviani
- When run_command does not find the command it handles
the exception by logging it as an error. However that
might not be an error, but the caller has no chance to
work around it. Now, the exception is logged as debug and
the caller is responsible to check the return code to
decide what to do with such error.
Signed-off-by: Jose Ricardo Ziviani <joserz(a)linux.vnet.ibm.com>
---
src/kimchi/utils.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/kimchi/utils.py b/src/kimchi/utils.py
index d71338a..ff3a5da 100644
--- a/src/kimchi/utils.py
+++ b/src/kimchi/utils.py
@@ -223,6 +223,11 @@ def run_command(cmd, timeout=None):
return out, error, proc.returncode
except TimeoutExpired:
raise
+ except OSError as e:
+ msg = "Impossible to execute '%s'" % ' '.join(cmd)
+ kimchi_log.debug("%s", msg)
+
+ return None, "%s %s" % (msg, e), -1
except Exception as e:
msg = "Failed to run command: %s." % " ".join(cmd)
msg = msg if proc is None else msg + "\n error code: %s."
--
1.9.1
9 years, 7 months