[RFC] Bizarre behaviour with libvirt on CentOS
by Ramon Medeiros
Hi,
i was looking for root cause of this bug:
"After creating a vepa network and adding it to a guest, the same is
listed in Actions->Edit. If the guest is poweron, the interfaces is not
listed".
When offline, libvirt says vepa interface is "type" (i run a GET on
vm/ifaces, see below): "network". When up, this parameter change to
"macvtap", what is breaking UI:
ui/js/src/kimchi.guest_edit_main.js
456 kimchi.getGuestInterfaces(kimchi.selectedGuest, function(data) {
457 for (var i = 0; i < data.length; i++) {
458 data[i].viewMode = "";
459 data[i].editMode = "hide";
460 data[i].id = i;
461 if (data[i].type == 'network')
462 addItem(data[i]);
463 }
464 });
So, the if at 461 fails and the interface is not added. Need to figure
out why libvirt is changing it.
Here is a get at vms/ifaces:
Poweroff:
{
"source":"eth0",
"mac":"52:54:00:2f:48:f4",
"model":"virtio",
"type":"network",
"mode":"vepa"
}
]
Poweron
{
"source":"eth0",
"mac":"52:54:00:2f:48:f4",
"model":"virtio",
"type":"macvtap",
"mode":"vepa"
}
Anyone know how to proceed? Can i open a bug against libvirt?
--
Ramon Nunes Medeiros
Kimchi Developer
Linux Technology Center Brazil
IBM Systems & Technology Group
Phone : +55 19 2132 7878
ramonn(a)br.ibm.com
8 years
[PATCH][Kimchi] Bug fix #1026: CentOS: Unable to get and update memory values for a powered off guest
by Ramon Medeiros
Parse vm memory from xml when it isn't available at dom.info
Signed-off-by: Ramon Medeiros <ramonn(a)linux.vnet.ibm.com>
---
model/vms.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/model/vms.py b/model/vms.py
index bff7ed2..22bb5ec 100644
--- a/model/vms.py
+++ b/model/vms.py
@@ -104,6 +104,7 @@ XPATH_BOOT = 'os/boot/@dev'
XPATH_BOOTMENU = 'os/bootmenu/@enable'
XPATH_CPU = './cpu'
XPATH_DESCRIPTION = './description'
+XPATH_MEMORY = './memory'
XPATH_NAME = './name'
XPATH_NUMA_CELL = './cpu/numa/cell'
XPATH_SNAP_VM_NAME = './domain/name'
@@ -1307,6 +1308,11 @@ class VMModel(object):
if memory != curr_mem:
memory = curr_mem + (self._get_mem_dev_total_size(xml) >> 10)
+ # On CentOS, dom.info does not retrieve memory. So, if machine does
+ # not have memory hotplug, parse memory from xml
+ if memory == 0:
+ memory = int(xpath_get_text(xml, XPATH_MEMORY)[0]) >> 10
+
# assure there is no zombie process left
for proc in self._serial_procs[:]:
if not proc.is_alive():
--
2.7.4
8 years
[PATCH] [Kimchi] Bug fix #1064: In Migrate guest window, text boxes are not taking input properly from keyboard.
by bianca@linux.vnet.ibm.com
From: Bianca Carvalho <bianca(a)linux.vnet.ibm.com>
Changed listVmsAuto function in kimchi.guest_main.js file to not run it
when Migrations modal are opened, so it prevents keyboard input problems
from happenning.
Signed-off-by: Bianca Carvalho <bianca(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.guest_main.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ui/js/src/kimchi.guest_main.js b/ui/js/src/kimchi.guest_main.js
index 21ab262..b08b714 100644
--- a/ui/js/src/kimchi.guest_main.js
+++ b/ui/js/src/kimchi.guest_main.js
@@ -789,7 +789,8 @@ kimchi.listVmsAuto = function() {
//Check if the actions button is opened or not,
//if opended stop the reload of the itens until closed
var $isDropdownOpened = $('[name="guest-actions"] ul.dropdown-menu').is(":visible");
- if (!$isDropdownOpened) {
+ var $isModalOpened = $('#migrate-guest-window').is(":visible");
+ if (!$isDropdownOpened && !$isModalOpened) {
if (kimchi.vmTimeout) {
clearTimeout(kimchi.vmTimeout);
}
--
2.9.3
8 years
[PATCH] [Wok] Bug fix #130: Wok does not support multiple words in plugin tag name
by bianca@linux.vnet.ibm.com
From: Bianca Carvalho <bianca(a)linux.vnet.ibm.com>
Changed parseTabs function in wok.main.js file to replace whitespaces
in the tab's name to raw character, doing that it will be possible to
use more than one word in tab's name.
Signed-off-by: Bianca Carvalho <bianca(a)linux.vnet.ibm.com>
---
ui/js/src/wok.main.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/js/src/wok.main.js b/ui/js/src/wok.main.js
index 8e986f7..658974a 100644
--- a/ui/js/src/wok.main.js
+++ b/ui/js/src/wok.main.js
@@ -82,7 +82,7 @@ wok.main = function() {
var parseTabs = function(plugin, xmlData) {
var tabs = [];
var funcNode = $(xmlData).find('functionality');
- var functionality = funcNode.text();
+ var functionality = funcNode.text().split(' ').join('\xa0');
var colorTab1 = funcNode.attr('colorTab1');
var colorTab2 = funcNode.attr('colorTab2');
wok.pluginsColor[plugin] = colorTab2;
--
2.9.3
8 years
[PATCH] [Wok] Bug fix #163: make check-local: whitespace verification is not excluding imported files
by bianca@linux.vnet.ibm.com
From: Bianca Carvalho <bianca(a)linux.vnet.ibm.com>
Changed Makefile.am to ignore ui imported files (ui/libs).
Signed-off-by: Bianca Carvalho <bianca(a)linux.vnet.ibm.com>
---
Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index 539c6a2..72ffb50 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -64,7 +64,7 @@ check-local:
@if $(GIT) rev-parse &> /dev/null ; then \
echo "Whitespace verification ..."; \
git grep --cached -Il '' | \
- grep -v '^ui/css/src/vendor/' | xargs egrep '.* +$$' \
+ grep -v '^ui/css/src/vendor/\|^ui/libs/' | xargs egrep '.* +$$' \
&& echo "ERROR: Whitespaces found" || echo "Ok"; \
echo "Check IBM license header and copyright date ..." ; \
/bin/bash check-IBM-license-header.sh ; \
--
2.9.3
8 years
[PATCH v3] [Wok] Bug fix #144: The filter of of the user activity log shows loading forever
by bianca@linux.vnet.ibm.com
From: Bianca Carvalho <bianca(a)linux.vnet.ibm.com>
User log data was storing null value to user field, changed the reqlogger.py
and wok.user-log.js to make sure both get 'N/A' instead of null.
Signed-off-by: Bianca Carvalho <bianca(a)linux.vnet.ibm.com>
---
src/wok/reqlogger.py | 2 +-
ui/js/wok.user-log.js | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/wok/reqlogger.py b/src/wok/reqlogger.py
index b51abf1..92e155d 100644
--- a/src/wok/reqlogger.py
+++ b/src/wok/reqlogger.py
@@ -99,7 +99,7 @@ def log_request(code, params, exception, method, status, app=None, user=None,
app = cherrypy.request.app.script_name
if user is None:
- user = cherrypy.session.get(USER_NAME, 'N/A')
+ user = cherrypy.session.get(USER_NAME, 'N/A') or 'N/A'
if ip is None:
ip = cherrypy.request.remote.ip
diff --git a/ui/js/wok.user-log.js b/ui/js/wok.user-log.js
index e49e428..fa4945f 100644
--- a/ui/js/wok.user-log.js
+++ b/ui/js/wok.user-log.js
@@ -155,11 +155,15 @@ wok.initUserLogConfigGridData = function() {
wok.getUserLogs(function(result) {
$.each(result, function(index, log){
var statusLabel = labelStyle(log.status);
+ var userLabel = labelStyle(log.user);
if (statusLabel != null) {
log.status = "<span class='" + statusLabel.labelColor + "'><i class='" + statusLabel.labelIcon + "' aria-hidden='true'></i> " + log.status + "</span> ";
} else {
log.status = "";
}
+ if (userLabel == null) {
+ log.user = "N/A";
+ }
})
wok.loadBootgridData(wok.opts_user_log['gridId'], result);
wok.showBootgridData(wok.opts_user_log);
--
2.9.3
8 years
[PATCH v2 stable][Wok] Bug fix #144: The filter of of the user activity log shows loading forever
by bianca@linux.vnet.ibm.com
From: Bianca Carvalho <bianca(a)linux.vnet.ibm.com>
User log data was storing null value to user field, changed the reqlogger.py
and wok.user-log.js to make sure both get 'N/A' instead of null.
Signed-off-by: Bianca Carvalho <bianca(a)linux.vnet.ibm.com>
---
src/wok/reqlogger.py | 2 +-
ui/js/wok.user-log.js | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/wok/reqlogger.py b/src/wok/reqlogger.py
index 37190dc..49c9589 100644
--- a/src/wok/reqlogger.py
+++ b/src/wok/reqlogger.py
@@ -99,7 +99,7 @@ def log_request(code, params, exception, method, status, app=None, user=None,
app = cherrypy.request.app.script_name
if user is None:
- user = cherrypy.session.get(USER_NAME, 'N/A')
+ user = cherrypy.session.get(USER_NAME, 'N/A') or 'N/A'
if ip is None:
ip = cherrypy.request.remote.ip
diff --git a/ui/js/wok.user-log.js b/ui/js/wok.user-log.js
index e49e428..fa4945f 100644
--- a/ui/js/wok.user-log.js
+++ b/ui/js/wok.user-log.js
@@ -155,11 +155,15 @@ wok.initUserLogConfigGridData = function() {
wok.getUserLogs(function(result) {
$.each(result, function(index, log){
var statusLabel = labelStyle(log.status);
+ var userLabel = labelStyle(log.user);
if (statusLabel != null) {
log.status = "<span class='" + statusLabel.labelColor + "'><i class='" + statusLabel.labelIcon + "' aria-hidden='true'></i> " + log.status + "</span> ";
} else {
log.status = "";
}
+ if (userLabel == null) {
+ log.user = "N/A";
+ }
})
wok.loadBootgridData(wok.opts_user_log['gridId'], result);
wok.showBootgridData(wok.opts_user_log);
--
2.9.3
8 years
[PATCH] [Kimchi] Use libvirtd service in Ubuntu
by Lucio Correia
Starting with Ubuntu 16.10, libvirtd is available, so use it
to keep the same standard across all distributions.
Signed-off-by: Lucio Correia <luciojhc(a)linux.vnet.ibm.com>
---
Makefile.am | 2 +-
contrib/kimchid.service.debian | 8 ++++++++
contrib/kimchid.service.ubuntu | 8 --------
utils.py | 8 +-------
4 files changed, 10 insertions(+), 16 deletions(-)
create mode 100644 contrib/kimchid.service.debian
delete mode 100644 contrib/kimchid.service.ubuntu
diff --git a/Makefile.am b/Makefile.am
index 36607a1..3cbc689 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -158,7 +158,7 @@ install-data-local:
@if test -d "$(systemdsystemunitdir)" ; then \
mkdir -p $(DESTDIR)/etc/systemd/system/wok.service.d; \
if test -f /etc/debian_version; then \
- $(INSTALL_DATA) contrib/kimchid.service.ubuntu $(DESTDIR)/etc/systemd/system/wok.service.d/kimchi.conf; \
+ $(INSTALL_DATA) contrib/kimchid.service.debian $(DESTDIR)/etc/systemd/system/wok.service.d/kimchi.conf; \
else \
$(INSTALL_DATA) contrib/kimchid.service.fedora $(DESTDIR)/etc/systemd/system/wok.service.d/kimchi.conf; \
fi; \
diff --git a/contrib/kimchid.service.debian b/contrib/kimchid.service.debian
new file mode 100644
index 0000000..fc58f6a
--- /dev/null
+++ b/contrib/kimchid.service.debian
@@ -0,0 +1,8 @@
+[Unit]
+Requires=wok.service
+Wants=libvirtd.service
+After=libvirtd.service wok.service
+
+[Service]
+Nice=0
+PrivateTmp=no
diff --git a/contrib/kimchid.service.ubuntu b/contrib/kimchid.service.ubuntu
deleted file mode 100644
index e261942..0000000
--- a/contrib/kimchid.service.ubuntu
+++ /dev/null
@@ -1,8 +0,0 @@
-[Unit]
-Requires=wok.service
-Wants=libvirt-bin.service
-After=libvirt-bin.service wok.service
-
-[Service]
-Nice=0
-PrivateTmp=no
diff --git a/utils.py b/utils.py
index 26d3cf6..1e2c951 100644
--- a/utils.py
+++ b/utils.py
@@ -20,7 +20,6 @@
import contextlib
import json
-import platform
import re
import sqlite3
import time
@@ -264,11 +263,6 @@ def is_libvirtd_up():
"""
Checks if libvirtd.service is up.
"""
- distro, _, _ = platform.linux_distribution()
- if distro.lower() == 'ubuntu':
- cmd = ['systemctl', 'is-active', 'libvirt-bin.service']
- else:
- cmd = ['systemctl', 'is-active', 'libvirtd.service']
-
+ cmd = ['systemctl', 'is-active', 'libvirtd.service']
output, error, rc = run_command(cmd, silent=True)
return True if output == 'active\n' else False
--
2.7.4
8 years
[PATCH] [Kimchi] Use libvirtd service in Ubuntu
by Lucio Correia
Starting with Ubuntu 16.10, libvirtd is available, so use it
to keep the same standard across all distributions.
Signed-off-by: Lucio Correia <luciojhc(a)linux.vnet.ibm.com>
---
Makefile.am | 2 +-
contrib/kimchid.service.debian | 8 ++++++++
contrib/kimchid.service.ubuntu | 8 --------
3 files changed, 9 insertions(+), 9 deletions(-)
create mode 100644 contrib/kimchid.service.debian
delete mode 100644 contrib/kimchid.service.ubuntu
diff --git a/Makefile.am b/Makefile.am
index a4fa712..68cdac0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -161,7 +161,7 @@ install-data-local:
@if test -d "$(systemdsystemunitdir)" ; then \
mkdir -p $(DESTDIR)/etc/systemd/system/wokd.service.d; \
if test -f /etc/debian_version; then \
- $(INSTALL_DATA) contrib/kimchid.service.ubuntu $(DESTDIR)/etc/systemd/system/wokd.service.d/kimchi.conf; \
+ $(INSTALL_DATA) contrib/kimchid.service.debian $(DESTDIR)/etc/systemd/system/wokd.service.d/kimchi.conf; \
else \
$(INSTALL_DATA) contrib/kimchid.service.fedora $(DESTDIR)/etc/systemd/system/wokd.service.d/kimchi.conf; \
fi; \
diff --git a/contrib/kimchid.service.debian b/contrib/kimchid.service.debian
new file mode 100644
index 0000000..87a5866
--- /dev/null
+++ b/contrib/kimchid.service.debian
@@ -0,0 +1,8 @@
+[Unit]
+Requires=wokd.service
+Wants=libvirtd.service
+After=libvirtd.service wokd.service
+
+[Service]
+Nice=0
+PrivateTmp=no
diff --git a/contrib/kimchid.service.ubuntu b/contrib/kimchid.service.ubuntu
deleted file mode 100644
index e52db66..0000000
--- a/contrib/kimchid.service.ubuntu
+++ /dev/null
@@ -1,8 +0,0 @@
-[Unit]
-Requires=wokd.service
-Wants=libvirt-bin.service
-After=libvirt-bin.service wokd.service
-
-[Service]
-Nice=0
-PrivateTmp=no
--
2.7.4
8 years