[PATCH v3] Disabling screen log in production environment
by Daniel Henrique Barboza
When building kimchi's RPM, some messages are getting
logged in /var/log/messages because cherrypy is logging
in the standard output. This happens because a function
in FeatureTests is enabling log.screen regardless of the
current environment. This patch makes a verification that
prevents the screen log to be enabled in the production
environment.
Signed-off-by: Daniel Henrique Barboza <danielhb(a)linux.vnet.ibm.com>
---
src/kimchi/featuretests.py | 31 ++++++++++++++++---------------
src/kimchi/model/utils.py | 4 ++--
src/kimchi/server.py | 6 +++++-
3 files changed, 23 insertions(+), 18 deletions(-)
diff --git a/src/kimchi/featuretests.py b/src/kimchi/featuretests.py
index c6f4687..f1eb8ae 100644
--- a/src/kimchi/featuretests.py
+++ b/src/kimchi/featuretests.py
@@ -80,30 +80,31 @@ SCSI_FC_XML = """
class FeatureTests(object):
@staticmethod
- def disable_screen_error_logging():
+ def disable_libvirt_error_logging():
def libvirt_errorhandler(userdata, error):
# A libvirt error handler to ignore annoying messages in stderr
pass
+ # Filter functions are enable only in production env
+ if cherrypy.config.get('environment') != 'production':
+ return
# Register the error handler to hide libvirt error in stderr
libvirt.registerErrorHandler(f=libvirt_errorhandler, ctx=None)
- # Disable cherrypy screen logging, in order to log errors on kimchi
- # file without displaying them on screen
- cherrypy.log.screen = False
@staticmethod
- def enable_screen_error_logging():
+ def enable_libvirt_error_logging():
+ # Filter functions are enable only in production env
+ if cherrypy.config.get('environment') != 'production':
+ return
# Unregister the error handler
libvirt.registerErrorHandler(f=None, ctx=None)
- # Enable cherrypy screen logging
- cherrypy.log.screen = True
@staticmethod
def libvirt_supports_iso_stream(protocol):
xml = ISO_STREAM_XML % {'protocol': protocol}
conn = None
try:
- FeatureTests.disable_screen_error_logging()
+ FeatureTests.disable_libvirt_error_logging()
conn = libvirt.open(None)
dom = conn.defineXML(xml)
dom.undefine()
@@ -112,7 +113,7 @@ class FeatureTests(object):
kimchi_log.error(e.message)
return False
finally:
- FeatureTests.enable_screen_error_logging()
+ FeatureTests.enable_libvirt_error_logging()
conn is None or conn.close()
@staticmethod
@@ -123,7 +124,7 @@ class FeatureTests(object):
return xml
try:
conn = libvirt.open(None)
- FeatureTests.disable_screen_error_logging()
+ FeatureTests.disable_libvirt_error_logging()
conn.findStoragePoolSources('netfs', _get_xml(), 0)
except libvirt.libvirtError as e:
kimchi_log.error(e.message)
@@ -132,7 +133,7 @@ class FeatureTests(object):
# it returns 38--general system call failure
return False
finally:
- FeatureTests.enable_screen_error_logging()
+ FeatureTests.enable_libvirt_error_logging()
conn is None or conn.close()
return True
@@ -173,7 +174,7 @@ class FeatureTests(object):
@staticmethod
def libvirt_support_fc_host():
try:
- FeatureTests.disable_screen_error_logging()
+ FeatureTests.disable_libvirt_error_logging()
conn = libvirt.open(None)
pool = None
pool = conn.storagePoolDefineXML(SCSI_FC_XML, 0)
@@ -182,7 +183,7 @@ class FeatureTests(object):
# Libvirt requires adapter name, not needed when supports to FC
return False
finally:
- FeatureTests.enable_screen_error_logging()
+ FeatureTests.enable_libvirt_error_logging()
pool is None or pool.undefine()
conn is None or conn.close()
return True
@@ -192,8 +193,8 @@ class FeatureTests(object):
KIMCHI_META_URL = "https://github.com/kimchi-project/kimchi/"
KIMCHI_NAMESPACE = "kimchi"
with RollbackContext() as rollback:
- FeatureTests.disable_screen_error_logging()
- rollback.prependDefer(FeatureTests.enable_screen_error_logging)
+ FeatureTests.disable_libvirt_error_logging()
+ rollback.prependDefer(FeatureTests.enable_libvirt_error_logging)
conn = libvirt.open(None)
rollback.prependDefer(conn.close)
dom = conn.defineXML(SIMPLE_VM_XML)
diff --git a/src/kimchi/model/utils.py b/src/kimchi/model/utils.py
index ac7086a..4d8e65a 100644
--- a/src/kimchi/model/utils.py
+++ b/src/kimchi/model/utils.py
@@ -85,7 +85,7 @@ def _kimchi_set_metadata_node(dom, node):
def libvirt_get_kimchi_metadata_node(dom, mode="current"):
- FeatureTests.disable_screen_error_logging()
+ FeatureTests.disable_libvirt_error_logging()
try:
xml = dom.metadata(libvirt.VIR_DOMAIN_METADATA_ELEMENT,
KIMCHI_META_URL,
@@ -94,7 +94,7 @@ def libvirt_get_kimchi_metadata_node(dom, mode="current"):
except libvirt.libvirtError:
return None
finally:
- FeatureTests.enable_screen_error_logging()
+ FeatureTests.enable_libvirt_error_logging()
def set_metadata_node(dom, node, mode="all"):
diff --git a/src/kimchi/server.py b/src/kimchi/server.py
index 8d166e5..6cc7143 100644
--- a/src/kimchi/server.py
+++ b/src/kimchi/server.py
@@ -91,13 +91,17 @@ class Server(object):
max_body_size_in_bytes = eval(options.max_body_size) * 1024
cherrypy.server.max_request_body_size = max_body_size_in_bytes
- cherrypy.log.screen = True
cherrypy.log.access_file = options.access_log
cherrypy.log.error_file = options.error_log
logLevel = LOGGING_LEVEL.get(options.log_level, logging.DEBUG)
dev_env = options.environment != 'production'
+ # Enable cherrypy screen logging if running environment
+ # is not 'production'
+ if dev_env:
+ cherrypy.log.screen = True
+
# Create handler to rotate access log file
h = logging.handlers.RotatingFileHandler(options.access_log, 'a',
10000000, 1000)
--
1.8.3.1
10 years, 2 months
[PATCH 0/2] Create a xmlutils module to hold all the XML manipulation
by Aline Manera
It is the first step to do a VMTemplate refactor, as all the XML manipulation
will be in a single place.
Aline Manera (2):
Create a xmlutils module to hold all the XML manipulation
Move networkxml.py to xmlutils module and update it to use
lxml.builder
src/kimchi/config.py.in | 2 +-
src/kimchi/model/host.py | 4 +-
src/kimchi/model/hostdev.py | 2 +-
src/kimchi/model/networks.py | 30 ++++-----
src/kimchi/model/storagepools.py | 16 ++---
src/kimchi/model/storagevolumes.py | 5 +-
src/kimchi/model/templates.py | 8 +--
src/kimchi/model/vms.py | 21 +++---
src/kimchi/networkxml.py | 127 -------------------------------------
src/kimchi/xmlutils.py | 63 ------------------
src/kimchi/xmlutils/__init__.py | 18 ++++++
src/kimchi/xmlutils/network.py | 123 +++++++++++++++++++++++++++++++++++
src/kimchi/xmlutils/utils.py | 63 ++++++++++++++++++
tests/test_networkxml.py | 29 ++++-----
tests/test_vmtemplate.py | 2 +-
15 files changed, 261 insertions(+), 252 deletions(-)
delete mode 100644 src/kimchi/networkxml.py
delete mode 100644 src/kimchi/xmlutils.py
create mode 100644 src/kimchi/xmlutils/__init__.py
create mode 100644 src/kimchi/xmlutils/network.py
create mode 100644 src/kimchi/xmlutils/utils.py
--
1.9.3
10 years, 2 months
[PATCH 0/2 V4] Detect and enable help page from plugins tabs
by Rodrigo Trujillo
This patch set changes the way Kimchi loads Help pages of the tabs of
the plugins.
It also changes the Sample plugin, in order to demonstrate and show
properly how to configure the a Help page
Rodrigo Trujillo (2):
Fix problems to open plugin's help pages
Changes in sample plugin to fix and improve help
configure.ac | 1 -
plugins/sample/Makefile.am | 12 +++++
plugins/sample/sample.conf.in | 5 ++
plugins/sample/ui/config/tab-ext.xml | 11 ++++-
plugins/sample/ui/pages/Makefile.am | 2 +-
.../sample/ui/pages/help/en_US/sample-tab1.html | 1 +
.../sample/ui/pages/help/en_US/sample-tab2.html | 1 +
plugins/sample/ui/pages/sample-tab1.html.tmpl | 30 ++++++++++++
plugins/sample/ui/pages/sample-tab2.html.tmpl | 30 ++++++++++++
plugins/sample/ui/pages/tab.html.tmpl | 30 ------------
ui/js/src/kimchi.main.js | 53 ++++++++++++++++------
11 files changed, 129 insertions(+), 47 deletions(-)
create mode 100644 plugins/sample/ui/pages/help/en_US/sample-tab1.html
create mode 100644 plugins/sample/ui/pages/help/en_US/sample-tab2.html
create mode 100644 plugins/sample/ui/pages/sample-tab1.html.tmpl
create mode 100644 plugins/sample/ui/pages/sample-tab2.html.tmpl
delete mode 100644 plugins/sample/ui/pages/tab.html.tmpl
--
1.9.3
10 years, 2 months
[PATCH 0/6 V2] Use installed spice-html5 package when possible
by Aline Manera
V1 -> V2:
- Check novnc/spice directory exists otherwise fallback to default directory
/usr/share/<novnc|spice-html5>
- Fix conditional to properly use --with-spice-html5 in kimchi.spec.fedora.in
Aline Manera (6):
Import the latest spice-html5 code into Kimchi
Modify spice_auto.html for Kimchi proposals
Add new spice-html5 code to Kimchi build process
Update Kimchi to use the installed spice-html5
Delete former imported spice code
Update COPYING content to expose the imported code
COPYING | 10 +-
configure.ac | 15 +-
contrib/DEBIAN/control.in | 3 +-
contrib/kimchi.spec.fedora.in | 30 +-
contrib/kimchi.spec.suse.in | 24 +-
docs/README.md | 10 +-
src/kimchi/Makefile.am | 11 +-
src/kimchi/config.py.in | 42 +-
tests/test_config.py.in | 15 +-
ui/Makefile.am | 2 +-
ui/css/Makefile.am | 2 -
ui/css/spice/Makefile.am | 20 -
ui/css/spice/spice.css | 115 ---
ui/js/Makefile.am | 2 -
ui/js/spice/Makefile.am | 22 -
ui/js/spice/atKeynames.js | 183 -----
ui/js/spice/bitmap.js | 51 --
ui/js/spice/cursor.js | 92 ---
ui/js/spice/display.js | 806 --------------------
ui/js/spice/enums.js | 282 -------
ui/js/spice/inputs.js | 251 -------
ui/js/spice/jsbn.js | 589 ---------------
ui/js/spice/lz.js | 166 ----
ui/js/spice/main.js | 176 -----
ui/js/spice/png.js | 256 -------
ui/js/spice/prng4.js | 79 --
ui/js/spice/quic.js | 1335 ---------------------------------
ui/js/spice/rng.js | 102 ---
ui/js/spice/rsa.js | 146 ----
ui/js/spice/sha1.js | 346 ---------
ui/js/spice/spiceconn.js | 447 -----------
ui/js/spice/spicedataview.js | 96 ---
ui/js/spice/spicemsg.js | 883 ----------------------
ui/js/spice/spicetype.js | 480 ------------
ui/js/spice/ticket.js | 250 ------
ui/js/spice/utils.js | 261 -------
ui/js/spice/wire.js | 123 ---
ui/js/src/kimchi.api.js | 2 +-
ui/pages/spice.html.tmpl | 140 ----
ui/spice-html5/Makefile.am | 25 +
ui/spice-html5/atKeynames.js | 183 +++++
ui/spice-html5/bitmap.js | 51 ++
ui/spice-html5/css/Makefile.am | 20 +
ui/spice-html5/css/spice.css | 118 +++
ui/spice-html5/cursor.js | 110 +++
ui/spice-html5/display.js | 823 ++++++++++++++++++++
ui/spice-html5/enums.js | 324 ++++++++
ui/spice-html5/inputs.js | 280 +++++++
ui/spice-html5/lz.js | 166 ++++
ui/spice-html5/main.js | 231 ++++++
ui/spice-html5/pages/Makefile.am | 20 +
ui/spice-html5/pages/spice_auto.html | 200 +++++
ui/spice-html5/playback.js | 278 +++++++
ui/spice-html5/png.js | 256 +++++++
ui/spice-html5/quic.js | 1335 +++++++++++++++++++++++++++++++++
ui/spice-html5/resize.js | 70 ++
ui/spice-html5/simulatecursor.js | 202 +++++
ui/spice-html5/spicearraybuffer.js | 58 ++
ui/spice-html5/spiceconn.js | 460 ++++++++++++
ui/spice-html5/spicedataview.js | 120 +++
ui/spice-html5/spicemsg.js | 1047 ++++++++++++++++++++++++++
ui/spice-html5/spicetype.js | 473 ++++++++++++
ui/spice-html5/thirdparty/Makefile.am | 20 +
ui/spice-html5/thirdparty/jsbn.js | 589 +++++++++++++++
ui/spice-html5/thirdparty/prng4.js | 79 ++
ui/spice-html5/thirdparty/rng.js | 102 +++
ui/spice-html5/thirdparty/rsa.js | 146 ++++
ui/spice-html5/thirdparty/sha1.js | 346 +++++++++
ui/spice-html5/ticket.js | 250 ++++++
ui/spice-html5/utils.js | 265 +++++++
ui/spice-html5/webm.js | 553 ++++++++++++++
ui/spice-html5/wire.js | 123 +++
72 files changed, 9425 insertions(+), 7763 deletions(-)
delete mode 100644 ui/css/spice/Makefile.am
delete mode 100644 ui/css/spice/spice.css
delete mode 100644 ui/js/spice/Makefile.am
delete mode 100644 ui/js/spice/atKeynames.js
delete mode 100644 ui/js/spice/bitmap.js
delete mode 100644 ui/js/spice/cursor.js
delete mode 100644 ui/js/spice/display.js
delete mode 100644 ui/js/spice/enums.js
delete mode 100644 ui/js/spice/inputs.js
delete mode 100644 ui/js/spice/jsbn.js
delete mode 100644 ui/js/spice/lz.js
delete mode 100644 ui/js/spice/main.js
delete mode 100644 ui/js/spice/png.js
delete mode 100644 ui/js/spice/prng4.js
delete mode 100644 ui/js/spice/quic.js
delete mode 100644 ui/js/spice/rng.js
delete mode 100644 ui/js/spice/rsa.js
delete mode 100644 ui/js/spice/sha1.js
delete mode 100644 ui/js/spice/spiceconn.js
delete mode 100644 ui/js/spice/spicedataview.js
delete mode 100644 ui/js/spice/spicemsg.js
delete mode 100644 ui/js/spice/spicetype.js
delete mode 100644 ui/js/spice/ticket.js
delete mode 100644 ui/js/spice/utils.js
delete mode 100644 ui/js/spice/wire.js
delete mode 100644 ui/pages/spice.html.tmpl
create mode 100644 ui/spice-html5/Makefile.am
create mode 100644 ui/spice-html5/atKeynames.js
create mode 100644 ui/spice-html5/bitmap.js
create mode 100644 ui/spice-html5/css/Makefile.am
create mode 100644 ui/spice-html5/css/spice.css
create mode 100644 ui/spice-html5/cursor.js
create mode 100644 ui/spice-html5/display.js
create mode 100644 ui/spice-html5/enums.js
create mode 100644 ui/spice-html5/inputs.js
create mode 100644 ui/spice-html5/lz.js
create mode 100644 ui/spice-html5/main.js
create mode 100644 ui/spice-html5/pages/Makefile.am
create mode 100644 ui/spice-html5/pages/spice_auto.html
create mode 100644 ui/spice-html5/playback.js
create mode 100644 ui/spice-html5/png.js
create mode 100644 ui/spice-html5/quic.js
create mode 100644 ui/spice-html5/resize.js
create mode 100644 ui/spice-html5/simulatecursor.js
create mode 100644 ui/spice-html5/spicearraybuffer.js
create mode 100644 ui/spice-html5/spiceconn.js
create mode 100644 ui/spice-html5/spicedataview.js
create mode 100644 ui/spice-html5/spicemsg.js
create mode 100644 ui/spice-html5/spicetype.js
create mode 100644 ui/spice-html5/thirdparty/Makefile.am
create mode 100644 ui/spice-html5/thirdparty/jsbn.js
create mode 100644 ui/spice-html5/thirdparty/prng4.js
create mode 100644 ui/spice-html5/thirdparty/rng.js
create mode 100644 ui/spice-html5/thirdparty/rsa.js
create mode 100644 ui/spice-html5/thirdparty/sha1.js
create mode 100644 ui/spice-html5/ticket.js
create mode 100644 ui/spice-html5/utils.js
create mode 100644 ui/spice-html5/webm.js
create mode 100644 ui/spice-html5/wire.js
--
1.9.3
10 years, 2 months
[PATCH v2] Disabling screen log in production environment
by Daniel Henrique Barboza
When building kimchi's RPM, some messages are getting
logged in /var/log/messages because cherrypy is logging
in the standard output. This happens because a function
in FeatureTests is enabling log.screen regardless of the
current environment. This patch makes a verification that
prevents the screen log to be enabled in the production
environment.
Signed-off-by: Daniel Henrique Barboza <danielhb(a)linux.vnet.ibm.com>
---
src/kimchi/featuretests.py | 31 ++++++++++++++++---------------
src/kimchi/server.py | 6 +++++-
2 files changed, 21 insertions(+), 16 deletions(-)
diff --git a/src/kimchi/featuretests.py b/src/kimchi/featuretests.py
index c6f4687..f1eb8ae 100644
--- a/src/kimchi/featuretests.py
+++ b/src/kimchi/featuretests.py
@@ -80,30 +80,31 @@ SCSI_FC_XML = """
class FeatureTests(object):
@staticmethod
- def disable_screen_error_logging():
+ def disable_libvirt_error_logging():
def libvirt_errorhandler(userdata, error):
# A libvirt error handler to ignore annoying messages in stderr
pass
+ # Filter functions are enable only in production env
+ if cherrypy.config.get('environment') != 'production':
+ return
# Register the error handler to hide libvirt error in stderr
libvirt.registerErrorHandler(f=libvirt_errorhandler, ctx=None)
- # Disable cherrypy screen logging, in order to log errors on kimchi
- # file without displaying them on screen
- cherrypy.log.screen = False
@staticmethod
- def enable_screen_error_logging():
+ def enable_libvirt_error_logging():
+ # Filter functions are enable only in production env
+ if cherrypy.config.get('environment') != 'production':
+ return
# Unregister the error handler
libvirt.registerErrorHandler(f=None, ctx=None)
- # Enable cherrypy screen logging
- cherrypy.log.screen = True
@staticmethod
def libvirt_supports_iso_stream(protocol):
xml = ISO_STREAM_XML % {'protocol': protocol}
conn = None
try:
- FeatureTests.disable_screen_error_logging()
+ FeatureTests.disable_libvirt_error_logging()
conn = libvirt.open(None)
dom = conn.defineXML(xml)
dom.undefine()
@@ -112,7 +113,7 @@ class FeatureTests(object):
kimchi_log.error(e.message)
return False
finally:
- FeatureTests.enable_screen_error_logging()
+ FeatureTests.enable_libvirt_error_logging()
conn is None or conn.close()
@staticmethod
@@ -123,7 +124,7 @@ class FeatureTests(object):
return xml
try:
conn = libvirt.open(None)
- FeatureTests.disable_screen_error_logging()
+ FeatureTests.disable_libvirt_error_logging()
conn.findStoragePoolSources('netfs', _get_xml(), 0)
except libvirt.libvirtError as e:
kimchi_log.error(e.message)
@@ -132,7 +133,7 @@ class FeatureTests(object):
# it returns 38--general system call failure
return False
finally:
- FeatureTests.enable_screen_error_logging()
+ FeatureTests.enable_libvirt_error_logging()
conn is None or conn.close()
return True
@@ -173,7 +174,7 @@ class FeatureTests(object):
@staticmethod
def libvirt_support_fc_host():
try:
- FeatureTests.disable_screen_error_logging()
+ FeatureTests.disable_libvirt_error_logging()
conn = libvirt.open(None)
pool = None
pool = conn.storagePoolDefineXML(SCSI_FC_XML, 0)
@@ -182,7 +183,7 @@ class FeatureTests(object):
# Libvirt requires adapter name, not needed when supports to FC
return False
finally:
- FeatureTests.enable_screen_error_logging()
+ FeatureTests.enable_libvirt_error_logging()
pool is None or pool.undefine()
conn is None or conn.close()
return True
@@ -192,8 +193,8 @@ class FeatureTests(object):
KIMCHI_META_URL = "https://github.com/kimchi-project/kimchi/"
KIMCHI_NAMESPACE = "kimchi"
with RollbackContext() as rollback:
- FeatureTests.disable_screen_error_logging()
- rollback.prependDefer(FeatureTests.enable_screen_error_logging)
+ FeatureTests.disable_libvirt_error_logging()
+ rollback.prependDefer(FeatureTests.enable_libvirt_error_logging)
conn = libvirt.open(None)
rollback.prependDefer(conn.close)
dom = conn.defineXML(SIMPLE_VM_XML)
diff --git a/src/kimchi/server.py b/src/kimchi/server.py
index 8d166e5..6cc7143 100644
--- a/src/kimchi/server.py
+++ b/src/kimchi/server.py
@@ -91,13 +91,17 @@ class Server(object):
max_body_size_in_bytes = eval(options.max_body_size) * 1024
cherrypy.server.max_request_body_size = max_body_size_in_bytes
- cherrypy.log.screen = True
cherrypy.log.access_file = options.access_log
cherrypy.log.error_file = options.error_log
logLevel = LOGGING_LEVEL.get(options.log_level, logging.DEBUG)
dev_env = options.environment != 'production'
+ # Enable cherrypy screen logging if running environment
+ # is not 'production'
+ if dev_env:
+ cherrypy.log.screen = True
+
# Create handler to rotate access log file
h = logging.handlers.RotatingFileHandler(options.access_log, 'a',
10000000, 1000)
--
1.8.3.1
10 years, 2 months
[PATCH v5] Backend support for templates with sockets, cores, and threads
by Christy Perez
In order to allow a guest to use SMT/hyperthreading, we should
enable passing in of the sockets, cores, and threads values when
creating a template.
All three values must be specified, as per the topology descr at
http://libvirt.org/formatdomain.html#elementsCPU
v4->v5:
- Fix format issues
- Remove if check for cpu_info in control, and set cpu_info
to the empty string in model if None
- Add format requirements error for topology requirements.
- Add new error to toplogy in API.json
- Update po files
v3->v4:
- Remove the unused cpu_ elements from common_spec
- Pass new_t into validate function to reduce complexity
- Rearrange code to decrese indents in _get_cpu_xml
v2->v3:
- Set vcpus based on topology, if specified.
- Move the update cpu+topology validation out to a function
for redability
- Add a minimum value of 1 for topology values
- Leave new English error msg as empty string
- Update the API documentation on cpu defaults
v1->v2:
- Added a check to make sure that vcpus = sockets*cores*threads
- Set individual topoology params to required in API.json
- Change the topology object types from string to integer
- Always return cpu_info from templates lookup()
- Removed check for cpu_info in to_vm_xml
- Build cpu_info xml using lxml.builder instead of string
- CPU and topology verification on template update
Signed-off-by: Christy Perez <christy(a)linux.vnet.ibm.com>
---
docs/API.md | 13 ++++++++++-
po/de_DE.po | 49 +++++++++++++++++++++++++++++++++++++-
po/en_US.po | 49 +++++++++++++++++++++++++++++++++++++-
po/es_ES.po | 49 +++++++++++++++++++++++++++++++++++++-
po/fr_FR.po | 49 +++++++++++++++++++++++++++++++++++++-
po/it_IT.po | 49 +++++++++++++++++++++++++++++++++++++-
po/ja_JP.po | 49 +++++++++++++++++++++++++++++++++++++-
po/kimchi.pot | 49 +++++++++++++++++++++++++++++++++++++-
po/ko_KR.po | 49 +++++++++++++++++++++++++++++++++++++-
po/pt_BR.po | 48 ++++++++++++++++++++++++++++++++++++-
po/ru_RU.po | 49 +++++++++++++++++++++++++++++++++++++-
po/zh_CN.po | 52 +++++++++++++++++++++++++++++++++++++----
po/zh_TW.po | 49 +++++++++++++++++++++++++++++++++++++-
src/kimchi/API.json | 36 ++++++++++++++++++++++++++--
src/kimchi/control/templates.py | 31 +++++++++++++-----------
src/kimchi/i18n.py | 2 ++
src/kimchi/model/templates.py | 33 ++++++++++++++++++++++++++
src/kimchi/osinfo.py | 5 ++--
src/kimchi/vmtemplate.py | 16 +++++++++++++
19 files changed, 690 insertions(+), 36 deletions(-)
diff --git a/docs/API.md b/docs/API.md
index 92fbbd5..6984649 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -194,7 +194,9 @@ Represents a snapshot of the Virtual Machine's primary monitor.
* name: The name of the Template. Used to identify the Template in this API
* os_distro *(optional)*: The operating system distribution
* os_version *(optional)*: The version of the operating system distribution
- * cpus *(optional)*: The number of CPUs assigned to the VM. Default is 1.
+ * cpus *(optional)*: The number of CPUs assigned to the VM.
+ Default is 1, unlees specifying a cpu topology. In that case, cpus
+ will default to a product of the topology values (see cpu_info).
* memory *(optional)*: The amount of memory assigned to the VM.
Default is 1024M.
* cdrom *(optional)*: A volume name or URI to an ISO image.
@@ -216,6 +218,15 @@ Represents a snapshot of the Virtual Machine's primary monitor.
Independent Computing Environments
* null: Graphics is disabled or type not supported
* listen: The network which the vnc/spice server listens on.
+ * cpu_info *(optional)*: CPU-specific information.
+ * topology: Specify sockets, threads, and cores to run the virtual CPU
+ threads on.
+ All three are required in order to specify cpu topology.
+ * sockets - The number of sockets to use.
+ * cores - The number of cores per socket.
+ * threads - The number of threads per core.
+ If specifying both cpus and CPU topology, make sure cpus is
+ equal to the product of sockets, cores, and threads.
### Sub-Collection: Virtual Machine Network Interfaces
diff --git a/po/de_DE.po b/po/de_DE.po
index 98bde90..9d4cf00 100644
--- a/po/de_DE.po
+++ b/po/de_DE.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-09-25 13:47-0300\n"
+"POT-Creation-Date: 2014-10-14 10:45-0500\n"
"PO-Revision-Date: 2013-07-11 17:32-0400\n"
"Last-Translator: Crístian Viana <vianac(a)linux.vnet.ibm.com>\n"
"Language-Team: English\n"
@@ -70,6 +70,15 @@ msgstr "Sie sind nicht berechtigt, auf Kimchi zuzugreifen"
msgid "Specify %(item)s to login into Kimchi"
msgstr "Geben Sie %(item)s an, um sich bei Kimchi anzumelden"
+msgid "Unknown \"_cap\" specified"
+msgstr ""
+
+msgid "\"_passthrough\" should be \"true\" or \"false\""
+msgstr ""
+
+msgid "\"_passthrough_affected_by\" should be a device name string"
+msgstr ""
+
#, python-format
msgid "Error while getting block devices. Details: %(err)s"
msgstr "Fehler beim Abrufen von Blockeinheiten. Details: %(err)s"
@@ -284,6 +293,26 @@ msgid "The life time for the guest console password must be a number."
msgstr ""
#, python-format
+msgid ""
+"VM %(vmid)s does not contain directly assigned host device %(dev_name)s."
+msgstr ""
+
+#, python-format
+msgid "The host device %(dev_name)s is not allowed to directly assign to VM."
+msgstr ""
+
+msgid ""
+"No IOMMU groups found. Host PCI pass through needs IOMMU group to function "
+"correctly. Please enable Intel VT-d or AMD IOMMU in your BIOS, then verify "
+"the Kernel is compiled with IOMMU support. For Intel CPU, add intel_iommu=on "
+"to your Kernel parameter in /boot/grub2/grub.conf. For AMD CPU, add iommu=pt "
+"iommu=1."
+msgstr ""
+
+msgid "\"name\" should be a device name string"
+msgstr ""
+
+#, python-format
msgid "Interface %(iface)s does not exist in virtual machine %(name)s"
msgstr ""
"Schnittstelle %(iface)s ist in virtueller Maschine %(name)s nicht vorhanden"
@@ -416,6 +445,16 @@ msgstr "Vorlagen-CD-ROM muss eine lokale oder ferne ISO-Datei sein"
msgid "Cannot identify base image %(path)s format"
msgstr ""
+msgid ""
+"When specifying CPU topology, VCPUs must be a product of sockets, cores, and "
+"threads."
+msgstr ""
+
+msgid ""
+"When specifying CPU topology, each element must be an integer greater than "
+"zero."
+msgstr ""
+
#, python-format
msgid "Storage pool %(name)s already exists"
msgstr "Speicherpool %(name)s ist bereits vorhanden"
@@ -850,6 +889,9 @@ msgstr ""
msgid "Node device '%(name)s' not found"
msgstr "Knoteneinheit '%(name)s' nicht gefunden"
+msgid "Conflicting flag filters specified."
+msgstr ""
+
msgid "No packages marked for update"
msgstr "Keine Pakete für Aktualisierung markiert"
@@ -1055,6 +1097,11 @@ msgstr "Repository konnte nicht hinzugefügt werden. Details: '%(err)s'"
msgid "Unable to remove repository. Details: '%(err)s'"
msgstr "Repository konnte nicht entfernt werden. Details: '%(err)s'"
+#, python-format
+msgid ""
+"Configuration items: '%(items)s' are not supported by repository manager"
+msgstr ""
+
msgid "ERROR CODE"
msgstr "FEHLERCODE"
diff --git a/po/en_US.po b/po/en_US.po
index eb571ca..14ed24b 100644
--- a/po/en_US.po
+++ b/po/en_US.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-09-25 13:47-0300\n"
+"POT-Creation-Date: 2014-10-14 10:45-0500\n"
"PO-Revision-Date: 2013-07-11 17:32-0400\n"
"Last-Translator: Crístian Viana <vianac(a)linux.vnet.ibm.com>\n"
"Language-Team: English\n"
@@ -68,6 +68,15 @@ msgstr ""
msgid "Specify %(item)s to login into Kimchi"
msgstr ""
+msgid "Unknown \"_cap\" specified"
+msgstr ""
+
+msgid "\"_passthrough\" should be \"true\" or \"false\""
+msgstr ""
+
+msgid "\"_passthrough_affected_by\" should be a device name string"
+msgstr ""
+
#, python-format
msgid "Error while getting block devices. Details: %(err)s"
msgstr ""
@@ -259,6 +268,26 @@ msgid "The life time for the guest console password must be a number."
msgstr ""
#, python-format
+msgid ""
+"VM %(vmid)s does not contain directly assigned host device %(dev_name)s."
+msgstr ""
+
+#, python-format
+msgid "The host device %(dev_name)s is not allowed to directly assign to VM."
+msgstr ""
+
+msgid ""
+"No IOMMU groups found. Host PCI pass through needs IOMMU group to function "
+"correctly. Please enable Intel VT-d or AMD IOMMU in your BIOS, then verify "
+"the Kernel is compiled with IOMMU support. For Intel CPU, add intel_iommu=on "
+"to your Kernel parameter in /boot/grub2/grub.conf. For AMD CPU, add iommu=pt "
+"iommu=1."
+msgstr ""
+
+msgid "\"name\" should be a device name string"
+msgstr ""
+
+#, python-format
msgid "Interface %(iface)s does not exist in virtual machine %(name)s"
msgstr ""
@@ -371,6 +400,16 @@ msgstr ""
msgid "Cannot identify base image %(path)s format"
msgstr ""
+msgid ""
+"When specifying CPU topology, VCPUs must be a product of sockets, cores, and "
+"threads."
+msgstr ""
+
+msgid ""
+"When specifying CPU topology, each element must be an integer greater than "
+"zero."
+msgstr ""
+
#, python-format
msgid "Storage pool %(name)s already exists"
msgstr ""
@@ -744,6 +783,9 @@ msgstr ""
msgid "Node device '%(name)s' not found"
msgstr ""
+msgid "Conflicting flag filters specified."
+msgstr ""
+
msgid "No packages marked for update"
msgstr ""
@@ -931,6 +973,11 @@ msgstr ""
msgid "Unable to remove repository. Details: '%(err)s'"
msgstr ""
+#, python-format
+msgid ""
+"Configuration items: '%(items)s' are not supported by repository manager"
+msgstr ""
+
msgid "ERROR CODE"
msgstr ""
diff --git a/po/es_ES.po b/po/es_ES.po
index 5a3fa46..1709b10 100644
--- a/po/es_ES.po
+++ b/po/es_ES.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-09-25 13:47-0300\n"
+"POT-Creation-Date: 2014-10-14 10:45-0500\n"
"PO-Revision-Date: 2013-07-11 17:32-0400\n"
"Last-Translator: Crístian Viana <vianac(a)linux.vnet.ibm.com>\n"
"Language-Team: English\n"
@@ -69,6 +69,15 @@ msgstr "No tiene autorización para acceder a Kimchi"
msgid "Specify %(item)s to login into Kimchi"
msgstr "Especifique %(item)s para iniciar la sesión en Kimchi"
+msgid "Unknown \"_cap\" specified"
+msgstr ""
+
+msgid "\"_passthrough\" should be \"true\" or \"false\""
+msgstr ""
+
+msgid "\"_passthrough_affected_by\" should be a device name string"
+msgstr ""
+
#, python-format
msgid "Error while getting block devices. Details: %(err)s"
msgstr ""
@@ -284,6 +293,26 @@ msgid "The life time for the guest console password must be a number."
msgstr ""
#, python-format
+msgid ""
+"VM %(vmid)s does not contain directly assigned host device %(dev_name)s."
+msgstr ""
+
+#, python-format
+msgid "The host device %(dev_name)s is not allowed to directly assign to VM."
+msgstr ""
+
+msgid ""
+"No IOMMU groups found. Host PCI pass through needs IOMMU group to function "
+"correctly. Please enable Intel VT-d or AMD IOMMU in your BIOS, then verify "
+"the Kernel is compiled with IOMMU support. For Intel CPU, add intel_iommu=on "
+"to your Kernel parameter in /boot/grub2/grub.conf. For AMD CPU, add iommu=pt "
+"iommu=1."
+msgstr ""
+
+msgid "\"name\" should be a device name string"
+msgstr ""
+
+#, python-format
msgid "Interface %(iface)s does not exist in virtual machine %(name)s"
msgstr "La interfaz %(iface)s no existe en la máquina virtual %(name)s"
@@ -413,6 +442,16 @@ msgstr "El CDROM de plantilla debe ser un archivo ISO local o remoto"
msgid "Cannot identify base image %(path)s format"
msgstr ""
+msgid ""
+"When specifying CPU topology, VCPUs must be a product of sockets, cores, and "
+"threads."
+msgstr ""
+
+msgid ""
+"When specifying CPU topology, each element must be an integer greater than "
+"zero."
+msgstr ""
+
#, python-format
msgid "Storage pool %(name)s already exists"
msgstr "La agrupación de almacenamiento %(name)s ya existe"
@@ -863,6 +902,9 @@ msgstr ""
msgid "Node device '%(name)s' not found"
msgstr "No se ha encontrado el dispositivo de nodo '%(name)s'"
+msgid "Conflicting flag filters specified."
+msgstr ""
+
msgid "No packages marked for update"
msgstr "No hay paquetes marcados para su actualización"
@@ -1073,6 +1115,11 @@ msgstr "No se puede añadir el repositorio. Detalles: '%(err)s'"
msgid "Unable to remove repository. Details: '%(err)s'"
msgstr "No se puede eliminar el repositorio. Detalles: '%(err)s'"
+#, python-format
+msgid ""
+"Configuration items: '%(items)s' are not supported by repository manager"
+msgstr ""
+
msgid "ERROR CODE"
msgstr "CÓDIGO DE ERROR"
diff --git a/po/fr_FR.po b/po/fr_FR.po
index 414dd4a..b1b4702 100644
--- a/po/fr_FR.po
+++ b/po/fr_FR.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-09-25 13:47-0300\n"
+"POT-Creation-Date: 2014-10-14 10:45-0500\n"
"PO-Revision-Date: 2014-08-27 21:30+0000\n"
"Last-Translator: BobSynfig\n"
"Language-Team: French (http://www.transifex.com/projects/p/kimchi/language/"
@@ -74,6 +74,15 @@ msgstr "Vous n'êtes pas autorisé à accéder à Kimchi"
msgid "Specify %(item)s to login into Kimchi"
msgstr "Spécifiez %(item)s pour vous logguer dans Kimchi"
+msgid "Unknown \"_cap\" specified"
+msgstr ""
+
+msgid "\"_passthrough\" should be \"true\" or \"false\""
+msgstr ""
+
+msgid "\"_passthrough_affected_by\" should be a device name string"
+msgstr ""
+
#, python-format
msgid "Error while getting block devices. Details: %(err)s"
msgstr "Erreur durant l'accès aux périphériques de bloc. Détails: %(err)s"
@@ -290,6 +299,26 @@ msgid "The life time for the guest console password must be a number."
msgstr ""
#, python-format
+msgid ""
+"VM %(vmid)s does not contain directly assigned host device %(dev_name)s."
+msgstr ""
+
+#, python-format
+msgid "The host device %(dev_name)s is not allowed to directly assign to VM."
+msgstr ""
+
+msgid ""
+"No IOMMU groups found. Host PCI pass through needs IOMMU group to function "
+"correctly. Please enable Intel VT-d or AMD IOMMU in your BIOS, then verify "
+"the Kernel is compiled with IOMMU support. For Intel CPU, add intel_iommu=on "
+"to your Kernel parameter in /boot/grub2/grub.conf. For AMD CPU, add iommu=pt "
+"iommu=1."
+msgstr ""
+
+msgid "\"name\" should be a device name string"
+msgstr ""
+
+#, python-format
msgid "Interface %(iface)s does not exist in virtual machine %(name)s"
msgstr "L'interface %(iface)s n'existe pas dans la machine virtuelle %(name)s"
@@ -421,6 +450,16 @@ msgstr "L'image de base de modèle doit petre un fichier image local valide"
msgid "Cannot identify base image %(path)s format"
msgstr "Ne peut identifier le format de l'image de base %(path)s"
+msgid ""
+"When specifying CPU topology, VCPUs must be a product of sockets, cores, and "
+"threads."
+msgstr ""
+
+msgid ""
+"When specifying CPU topology, each element must be an integer greater than "
+"zero."
+msgstr ""
+
#, python-format
msgid "Storage pool %(name)s already exists"
msgstr "Le pool de stockage %(name)s existe déjà"
@@ -855,6 +894,9 @@ msgstr ""
msgid "Node device '%(name)s' not found"
msgstr "Périphérique de noeud '%(name)s' non trouvé"
+msgid "Conflicting flag filters specified."
+msgstr ""
+
msgid "No packages marked for update"
msgstr "Aucun paquet marqué pour mise à jour"
@@ -1061,6 +1103,11 @@ msgstr "Impossible d'ajouter un dépôt. Détails: '%(err)s'"
msgid "Unable to remove repository. Details: '%(err)s'"
msgstr "Impossible de supprimer un dépôt. Détails: '%(err)s'"
+#, python-format
+msgid ""
+"Configuration items: '%(items)s' are not supported by repository manager"
+msgstr ""
+
msgid "ERROR CODE"
msgstr "ERROR CODE"
diff --git a/po/it_IT.po b/po/it_IT.po
index 4a6c919..91e17d4 100644
--- a/po/it_IT.po
+++ b/po/it_IT.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-09-25 13:47-0300\n"
+"POT-Creation-Date: 2014-10-14 10:45-0500\n"
"PO-Revision-Date: 2013-07-11 17:32-0400\n"
"Last-Translator: Crístian Viana <vianac(a)linux.vnet.ibm.com>\n"
"Language-Team: English\n"
@@ -69,6 +69,15 @@ msgstr "Non si dispone dell'autorizzazione ad accedere a Kimchi"
msgid "Specify %(item)s to login into Kimchi"
msgstr "Specificare %(item)s per accedere a Kimchi"
+msgid "Unknown \"_cap\" specified"
+msgstr ""
+
+msgid "\"_passthrough\" should be \"true\" or \"false\""
+msgstr ""
+
+msgid "\"_passthrough_affected_by\" should be a device name string"
+msgstr ""
+
#, python-format
msgid "Error while getting block devices. Details: %(err)s"
msgstr ""
@@ -278,6 +287,26 @@ msgid "The life time for the guest console password must be a number."
msgstr ""
#, python-format
+msgid ""
+"VM %(vmid)s does not contain directly assigned host device %(dev_name)s."
+msgstr ""
+
+#, python-format
+msgid "The host device %(dev_name)s is not allowed to directly assign to VM."
+msgstr ""
+
+msgid ""
+"No IOMMU groups found. Host PCI pass through needs IOMMU group to function "
+"correctly. Please enable Intel VT-d or AMD IOMMU in your BIOS, then verify "
+"the Kernel is compiled with IOMMU support. For Intel CPU, add intel_iommu=on "
+"to your Kernel parameter in /boot/grub2/grub.conf. For AMD CPU, add iommu=pt "
+"iommu=1."
+msgstr ""
+
+msgid "\"name\" should be a device name string"
+msgstr ""
+
+#, python-format
msgid "Interface %(iface)s does not exist in virtual machine %(name)s"
msgstr "L'interfaccia %(iface)s non esiste nella macchina virtuale %(name)s"
@@ -406,6 +435,16 @@ msgstr "Il CDROM del modello deve essere un file ISO locale o remoto"
msgid "Cannot identify base image %(path)s format"
msgstr ""
+msgid ""
+"When specifying CPU topology, VCPUs must be a product of sockets, cores, and "
+"threads."
+msgstr ""
+
+msgid ""
+"When specifying CPU topology, each element must be an integer greater than "
+"zero."
+msgstr ""
+
#, python-format
msgid "Storage pool %(name)s already exists"
msgstr "Pool di memoria %(name)s già esistente"
@@ -834,6 +873,9 @@ msgstr ""
msgid "Node device '%(name)s' not found"
msgstr "Dispositivo nodo '%(name)s' non trovato"
+msgid "Conflicting flag filters specified."
+msgstr ""
+
msgid "No packages marked for update"
msgstr "Nessun pacchetto contrassegnato per l'aggiornamento"
@@ -1042,6 +1084,11 @@ msgstr "Impossibile aggiungere il repository. Dettagli: '%(err)s'"
msgid "Unable to remove repository. Details: '%(err)s'"
msgstr "Impossibile rimuovere il repository. Dettagli: '%(err)s'"
+#, python-format
+msgid ""
+"Configuration items: '%(items)s' are not supported by repository manager"
+msgstr ""
+
msgid "ERROR CODE"
msgstr "CODICE DI ERRORE"
diff --git a/po/ja_JP.po b/po/ja_JP.po
index af00487..23c1ce7 100644
--- a/po/ja_JP.po
+++ b/po/ja_JP.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-09-25 13:47-0300\n"
+"POT-Creation-Date: 2014-10-14 10:45-0500\n"
"PO-Revision-Date: 2013-07-11 17:32-0400\n"
"Last-Translator: Crístian Viana <vianac(a)linux.vnet.ibm.com>\n"
"Language-Team: English\n"
@@ -68,6 +68,15 @@ msgstr "Kimchi へのアクセスを許可されていません"
msgid "Specify %(item)s to login into Kimchi"
msgstr "Kimchi にログインするには、%(item)s を指定します"
+msgid "Unknown \"_cap\" specified"
+msgstr ""
+
+msgid "\"_passthrough\" should be \"true\" or \"false\""
+msgstr ""
+
+msgid "\"_passthrough_affected_by\" should be a device name string"
+msgstr ""
+
#, python-format
msgid "Error while getting block devices. Details: %(err)s"
msgstr ""
@@ -275,6 +284,26 @@ msgid "The life time for the guest console password must be a number."
msgstr ""
#, python-format
+msgid ""
+"VM %(vmid)s does not contain directly assigned host device %(dev_name)s."
+msgstr ""
+
+#, python-format
+msgid "The host device %(dev_name)s is not allowed to directly assign to VM."
+msgstr ""
+
+msgid ""
+"No IOMMU groups found. Host PCI pass through needs IOMMU group to function "
+"correctly. Please enable Intel VT-d or AMD IOMMU in your BIOS, then verify "
+"the Kernel is compiled with IOMMU support. For Intel CPU, add intel_iommu=on "
+"to your Kernel parameter in /boot/grub2/grub.conf. For AMD CPU, add iommu=pt "
+"iommu=1."
+msgstr ""
+
+msgid "\"name\" should be a device name string"
+msgstr ""
+
+#, python-format
msgid "Interface %(iface)s does not exist in virtual machine %(name)s"
msgstr "インターフェース %(iface)s は仮想マシン %(name)s には存在しません"
@@ -413,6 +442,16 @@ msgstr ""
msgid "Cannot identify base image %(path)s format"
msgstr ""
+msgid ""
+"When specifying CPU topology, VCPUs must be a product of sockets, cores, and "
+"threads."
+msgstr ""
+
+msgid ""
+"When specifying CPU topology, each element must be an integer greater than "
+"zero."
+msgstr ""
+
#, python-format
msgid "Storage pool %(name)s already exists"
msgstr "ストレージ・プール %(name)s は既に存在します"
@@ -847,6 +886,9 @@ msgstr "稼働中の仮想マシンがあるため、ホスト・マシンをリ
msgid "Node device '%(name)s' not found"
msgstr "ノード・デバイス「%(name)s」が見つかりません"
+msgid "Conflicting flag filters specified."
+msgstr ""
+
msgid "No packages marked for update"
msgstr "更新の対象としてマークされているパッケージはありません"
@@ -1054,6 +1096,11 @@ msgstr "リポジトリーを追加できません。詳細: 「%(err)s」"
msgid "Unable to remove repository. Details: '%(err)s'"
msgstr "リポジトリーを削除できません。詳細: 「%(err)s」"
+#, python-format
+msgid ""
+"Configuration items: '%(items)s' are not supported by repository manager"
+msgstr ""
+
msgid "ERROR CODE"
msgstr "エラー・コード"
diff --git a/po/kimchi.pot b/po/kimchi.pot
index 685802e..9fe3491 100755
--- a/po/kimchi.pot
+++ b/po/kimchi.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-09-25 13:47-0300\n"
+"POT-Creation-Date: 2014-10-14 10:45-0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL(a)li.org>\n"
@@ -68,6 +68,15 @@ msgstr ""
msgid "Specify %(item)s to login into Kimchi"
msgstr ""
+msgid "Unknown \"_cap\" specified"
+msgstr ""
+
+msgid "\"_passthrough\" should be \"true\" or \"false\""
+msgstr ""
+
+msgid "\"_passthrough_affected_by\" should be a device name string"
+msgstr ""
+
#, python-format
msgid "Error while getting block devices. Details: %(err)s"
msgstr ""
@@ -259,6 +268,26 @@ msgid "The life time for the guest console password must be a number."
msgstr ""
#, python-format
+msgid ""
+"VM %(vmid)s does not contain directly assigned host device %(dev_name)s."
+msgstr ""
+
+#, python-format
+msgid "The host device %(dev_name)s is not allowed to directly assign to VM."
+msgstr ""
+
+msgid ""
+"No IOMMU groups found. Host PCI pass through needs IOMMU group to function "
+"correctly. Please enable Intel VT-d or AMD IOMMU in your BIOS, then verify "
+"the Kernel is compiled with IOMMU support. For Intel CPU, add intel_iommu=on "
+"to your Kernel parameter in /boot/grub2/grub.conf. For AMD CPU, add iommu=pt "
+"iommu=1."
+msgstr ""
+
+msgid "\"name\" should be a device name string"
+msgstr ""
+
+#, python-format
msgid "Interface %(iface)s does not exist in virtual machine %(name)s"
msgstr ""
@@ -371,6 +400,16 @@ msgstr ""
msgid "Cannot identify base image %(path)s format"
msgstr ""
+msgid ""
+"When specifying CPU topology, VCPUs must be a product of sockets, cores, and "
+"threads."
+msgstr ""
+
+msgid ""
+"When specifying CPU topology, each element must be an integer greater than "
+"zero."
+msgstr ""
+
#, python-format
msgid "Storage pool %(name)s already exists"
msgstr ""
@@ -744,6 +783,9 @@ msgstr ""
msgid "Node device '%(name)s' not found"
msgstr ""
+msgid "Conflicting flag filters specified."
+msgstr ""
+
msgid "No packages marked for update"
msgstr ""
@@ -931,6 +973,11 @@ msgstr ""
msgid "Unable to remove repository. Details: '%(err)s'"
msgstr ""
+#, python-format
+msgid ""
+"Configuration items: '%(items)s' are not supported by repository manager"
+msgstr ""
+
msgid "ERROR CODE"
msgstr ""
diff --git a/po/ko_KR.po b/po/ko_KR.po
index a9f82e4..f36d782 100644
--- a/po/ko_KR.po
+++ b/po/ko_KR.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-09-25 13:47-0300\n"
+"POT-Creation-Date: 2014-10-14 10:45-0500\n"
"PO-Revision-Date: 2013-07-11 17:32-0400\n"
"Last-Translator: Crístian Viana <vianac(a)linux.vnet.ibm.com>\n"
"Language-Team: English\n"
@@ -67,6 +67,15 @@ msgstr "Kimchi에 액세스할 권한이 없습니다."
msgid "Specify %(item)s to login into Kimchi"
msgstr "Kimchi에 로그인하려면 %(item)s을(를) 지정하십시오."
+msgid "Unknown \"_cap\" specified"
+msgstr ""
+
+msgid "\"_passthrough\" should be \"true\" or \"false\""
+msgstr ""
+
+msgid "\"_passthrough_affected_by\" should be a device name string"
+msgstr ""
+
#, python-format
msgid "Error while getting block devices. Details: %(err)s"
msgstr "블록 장치를 가져오는 중에 오류가 발생했습니다. 세부사항: %(err)s"
@@ -268,6 +277,26 @@ msgid "The life time for the guest console password must be a number."
msgstr ""
#, python-format
+msgid ""
+"VM %(vmid)s does not contain directly assigned host device %(dev_name)s."
+msgstr ""
+
+#, python-format
+msgid "The host device %(dev_name)s is not allowed to directly assign to VM."
+msgstr ""
+
+msgid ""
+"No IOMMU groups found. Host PCI pass through needs IOMMU group to function "
+"correctly. Please enable Intel VT-d or AMD IOMMU in your BIOS, then verify "
+"the Kernel is compiled with IOMMU support. For Intel CPU, add intel_iommu=on "
+"to your Kernel parameter in /boot/grub2/grub.conf. For AMD CPU, add iommu=pt "
+"iommu=1."
+msgstr ""
+
+msgid "\"name\" should be a device name string"
+msgstr ""
+
+#, python-format
msgid "Interface %(iface)s does not exist in virtual machine %(name)s"
msgstr "가상 머신 %(name)s에 %(iface)s 인터페이스가 없습니다."
@@ -387,6 +416,16 @@ msgstr "템플리트 CDROM은 로컬 또는 원격 ISO 파일이어야 합니다
msgid "Cannot identify base image %(path)s format"
msgstr ""
+msgid ""
+"When specifying CPU topology, VCPUs must be a product of sockets, cores, and "
+"threads."
+msgstr ""
+
+msgid ""
+"When specifying CPU topology, each element must be an integer greater than "
+"zero."
+msgstr ""
+
#, python-format
msgid "Storage pool %(name)s already exists"
msgstr "스토리지 풀 %(name)s이(가) 이미 존재합니다."
@@ -796,6 +835,9 @@ msgstr "가상 머신을 실행 중인 호스트 머신을 다시 부팅할 수
msgid "Node device '%(name)s' not found"
msgstr "노드 장치 '%(name)s'이(가) 없습니다."
+msgid "Conflicting flag filters specified."
+msgstr ""
+
msgid "No packages marked for update"
msgstr "업데이트 표시된 패키지가 없습니다."
@@ -985,6 +1027,11 @@ msgstr "저장소를 추가할 수 없습니다. 세부사항: '%(err)s'"
msgid "Unable to remove repository. Details: '%(err)s'"
msgstr "저장소를 제거할 수 없습니다. 세부사항: '%(err)s'"
+#, python-format
+msgid ""
+"Configuration items: '%(items)s' are not supported by repository manager"
+msgstr ""
+
msgid "ERROR CODE"
msgstr "오류 코드"
diff --git a/po/pt_BR.po b/po/pt_BR.po
index f2fba64..ff1a7a8 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 1.0\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-09-25 13:47-0300\n"
+"POT-Creation-Date: 2014-10-14 10:45-0500\n"
"PO-Revision-Date: 2014-09-16 18:45+0000\n"
"Last-Translator: Crístian Deives dos Santos Viana <cristiandeives@gmail."
"com>\n"
@@ -87,6 +87,15 @@ msgstr "Você não está autorizado para acessar o Kimchi"
msgid "Specify %(item)s to login into Kimchi"
msgstr "Especifique %(item)s para autenticar no Kimchi"
+msgid "Unknown \"_cap\" specified"
+msgstr ""
+
+msgid "\"_passthrough\" should be \"true\" or \"false\""
+msgstr ""
+
+msgid "\"_passthrough_affected_by\" should be a device name string"
+msgstr ""
+
#, python-format
msgid "Error while getting block devices. Details: %(err)s"
msgstr "Erro ao consultar block devices. Detalhes %(err)s"
@@ -303,6 +312,25 @@ msgid "The life time for the guest console password must be a number."
msgstr "O tempo de vida da senha do console do guest deve ser um número."
#, python-format
+msgid ""
+"VM %(vmid)s does not contain directly assigned host device %(dev_name)s."
+msgstr ""
+
+msgid "The host device %(dev_name)s is not allowed to directly assign to VM."
+msgstr ""
+
+msgid ""
+"No IOMMU groups found. Host PCI pass through needs IOMMU group to function "
+"correctly. Please enable Intel VT-d or AMD IOMMU in your BIOS, then verify "
+"the Kernel is compiled with IOMMU support. For Intel CPU, add intel_iommu=on "
+"to your Kernel parameter in /boot/grub2/grub.conf. For AMD CPU, add iommu=pt "
+"iommu=1."
+msgstr ""
+
+msgid "\"name\" should be a device name string"
+msgstr ""
+
+#, python-format
msgid "Interface %(iface)s does not exist in virtual machine %(name)s"
msgstr "Interface %(iface)s não existe na máquina virtual %(name)s"
@@ -424,6 +452,16 @@ msgstr "Imagem base do modelo deve ser um arquivo de imagem local válido"
msgid "Cannot identify base image %(path)s format"
msgstr "Não foi possível identificar o formato da imagem base %(path)s"
+msgid ""
+"When specifying CPU topology, VCPUs must be a product of sockets, cores, and "
+"threads."
+msgstr ""
+
+msgid ""
+"When specifying CPU topology, each element must be an integer greater than "
+"zero."
+msgstr ""
+
#, python-format
msgid "Storage pool %(name)s already exists"
msgstr "Storage pool %(name)s já existe"
@@ -853,6 +891,9 @@ msgstr ""
msgid "Node device '%(name)s' not found"
msgstr "Dispositivo de nó '%(name)s' não encontrado"
+msgid "Conflicting flag filters specified."
+msgstr ""
+
msgid "No packages marked for update"
msgstr "Nenhum pacote marcado para atualização"
@@ -1064,6 +1105,11 @@ msgstr "Não foi possível adicionar o repositório. Detalhes: '%(err)s'"
msgid "Unable to remove repository. Details: '%(err)s'"
msgstr "Não foi possível remover o repositório. Detalhes: '%(err)s'"
+#, python-format
+msgid ""
+"Configuration items: '%(items)s' are not supported by repository manager"
+msgstr ""
+
msgid "ERROR CODE"
msgstr "CÓDIGO DE ERRO"
diff --git a/po/ru_RU.po b/po/ru_RU.po
index 059b999..e55d170 100644
--- a/po/ru_RU.po
+++ b/po/ru_RU.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-09-25 13:47-0300\n"
+"POT-Creation-Date: 2014-10-14 10:45-0500\n"
"PO-Revision-Date: 2014-08-28 17:32+0000\n"
"Last-Translator: Aline Manera <aline.manera(a)gmail.com>\n"
"Language-Team: Russian (http://www.transifex.com/projects/p/kimchi/language/"
@@ -68,6 +68,15 @@ msgstr "Нет прав доступа к Kimchi"
msgid "Specify %(item)s to login into Kimchi"
msgstr "Укажите %(item)s для входа в Kimchi"
+msgid "Unknown \"_cap\" specified"
+msgstr ""
+
+msgid "\"_passthrough\" should be \"true\" or \"false\""
+msgstr ""
+
+msgid "\"_passthrough_affected_by\" should be a device name string"
+msgstr ""
+
#, python-format
msgid "Error while getting block devices. Details: %(err)s"
msgstr "Ошибка получения блочных устройств. Сведения: %(err)s"
@@ -271,6 +280,26 @@ msgid "The life time for the guest console password must be a number."
msgstr ""
#, python-format
+msgid ""
+"VM %(vmid)s does not contain directly assigned host device %(dev_name)s."
+msgstr ""
+
+#, python-format
+msgid "The host device %(dev_name)s is not allowed to directly assign to VM."
+msgstr ""
+
+msgid ""
+"No IOMMU groups found. Host PCI pass through needs IOMMU group to function "
+"correctly. Please enable Intel VT-d or AMD IOMMU in your BIOS, then verify "
+"the Kernel is compiled with IOMMU support. For Intel CPU, add intel_iommu=on "
+"to your Kernel parameter in /boot/grub2/grub.conf. For AMD CPU, add iommu=pt "
+"iommu=1."
+msgstr ""
+
+msgid "\"name\" should be a device name string"
+msgstr ""
+
+#, python-format
msgid "Interface %(iface)s does not exist in virtual machine %(name)s"
msgstr "Интерфейс %(iface)s не существует в виртуальной машине %(name)s"
@@ -385,6 +414,16 @@ msgstr "CDROM шаблона должен быть локальным или у
msgid "Cannot identify base image %(path)s format"
msgstr ""
+msgid ""
+"When specifying CPU topology, VCPUs must be a product of sockets, cores, and "
+"threads."
+msgstr ""
+
+msgid ""
+"When specifying CPU topology, each element must be an integer greater than "
+"zero."
+msgstr ""
+
#, python-format
msgid "Storage pool %(name)s already exists"
msgstr "Пул памяти %(name)s уже существует"
@@ -791,6 +830,9 @@ msgstr "Не удалось перезагрузить систему хоста
msgid "Node device '%(name)s' not found"
msgstr "Устройство %(name)s узла не найдено"
+msgid "Conflicting flag filters specified."
+msgstr ""
+
msgid "No packages marked for update"
msgstr "Нет пакетов, помеченных для обновления"
@@ -985,6 +1027,11 @@ msgstr "Не удалось добавить хранилище. Сведени
msgid "Unable to remove repository. Details: '%(err)s'"
msgstr "Не удалось удалить хранилище. Сведения: %(err)s"
+#, python-format
+msgid ""
+"Configuration items: '%(items)s' are not supported by repository manager"
+msgstr ""
+
msgid "ERROR CODE"
msgstr "Код ошибки"
diff --git a/po/zh_CN.po b/po/zh_CN.po
index f77e405..a6f511f 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-09-25 13:47-0300\n"
+"POT-Creation-Date: 2014-10-14 10:45-0500\n"
"PO-Revision-Date: 2013-06-27 10:48+0000\n"
"Last-Translator: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>\n"
"Language-Team: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>\n"
@@ -84,6 +84,15 @@ msgstr "您没有被授权访问Kimchi"
msgid "Specify %(item)s to login into Kimchi"
msgstr "指定登录Kimchi的%(item)s"
+msgid "Unknown \"_cap\" specified"
+msgstr ""
+
+msgid "\"_passthrough\" should be \"true\" or \"false\""
+msgstr ""
+
+msgid "\"_passthrough_affected_by\" should be a device name string"
+msgstr ""
+
#, python-format
msgid "Error while getting block devices. Details: %(err)s"
msgstr "获取块设备时出错。详情:%(err)s"
@@ -280,6 +289,25 @@ msgid "The life time for the guest console password must be a number."
msgstr "客户机命令行密码有效时间必须是一个数字。"
#, python-format
+msgid ""
+"VM %(vmid)s does not contain directly assigned host device %(dev_name)s."
+msgstr ""
+
+msgid "The host device %(dev_name)s is not allowed to directly assign to VM."
+msgstr ""
+
+msgid ""
+"No IOMMU groups found. Host PCI pass through needs IOMMU group to function "
+"correctly. Please enable Intel VT-d or AMD IOMMU in your BIOS, then verify "
+"the Kernel is compiled with IOMMU support. For Intel CPU, add intel_iommu=on "
+"to your Kernel parameter in /boot/grub2/grub.conf. For AMD CPU, add iommu=pt "
+"iommu=1."
+msgstr ""
+
+msgid "\"name\" should be a device name string"
+msgstr ""
+
+#, python-format
msgid "Interface %(iface)s does not exist in virtual machine %(name)s"
msgstr "虚拟机 %(name)s 中没有接口 %(iface)s"
@@ -392,6 +420,16 @@ msgstr "模板基础镜像必须为一个有效的本地镜像文件"
msgid "Cannot identify base image %(path)s format"
msgstr "未能识别基础镜像%(path)s格式"
+msgid ""
+"When specifying CPU topology, VCPUs must be a product of sockets, cores, and "
+"threads."
+msgstr ""
+
+msgid ""
+"When specifying CPU topology, each element must be an integer greater than "
+"zero."
+msgstr ""
+
#, python-format
msgid "Storage pool %(name)s already exists"
msgstr "存储池%(name)s已经存在"
@@ -767,6 +805,9 @@ msgstr "有虚拟机在运行,不能重起主机"
msgid "Node device '%(name)s' not found"
msgstr "没有找到节点设备'%(name)s'"
+msgid "Conflicting flag filters specified."
+msgstr ""
+
msgid "No packages marked for update"
msgstr "没有软件包标识要升级"
@@ -954,6 +995,11 @@ msgstr "不能增加软件仓库。详情:'%(err)s'"
msgid "Unable to remove repository. Details: '%(err)s'"
msgstr "不能移除软件仓库。详情:'%(err)s'"
+#, python-format
+msgid ""
+"Configuration items: '%(items)s' are not supported by repository manager"
+msgstr "软件仓库不支持配置类型: %(items)s"
+
msgid "ERROR CODE"
msgstr "错误码"
@@ -1866,7 +1912,3 @@ msgstr "没有发现模板"
msgid "Clone"
msgstr "制作副本"
-
-#~ msgid ""
-#~ "Configuration items: '%(items)s' are not supported by repository manager"
-#~ msgstr "软件仓库不支持配置类型: %(items)s"
diff --git a/po/zh_TW.po b/po/zh_TW.po
index 4040b2a..792d004 100644
--- a/po/zh_TW.po
+++ b/po/zh_TW.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2014-09-25 13:47-0300\n"
+"POT-Creation-Date: 2014-10-14 10:45-0500\n"
"PO-Revision-Date: 2013-07-11 17:32-0400\n"
"Last-Translator: Crístian Viana <vianac(a)linux.vnet.ibm.com>\n"
"Language-Team: English\n"
@@ -67,6 +67,15 @@ msgstr "您未獲授權來存取 Kimchi"
msgid "Specify %(item)s to login into Kimchi"
msgstr "指定 %(item)s 以登入 Kimchi"
+msgid "Unknown \"_cap\" specified"
+msgstr ""
+
+msgid "\"_passthrough\" should be \"true\" or \"false\""
+msgstr ""
+
+msgid "\"_passthrough_affected_by\" should be a device name string"
+msgstr ""
+
#, python-format
msgid "Error while getting block devices. Details: %(err)s"
msgstr "取得區塊裝置時發生錯誤。詳細資料:%(err)s"
@@ -262,6 +271,26 @@ msgid "The life time for the guest console password must be a number."
msgstr ""
#, python-format
+msgid ""
+"VM %(vmid)s does not contain directly assigned host device %(dev_name)s."
+msgstr ""
+
+#, python-format
+msgid "The host device %(dev_name)s is not allowed to directly assign to VM."
+msgstr ""
+
+msgid ""
+"No IOMMU groups found. Host PCI pass through needs IOMMU group to function "
+"correctly. Please enable Intel VT-d or AMD IOMMU in your BIOS, then verify "
+"the Kernel is compiled with IOMMU support. For Intel CPU, add intel_iommu=on "
+"to your Kernel parameter in /boot/grub2/grub.conf. For AMD CPU, add iommu=pt "
+"iommu=1."
+msgstr ""
+
+msgid "\"name\" should be a device name string"
+msgstr ""
+
+#, python-format
msgid "Interface %(iface)s does not exist in virtual machine %(name)s"
msgstr "介面 %(iface)s 不存在於虛擬機器 %(name)s 中"
@@ -374,6 +403,16 @@ msgstr "範本 CDROM 必須是本端或遠端 ISO 檔案"
msgid "Cannot identify base image %(path)s format"
msgstr ""
+msgid ""
+"When specifying CPU topology, VCPUs must be a product of sockets, cores, and "
+"threads."
+msgstr ""
+
+msgid ""
+"When specifying CPU topology, each element must be an integer greater than "
+"zero."
+msgstr ""
+
#, python-format
msgid "Storage pool %(name)s already exists"
msgstr "儲存區 %(name)s 已存在"
@@ -747,6 +786,9 @@ msgstr "無法將主機重新開機,因為有一些虛擬機器正在執行中
msgid "Node device '%(name)s' not found"
msgstr "找不到節點裝置 '%(name)s'"
+msgid "Conflicting flag filters specified."
+msgstr ""
+
msgid "No packages marked for update"
msgstr "沒有套件標示為要進行更新"
@@ -934,6 +976,11 @@ msgstr "無法新增儲存庫。詳細資料:'%(err)s'"
msgid "Unable to remove repository. Details: '%(err)s'"
msgstr "無法移除儲存庫。詳細資料:'%(err)s'"
+#, python-format
+msgid ""
+"Configuration items: '%(items)s' are not supported by repository manager"
+msgstr ""
+
msgid "ERROR CODE"
msgstr "錯誤碼"
diff --git a/src/kimchi/API.json b/src/kimchi/API.json
index d9e13f0..a1156d5 100644
--- a/src/kimchi/API.json
+++ b/src/kimchi/API.json
@@ -26,6 +26,36 @@
]
}
}
+ },
+ "cpu_info": {
+ "description": "Configure CPU specifics for a VM.",
+ "type": "object",
+ "properties": {
+ "topology": {
+ "description": "Configure the guest CPU topology.",
+ "type": "object",
+ "properties": {
+ "sockets": {
+ "type": "integer",
+ "required": true,
+ "minimum": 1,
+ "error": "KCHTMPL0026E"
+ },
+ "cores": {
+ "type": "integer",
+ "required": true,
+ "minimum": 1,
+ "error": "KCHTMPL0026E"
+ },
+ "threads": {
+ "type": "integer",
+ "required": true,
+ "minimum": 1,
+ "error": "KCHTMPL0026E"
+ }
+ }
+ }
+ }
}
},
"properties": {
@@ -448,7 +478,8 @@
"type": "array",
"items": { "type": "string" }
},
- "graphics": { "$ref": "#/kimchitype/graphics" }
+ "graphics": { "$ref": "#/kimchitype/graphics" },
+ "cpu_info": { "$ref": "#/kimchitype/cpu_info" }
},
"additionalProperties": false,
"error": "KCHAPI0001E"
@@ -612,7 +643,8 @@
"type": "array",
"items": { "type": "string" }
},
- "graphics": { "$ref": "#/kimchitype/graphics" }
+ "graphics": { "$ref": "#/kimchitype/graphics" },
+ "cpu_info": { "$ref": "#/kimchitype/cpu_info" }
},
"additionalProperties": false,
"error": "KCHAPI0001E"
diff --git a/src/kimchi/control/templates.py b/src/kimchi/control/templates.py
index e17fa54..70c9457 100644
--- a/src/kimchi/control/templates.py
+++ b/src/kimchi/control/templates.py
@@ -38,22 +38,25 @@ def __init__(self, model, ident):
self.update_params = ["name", "folder", "icon", "os_distro",
"storagepool", "os_version", "cpus",
"memory", "cdrom", "disks", "networks",
- "graphics"]
+ "graphics", "cpu_info"]
self.uri_fmt = "/templates/%s"
self.clone = self.generate_action_handler('clone')
@property
def data(self):
- return {'name': self.ident,
- 'icon': self.info['icon'],
- 'invalid': self.info['invalid'],
- 'os_distro': self.info['os_distro'],
- 'os_version': self.info['os_version'],
- 'cpus': self.info['cpus'],
- 'memory': self.info['memory'],
- 'cdrom': self.info.get('cdrom', None),
- 'disks': self.info['disks'],
- 'storagepool': self.info['storagepool'],
- 'networks': self.info['networks'],
- 'folder': self.info.get('folder', []),
- 'graphics': self.info['graphics']}
+ return {
+ 'name': self.ident,
+ 'icon': self.info['icon'],
+ 'invalid': self.info['invalid'],
+ 'os_distro': self.info['os_distro'],
+ 'os_version': self.info['os_version'],
+ 'cpus': self.info['cpus'],
+ 'memory': self.info['memory'],
+ 'cdrom': self.info.get('cdrom', None),
+ 'disks': self.info['disks'],
+ 'storagepool': self.info['storagepool'],
+ 'networks': self.info['networks'],
+ 'folder': self.info.get('folder', []),
+ 'graphics': self.info['graphics'],
+ 'cpu_info': self.info.get('cpu_info')
+ }
diff --git a/src/kimchi/i18n.py b/src/kimchi/i18n.py
index 75fb076..74ea98e 100644
--- a/src/kimchi/i18n.py
+++ b/src/kimchi/i18n.py
@@ -143,6 +143,8 @@
"KCHTMPL0022E": _("Disk size must be an integer greater than 1GB."),
"KCHTMPL0023E": _("Template base image must be a valid local image file"),
"KCHTMPL0024E": _("Cannot identify base image %(path)s format"),
+ "KCHTMPL0025E": _("When specifying CPU topology, VCPUs must be a product of sockets, cores, and threads."),
+ "KCHTMPL0026E": _("When specifying CPU topology, each element must be an integer greater than zero."),
"KCHPOOL0001E": _("Storage pool %(name)s already exists"),
"KCHPOOL0002E": _("Storage pool %(name)s does not exist"),
diff --git a/src/kimchi/model/templates.py b/src/kimchi/model/templates.py
index 9278cdc..c75fc7b 100644
--- a/src/kimchi/model/templates.py
+++ b/src/kimchi/model/templates.py
@@ -48,6 +48,23 @@ def create(self, params):
{'filename': iso, 'user': user,
'err': excp})
+ cpu_info = params.get('cpu_info')
+ if cpu_info:
+ topology = cpu_info.get('topology')
+ # Check, even though currently only topology
+ # is supported.
+ if topology:
+ sockets = topology['sockets']
+ cores = topology['cores']
+ threads = topology['threads']
+ vcpus = params.get('cpus')
+ if vcpus is None:
+ params['cpus'] = sockets * cores * threads
+ elif vcpus != sockets * cores * threads:
+ raise InvalidParameter("KCHTMPL0025E")
+ else:
+ params['cpu_info'] = ''
+
conn = self.conn.get()
pool_uri = params.get(u'storagepool', '')
if pool_uri:
@@ -156,6 +173,10 @@ def update(self, name, params):
old_t = self.lookup(name)
new_t = copy.copy(old_t)
new_t.update(params)
+
+ if not self._validate_updated_cpu_params(new_t):
+ raise InvalidParameter('KCHTMPL0025E')
+
ident = name
conn = self.conn.get()
@@ -187,6 +208,18 @@ def update(self, name, params):
raise
return ident
+ def _validate_updated_cpu_params(self, info):
+ # Note: cpu_info is the parent of topology. cpus is vcpus
+ vcpus = info['cpus']
+ cpu_info = info.get('cpu_info')
+ if cpu_info is None:
+ return True
+ topology = cpu_info.get('topology')
+ if topology is None:
+ return True
+ return vcpus == topology['sockets'] * topology['cores'] * \
+ topology['threads']
+
class LibvirtVMTemplate(VMTemplate):
def __init__(self, args, scan=False, conn=None):
diff --git a/src/kimchi/osinfo.py b/src/kimchi/osinfo.py
index 6ee5e48..0e16b50 100644
--- a/src/kimchi/osinfo.py
+++ b/src/kimchi/osinfo.py
@@ -32,9 +32,8 @@
'power': ('ppc', 'ppc64')}
-common_spec = {'cpus': 1, 'cpu_cores': 1, 'cpu_threads': 1, 'memory': 1024,
- 'disks': [{'index': 0, 'size': 10}], 'cdrom_bus': 'ide',
- 'cdrom_index': 2, 'mouse_bus': 'ps2'}
+common_spec = {'cpus': 1, 'memory': 1024, 'disks': [{'index': 0, 'size': 10}],
+ 'cdrom_bus': 'ide', 'cdrom_index': 2, 'mouse_bus': 'ps2'}
modern_spec = dict(common_spec, disk_bus='virtio', nic_model='virtio')
diff --git a/src/kimchi/vmtemplate.py b/src/kimchi/vmtemplate.py
index 5f22db9..18d802b 100644
--- a/src/kimchi/vmtemplate.py
+++ b/src/kimchi/vmtemplate.py
@@ -358,6 +358,20 @@ def _get_input_output_xml(self):
input_output += sound % self.info
return input_output
+ def _get_cpu_xml(self):
+
+ cpu_info = self.info.get('cpu_info')
+ if cpu_info is None:
+ return ""
+ cpu_topo = cpu_info.get('topology')
+ if cpu_topo is None:
+ return ""
+ return etree.tostring(E.cpu(E.topology(
+ sockets=str(cpu_topo['sockets']),
+ cores=str(cpu_topo['cores']),
+ threads=str(cpu_topo['threads']))))
+
+
def to_vm_xml(self, vm_name, vm_uuid, **kwargs):
params = dict(self.info)
params['name'] = vm_name
@@ -369,6 +383,7 @@ def to_vm_xml(self, vm_name, vm_uuid, **kwargs):
params['qemu-stream-cmdline'] = ''
graphics = kwargs.get('graphics')
params['graphics'] = self._get_graphics_xml(graphics)
+ params['cpu_info'] = self._get_cpu_xml()
# Current implementation just allows to create disk in one single
# storage pool, so we cannot mix the types (scsi volumes vs img file)
@@ -400,6 +415,7 @@ def to_vm_xml(self, vm_name, vm_uuid, **kwargs):
<uuid>%(uuid)s</uuid>
<memory unit='MiB'>%(memory)s</memory>
<vcpu>%(cpus)s</vcpu>
+ %(cpu_info)s
<os>
<type arch='%(arch)s'>hvm</type>
<boot dev='hd'/>
--
1.9.3
10 years, 2 months
[PATCH v4] Backend support for templates with sockets, cores, and threads
by Christy Perez
In order to allow a guest to use SMT/hyperthreading, we should
enable passing in of the sockets, cores, and threads values when
creating a template.
All three values must be specified, as per the topology descr at
http://libvirt.org/formatdomain.html#elementsCPU
v3->v4:
- Remove the unused cpu_ elements from common_spec
- Pass new_t into validate function to reduce complexity
- Rearrange code to decrese indents in _get_cpu_xml
v2->v3:
- Set vcpus based on topology, if specified.
- Move the update cpu+topology validation out to a function
for redability
- Add a minimum value of 1 for topology values
- Leave new English error msg as empty string
- Update the API documentation on cpu defaults
v1->v2:
- Added a check to make sure that vcpus = sockets*cores*threads
- Set individual topoology params to required in API.json
- Change the topology object types from string to integer
- Always return cpu_info from templates lookup()
- Removed check for cpu_info in to_vm_xml
- Build cpu_info xml using lxml.builder instead of string
- CPU and topology verification on template update
Signed-off-by: Christy Perez <christy(a)linux.vnet.ibm.com>
---
docs/API.md | 13 ++++++++++++-
po/en_US.po | 3 +++
po/pt_BR.po | 3 +++
po/zh_CN.po | 3 +++
src/kimchi/API.json | 33 +++++++++++++++++++++++++++++++--
src/kimchi/control/templates.py | 13 ++++++++++---
src/kimchi/i18n.py | 1 +
src/kimchi/model/templates.py | 32 ++++++++++++++++++++++++++++++++
src/kimchi/osinfo.py | 5 ++---
src/kimchi/vmtemplate.py | 16 ++++++++++++++++
10 files changed, 113 insertions(+), 9 deletions(-)
diff --git a/docs/API.md b/docs/API.md
index 92fbbd5..6984649 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -194,7 +194,9 @@ Represents a snapshot of the Virtual Machine's primary monitor.
* name: The name of the Template. Used to identify the Template in this API
* os_distro *(optional)*: The operating system distribution
* os_version *(optional)*: The version of the operating system distribution
- * cpus *(optional)*: The number of CPUs assigned to the VM. Default is 1.
+ * cpus *(optional)*: The number of CPUs assigned to the VM.
+ Default is 1, unlees specifying a cpu topology. In that case, cpus
+ will default to a product of the topology values (see cpu_info).
* memory *(optional)*: The amount of memory assigned to the VM.
Default is 1024M.
* cdrom *(optional)*: A volume name or URI to an ISO image.
@@ -216,6 +218,15 @@ Represents a snapshot of the Virtual Machine's primary monitor.
Independent Computing Environments
* null: Graphics is disabled or type not supported
* listen: The network which the vnc/spice server listens on.
+ * cpu_info *(optional)*: CPU-specific information.
+ * topology: Specify sockets, threads, and cores to run the virtual CPU
+ threads on.
+ All three are required in order to specify cpu topology.
+ * sockets - The number of sockets to use.
+ * cores - The number of cores per socket.
+ * threads - The number of threads per core.
+ If specifying both cpus and CPU topology, make sure cpus is
+ equal to the product of sockets, cores, and threads.
### Sub-Collection: Virtual Machine Network Interfaces
diff --git a/po/en_US.po b/po/en_US.po
index eb571ca..a88675c 100644
--- a/po/en_US.po
+++ b/po/en_US.po
@@ -371,6 +371,9 @@ msgstr ""
msgid "Cannot identify base image %(path)s format"
msgstr ""
+msgid "When specifying CPU topology, VCPUs must be a product of sockets, cores, and threads."
+msgstr ""
+
#, python-format
msgid "Storage pool %(name)s already exists"
msgstr ""
diff --git a/po/pt_BR.po b/po/pt_BR.po
index f2fba64..1bebe30 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -424,6 +424,9 @@ msgstr "Imagem base do modelo deve ser um arquivo de imagem local válido"
msgid "Cannot identify base image %(path)s format"
msgstr "Não foi possível identificar o formato da imagem base %(path)s"
+msgid "When specifying CPU topology, VCPUs must be a product of sockets, cores, and threads."
+msgstr ""
+
#, python-format
msgid "Storage pool %(name)s already exists"
msgstr "Storage pool %(name)s já existe"
diff --git a/po/zh_CN.po b/po/zh_CN.po
index f77e405..f944b8d 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -392,6 +392,9 @@ msgstr "模板基础镜像必须为一个有效的本地镜像文件"
msgid "Cannot identify base image %(path)s format"
msgstr "未能识别基础镜像%(path)s格式"
+msgid "When specifying CPU topology, VCPUs must be a product of sockets, cores, and threads."
+msgstr ""
+
#, python-format
msgid "Storage pool %(name)s already exists"
msgstr "存储池%(name)s已经存在"
diff --git a/src/kimchi/API.json b/src/kimchi/API.json
index d9e13f0..d3edf27 100644
--- a/src/kimchi/API.json
+++ b/src/kimchi/API.json
@@ -26,6 +26,33 @@
]
}
}
+ },
+ "cpu_info": {
+ "description": "Configure CPU specifics for a VM.",
+ "type": "object",
+ "properties": {
+ "topology": {
+ "description": "Configure the guest CPU topology.",
+ "type": "object",
+ "properties": {
+ "sockets": {
+ "type": "integer",
+ "required": true,
+ "minimum": 1
+ },
+ "cores": {
+ "type": "integer",
+ "required": true,
+ "minimum": 1
+ },
+ "threads": {
+ "type": "integer",
+ "required": true,
+ "minimum": 1
+ }
+ }
+ }
+ }
}
},
"properties": {
@@ -448,7 +475,8 @@
"type": "array",
"items": { "type": "string" }
},
- "graphics": { "$ref": "#/kimchitype/graphics" }
+ "graphics": { "$ref": "#/kimchitype/graphics" },
+ "cpu_info": { "$ref": "#/kimchitype/cpu_info" }
},
"additionalProperties": false,
"error": "KCHAPI0001E"
@@ -612,7 +640,8 @@
"type": "array",
"items": { "type": "string" }
},
- "graphics": { "$ref": "#/kimchitype/graphics" }
+ "graphics": { "$ref": "#/kimchitype/graphics" },
+ "cpu_info": { "$ref": "#/kimchitype/cpu_info" }
},
"additionalProperties": false,
"error": "KCHAPI0001E"
diff --git a/src/kimchi/control/templates.py b/src/kimchi/control/templates.py
index e17fa54..54caa92 100644
--- a/src/kimchi/control/templates.py
+++ b/src/kimchi/control/templates.py
@@ -38,13 +38,14 @@ def __init__(self, model, ident):
self.update_params = ["name", "folder", "icon", "os_distro",
"storagepool", "os_version", "cpus",
"memory", "cdrom", "disks", "networks",
- "graphics"]
+ "graphics", "cpu_info"]
self.uri_fmt = "/templates/%s"
self.clone = self.generate_action_handler('clone')
@property
def data(self):
- return {'name': self.ident,
+ return_data = {
+ 'name': self.ident,
'icon': self.info['icon'],
'invalid': self.info['invalid'],
'os_distro': self.info['os_distro'],
@@ -56,4 +57,10 @@ def data(self):
'storagepool': self.info['storagepool'],
'networks': self.info['networks'],
'folder': self.info.get('folder', []),
- 'graphics': self.info['graphics']}
+ 'graphics': self.info['graphics']
+ }
+ if (self.info.get('cpu_info')):
+ return_data['cpu_info'] = self.info['cpu_info']
+ else:
+ return_data['cpu_info'] = ''
+ return return_data
diff --git a/src/kimchi/i18n.py b/src/kimchi/i18n.py
index 75fb076..611316c 100644
--- a/src/kimchi/i18n.py
+++ b/src/kimchi/i18n.py
@@ -143,6 +143,7 @@
"KCHTMPL0022E": _("Disk size must be an integer greater than 1GB."),
"KCHTMPL0023E": _("Template base image must be a valid local image file"),
"KCHTMPL0024E": _("Cannot identify base image %(path)s format"),
+ "KCHTMPL0025E": _("When specifying CPU topology, VCPUs must be a product of sockets, cores, and threads."),
"KCHPOOL0001E": _("Storage pool %(name)s already exists"),
"KCHPOOL0002E": _("Storage pool %(name)s does not exist"),
diff --git a/src/kimchi/model/templates.py b/src/kimchi/model/templates.py
index 9278cdc..2954148 100644
--- a/src/kimchi/model/templates.py
+++ b/src/kimchi/model/templates.py
@@ -48,6 +48,22 @@ def create(self, params):
{'filename': iso, 'user': user,
'err': excp})
+ cpu_info = params.get('cpu_info')
+ if cpu_info:
+ cpu_info = dict(params['cpu_info'])
+ topology = cpu_info.get('topology')
+ # Check, even though currently only topology
+ # is supported.
+ if topology:
+ sockets = topology['sockets']
+ cores = topology['cores']
+ threads = topology['threads']
+ vcpus = params.get('cpus')
+ if vcpus is None:
+ params['cpus'] = sockets * cores * threads
+ elif vcpus != sockets * cores * threads:
+ raise InvalidParameter("KCHTMPL0025E")
+
conn = self.conn.get()
pool_uri = params.get(u'storagepool', '')
if pool_uri:
@@ -156,6 +172,10 @@ def update(self, name, params):
old_t = self.lookup(name)
new_t = copy.copy(old_t)
new_t.update(params)
+
+ if not self._validate_updated_cpu_params(new_t):
+ raise InvalidParameter('KCHTMPL0025E')
+
ident = name
conn = self.conn.get()
@@ -187,6 +207,18 @@ def update(self, name, params):
raise
return ident
+ def _validate_updated_cpu_params(self, info):
+ # Note: cpu_info is the parent of topology. cpus is vcpus
+ vcpus = info['cpus']
+ cpu_info = info.get('cpu_info')
+ if cpu_info is None:
+ return True
+ topology = cpu_info.get('topology')
+ if topology is None:
+ return True
+ return vcpus == topology['sockets'] * topology['cores'] * \
+ topology['threads']
+
class LibvirtVMTemplate(VMTemplate):
def __init__(self, args, scan=False, conn=None):
diff --git a/src/kimchi/osinfo.py b/src/kimchi/osinfo.py
index 6ee5e48..0e16b50 100644
--- a/src/kimchi/osinfo.py
+++ b/src/kimchi/osinfo.py
@@ -32,9 +32,8 @@
'power': ('ppc', 'ppc64')}
-common_spec = {'cpus': 1, 'cpu_cores': 1, 'cpu_threads': 1, 'memory': 1024,
- 'disks': [{'index': 0, 'size': 10}], 'cdrom_bus': 'ide',
- 'cdrom_index': 2, 'mouse_bus': 'ps2'}
+common_spec = {'cpus': 1, 'memory': 1024, 'disks': [{'index': 0, 'size': 10}],
+ 'cdrom_bus': 'ide', 'cdrom_index': 2, 'mouse_bus': 'ps2'}
modern_spec = dict(common_spec, disk_bus='virtio', nic_model='virtio')
diff --git a/src/kimchi/vmtemplate.py b/src/kimchi/vmtemplate.py
index 5f22db9..cfb7704 100644
--- a/src/kimchi/vmtemplate.py
+++ b/src/kimchi/vmtemplate.py
@@ -358,6 +358,20 @@ def _get_input_output_xml(self):
input_output += sound % self.info
return input_output
+ def _get_cpu_xml(self):
+
+ cpu_info = self.info.get('cpu_info')
+ if cpu_info is None:
+ return ""
+ cpu_topo = cpu_info.get('topology')
+ if cpu_topo is None:
+ return ""
+ return etree.tostring(E.cpu(E.topology(
+ sockets=str(cpu_topo['sockets']),
+ cores=str(cpu_topo['cores']),
+ threads=str(cpu_topo['threads']))))
+
+
def to_vm_xml(self, vm_name, vm_uuid, **kwargs):
params = dict(self.info)
params['name'] = vm_name
@@ -369,6 +383,7 @@ def to_vm_xml(self, vm_name, vm_uuid, **kwargs):
params['qemu-stream-cmdline'] = ''
graphics = kwargs.get('graphics')
params['graphics'] = self._get_graphics_xml(graphics)
+ params['cpu_info'] = self._get_cpu_xml()
# Current implementation just allows to create disk in one single
# storage pool, so we cannot mix the types (scsi volumes vs img file)
@@ -400,6 +415,7 @@ def to_vm_xml(self, vm_name, vm_uuid, **kwargs):
<uuid>%(uuid)s</uuid>
<memory unit='MiB'>%(memory)s</memory>
<vcpu>%(cpus)s</vcpu>
+ %(cpu_info)s
<os>
<type arch='%(arch)s'>hvm</type>
<boot dev='hd'/>
--
1.9.3
10 years, 2 months
[PATCH 0/2 V5] Detect and enable help page from plugins tabs
by Rodrigo Trujillo
This patch set changes the way Kimchi loads Help pages of the tabs of
the plugins.
It also changes the Sample plugin, in order to demonstrate and show
properly how to configure the a Help page
V5:
- removed do_substituion. Use kimchi.config.PluginPaths
- make changes proposed by Aline in kimchi.main.js
Rodrigo Trujillo (2):
Fix problems to open plugin's help pages
Changes in sample plugin to fix and improve help
plugins/sample/sample.conf.in | 5 ++
plugins/sample/ui/config/tab-ext.xml | 11 ++++-
plugins/sample/ui/pages/Makefile.am | 2 +-
.../sample/ui/pages/help/en_US/sample-tab1.html | 1 +
.../sample/ui/pages/help/en_US/sample-tab2.html | 1 +
plugins/sample/ui/pages/sample-tab1.html.tmpl | 30 ++++++++++++
plugins/sample/ui/pages/sample-tab2.html.tmpl | 30 ++++++++++++
plugins/sample/ui/pages/tab.html.tmpl | 30 ------------
ui/js/src/kimchi.main.js | 53 ++++++++++++++++------
9 files changed, 116 insertions(+), 47 deletions(-)
create mode 100644 plugins/sample/ui/pages/help/en_US/sample-tab1.html
create mode 100644 plugins/sample/ui/pages/help/en_US/sample-tab2.html
create mode 100644 plugins/sample/ui/pages/sample-tab1.html.tmpl
create mode 100644 plugins/sample/ui/pages/sample-tab2.html.tmpl
delete mode 100644 plugins/sample/ui/pages/tab.html.tmpl
--
1.9.3
10 years, 2 months
[PATCH] Disabling screen log in production environment
by Daniel Henrique Barboza
When building kimchi's RPM, some messages are getting
logged in /var/log/messages because cherrypy is logging
in the standard output. This happens because a function
in FeatureTests is enabling log.screen regardless of the
current environment. This patch makes a verification that
prevents the screen log to be enabled in the production
environment.
The line 'cherrypy.log.screen = True' was removed in
server.py because it has no effect. It is ignored in the
default (=production) environment and it is redundant in
dev environment because the screen log is activated by
default.
Signed-off-by: Daniel Henrique Barboza <danielhb(a)linux.vnet.ibm.com>
---
src/kimchi/featuretests.py | 6 ++++--
src/kimchi/server.py | 1 -
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/kimchi/featuretests.py b/src/kimchi/featuretests.py
index c6f4687..1310745 100644
--- a/src/kimchi/featuretests.py
+++ b/src/kimchi/featuretests.py
@@ -95,8 +95,10 @@ class FeatureTests(object):
def enable_screen_error_logging():
# Unregister the error handler
libvirt.registerErrorHandler(f=None, ctx=None)
- # Enable cherrypy screen logging
- cherrypy.log.screen = True
+ # Enable cherrypy screen logging if running environment
+ # is not 'production'
+ if cherrypy.config.get('environment') != 'production':
+ cherrypy.log.screen = True
@staticmethod
def libvirt_supports_iso_stream(protocol):
diff --git a/src/kimchi/server.py b/src/kimchi/server.py
index 8d166e5..46f128c 100644
--- a/src/kimchi/server.py
+++ b/src/kimchi/server.py
@@ -91,7 +91,6 @@ class Server(object):
max_body_size_in_bytes = eval(options.max_body_size) * 1024
cherrypy.server.max_request_body_size = max_body_size_in_bytes
- cherrypy.log.screen = True
cherrypy.log.access_file = options.access_log
cherrypy.log.error_file = options.error_log
--
1.8.3.1
10 years, 2 months