[libvirt] libvirt: xen: Shutdown detection fixes
by Stefan Bader
The issue is easy to observe when using virt-manager as a frontend.
Its main window seems to open connections for the up/down main
display once and then only repeats DomainGetInfo on the same
connection to check whether the instance is up or shut down.
The initial open on the connection sets the domain id to -1 for
inactive managed domains. And once running, the hypervisor driver
returns the status. But after shutdown, the domain cannot be found
by the hypervisor driver and the domain info is obtained by the
xend driver. However, that expects the domain id to be -1 for
inactive domains. This is not true (anymore). In testing I found
that domain/status seems to be always present and better suited
to check whether a domain is running or not (0 for shutdown and
2 for running, there are probably other values, too).
Beside the change, which does fix this problem, the question is
whether there should be a mechanism that resets domain->id to -1
when the instance is found to be shut down. And if that should
happen, should it be done by any sub-driver or by the unified
driver.
The second problem I observed when I shut down an instance from
the vnc console provided by virt-manager. As soon as the instance
was down, the log produced internal errors about every second.
Found this again, to be related to the unified driver approach.
The call that causes the many error messages is GetVcpus. While
the instance is up, the hypervisor driver returns those. But
after shutdown, the domain cannot be found by that driver. The
xend driver works, though. So what happens is that the hypervisor
driver logs an internal error but the call succeeds because the
xend driver returns successful.
This generally opens the question whether a sub-driver should
log any errors (at least not on error level, maybe debug)?
The second patch only quiets down the one message I saw repeated
that often. There are some other errors logged without any
obvious problems interacting with the instances, but those are
by far less often.
-Stefan
Please cc: me on replies as I am (yeah still) not subscribed to
this m-l. Thanks.
12 years, 7 months
[libvirt] [PATCH 1/2] build: drop obsolete qparams test
by Eric Blake
Otherwise, 'make check' breaks since commit bc1ff160 deleted
qparams.h. A later patch will ensure that viruri takes over
what qparams used to do.
* tests/qparamtest.c (mymain): Delete, now that we have viruri.
* tests/Makefile.am (check_PROGRAMS, TESTS, qparamtest_SOURCES):
Delete old test.
* .gitignore: Add recent test additions.
---
Pushing this under the build-breaker rule.
.gitignore | 3 +++
tests/Makefile.am | 7 +------
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/.gitignore b/.gitignore
index b35e863..2f27ff4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -139,11 +139,14 @@
/tests/ssh
/tests/statstest
/tests/utiltest
+/tests/virauthconfigtest
/tests/virbuftest
/tests/virhashtest
+/tests/virkeyfiletest
/tests/virnet*test
/tests/virshtest
/tests/virtimetest
+/tests/viruritest
/tests/vmx2xmltest
/tests/xencapstest
/tests/xmconfigtest
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 0e5ca39..4755a3e 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -92,7 +92,7 @@ EXTRA_DIST = \
.valgrind.supp
check_PROGRAMS = virshtest conftest sockettest \
- nodeinfotest qparamtest virbuftest \
+ nodeinfotest virbuftest \
commandtest commandhelper seclabeltest \
virhashtest virnetmessagetest virnetsockettest ssh \
utiltest virnettlscontexttest shunloadtest \
@@ -210,7 +210,6 @@ EXTRA_DIST += $(test_scripts)
TESTS = virshtest \
nodeinfotest \
- qparamtest \
virbuftest \
sockettest \
commandtest \
@@ -529,10 +528,6 @@ seclabeltest_SOURCES = \
seclabeltest.c
seclabeltest_LDADD = ../src/libvirt_driver_security.la $(LDADDS)
-qparamtest_SOURCES = \
- qparamtest.c testutils.h testutils.c
-qparamtest_LDADD = $(LDADDS)
-
virbuftest_SOURCES = \
virbuftest.c testutils.h testutils.c
virbuftest_LDADD = $(LDADDS)
--
1.7.7.6
12 years, 7 months
[libvirt] [libvirt-glib] [PATCH] cannot build master - conn_test fails to build due to missing linkage on in tree libvirt-gconfig
by Alban Browaeys
link conn_test againt in tree libvirt-gconfig
Description of problem:
CCLD conn-test
../libvirt-gobject/.libs/libvirt-gobject-1.0.so: undefined reference to
`gvir_config_domain_interface_get_ifname(a)LIBVIRT_GCONFIG_0.0.4'
Attach patch add ../libvirt-gconfig/libvirt-gconfig-1.0.la \
to the conn_test_LDADD to fix this issue.
>From b62413c4b888b140ad6d7214d2163ce06f57ff19 Mon Sep 17 00:00:00 2001
From: Alban Browaeys <prahal(a)yahoo.com>
Date: Tue, 6 Mar 2012 20:55:14 +0100
Subject: [PATCH] examples: test not linked against in tree libvirt-gconfig
CCLD conn-test
../libvirt-gobject/.libs/libvirt-gobject-1.0.so: undefined reference to
`gvir_config_domain_interface_get_ifname(a)LIBVIRT_GCONFIG_0.0.4'
---
examples/Makefile.am | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/examples/Makefile.am b/examples/Makefile.am
index b77076d..09843e5 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -24,6 +24,7 @@ conn_test_CFLAGS = \
conn_test_SOURCES = \
conn-test.c
conn_test_LDADD = \
+ ../libvirt-gconfig/libvirt-gconfig-1.0.la \
../libvirt-gobject/libvirt-gobject-1.0.la \
$(LIBVIRT_LIBS) \
$(GLIB2_LIBS) \
--
1.7.9.1
12 years, 7 months
[libvirt] [test-API PATCHv2] libs: Add flags for streams and the console
by Peter Krempa
Add the local copy of the flags.
---
lib/domainAPI.py | 3 +++
lib/streamAPI.py | 3 +++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/lib/domainAPI.py b/lib/domainAPI.py
index bc0069b..43565c2 100644
--- a/lib/domainAPI.py
+++ b/lib/domainAPI.py
@@ -912,3 +912,6 @@ VIR_DOMAIN_AFFECT_CURRENT = 0
VIR_DOMAIN_AFFECT_LIVE = 1
VIR_DOMAIN_AFFECT_CONFIG = 2
+# virDomainConsoleFlags
+VIR_DOMAIN_CONSOLE_FORCE = 1
+VIR_DOMAIN_CONSOLE_SAFE = 2
diff --git a/lib/streamAPI.py b/lib/streamAPI.py
index 18ce71e..0dfda28 100644
--- a/lib/streamAPI.py
+++ b/lib/streamAPI.py
@@ -118,3 +118,6 @@ VIR_EVENT_HANDLE_READABLE = 1
VIR_EVENT_HANDLE_WRITABLE = 2
VIR_EVENT_HANDLE_ERROR = 4
VIR_EVENT_HANDLE_HANGUP = 8
+
+# virStreamFlags
+VIR_STREAM_NONBLOCK = 1
--
1.7.3.4
12 years, 7 months
[libvirt] [test-API PATCH] streamAPI: Create stream objects that are already encapsulated
by Peter Krempa
With this patch, the newStream() method of the ConnectAPI class returns
an already encapsulated StreamAPI object .
*lib/connectAPI.py: - modify newStream method to return StreamAPI
object
*lib/streamAPI.py: - modify constructor to take virStream objects
---
lib/connectAPI.py | 4 +++-
lib/streamAPI.py | 9 ++-------
2 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/lib/connectAPI.py b/lib/connectAPI.py
index f52467f..2723fc8 100644
--- a/lib/connectAPI.py
+++ b/lib/connectAPI.py
@@ -24,6 +24,7 @@ import os
import re
import libvirt
+from lib import streamAPI
def append_path(path):
"""Append root path of package"""
@@ -226,7 +227,8 @@ class ConnectAPI(object):
def newStream(self, flag = 0):
try:
- return self.conn.newStream(flag)
+ st_obj = self.conn.newStream(flag)
+ return streamAPI.StreamAPI(st_obj)
except libvirt.libvirtError, e:
message = e.get_error_message()
code = e.get_error_code()
diff --git a/lib/streamAPI.py b/lib/streamAPI.py
index 18ce71e..f551992 100644
--- a/lib/streamAPI.py
+++ b/lib/streamAPI.py
@@ -38,13 +38,8 @@ append_path(result.group(0))
import exception
class StreamAPI(object):
- def __init__(self, conn, flags = 0):
- try:
- self.stream = conn.newStream(flags)
- except libvirt.libvirtError, e:
- message = e.get_error_message()
- code = e.get_error_code()
- raise exception.LibvirtAPI(message, code)
+ def __init__(self, stream):
+ self.stream = stream;
def getStream(self):
return self.stream
--
1.7.3.4
12 years, 7 months
[libvirt] [PATCH] test-API: Remove trailing spaces
by Osier Yang
Script used to do the work:
% for f in $(find . -type f -name "*.py"); do \
sed -i -e "s/\(?*\)\s\+$/\1/g" $f; \
done
---
env_inspect.py | 20 +++++-----
exception.py | 12 +++---
lib/snapshotAPI.py | 18 ++++----
logxmlparser.py | 80 +++++++++++++++++++-------------------
process.py | 6 +-
repos/domain/attach_interface.py | 2 +-
repos/domain/ownership_test.py | 2 +-
7 files changed, 70 insertions(+), 70 deletions(-)
diff --git a/env_inspect.py b/env_inspect.py
index e790e03..a290329 100644
--- a/env_inspect.py
+++ b/env_inspect.py
@@ -13,11 +13,11 @@
# The GPL text is available in the file COPYING that accompanies this
# distribution and at <http://www.gnu.org/licenses>.
#
-# Filename: envinspect.py
-# Summary: To generate a callable class for clearing testing environment
-# Description: The module match the reference of clearing function
-# from each testcase to the corresponding testcase's
-# argument in the order of testcase running
+# Filename: envinspect.py
+# Summary: To generate a callable class for clearing testing environment
+# Description: The module match the reference of clearing function
+# from each testcase to the corresponding testcase's
+# argument in the order of testcase running
import subprocess
@@ -72,7 +72,7 @@ class EnvInspect(object):
"""to check and collect the testing enviroment infomation
before performing testing
"""
-
+
def __init__(self, logger):
self.logger = logger
@@ -87,7 +87,7 @@ class EnvInspect(object):
self.logger.info(" %-36s%-6s" % (get_libvirt_ver()[1], result))
if get_libvirt_pyth_ver()[0] == 100:
- result = NOTOK
+ result = NOTOK
flag = 1
else:
result = OK
@@ -100,7 +100,7 @@ class EnvInspect(object):
result = OK
self.logger.info(" %-36s%-6s" % (get_libvirt_cli_ver()[1], result))
- if get_qemu_kvm_ver()[0] == 150 and flag == 0:
+ if get_qemu_kvm_ver()[0] == 150 and flag == 0:
flag = 0
elif get_qemu_kvm_ver()[0] == 150 and flag == 1:
flag = 1
@@ -115,8 +115,8 @@ class EnvInspect(object):
result = OK
self.logger.info(" %-36s%-6s" % (get_kernel_ver()[1], result))
- return flag
-
+ return flag
+
OK = "ok"
NOTOK = "not ok"
diff --git a/exception.py b/exception.py
index 1a6d6f1..5a6a6d3 100644
--- a/exception.py
+++ b/exception.py
@@ -13,10 +13,10 @@
# The GPL text is available in the file COPYING that accompanies this
# distribution and at <http://www.gnu.org/licenses>.
#
-# Filename: exception.py
-# Summary: the exception class
-# Description: The module defines the exceptions the framework could use
-# when fatal error occurred.
+# Filename: exception.py
+# Summary: the exception class
+# Description: The module defines the exceptions the framework could use
+# when fatal error occurred.
import libvirt
@@ -32,13 +32,13 @@ class LibvirtException(Exception):
return repr(self.errorstr)
def response(self):
- self.status = {'code':self.code, 'message':"%s:%s" %
+ self.status = {'code':self.code, 'message':"%s:%s" %
(self.message, str(self))}
return self.status
class FileDoesNotExist(LibvirtException):
code = 201
- message = "File does not exist"
+ message = "File does not exist"
class SectionDoesNotExist(LibvirtException):
code = 202
diff --git a/lib/snapshotAPI.py b/lib/snapshotAPI.py
index 43ccb89..d363992 100644
--- a/lib/snapshotAPI.py
+++ b/lib/snapshotAPI.py
@@ -24,14 +24,14 @@ import libvirt
import re
import os
-def append_path(path):
+def append_path(path):
"""Append root path of package"""
if path in sys.path:
pass
else:
sys.path.append(path)
-
-pwd = os.getcwd()
+
+pwd = os.getcwd()
result = re.search('(.*)libvirt-test-API', pwd)
append_path(result.group(0))
@@ -39,7 +39,7 @@ import exception
class SnapshotAPI(object):
def __init__(self, connection):
- self.conn = connection
+ self.conn = connection
def create(self, domname, xml_desc, flag = 0):
try:
@@ -57,7 +57,7 @@ class SnapshotAPI(object):
except libvirt.libvirtError, e:
message = e.get_error_message()
code = e.get_error_code()
- raise exception.LibvirtAPI(message, code)
+ raise exception.LibvirtAPI(message, code)
def snapshot_name_list(self, domname, flag = 0):
try:
@@ -66,7 +66,7 @@ class SnapshotAPI(object):
except libvirt.libvirtError, e:
message = e.get_error_message()
code = e.get_error_code()
- raise exception.LibvirtAPI(message, code)
+ raise exception.LibvirtAPI(message, code)
def snapshot_nums(self, domname, flag = 0):
try:
@@ -95,7 +95,7 @@ class SnapshotAPI(object):
message = e.get_error_message()
code = e.get_error_code()
raise exception.LibvirtAPI(message, code)
-
+
def delete(self, domname, snapname, flag = 0):
try:
snap = self.snapshot_lookup_by_name(domname, snapname, flag = 0)
@@ -103,7 +103,7 @@ class SnapshotAPI(object):
except libvirt.libvirtError, e:
message = e.get_error_message()
code = e.get_error_code()
- raise exception.LibvirtAPI(message, code)
+ raise exception.LibvirtAPI(message, code)
def get_xml_desc(self, domname, snapname, flag = 0):
try:
@@ -122,4 +122,4 @@ class SnapshotAPI(object):
message = e.get_error_message()
code = e.get_error_code()
raise exception.LibvirtAPI(message, code)
-
+
diff --git a/logxmlparser.py b/logxmlparser.py
index 014397e..48e3c51 100644
--- a/logxmlparser.py
+++ b/logxmlparser.py
@@ -13,10 +13,10 @@
# The GPL text is available in the file COPYING that accompanies this
# distribution and at <http://www.gnu.org/licenses>.
#
-# Filename: xmlparser.py
-# Summary: generate xmlfile for log management
-# Description: The module gives methods to write xml block
-# during a testrun running
+# Filename: xmlparser.py
+# Summary: generate xmlfile for log management
+# Description: The module gives methods to write xml block
+# during a testrun running
import os
import copy
@@ -30,19 +30,19 @@ class LogXMLParser(object):
"""
def __init__(self, logxml):
self.logxml = logxml
- self.doc = Document()
+ self.doc = Document()
- def generate_logxml(self):
+ def generate_logxml(self):
""" generate a new log xml file with head if that doesn't exist """
XMLFILE = open(self.logxml, "w")
XMLFILE.write('<?xml version="1.0"?><?xml-stylesheet type="text/xsl"\
href="log.xsl"?><log xmlns:xlink= \
- "http://www.w3.org/1999/xlink"></log>')
- XMLFILE.close()
+ "http://www.w3.org/1999/xlink"></log>')
+ XMLFILE.close()
def add_testrun_xml(self, testrunid):
""" add testrun info into log xml file"""
- xmldoc = minidom.parse(self.logxml)
+ xmldoc = minidom.parse(self.logxml)
testrun = self.doc.createElement('testrun')
testrun.setAttribute("name", testrunid)
xmldoc.childNodes[1].appendChild(testrun)
@@ -52,30 +52,30 @@ class LogXMLParser(object):
def add_test_xml(self, testrunid, testid):
""" add a test info into log xml file"""
xmldoc = minidom.parse(self.logxml)
- test = self.doc.createElement('test')
+ test = self.doc.createElement('test')
test.setAttribute("id", testid)
testrunlist = xmldoc.getElementsByTagName('testrun')
for testrun in testrunlist:
runattr = testrun.attributes["name"]
if runattr.value == testrunid:
- testrun.appendChild(test)
+ testrun.appendChild(test)
- self.__write_to_file(xmldoc, self.logxml)
+ self.__write_to_file(xmldoc, self.logxml)
def add_testprocedure_xml(self, testrunid, testid, test_procedure):
""" add test procedure info into log xml file """
xmldoc = minidom.parse(self.logxml)
procedure = self.doc.createElement('test_procedure')
- casename = test_procedure.keys()[0]
+ casename = test_procedure.keys()[0]
valuedict = test_procedure[casename]
test_casename = self.doc.createElement('action')
- test_casename.setAttribute('name', casename)
+ test_casename.setAttribute('name', casename)
for arg in valuedict.keys():
- test_arg = self.doc.createElement('arg')
- test_arg.setAttribute("name", arg)
+ test_arg = self.doc.createElement('arg')
+ test_arg.setAttribute("name", arg)
test_value = self.doc.createTextNode(valuedict[arg])
test_arg.appendChild(test_value)
test_casename.appendChild(test_arg)
@@ -92,20 +92,20 @@ class LogXMLParser(object):
if testattr.value == testid:
test.appendChild(procedure)
- self. __write_to_file(xmldoc, self.logxml)
+ self. __write_to_file(xmldoc, self.logxml)
- def add_test_summary(self, testrunid, testid, result,
+ def add_test_summary(self, testrunid, testid, result,
start_time, end_time, path):
""" add a test summary xml block into log xml file """
xmldoc = minidom.parse(self.logxml)
testresult = self.doc.createElement('result')
resulttext = self.doc.createTextNode(result)
testresult.appendChild(resulttext)
-
+
teststarttime = self.doc.createElement('start_time')
starttimetext = self.doc.createTextNode(start_time)
teststarttime.appendChild(starttimetext)
-
+
testendtime = self.doc.createElement('end_time')
endtimetext = self.doc.createTextNode(end_time)
testendtime.appendChild(endtimetext)
@@ -126,20 +126,20 @@ class LogXMLParser(object):
test.childNodes.insert(0, testpath)
test.childNodes.insert(0, testendtime)
test.childNodes.insert(0, teststarttime)
- test.childNodes.insert(0, testresult)
+ test.childNodes.insert(0, testresult)
self. __write_to_file(xmldoc, self.logxml)
- def add_testrun_summary(self, testrunid, passnum, failnum, totalnum,
+ def add_testrun_summary(self, testrunid, passnum, failnum, totalnum,
start_time, end_time):
""" add a testrun summary xml block into log xml file """
xmldoc = minidom.parse(self.logxml)
testpass = self.doc.createElement('pass')
passtext = self.doc.createTextNode(str(passnum))
testpass.appendChild(passtext)
-
- testfail = self.doc.createElement('fail')
+
+ testfail = self.doc.createElement('fail')
failtext = self.doc.createTextNode(str(failnum))
testfail.appendChild(failtext)
@@ -154,7 +154,7 @@ class LogXMLParser(object):
teststarttime = self.doc.createElement('start_time')
starttimetext = self.doc.createTextNode(start_time)
teststarttime.appendChild(starttimetext)
-
+
testendtime = self.doc.createElement('end_time')
endtimetext = self.doc.createTextNode(end_time)
testendtime.appendChild(endtimetext)
@@ -170,10 +170,10 @@ class LogXMLParser(object):
testrun.childNodes.insert(0, testpass)
self. __write_to_file(xmldoc, self.logxml)
-
+
def remove_test_xml(self, testrunid, testid):
""" to remove a test xml block from a log xml file """
- xmldoc = minidom.parse(self.logxml)
+ xmldoc = minidom.parse(self.logxml)
testrunlist = xmldoc.getElementsByTagName('testrun')
testrunattrlist = []
@@ -187,21 +187,21 @@ class LogXMLParser(object):
testattr = test.attributes["id"]
if testattr.value == testid:
testattrlist.append(testattr.value)
- testrun.removeChild(test)
+ testrun.removeChild(test)
if len(testattrlist) == 0:
raise exception.NoTestFound(
- "In the xmllog file testrunid %s no testid %s found" %
+ "In the xmllog file testrunid %s no testid %s found" %
(testrunid, testid))
if len(testrunattrlist) == 0:
raise exception.NoTestRunFound(
- "In the xmllog file no testrunid %s found" %
+ "In the xmllog file no testrunid %s found" %
testrunid)
- self. __write_to_file(xmldoc, self.logxml)
-
+ self. __write_to_file(xmldoc, self.logxml)
+
def remove_testrun_xml(self, testrunid):
""" remove a testrun xml block from log xml file """
- xmldoc = minidom.parse(self.logxml)
+ xmldoc = minidom.parse(self.logxml)
testrunlist = xmldoc.getElementsByTagName('testrun')
testrunattrlist = []
@@ -213,9 +213,9 @@ class LogXMLParser(object):
if len(testrunattrlist) == 0:
raise exception.NoTestRunFound(
- "In the xmllog file no testrunid %s found" %
+ "In the xmllog file no testrunid %s found" %
testrunid)
-
+
self. __write_to_file(xmldoc, self.logxml)
def remove_alltestrun_xml(self):
@@ -228,8 +228,8 @@ class LogXMLParser(object):
runattr = testrun.attributes["name"]
testrunattrlist.append(runattr.value)
xmldoc.childNodes[1].removeChild(testrun)
-
- self. __write_to_file(xmldoc, self.logxml)
+
+ self. __write_to_file(xmldoc, self.logxml)
return testrunattrlist
def merge_xmlfiles(self, logxml_two):
@@ -241,13 +241,13 @@ class LogXMLParser(object):
for testrun in testrunlist_two_copy:
xmldoc_one.childNodes[1].appendChild(testrun)
-
- self. __write_to_file(xmldoc_one, self.logxml)
+
+ self. __write_to_file(xmldoc_one, self.logxml)
self. __write_to_file(xmldoc_two, logxml_two)
def __write_to_file(self, xmldoc, logxml):
""" save changes into log xml file """
file = open(logxml, "w")
- xmldoc.writexml(file)
+ xmldoc.writexml(file)
file.close()
diff --git a/process.py b/process.py
index 4d65f72..a712816 100644
--- a/process.py
+++ b/process.py
@@ -13,10 +13,10 @@
# The GPL text is available in the file COPYING that accompanies this
# distribution and at <http://www.gnu.org/licenses>.
#
-# Filename: process.py
-# Summary: multiprocessing module
+# Filename: process.py
+# Summary: multiprocessing module
# Description: If the switch of multiprocessing is on,
-# the module will be called to fork subprocess
+# the module will be called to fork subprocess
import os
import sys
diff --git a/repos/domain/attach_interface.py b/repos/domain/attach_interface.py
index 9d475a3..e6bbbda 100644
--- a/repos/domain/attach_interface.py
+++ b/repos/domain/attach_interface.py
@@ -107,7 +107,7 @@ def attach_interface(params):
return 1
finally:
conn.close()
- logger.info("closed hypervisor connection")
+ logger.info("closed hypervisor connection")
if test_result:
return 0
diff --git a/repos/domain/ownership_test.py b/repos/domain/ownership_test.py
index 1eacbcf..5464d86 100644
--- a/repos/domain/ownership_test.py
+++ b/repos/domain/ownership_test.py
@@ -230,7 +230,7 @@ def ownership_test(params):
logger.info("check the domain state")
ret = check_domain_running(domobj, guestname, logger)
if ret:
- return return_close(conn, logger, 1)
+ return return_close(conn, logger, 1)
try:
domobj.save(guestname, SAVE_FILE)
--
1.7.7.3
12 years, 7 months
[libvirt] [PATCH] Add qemu support for ppc64 on FC16 or above for rpm packaging
by Li Zhang
On Fedora16 or above, qemu is supported now. So it is added
in rpm packaging.
Signed-off-by: Li Zhang <zhlcindy(a)linux.vnet.ibm.com>
---
libvirt.spec.in | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 072fd8e..568a84f 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -139,8 +139,8 @@
%define with_xen 0
%endif
-# Fedora doesn't have any QEMU on ppc64 - only ppc
-%if 0%{?fedora}
+# Fedora doesn't have any QEMU on ppc64 until FC16 - only ppc
+%if 0%{?fedora} < 16
%ifarch ppc64
%define with_qemu 0
%endif
--
1.7.5.4
12 years, 7 months
[libvirt] QEMU fstatfs(2) and libvirt SELinux policy
by Stefan Hajnoczi
Hi,
I have a question about the libvirt SELinux policy that can be applied
to QEMU processes. Yesterday Laine helped Khoa and me diagnose an
issue where QEMU was doing fstatfs(2) but SELinux prevented this
FILESYSTEM__GETATTR operation, resulting in a failed syscall with
-EACCES. The SELinux hook is:
security/selinux/hooks.c:selinux_sb_statfs():
return superblock_has_perm(cred, dentry->d_sb,
FILESYSTEM__GETATTR, &ad);
It turns out this problem also affects XFS discard support in QEMU
today. QEMU calls platform_test_xfs_fd() in libxfs, which works like
this:
static __inline__ int platform_test_xfs_fd(int fd)
{
struct statfs buf;
if (fstatfs(fd, &buf) < 0)
return 0;
return (buf.f_type == 0x58465342); /* XFSB */
}
In other words, XFS detection will fail when SELinux is enabled.
I'm not familiar with libvirt's use of SELinux. Can someone explain
if we need to expand the policy in libvirt and how to do that?
Thanks,
Stefan
12 years, 7 months
[libvirt] [PATCH] spec: Add missed dependancy for numad
by Osier Yang
numad is available since Fedora 17 and RHEL6.X. And it's not supported
on s390[x] and ARM.
---
configure.ac | 26 +++++++++++++++++++++-----
libvirt.spec.in | 19 ++++++++++++++++++-
src/qemu/qemu_process.c | 2 +-
3 files changed, 40 insertions(+), 7 deletions(-)
diff --git a/configure.ac b/configure.ac
index 31f0835..ce9c0ff 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1445,14 +1445,29 @@ AM_CONDITIONAL([HAVE_NUMACTL], [test "$with_numactl" != "no"])
AC_SUBST([NUMACTL_CFLAGS])
AC_SUBST([NUMACTL_LIBS])
-dnl Do we have numad?
-if test "$with_qemu" = "yes"; then
- AC_PATH_PROG([NUMAD], [numad], [], [/bin:/usr/bin:/usr/local/bin:$PATH])
+dnl numad
+AC_ARG_WITH([numad],
+ AC_HELP_STRING([--with-numad], [use numad to manage CPU placement dynamically @<:@default=check@:>@]),
+ [],
+ [with_numad=check])
- if test -n "$NUMAD"; then
- AC_DEFINE_UNQUOTED([NUMAD],["$NUMAD"], [Location or name of the numad program])
+if test "$with_numad" != "no" ; then
+ AC_PATH_PROG([NUMAD], [numad], [], [/bin:/usr/bin])
+ if test -z "$NUMAD" ; then
+ if test "$with_numad" = "check"; then
+ with_numad="no"
+ else
+ AC_MSG_ERROR([You must install the 'numad' to manage CPU placement dynamically])
fi
+ else
+ with_numad="yes"
+ fi
+ if test "$with_numad" = "yes"; then
+ AC_DEFINE_UNQUOTED([HAVE_NUMAD], 1, [whether numad is available])
+ AC_DEFINE_UNQUOTED([NUMAD],["$NUMAD"], [Location or name of the numad program])
+ fi
fi
+AM_CONDITIONAL([HAVE_NUMAD], [test "$with_numad" != "no"])
dnl pcap lib
LIBPCAP_CONFIG="pcap-config"
@@ -2774,6 +2789,7 @@ AC_MSG_NOTICE([Warning Flags: $WARN_CFLAGS])
AC_MSG_NOTICE([ Readline: $lv_use_readline])
AC_MSG_NOTICE([ Python: $with_python])
AC_MSG_NOTICE([ DTrace: $with_dtrace])
+AC_MSG_NOTICE([ numad: $with_numad])
AC_MSG_NOTICE([ XML Catalog: $XML_CATALOG_FILE])
AC_MSG_NOTICE([ Init script: $with_init_script])
AC_MSG_NOTICE([Console locks: $with_console_lock_files])
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 072fd8e..78800c7 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -84,6 +84,7 @@
%define with_cgconfig 0%{!?_without_cgconfig:0}
%define with_sanlock 0%{!?_without_sanlock:0}
%define with_systemd 0%{!?_without_systemd:0}
+%define with_numad 0%{!?_without_numad:0}
# Non-server/HV driver defaults which are always enabled
%define with_python 0%{!?_without_python:1}
@@ -205,11 +206,19 @@
%define with_storage_disk 0
%endif
-# Enable libpcap library
%if %{with_qemu}
%define with_nwfilter 0%{!?_without_nwfilter:%{server_drivers}}
+# Enable libpcap library
%define with_libpcap 0%{!?_without_libpcap:%{server_drivers}}
%define with_macvtap 0%{!?_without_macvtap:%{server_drivers}}
+
+# numad is used to manage the CPU placement dynamically,
+# it's not available on s390[x] and ARM.
+%if 0%{?fedora} >= 17 || 0%{?rhel} >= 6
+%ifnarch s390 s390x %{arm}
+%define with_numad 0%{!?_without_numad:%{server_drivers}}
+%endif
+%endif
%endif
%if %{with_macvtap}
@@ -357,6 +366,9 @@ Requires(post): systemd-sysv
Requires(preun): systemd-units
Requires(postun): systemd-units
%endif
+%if %{with_numad}
+Requires: numad
+%endif
# All build-time requirements
%if 0%{?enable_autotools}
@@ -690,6 +702,10 @@ of recent versions of Linux (and other OSes).
%define _without_numactl --without-numactl
%endif
+%if ! %{with_numad}
+%define _without_numad --without-numad
+%endif
+
%if ! %{with_capng}
%define _without_capng --without-capng
%endif
@@ -775,6 +791,7 @@ autoreconf -if
%{?_without_storage_disk} \
%{?_without_storage_mpath} \
%{?_without_numactl} \
+ %{?_without_numad} \
%{?_without_capng} \
%{?_without_netcf} \
%{?_without_selinux} \
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 8915a9a..d0706b4 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -1633,7 +1633,7 @@ qemuProcessInitNumaMemoryPolicy(virDomainObjPtr vm)
}
#endif
-#if defined(NUMAD)
+#if HAVE_NUMAD
static char *
qemuGetNumadAdvice(virDomainDefPtr def)
{
--
1.7.7.3
12 years, 7 months
[libvirt] [PATCH 0/2] atomic snapshots, round 2
by Eric Blake
Depends on round 1 v2 being applied first:
https://www.redhat.com/archives/libvir-list/2012-March/msg00747.html
So far, I've tested that the error handling path works when targeting
the qemu of Fedora 16; I still plan to test that the success path
works with a self-built qemu using the code that has been accepted
for the upcoming qemu 1.1.
Eric Blake (2):
snapshot: add support for qemu transaction command
snapshot: wire up qemu transaction command
src/qemu/qemu_driver.c | 112 ++++++++++++++++++++++++++++++++++++++++--
src/qemu/qemu_monitor.c | 33 ++++++++++--
src/qemu/qemu_monitor.h | 4 ++
src/qemu/qemu_monitor_json.c | 82 ++++++++++++++++++++++++-------
src/qemu/qemu_monitor_json.h | 2 +
5 files changed, 205 insertions(+), 28 deletions(-)
--
1.7.7.6
12 years, 7 months