Devel
Threads by month
- ----- 2026 -----
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- 49 participants
- 40232 discussions
[libvirt] [PATCH v2] Allow stack traces to be included with log messages
by Daniel P. Berrange 15 May '12
by Daniel P. Berrange 15 May '12
15 May '12
From: "Daniel P. Berrange" <berrange(a)redhat.com>
Sometimes it is useful to see the callpath for log messages.
This change enhances the log filter syntax so that stack traces
can be show by setting '1:+NAME' instead of '1:NAME'.
This results in output like:
2012-05-09 14:18:45.136+0000: 13314: debug : virInitialize:414 : register drivers
/home/berrange/src/virt/libvirt/src/.libs/libvirt.so.0(virInitialize+0xd6)[0x7f89188ebe86]
/home/berrange/src/virt/libvirt/tools/.libs/lt-virsh[0x431921]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x3a21e21735]
/home/berrange/src/virt/libvirt/tools/.libs/lt-virsh[0x40a279]
2012-05-09 14:18:45.136+0000: 13314: debug : virRegisterDriver:775 : driver=0x7f8918d02760 name=Test
/home/berrange/src/virt/libvirt/src/.libs/libvirt.so.0(virRegisterDriver+0x6b)[0x7f89188ec717]
/home/berrange/src/virt/libvirt/src/.libs/libvirt.so.0(+0x11b3ad)[0x7f891891e3ad]
/home/berrange/src/virt/libvirt/src/.libs/libvirt.so.0(virInitialize+0xf3)[0x7f89188ebea3]
/home/berrange/src/virt/libvirt/tools/.libs/lt-virsh[0x431921]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x3a21e21735]
/home/berrange/src/virt/libvirt/tools/.libs/lt-virsh[0x40a279]
* docs/logging.html.in: Document new syntax
* configure.ac: Check for execinfo.h
* src/util/logging.c, src/util/logging.h: Add support for
stack traces
* tests/testutils.c: Adapt to API change
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
configure.ac | 2 +-
docs/logging.html.in | 6 +++--
src/util/logging.c | 73 ++++++++++++++++++++++++++++++++++++++++++--------
src/util/logging.h | 9 ++++++-
tests/testutils.c | 4 +++
5 files changed, 79 insertions(+), 15 deletions(-)
diff --git a/configure.ac b/configure.ac
index a6894ae..9c356c9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -158,7 +158,7 @@ dnl Availability of various common headers (non-fatal if missing).
AC_CHECK_HEADERS([pwd.h paths.h regex.h sys/un.h \
sys/poll.h syslog.h mntent.h net/ethernet.h linux/magic.h \
sys/un.h sys/syscall.h netinet/tcp.h ifaddrs.h libtasn1.h \
- net/if.h])
+ net/if.h execinfo.h])
AC_MSG_CHECKING([for struct ifreq in net/if.h])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
diff --git a/docs/logging.html.in b/docs/logging.html.in
index 22b5422..87e2292 100644
--- a/docs/logging.html.in
+++ b/docs/logging.html.in
@@ -114,8 +114,10 @@
</h3>
<p>The syntax for filters and outputs is the same for both types of
variables.</p>
- <p>The format for a filter is:</p>
- <pre>x:name</pre>
+ <p>The format for a filter is one of:</p>
+ <pre>
+ x:name (log message only)
+ x:+name (log message + stack trace)</pre>
<p>where <code>name</code> is a match string e.g. <code>remote</code> or
<code>qemu</code> and the x is the minimal level where matching messages
should be logged:</p>
diff --git a/src/util/logging.c b/src/util/logging.c
index 48a056d..110ad7e 100644
--- a/src/util/logging.c
+++ b/src/util/logging.c
@@ -34,6 +34,9 @@
#if HAVE_SYSLOG_H
# include <syslog.h>
#endif
+#ifdef HAVE_EXECINFO_H
+# include <execinfo.h>
+#endif
#include "ignore-value.h"
#include "virterror_internal.h"
@@ -64,6 +67,7 @@ static int virLogEnd = 0;
struct _virLogFilter {
const char *match;
int priority;
+ unsigned int flags;
};
typedef struct _virLogFilter virLogFilter;
typedef virLogFilter *virLogFilterPtr;
@@ -99,7 +103,9 @@ static int virLogResetFilters(void);
static int virLogResetOutputs(void);
static int virLogOutputToFd(const char *category, int priority,
const char *funcname, long long linenr,
- const char *timestamp, const char *str,
+ const char *timestamp,
+ unsigned int flags,
+ const char *str,
void *data);
/*
@@ -472,7 +478,7 @@ static int virLogResetFilters(void) {
* virLogDefineFilter:
* @match: the pattern to match
* @priority: the priority to give to messages matching the pattern
- * @flags: extra flag, currently unused
+ * @flags: extra flags, see virLogFilterFlags enum
*
* Defines a pattern used for log filtering, it allow to select or
* reject messages independently of the default priority.
@@ -487,7 +493,7 @@ int virLogDefineFilter(const char *match, int priority,
int i;
char *mdup = NULL;
- virCheckFlags(0, -1);
+ virCheckFlags(VIR_LOG_STACK_TRACE, -1);
if ((match == NULL) || (priority < VIR_LOG_DEBUG) ||
(priority > VIR_LOG_ERROR))
@@ -514,6 +520,7 @@ int virLogDefineFilter(const char *match, int priority,
}
virLogFilters[i].match = mdup;
virLogFilters[i].priority = priority;
+ virLogFilters[i].flags = flags;
virLogNbFilters++;
cleanup:
virLogUnlock();
@@ -530,7 +537,8 @@ cleanup:
*
* Returns 0 if not matched or the new priority if found.
*/
-static int virLogFiltersCheck(const char *input) {
+static int virLogFiltersCheck(const char *input,
+ unsigned int *flags) {
int ret = 0;
int i;
@@ -538,6 +546,7 @@ static int virLogFiltersCheck(const char *input) {
for (i = 0;i < virLogNbFilters;i++) {
if (strstr(input, virLogFilters[i].match)) {
ret = virLogFilters[i].priority;
+ *flags = virLogFilters[i].flags;
break;
}
}
@@ -691,6 +700,7 @@ void virLogMessage(const char *category, int priority, const char *funcname,
int saved_errno = errno;
int emit = 1;
va_list ap;
+ unsigned int filterflags = 0;
if (!virLogInitialized)
virLogStartup();
@@ -701,7 +711,7 @@ void virLogMessage(const char *category, int priority, const char *funcname,
/*
* check against list of specific logging patterns
*/
- fprio = virLogFiltersCheck(category);
+ fprio = virLogFiltersCheck(category, &filterflags);
if (fprio == 0) {
if (priority < virLogDefaultPriority)
emit = 0;
@@ -753,13 +763,14 @@ void virLogMessage(const char *category, int priority, const char *funcname,
if (virLogVersionString(&ver) >= 0)
virLogOutputs[i].f(category, VIR_LOG_INFO,
__func__, __LINE__,
- timestamp, ver,
+ timestamp, 0, ver,
virLogOutputs[i].data);
VIR_FREE(ver);
virLogOutputs[i].logVersion = false;
}
virLogOutputs[i].f(category, priority, funcname, linenr,
- timestamp, msg, virLogOutputs[i].data);
+ timestamp, filterflags,
+ msg, virLogOutputs[i].data);
}
}
if ((virLogNbOutputs == 0) && (flags != 1)) {
@@ -768,13 +779,14 @@ void virLogMessage(const char *category, int priority, const char *funcname,
if (virLogVersionString(&ver) >= 0)
virLogOutputToFd(category, VIR_LOG_INFO,
__func__, __LINE__,
- timestamp, ver,
+ timestamp, 0, ver,
(void *) STDERR_FILENO);
VIR_FREE(ver);
logVersionStderr = false;
}
virLogOutputToFd(category, priority, funcname, linenr,
- timestamp, msg, (void *) STDERR_FILENO);
+ timestamp, filterflags,
+ msg, (void *) STDERR_FILENO);
}
virLogUnlock();
@@ -783,11 +795,34 @@ cleanup:
errno = saved_errno;
}
+
+static void virLogStackTraceToFd(int fd)
+{
+#ifdef HAVE_EXECINFO_H
+ void *array[100];
+ int size;
+
+# define STRIP_DEPTH 3
+
+ size = backtrace(array, ARRAY_CARDINALITY(array));
+ backtrace_symbols_fd(array + STRIP_DEPTH, size - STRIP_DEPTH, fd);
+ ignore_value(safewrite(fd, "\n", 1));
+#else
+ static bool doneWarning = false;
+ const char *msg = "Stack trace not available on this platform\n";
+ if (!doneWarning) {
+ ignore_value(safewrite(fd, msg, strlen(msg)));
+ doneWarning = true;
+ }
+#endif
+}
+
static int virLogOutputToFd(const char *category ATTRIBUTE_UNUSED,
int priority ATTRIBUTE_UNUSED,
const char *funcname ATTRIBUTE_UNUSED,
long long linenr ATTRIBUTE_UNUSED,
const char *timestamp,
+ unsigned int flags,
const char *str,
void *data)
{
@@ -804,6 +839,9 @@ static int virLogOutputToFd(const char *category ATTRIBUTE_UNUSED,
ret = safewrite(fd, msg, strlen(msg));
VIR_FREE(msg);
+ if (flags & VIR_LOG_STACK_TRACE)
+ virLogStackTraceToFd(fd);
+
return ret;
}
@@ -841,11 +879,14 @@ static int virLogOutputToSyslog(const char *category ATTRIBUTE_UNUSED,
const char *funcname ATTRIBUTE_UNUSED,
long long linenr ATTRIBUTE_UNUSED,
const char *timestamp ATTRIBUTE_UNUSED,
+ unsigned int flags,
const char *str,
void *data ATTRIBUTE_UNUSED)
{
int prio;
+ virCheckFlags(VIR_LOG_STACK_TRACE, -1);
+
switch (priority) {
case VIR_LOG_DEBUG:
prio = LOG_DEBUG;
@@ -1024,12 +1065,17 @@ int virLogParseFilters(const char *filters) {
virSkipSpaces(&cur);
while (*cur != 0) {
+ unsigned int flags = 0;
prio= virParseNumber(&cur);
if ((prio < VIR_LOG_DEBUG) || (prio > VIR_LOG_ERROR))
goto cleanup;
if (*cur != ':')
goto cleanup;
cur++;
+ if (*cur == '+') {
+ flags |= VIR_LOG_STACK_TRACE;
+ cur++;
+ }
str = cur;
while ((*cur != 0) && (!IS_SPACE(cur)))
cur++;
@@ -1038,7 +1084,7 @@ int virLogParseFilters(const char *filters) {
name = strndup(str, cur - str);
if (name == NULL)
goto cleanup;
- if (virLogDefineFilter(name, prio, 0) >= 0)
+ if (virLogDefineFilter(name, prio, flags) >= 0)
count++;
VIR_FREE(name);
virSkipSpaces(&cur);
@@ -1072,7 +1118,12 @@ char *virLogGetFilters(void) {
virLogLock();
for (i = 0; i < virLogNbFilters; i++) {
- virBufferAsprintf(&filterbuf, "%d:%s ", virLogFilters[i].priority,
+ const char *sep = ":";
+ if (virLogFilters[i].flags & VIR_LOG_STACK_TRACE)
+ sep = ":+";
+ virBufferAsprintf(&filterbuf, "%d%s%s ",
+ virLogFilters[i].priority,
+ sep,
virLogFilters[i].match);
}
virLogUnlock();
diff --git a/src/util/logging.h b/src/util/logging.h
index 2343de0..a6fa63e 100644
--- a/src/util/logging.h
+++ b/src/util/logging.h
@@ -79,6 +79,7 @@ typedef enum {
* @funcname: the function emitting the message
* @linenr: line where the message was emitted
* @timestamp: zero terminated string with timestamp of the message
+ * @flags: flags associated with the message
* @str: the message to log, preformatted and zero terminated
* @data: extra output logging data
*
@@ -88,7 +89,9 @@ typedef enum {
*/
typedef int (*virLogOutputFunc) (const char *category, int priority,
const char *funcname, long long linenr,
- const char *timestamp, const char *str,
+ const char *timestamp,
+ unsigned int flags,
+ const char *str,
void *data);
/**
@@ -99,6 +102,10 @@ typedef int (*virLogOutputFunc) (const char *category, int priority,
*/
typedef void (*virLogCloseFunc) (void *data);
+typedef enum {
+ VIR_LOG_STACK_TRACE = (1 << 0),
+} virLogFlags;
+
extern int virLogGetNbFilters(void);
extern int virLogGetNbOutputs(void);
extern char *virLogGetFilters(void);
diff --git a/tests/testutils.c b/tests/testutils.c
index 6eb40ed..98595ad 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -44,6 +44,8 @@
# include <paths.h>
#endif
+#define VIR_FROM_THIS VIR_FROM_NONE
+
#define GETTIMEOFDAY(T) gettimeofday(T, NULL)
#define DIFF_MSEC(T, U) \
((((int) ((T)->tv_sec - (U)->tv_sec)) * 1000000.0 + \
@@ -469,10 +471,12 @@ virtTestLogOutput(const char *category ATTRIBUTE_UNUSED,
const char *funcname ATTRIBUTE_UNUSED,
long long lineno ATTRIBUTE_UNUSED,
const char *timestamp,
+ unsigned int flags,
const char *str,
void *data)
{
struct virtTestLogData *log = data;
+ virCheckFlags(VIR_LOG_STACK_TRACE, -1);
virBufferAsprintf(&log->buf, "%s: %s", timestamp, str);
return strlen(timestamp) + 2 + strlen(str);
}
--
1.7.10.1
2
1
From: "Daniel P. Berrange" <berrange(a)redhat.com>
According to Fedora guidelines, because we bundle gnulib we
need to add a virtual Provides: bundled(gnulib).
https://fedoraproject.org/wiki/Packaging:No_Bundled_Libraries#Requirement_i…
---
libvirt.spec.in | 2 ++
1 file changed, 2 insertions(+)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 2e08abb..eef8ce1 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -460,6 +460,8 @@ BuildRequires: scrub
BuildRequires: numad
%endif
+Provides: bundled(gnulib)
+
%description
Libvirt is a C toolkit to interact with the virtualization capabilities
of recent versions of Linux (and other OSes). The main package includes
--
1.7.10.1
2
1
[libvirt] [libvirt-glib 1/3] API to get capabilities from connection
by Zeeshan Ali (Khattak) 15 May '12
by Zeeshan Ali (Khattak) 15 May '12
15 May '12
From: "Zeeshan Ali (Khattak)" <zeeshanak(a)gnome.org>
---
libvirt-gconfig/libvirt-gconfig-capabilities.c | 4 ---
libvirt-gobject/libvirt-gobject-connection.c | 32 ++++++++++++++++++++++++
libvirt-gobject/libvirt-gobject-connection.h | 3 ++
libvirt-gobject/libvirt-gobject.sym | 1 +
4 files changed, 36 insertions(+), 4 deletions(-)
diff --git a/libvirt-gconfig/libvirt-gconfig-capabilities.c b/libvirt-gconfig/libvirt-gconfig-capabilities.c
index 4c4df68..3d9d036 100644
--- a/libvirt-gconfig/libvirt-gconfig-capabilities.c
+++ b/libvirt-gconfig/libvirt-gconfig-capabilities.c
@@ -54,8 +54,6 @@ GVirConfigCapabilities *gvir_config_capabilities_new(void)
{
GVirConfigObject *object;
- /* FIXME: what is the XML root of the capability node? I suspect it is
- * either 'guest' or 'host' */
object = gvir_config_object_new(GVIR_CONFIG_TYPE_CAPABILITIES,
"capabilities",
DATADIR "/libvirt/schemas/capability.rng");
@@ -67,8 +65,6 @@ GVirConfigCapabilities *gvir_config_capabilities_new_from_xml(const gchar *xml,
{
GVirConfigObject *object;
- /* FIXME: what is the XML root of the capability node? I suspect it is
- * either 'guest' or 'host' */
object = gvir_config_object_new_from_xml(GVIR_CONFIG_TYPE_CAPABILITIES,
"capabilities",
DATADIR "/libvirt/schemas/capability.rng",
diff --git a/libvirt-gobject/libvirt-gobject-connection.c b/libvirt-gobject/libvirt-gobject-connection.c
index baeeb1c..4f04f98 100644
--- a/libvirt-gobject/libvirt-gobject-connection.c
+++ b/libvirt-gobject/libvirt-gobject-connection.c
@@ -1387,3 +1387,35 @@ GVirNodeInfo *gvir_connection_get_node_info(GVirConnection *conn,
return ret;
}
+
+/**
+ * gvir_connection_get_capabilities:
+ * @conn: the connection
+ * @err: return location for any #GError
+ *
+ * Return value: (transfer full): a #GVirConfigCapabilities or NULL
+ */
+GVirConfigCapabilities *gvir_connection_get_capabilities(GVirConnection *conn,
+ GError **err)
+{
+ GVirConfigCapabilities *caps;
+ char *caps_xml;
+
+ g_return_val_if_fail(GVIR_IS_CONNECTION(conn), NULL);
+ g_return_val_if_fail(err == NULL || *err == NULL, NULL);
+ g_return_val_if_fail(conn->priv->conn, NULL);
+
+ caps_xml = virConnectGetCapabilities(conn->priv->conn);
+ if (caps_xml == NULL) {
+ gvir_set_error_literal(err, GVIR_CONNECTION_ERROR,
+ 0,
+ "Unable to get capabilities");
+ return NULL;
+ }
+
+ caps = gvir_config_capabilities_new_from_xml(caps_xml, err);
+ free(caps_xml);
+
+ return caps;
+}
+
diff --git a/libvirt-gobject/libvirt-gobject-connection.h b/libvirt-gobject/libvirt-gobject-connection.h
index 3cc60a2..8c48f67 100644
--- a/libvirt-gobject/libvirt-gobject-connection.h
+++ b/libvirt-gobject/libvirt-gobject-connection.h
@@ -191,6 +191,9 @@ GVirStream *gvir_connection_get_stream(GVirConnection *conn,
GVirNodeInfo *gvir_connection_get_node_info(GVirConnection *conn,
GError **err);
+GVirConfigCapabilities *gvir_connection_get_capabilities(GVirConnection *conn,
+ GError **err);
+
G_END_DECLS
#endif /* __LIBVIRT_GOBJECT_CONNECTION_H__ */
diff --git a/libvirt-gobject/libvirt-gobject.sym b/libvirt-gobject/libvirt-gobject.sym
index f43836f..0c9fc37 100644
--- a/libvirt-gobject/libvirt-gobject.sym
+++ b/libvirt-gobject/libvirt-gobject.sym
@@ -31,6 +31,7 @@ LIBVIRT_GOBJECT_0.0.8 {
gvir_connection_create_storage_pool;
gvir_connection_start_domain;
gvir_connection_get_node_info;
+ gvir_connection_get_capabilities;
gvir_domain_device_get_type;
gvir_domain_device_get_domain;
--
1.7.7.6
3
41
[libvirt] [PATCH] openvz: read vmguarpages/privvmpages to set memory tunables [v2]
by Guido Günther 15 May '12
by Guido Günther 15 May '12
15 May '12
---
This is a reworked version of the patch already sent, now adding
handling for "unlimited" (represented by LONG_MAX in openvz) as well as
a schema testcase. I also switched all value to unsigned long long to
avoid overflows.
Note that privvmpages is the amount of memory available to the
application. The total memory usage of the container might be higher due
to used kernel memory. This does probably warrant an extra tunable
later. O.k. to apply?
Cheers,
-- Guido
src/openvz/openvz_conf.c | 113 ++++++++++++
src/openvz/openvz_driver.c | 208 +++++++++++++++++++++++
tests/domainschemadata/domain-openvz-simple.xml | 27 +++
3 files changed, 348 insertions(+)
create mode 100644 tests/domainschemadata/domain-openvz-simple.xml
diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c
index 5848ec4..a169ae6 100644
--- a/src/openvz/openvz_conf.c
+++ b/src/openvz/openvz_conf.c
@@ -129,6 +129,46 @@ int openvzExtractVersion(struct openvz_driver *driver)
}
+/* Parse config values of the form barrier:limit into barrier and limit */
+static int
+openvzParseBarrierLimit(const char* value,
+ unsigned long long *barrier,
+ unsigned long long *limit)
+{
+ char *token;
+ char *saveptr = NULL;
+ char *str = strdup(value);
+
+ if (str == NULL) {
+ virReportOOMError();
+ goto error;
+ }
+
+ token = strtok_r(str, ":", &saveptr);
+ if (token == NULL) {
+ goto error;
+ } else {
+ if (barrier != NULL) {
+ if (virStrToLong_ull(token, NULL, 10, barrier))
+ goto error;
+ }
+ }
+ token = strtok_r(NULL, ":", &saveptr);
+ if (token == NULL) {
+ goto error;
+ } else {
+ if (limit != NULL) {
+ if (virStrToLong_ull(token, NULL, 10, limit))
+ goto error;
+ }
+ }
+ return 0;
+error:
+ VIR_FREE(str);
+ return -1;
+}
+
+
static int openvzDefaultConsoleType(const char *ostype ATTRIBUTE_UNUSED)
{
return VIR_DOMAIN_CHR_CONSOLE_TARGET_TYPE_OPENVZ;
@@ -423,6 +463,78 @@ error:
}
+static int
+openvzReadMemConf(virDomainDefPtr def, int veid)
+{
+ int ret;
+ char *temp = NULL;
+ unsigned long long barrier, limit;
+ const char *param;
+ unsigned long kb_per_pages;
+
+ kb_per_pages = sysconf(_SC_PAGESIZE) / 1024;
+ if (kb_per_pages == -1) {
+ openvzError(VIR_ERR_INTERNAL_ERROR,
+ _("Can't determine page size"));
+ goto error;
+ }
+
+ /* Memory allocation guarantee */
+ param = "VMGUARPAGES";
+ ret = openvzReadVPSConfigParam(veid, param, &temp);
+ if (ret < 0) {
+ openvzError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not read '%s' from config for container %d"),
+ param, veid);
+ goto error;
+ } else if (ret > 0) {
+ ret = openvzParseBarrierLimit(temp, &barrier, NULL);
+ if (ret < 0) {
+ openvzError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not parse barrier of '%s' "
+ "from config for container %d"), param, veid);
+ goto error;
+ }
+ if (barrier == LONG_MAX)
+ def->mem.min_guarantee = 0ull;
+ else
+ def->mem.min_guarantee = barrier * kb_per_pages;
+ }
+
+ /* Memory hard and soft limits */
+ param = "PRIVVMPAGES";
+ ret = openvzReadVPSConfigParam(veid, param, &temp);
+ if (ret < 0) {
+ openvzError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not read '%s' from config for container %d"),
+ param, veid);
+ goto error;
+ } else if (ret > 0) {
+ ret = openvzParseBarrierLimit(temp, &barrier, &limit);
+ if (ret < 0) {
+ openvzError(VIR_ERR_INTERNAL_ERROR,
+ _("Could not parse barrier and limit of '%s' "
+ "from config for container %d"), param, veid);
+ goto error;
+ }
+ if (barrier == LONG_MAX)
+ def->mem.soft_limit = 0ull;
+ else
+ def->mem.soft_limit = barrier * kb_per_pages;
+
+ if (limit == LONG_MAX)
+ def->mem.hard_limit = 0ull;
+ else
+ def->mem.hard_limit = limit * kb_per_pages;
+ }
+
+ ret = 0;
+error:
+ VIR_FREE(temp);
+ return ret;
+}
+
+
/* Free all memory associated with a openvz_driver structure */
void
openvzFreeDriver(struct openvz_driver *driver)
@@ -535,6 +647,7 @@ int openvzLoadDomains(struct openvz_driver *driver) {
openvzReadNetworkConf(dom->def, veid);
openvzReadFSConf(dom->def, veid);
+ openvzReadMemConf(dom->def, veid);
virUUIDFormat(dom->def->uuid, uuidstr);
if (virHashAddEntry(driver->domains.objs, uuidstr, dom) < 0)
diff --git a/src/openvz/openvz_driver.c b/src/openvz/openvz_driver.c
index e8b6915..555161e 100644
--- a/src/openvz/openvz_driver.c
+++ b/src/openvz/openvz_driver.c
@@ -54,6 +54,7 @@
#include "nodeinfo.h"
#include "memory.h"
#include "virfile.h"
+#include "virtypedparam.h"
#include "logging.h"
#include "command.h"
#include "viruri.h"
@@ -65,6 +66,8 @@
#define CMDBUF_LEN 1488
#define CMDOP_LEN 288
+#define OPENVZ_NB_MEM_PARAM 3
+
static int openvzGetProcessInfo(unsigned long long *cpuTime, int vpsid);
static int openvzGetMaxVCPUs(virConnectPtr conn, const char *type);
static int openvzDomainGetMaxVcpus(virDomainPtr dom);
@@ -1631,6 +1634,209 @@ cleanup:
return -1;
}
+
+static int
+openvzDomainGetBarrierLimit(virDomainPtr domain,
+ const char *param,
+ unsigned long long *barrier,
+ unsigned long long *limit)
+{
+ int status, ret = -1;
+ char *output = NULL;
+ virCommandPtr cmd = virCommandNewArgList(VZLIST, "--no-header", NULL);
+
+ virCommandSetOutputBuffer(cmd, &output);
+ virCommandAddArgFormat(cmd, "-o%s.b,%s.l", param, param);
+ virCommandAddArg(cmd, domain->name);
+ if (virCommandRun(cmd, &status)) {
+ openvzError(VIR_ERR_OPERATION_FAILED,
+ _("Failed to get %s for %s: %d"), param, domain->name,
+ status);
+ goto cleanup;
+ }
+
+ if (sscanf(output, "%llu %llu", barrier, limit) != 2) {
+ openvzError(VIR_ERR_INTERNAL_ERROR,
+ _("Can't parse "VZLIST" output, got %s"), output);
+ goto cleanup;
+ }
+
+ ret = 0;
+cleanup:
+ VIR_FREE(output);
+ virCommandFree(cmd);
+ return ret;
+}
+
+
+static int
+openvzDomainSetBarrierLimit(virDomainPtr domain,
+ const char *param,
+ unsigned long long barrier,
+ unsigned long long limit)
+{
+ int status, ret = -1;
+ virCommandPtr cmd = virCommandNewArgList(VZCTL, "--quiet", "set", NULL);
+
+ /* LONG_MAX indicates unlimited so reject larger values */
+ if (barrier > LONG_MAX || limit > LONG_MAX) {
+ openvzError(VIR_ERR_OPERATION_FAILED,
+ _("Failed to set %s for %s: value too large"), param,
+ domain->name);
+ goto cleanup;
+ }
+
+ virCommandAddArg(cmd, domain->name);
+ virCommandAddArgFormat(cmd, "--%s", param);
+ virCommandAddArgFormat(cmd, "%llu:%llu", barrier, limit);
+ virCommandAddArg(cmd, "--save");
+ if (virCommandRun(cmd, &status)) {
+ openvzError(VIR_ERR_OPERATION_FAILED,
+ _("Failed to set %s for %s: %d"), param, domain->name,
+ status);
+ goto cleanup;
+ }
+
+ ret = 0;
+cleanup:
+ virCommandFree(cmd);
+ return ret;
+}
+
+
+static int
+openvzDomainGetMemoryParameters(virDomainPtr domain,
+ virTypedParameterPtr params,
+ int *nparams,
+ unsigned int flags)
+{
+ int i, result = -1;
+ const char *name;
+ long kb_per_pages;
+ unsigned long long barrier, limit, val;
+
+ virCheckFlags(0, -1);
+
+ kb_per_pages = sysconf(_SC_PAGESIZE) / 1024;
+ if (kb_per_pages == -1) {
+ openvzError(VIR_ERR_INTERNAL_ERROR,
+ _("Can't determine page size"));
+ goto cleanup;
+ }
+
+ if (*nparams == 0) {
+ *nparams = OPENVZ_NB_MEM_PARAM;
+ return 0;
+ }
+
+ for (i = 0; i <= *nparams; i++) {
+ virMemoryParameterPtr param = ¶ms[i];
+
+ switch (i) {
+ case 0:
+ name = "privvmpages";
+ if (openvzDomainGetBarrierLimit(domain, name, &barrier, &limit) < 0)
+ goto cleanup;
+
+ val = (limit == LONG_MAX) ? 0ull : limit * kb_per_pages;
+ if (virTypedParameterAssign(param, VIR_DOMAIN_MEMORY_HARD_LIMIT,
+ VIR_TYPED_PARAM_ULLONG, val) < 0)
+ goto cleanup;
+ break;
+
+ case 1:
+ name = "privvmpages";
+ if (openvzDomainGetBarrierLimit(domain, name, &barrier, &limit) < 0)
+ goto cleanup;
+
+ val = (barrier == LONG_MAX) ? 0ull : barrier * kb_per_pages;
+ if (virTypedParameterAssign(param, VIR_DOMAIN_MEMORY_SOFT_LIMIT,
+ VIR_TYPED_PARAM_ULLONG, val) < 0)
+ goto cleanup;
+ break;
+
+ case 2:
+ name = "vmguarpages";
+ if (openvzDomainGetBarrierLimit(domain, name, &barrier, &limit) < 0)
+ goto cleanup;
+
+ val = (barrier == LONG_MAX) ? 0ull : barrier * kb_per_pages;
+ if (virTypedParameterAssign(param, VIR_DOMAIN_MEMORY_MIN_GUARANTEE,
+ VIR_TYPED_PARAM_ULLONG, val) < 0)
+ goto cleanup;
+ break;
+ }
+ }
+
+ if (*nparams > OPENVZ_NB_MEM_PARAM)
+ *nparams = OPENVZ_NB_MEM_PARAM;
+ result = 0;
+
+cleanup:
+ return result;
+}
+
+
+static int
+openvzDomainSetMemoryParameters(virDomainPtr domain,
+ virTypedParameterPtr params,
+ int nparams,
+ unsigned int flags)
+{
+ int i, result = -1;
+ long kb_per_pages;
+
+ kb_per_pages = sysconf(_SC_PAGESIZE) / 1024;
+ if (kb_per_pages == -1) {
+ openvzError(VIR_ERR_INTERNAL_ERROR,
+ _("Can't determine page size"));
+ goto cleanup;
+ }
+
+ virCheckFlags(0, -1);
+ if (virTypedParameterArrayValidate(params, nparams,
+ VIR_DOMAIN_MEMORY_HARD_LIMIT,
+ VIR_TYPED_PARAM_ULLONG,
+ VIR_DOMAIN_MEMORY_SOFT_LIMIT,
+ VIR_TYPED_PARAM_ULLONG,
+ VIR_DOMAIN_MEMORY_MIN_GUARANTEE,
+ VIR_TYPED_PARAM_ULLONG,
+ NULL) < 0)
+ return -1;
+
+ for (i = 0; i < nparams; i++) {
+ virTypedParameterPtr param = ¶ms[i];
+ unsigned long long barrier, limit;
+
+ if (STREQ(param->field, VIR_DOMAIN_MEMORY_HARD_LIMIT)) {
+ if (openvzDomainGetBarrierLimit(domain, "privvmpages",
+ &barrier, &limit) < 0)
+ goto cleanup;
+ limit = params[i].value.ul / kb_per_pages;
+ if (openvzDomainSetBarrierLimit(domain, "privvmpages",
+ barrier, limit) < 0)
+ goto cleanup;
+ } else if (STREQ(param->field, VIR_DOMAIN_MEMORY_SOFT_LIMIT)) {
+ if (openvzDomainGetBarrierLimit(domain, "privvmpages",
+ &barrier, &limit) < 0)
+ goto cleanup;
+ barrier = params[i].value.ul / kb_per_pages;
+ if (openvzDomainSetBarrierLimit(domain, "privvmpages",
+ barrier, limit) < 0)
+ goto cleanup;
+ } else if (STREQ(param->field, VIR_DOMAIN_MEMORY_MIN_GUARANTEE)) {
+ barrier = params[i].value.ul / kb_per_pages;
+ if (openvzDomainSetBarrierLimit(domain, "vmguarpages",
+ barrier, LONG_MAX) < 0)
+ goto cleanup;
+ }
+ }
+ result = 0;
+cleanup:
+ return result;
+}
+
+
static int
openvzGetVEStatus(virDomainObjPtr vm, int *status, int *reason)
{
@@ -1752,6 +1958,8 @@ static virDriver openvzDriver = {
.domainDestroy = openvzDomainShutdown, /* 0.3.1 */
.domainDestroyFlags = openvzDomainShutdownFlags, /* 0.9.4 */
.domainGetOSType = openvzGetOSType, /* 0.3.1 */
+ .domainGetMemoryParameters = openvzDomainGetMemoryParameters, /* 0.9.12 */
+ .domainSetMemoryParameters = openvzDomainSetMemoryParameters, /* 0.9.12 */
.domainGetInfo = openvzDomainGetInfo, /* 0.3.1 */
.domainGetState = openvzDomainGetState, /* 0.9.2 */
.domainSetVcpus = openvzDomainSetVcpus, /* 0.4.6 */
diff --git a/tests/domainschemadata/domain-openvz-simple.xml b/tests/domainschemadata/domain-openvz-simple.xml
new file mode 100644
index 0000000..aba64a4
--- /dev/null
+++ b/tests/domainschemadata/domain-openvz-simple.xml
@@ -0,0 +1,27 @@
+<domain type='openvz'>
+ <name>100</name>
+ <uuid>7109d234-f5a8-30a6-5dd2-39ca85ce3958</uuid>
+ <memory unit='KiB'>0</memory>
+ <currentMemory unit='KiB'>0</currentMemory>
+ <memtune>
+ <hard_limit unit='KiB'>278528</hard_limit>
+ <soft_limit unit='KiB'>262144</soft_limit>
+ <min_guarantee unit='KiB'>135168</min_guarantee>
+ </memtune>
+ <vcpu>1</vcpu>
+ <os>
+ <type>exe</type>
+ <init>/sbin/init</init>
+ </os>
+ <clock offset='utc'/>
+ <on_poweroff>destroy</on_poweroff>
+ <on_reboot>destroy</on_reboot>
+ <on_crash>destroy</on_crash>
+ <devices>
+ <filesystem type='template' accessmode='passthrough'>
+ <source name='debian'/>
+ <target dir='/'/>
+ </filesystem>
+ </devices>
+</domain>
+
--
1.7.10
2
7
[libvirt] [PATCH] Allow stack traces to be included with log messages
by Daniel P. Berrange 15 May '12
by Daniel P. Berrange 15 May '12
15 May '12
From: "Daniel P. Berrange" <berrange(a)redhat.com>
Sometimes it is useful to see the callpath for log messages.
This change enhances the log filter syntax so that stck traces
can be show by setting '1:+NAME' instead of '1:NAME'.
This results in output like:
2012-05-09 14:18:45.136+0000: 13314: debug : virInitialize:414 : register drivers
/home/berrange/src/virt/libvirt/src/.libs/libvirt.so.0(virInitialize+0xd6)[0x7f89188ebe86]
/home/berrange/src/virt/libvirt/tools/.libs/lt-virsh[0x431921]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x3a21e21735]
/home/berrange/src/virt/libvirt/tools/.libs/lt-virsh[0x40a279]
2012-05-09 14:18:45.136+0000: 13314: debug : virRegisterDriver:775 : driver=0x7f8918d02760 name=Test
/home/berrange/src/virt/libvirt/src/.libs/libvirt.so.0(virRegisterDriver+0x6b)[0x7f89188ec717]
/home/berrange/src/virt/libvirt/src/.libs/libvirt.so.0(+0x11b3ad)[0x7f891891e3ad]
/home/berrange/src/virt/libvirt/src/.libs/libvirt.so.0(virInitialize+0xf3)[0x7f89188ebea3]
/home/berrange/src/virt/libvirt/tools/.libs/lt-virsh[0x431921]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x3a21e21735]
/home/berrange/src/virt/libvirt/tools/.libs/lt-virsh[0x40a279]
* docs/logging.html.in: Document new syntax
* configure.ac: Check for execinfo.h
* src/util/logging.c, src/util/logging.h: Add support for
stack traces
* tests/testutils.c: Adapt to API change
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
configure.ac | 2 +-
docs/logging.html.in | 6 +++--
src/util/logging.c | 67 +++++++++++++++++++++++++++++++++++++++++---------
src/util/logging.h | 9 ++++++-
tests/testutils.c | 1 +
5 files changed, 70 insertions(+), 15 deletions(-)
diff --git a/configure.ac b/configure.ac
index 30eff91..c1bf57b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -158,7 +158,7 @@ dnl Availability of various common headers (non-fatal if missing).
AC_CHECK_HEADERS([pwd.h paths.h regex.h sys/un.h \
sys/poll.h syslog.h mntent.h net/ethernet.h linux/magic.h \
sys/un.h sys/syscall.h netinet/tcp.h ifaddrs.h libtasn1.h \
- net/if.h])
+ net/if.h execinfo.h])
AC_MSG_CHECKING([for struct ifreq in net/if.h])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
diff --git a/docs/logging.html.in b/docs/logging.html.in
index 22b5422..87e2292 100644
--- a/docs/logging.html.in
+++ b/docs/logging.html.in
@@ -114,8 +114,10 @@
</h3>
<p>The syntax for filters and outputs is the same for both types of
variables.</p>
- <p>The format for a filter is:</p>
- <pre>x:name</pre>
+ <p>The format for a filter is one of:</p>
+ <pre>
+ x:name (log message only)
+ x:+name (log message + stack trace)</pre>
<p>where <code>name</code> is a match string e.g. <code>remote</code> or
<code>qemu</code> and the x is the minimal level where matching messages
should be logged:</p>
diff --git a/src/util/logging.c b/src/util/logging.c
index 48a056d..062917d 100644
--- a/src/util/logging.c
+++ b/src/util/logging.c
@@ -34,6 +34,9 @@
#if HAVE_SYSLOG_H
# include <syslog.h>
#endif
+#ifdef HAVE_EXECINFO_H
+# include <execinfo.h>
+#endif
#include "ignore-value.h"
#include "virterror_internal.h"
@@ -64,6 +67,7 @@ static int virLogEnd = 0;
struct _virLogFilter {
const char *match;
int priority;
+ unsigned int flags;
};
typedef struct _virLogFilter virLogFilter;
typedef virLogFilter *virLogFilterPtr;
@@ -99,7 +103,9 @@ static int virLogResetFilters(void);
static int virLogResetOutputs(void);
static int virLogOutputToFd(const char *category, int priority,
const char *funcname, long long linenr,
- const char *timestamp, const char *str,
+ const char *timestamp,
+ unsigned int flags,
+ const char *str,
void *data);
/*
@@ -472,7 +478,7 @@ static int virLogResetFilters(void) {
* virLogDefineFilter:
* @match: the pattern to match
* @priority: the priority to give to messages matching the pattern
- * @flags: extra flag, currently unused
+ * @flags: extra flags, see virLogFilterFlags enum
*
* Defines a pattern used for log filtering, it allow to select or
* reject messages independently of the default priority.
@@ -487,7 +493,7 @@ int virLogDefineFilter(const char *match, int priority,
int i;
char *mdup = NULL;
- virCheckFlags(0, -1);
+ virCheckFlags(VIR_LOG_STACK_TRACE, -1);
if ((match == NULL) || (priority < VIR_LOG_DEBUG) ||
(priority > VIR_LOG_ERROR))
@@ -514,6 +520,7 @@ int virLogDefineFilter(const char *match, int priority,
}
virLogFilters[i].match = mdup;
virLogFilters[i].priority = priority;
+ virLogFilters[i].flags = flags;
virLogNbFilters++;
cleanup:
virLogUnlock();
@@ -530,7 +537,8 @@ cleanup:
*
* Returns 0 if not matched or the new priority if found.
*/
-static int virLogFiltersCheck(const char *input) {
+static int virLogFiltersCheck(const char *input,
+ unsigned int *flags) {
int ret = 0;
int i;
@@ -538,6 +546,7 @@ static int virLogFiltersCheck(const char *input) {
for (i = 0;i < virLogNbFilters;i++) {
if (strstr(input, virLogFilters[i].match)) {
ret = virLogFilters[i].priority;
+ *flags = virLogFilters[i].flags;
break;
}
}
@@ -691,6 +700,7 @@ void virLogMessage(const char *category, int priority, const char *funcname,
int saved_errno = errno;
int emit = 1;
va_list ap;
+ unsigned int filterflags = 0;
if (!virLogInitialized)
virLogStartup();
@@ -701,7 +711,7 @@ void virLogMessage(const char *category, int priority, const char *funcname,
/*
* check against list of specific logging patterns
*/
- fprio = virLogFiltersCheck(category);
+ fprio = virLogFiltersCheck(category, &filterflags);
if (fprio == 0) {
if (priority < virLogDefaultPriority)
emit = 0;
@@ -753,13 +763,14 @@ void virLogMessage(const char *category, int priority, const char *funcname,
if (virLogVersionString(&ver) >= 0)
virLogOutputs[i].f(category, VIR_LOG_INFO,
__func__, __LINE__,
- timestamp, ver,
+ timestamp, 0, ver,
virLogOutputs[i].data);
VIR_FREE(ver);
virLogOutputs[i].logVersion = false;
}
virLogOutputs[i].f(category, priority, funcname, linenr,
- timestamp, msg, virLogOutputs[i].data);
+ timestamp, filterflags,
+ msg, virLogOutputs[i].data);
}
}
if ((virLogNbOutputs == 0) && (flags != 1)) {
@@ -768,13 +779,14 @@ void virLogMessage(const char *category, int priority, const char *funcname,
if (virLogVersionString(&ver) >= 0)
virLogOutputToFd(category, VIR_LOG_INFO,
__func__, __LINE__,
- timestamp, ver,
+ timestamp, 0, ver,
(void *) STDERR_FILENO);
VIR_FREE(ver);
logVersionStderr = false;
}
virLogOutputToFd(category, priority, funcname, linenr,
- timestamp, msg, (void *) STDERR_FILENO);
+ timestamp, filterflags,
+ msg, (void *) STDERR_FILENO);
}
virLogUnlock();
@@ -783,11 +795,30 @@ cleanup:
errno = saved_errno;
}
+
+static void virLogStackTraceToFd(int fd)
+{
+#ifdef HAVE_EXECINFO_H
+ void *array[100];
+ int size;
+
+#define STRIP_DEPTH 3
+
+ size = backtrace(array, sizeof(array)/sizeof(array[0]));
+ backtrace_symbols_fd(array + STRIP_DEPTH, size - STRIP_DEPTH, fd);
+ ignore_value(safewrite(fd, "\n", 1));
+#else
+ const char *msg = "stack trace not available on this platform";
+ ignore_value(safewrite(fd, msg, strlen(msg)));
+#endif
+}
+
static int virLogOutputToFd(const char *category ATTRIBUTE_UNUSED,
int priority ATTRIBUTE_UNUSED,
const char *funcname ATTRIBUTE_UNUSED,
long long linenr ATTRIBUTE_UNUSED,
const char *timestamp,
+ unsigned int flags,
const char *str,
void *data)
{
@@ -804,6 +835,9 @@ static int virLogOutputToFd(const char *category ATTRIBUTE_UNUSED,
ret = safewrite(fd, msg, strlen(msg));
VIR_FREE(msg);
+ if (flags & VIR_LOG_STACK_TRACE)
+ virLogStackTraceToFd(fd);
+
return ret;
}
@@ -841,6 +875,7 @@ static int virLogOutputToSyslog(const char *category ATTRIBUTE_UNUSED,
const char *funcname ATTRIBUTE_UNUSED,
long long linenr ATTRIBUTE_UNUSED,
const char *timestamp ATTRIBUTE_UNUSED,
+ unsigned int flags ATTRIBUTE_UNUSED,
const char *str,
void *data ATTRIBUTE_UNUSED)
{
@@ -1024,12 +1059,17 @@ int virLogParseFilters(const char *filters) {
virSkipSpaces(&cur);
while (*cur != 0) {
+ unsigned int flags = 0;
prio= virParseNumber(&cur);
if ((prio < VIR_LOG_DEBUG) || (prio > VIR_LOG_ERROR))
goto cleanup;
if (*cur != ':')
goto cleanup;
cur++;
+ if (*cur == '+') {
+ flags |= VIR_LOG_STACK_TRACE;
+ cur++;
+ }
str = cur;
while ((*cur != 0) && (!IS_SPACE(cur)))
cur++;
@@ -1038,7 +1078,7 @@ int virLogParseFilters(const char *filters) {
name = strndup(str, cur - str);
if (name == NULL)
goto cleanup;
- if (virLogDefineFilter(name, prio, 0) >= 0)
+ if (virLogDefineFilter(name, prio, flags) >= 0)
count++;
VIR_FREE(name);
virSkipSpaces(&cur);
@@ -1072,7 +1112,12 @@ char *virLogGetFilters(void) {
virLogLock();
for (i = 0; i < virLogNbFilters; i++) {
- virBufferAsprintf(&filterbuf, "%d:%s ", virLogFilters[i].priority,
+ const char *sep = ":";
+ if (virLogFilters[i].flags & VIR_LOG_STACK_TRACE)
+ sep = ":+";
+ virBufferAsprintf(&filterbuf, "%d%s%s ",
+ virLogFilters[i].priority,
+ sep,
virLogFilters[i].match);
}
virLogUnlock();
diff --git a/src/util/logging.h b/src/util/logging.h
index 2343de0..a6fa63e 100644
--- a/src/util/logging.h
+++ b/src/util/logging.h
@@ -79,6 +79,7 @@ typedef enum {
* @funcname: the function emitting the message
* @linenr: line where the message was emitted
* @timestamp: zero terminated string with timestamp of the message
+ * @flags: flags associated with the message
* @str: the message to log, preformatted and zero terminated
* @data: extra output logging data
*
@@ -88,7 +89,9 @@ typedef enum {
*/
typedef int (*virLogOutputFunc) (const char *category, int priority,
const char *funcname, long long linenr,
- const char *timestamp, const char *str,
+ const char *timestamp,
+ unsigned int flags,
+ const char *str,
void *data);
/**
@@ -99,6 +102,10 @@ typedef int (*virLogOutputFunc) (const char *category, int priority,
*/
typedef void (*virLogCloseFunc) (void *data);
+typedef enum {
+ VIR_LOG_STACK_TRACE = (1 << 0),
+} virLogFlags;
+
extern int virLogGetNbFilters(void);
extern int virLogGetNbOutputs(void);
extern char *virLogGetFilters(void);
diff --git a/tests/testutils.c b/tests/testutils.c
index 4e8484f..57cf84c 100644
--- a/tests/testutils.c
+++ b/tests/testutils.c
@@ -469,6 +469,7 @@ virtTestLogOutput(const char *category ATTRIBUTE_UNUSED,
const char *funcname ATTRIBUTE_UNUSED,
long long lineno ATTRIBUTE_UNUSED,
const char *timestamp,
+ unsigned int flags ATTRIBUTE_UNUSED,
const char *str,
void *data)
{
--
1.7.10.1
2
2
15 May '12
> >> Thanks, your patch looks good but needs two further small additions
> >> to the libvirt_sanlock.aug and test_libvirt_sanlock.aug files to
> >> take account of the new config parameter.
> >
> > Oops, Updated patch attached (tested with augparse)
> >
> > David
> >
> >
> > ----------------------------------------
> >
> > commit 33678a8b2d294bebf327106d586d41c9b157174f
> > Author: David Weber <wb(a)munzinger.de>
> > Date: Mon May 14 09:43:27 2012 +0200
> >
> > Add ignore param for readonly and shared disk in sanlock
>
> ACK and pushed, after fixing up whitespace nits ('make syntax-check'
> would have caught the trailing whitespace, but not the other one), and
> adding you to AUTHORS (let me know if you prefer an alternate spelling).
Thanks for the push. Sorry for all the problems. I'll do it better next
time ;)
>
> Is it sanlock, or libvirt, or a combination of both that don't yet
> support shared resource locks? I modified this as follows (and hope
> that it was good enough, since I pushed):
>
> # Enable this flag to have sanlock ignore readonly and shared disks.
> # If disabled, then this rejects attempts to share resources until
> # sanlock gains support for shared locks.
> #
> #ignore_readonly_and_shared_disks = 1
Right, it's sanlock who doesn't support it. So your text is right.
David
To: eblake(a)redhat.com
Cc: berrange(a)redhat.com
libvir-list(a)redhat.com
sanlock-devel(a)lists.fedorahosted.org
1
0
[libvirt] no check of freeMem before restoring a VM in libxl-driver, is it a bug?
by Oscar Ben 15 May '12
by Oscar Ben 15 May '12
15 May '12
in func 'libxlDomainRestoreFlags',it doesn't use 'libxlFreeMem' to check
whether there are enough memory before restoring the vm!It just restore the
vm anyway,until xenlight found no enough space in the middle of the process
Is this a bug?or It's designed this way by purpose?Thanks in advance.
2
1
[libvirt] [PATCH] libvirt-guests: Remove LISTFILE if it's empty when stopping service
by Osier Yang 15 May '12
by Osier Yang 15 May '12
15 May '12
$LISTFILE is created even no domain is running, and the empty
$LISTFILE could cause improper service status.
stoped ,with saved guests
Which is not right, as there is no domain was saved.
---
tools/libvirt-guests.init.sh | 42 +++++++++++++++++++++++-------------------
1 files changed, 23 insertions(+), 19 deletions(-)
diff --git a/tools/libvirt-guests.init.sh b/tools/libvirt-guests.init.sh
index aafb4d4..c0d8a7e 100644
--- a/tools/libvirt-guests.init.sh
+++ b/tools/libvirt-guests.init.sh
@@ -461,26 +461,30 @@ stop() {
done
set +f
- while read uri list; do
- if "$suspending"; then
- eval_gettext "Suspending guests on \$uri URI..."; echo
- else
- eval_gettext "Shutting down guests on \$uri URI..."; echo
- fi
+ if [ -s $LISTFILE ]; then
+ while read uri list; do
+ if "$suspending"; then
+ eval_gettext "Suspending guests on \$uri URI..."; echo
+ else
+ eval_gettext "Shutting down guests on \$uri URI..."; echo
+ fi
- if [ "$PARALLEL_SHUTDOWN" -gt 1 ] &&
- ! "$suspending"; then
- shutdown_guests_parallel "$uri" "$list"
- else
- for guest in $list; do
- if "$suspending"; then
- suspend_guest "$uri" "$guest"
- else
- shutdown_guest "$uri" "$guest"
- fi
- done
- fi
- done <"$LISTFILE"
+ if [ "$PARALLEL_SHUTDOWN" -gt 1 ] &&
+ ! "$suspending"; then
+ shutdown_guests_parallel "$uri" "$list"
+ else
+ for guest in $list; do
+ if "$suspending"; then
+ suspend_guest "$uri" "$guest"
+ else
+ shutdown_guest "$uri" "$guest"
+ fi
+ done
+ fi
+ done <"$LISTFILE"
+ else
+ rm -f $LISTFILE
+ fi
rm -f "$VAR_SUBSYS_LIBVIRT_GUESTS"
}
--
1.7.7.3
2
2
This builds on Osier's patch v1 here:
https://www.redhat.com/archives/libvir-list/2012-May/msg00663.html
to add some tests as recommended by Dan Berrange.
Patches 1-3 are new, and patch 4 is Osier's patch plus a change
to the testsuite to show what really changed. According to sysfs
of the AMD machine that he and I were playing with, there were 8
NUMA nodes of 6 CPUs each in a staggered grouping; for example,
/sys/devices/system/node/node0/cpulist shows 0,4,8,12,16,20.
I'd have to think a lot more about whether we are representing
things correctly with the hack of going by cpuinfo's claim of
12 cores (2 cores per socket, with 6 sockets). For example,
is node/has_cpu any better than node/possible, or any better
than a readdir() over node/ looking for all node[0-9]*
subdirectories? At any rate, having tests will help us feel
better about any v3 tweaks to this series.
Please feel free to contribute more tests for machines with
different NUMA configurations that you have access to.
Eric Blake (3):
nodeinfo: drop static variable
nodeinfo: avoid probing host filesystem during test
nodeinfo: add some more tests
Osier Yang (1):
nodeinfo: Get the correct CPU number on AMD Magny Cours platform
src/nodeinfo.c | 181 ++-
.../linux-nodeinfo-sysfs-test-2-cpu-x86-output.txt | 1 +
.../linux-nodeinfo-sysfs-test-2-x86.cpuinfo | 52 +
.../cpu/cpu0/topology/core_id | 1 +
.../cpu/cpu0/topology/core_siblings | 1 +
.../cpu/cpu0/topology/core_siblings_list | 1 +
.../cpu/cpu0/topology/physical_package_id | 1 +
.../cpu/cpu0/topology/thread_siblings | 1 +
.../cpu/cpu0/topology/thread_siblings_list | 1 +
.../linux-nodeinfo-sysfs-test-2/cpu/cpu1/online | 1 +
.../cpu/cpu1/topology/core_id | 1 +
.../cpu/cpu1/topology/core_siblings | 1 +
.../cpu/cpu1/topology/core_siblings_list | 1 +
.../cpu/cpu1/topology/physical_package_id | 1 +
.../cpu/cpu1/topology/thread_siblings | 1 +
.../cpu/cpu1/topology/thread_siblings_list | 1 +
.../linux-nodeinfo-sysfs-test-2/node/node0/meminfo | 29 +
.../linux-nodeinfo-sysfs-test-2/node/possible | 1 +
.../linux-nodeinfo-sysfs-test-3-cpu-x86-output.txt | 1 +
.../linux-nodeinfo-sysfs-test-3-x86.cpuinfo | 1248 ++++++++++++++++++++
.../cpu/cpu0/topology/core_id | 1 +
.../cpu/cpu0/topology/physical_package_id | 1 +
.../cpu/cpu0/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu1/online | 1 +
.../cpu/cpu1/topology/core_id | 1 +
.../cpu/cpu1/topology/physical_package_id | 1 +
.../cpu/cpu1/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu10/online | 1 +
.../cpu/cpu10/topology/core_id | 1 +
.../cpu/cpu10/topology/physical_package_id | 1 +
.../cpu/cpu10/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu11/online | 1 +
.../cpu/cpu11/topology/core_id | 1 +
.../cpu/cpu11/topology/physical_package_id | 1 +
.../cpu/cpu11/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu12/online | 1 +
.../cpu/cpu12/topology/core_id | 1 +
.../cpu/cpu12/topology/physical_package_id | 1 +
.../cpu/cpu12/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu13/online | 1 +
.../cpu/cpu13/topology/core_id | 1 +
.../cpu/cpu13/topology/physical_package_id | 1 +
.../cpu/cpu13/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu14/online | 1 +
.../cpu/cpu14/topology/core_id | 1 +
.../cpu/cpu14/topology/physical_package_id | 1 +
.../cpu/cpu14/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu15/online | 1 +
.../cpu/cpu15/topology/core_id | 1 +
.../cpu/cpu15/topology/physical_package_id | 1 +
.../cpu/cpu15/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu16/online | 1 +
.../cpu/cpu16/topology/core_id | 1 +
.../cpu/cpu16/topology/physical_package_id | 1 +
.../cpu/cpu16/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu17/online | 1 +
.../cpu/cpu17/topology/core_id | 1 +
.../cpu/cpu17/topology/physical_package_id | 1 +
.../cpu/cpu17/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu18/online | 1 +
.../cpu/cpu18/topology/core_id | 1 +
.../cpu/cpu18/topology/physical_package_id | 1 +
.../cpu/cpu18/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu19/online | 1 +
.../cpu/cpu19/topology/core_id | 1 +
.../cpu/cpu19/topology/physical_package_id | 1 +
.../cpu/cpu19/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu2/online | 1 +
.../cpu/cpu2/topology/core_id | 1 +
.../cpu/cpu2/topology/physical_package_id | 1 +
.../cpu/cpu2/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu20/online | 1 +
.../cpu/cpu20/topology/core_id | 1 +
.../cpu/cpu20/topology/physical_package_id | 1 +
.../cpu/cpu20/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu21/online | 1 +
.../cpu/cpu21/topology/core_id | 1 +
.../cpu/cpu21/topology/physical_package_id | 1 +
.../cpu/cpu21/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu22/online | 1 +
.../cpu/cpu22/topology/core_id | 1 +
.../cpu/cpu22/topology/physical_package_id | 1 +
.../cpu/cpu22/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu23/online | 1 +
.../cpu/cpu23/topology/core_id | 1 +
.../cpu/cpu23/topology/physical_package_id | 1 +
.../cpu/cpu23/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu24/online | 1 +
.../cpu/cpu24/topology/core_id | 1 +
.../cpu/cpu24/topology/physical_package_id | 1 +
.../cpu/cpu24/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu25/online | 1 +
.../cpu/cpu25/topology/core_id | 1 +
.../cpu/cpu25/topology/physical_package_id | 1 +
.../cpu/cpu25/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu26/online | 1 +
.../cpu/cpu26/topology/core_id | 1 +
.../cpu/cpu26/topology/physical_package_id | 1 +
.../cpu/cpu26/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu27/online | 1 +
.../cpu/cpu27/topology/core_id | 1 +
.../cpu/cpu27/topology/physical_package_id | 1 +
.../cpu/cpu27/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu28/online | 1 +
.../cpu/cpu28/topology/core_id | 1 +
.../cpu/cpu28/topology/physical_package_id | 1 +
.../cpu/cpu28/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu29/online | 1 +
.../cpu/cpu29/topology/core_id | 1 +
.../cpu/cpu29/topology/physical_package_id | 1 +
.../cpu/cpu29/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu3/online | 1 +
.../cpu/cpu3/topology/core_id | 1 +
.../cpu/cpu3/topology/physical_package_id | 1 +
.../cpu/cpu3/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu30/online | 1 +
.../cpu/cpu30/topology/core_id | 1 +
.../cpu/cpu30/topology/physical_package_id | 1 +
.../cpu/cpu30/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu31/online | 1 +
.../cpu/cpu31/topology/core_id | 1 +
.../cpu/cpu31/topology/physical_package_id | 1 +
.../cpu/cpu31/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu32/online | 1 +
.../cpu/cpu32/topology/core_id | 1 +
.../cpu/cpu32/topology/physical_package_id | 1 +
.../cpu/cpu32/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu33/online | 1 +
.../cpu/cpu33/topology/core_id | 1 +
.../cpu/cpu33/topology/physical_package_id | 1 +
.../cpu/cpu33/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu34/online | 1 +
.../cpu/cpu34/topology/core_id | 1 +
.../cpu/cpu34/topology/physical_package_id | 1 +
.../cpu/cpu34/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu35/online | 1 +
.../cpu/cpu35/topology/core_id | 1 +
.../cpu/cpu35/topology/physical_package_id | 1 +
.../cpu/cpu35/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu36/online | 1 +
.../cpu/cpu36/topology/core_id | 1 +
.../cpu/cpu36/topology/physical_package_id | 1 +
.../cpu/cpu36/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu37/online | 1 +
.../cpu/cpu37/topology/core_id | 1 +
.../cpu/cpu37/topology/physical_package_id | 1 +
.../cpu/cpu37/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu38/online | 1 +
.../cpu/cpu38/topology/core_id | 1 +
.../cpu/cpu38/topology/physical_package_id | 1 +
.../cpu/cpu38/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu39/online | 1 +
.../cpu/cpu39/topology/core_id | 1 +
.../cpu/cpu39/topology/physical_package_id | 1 +
.../cpu/cpu39/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu4/online | 1 +
.../cpu/cpu4/topology/core_id | 1 +
.../cpu/cpu4/topology/physical_package_id | 1 +
.../cpu/cpu4/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu40/online | 1 +
.../cpu/cpu40/topology/core_id | 1 +
.../cpu/cpu40/topology/physical_package_id | 1 +
.../cpu/cpu40/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu41/online | 1 +
.../cpu/cpu41/topology/core_id | 1 +
.../cpu/cpu41/topology/physical_package_id | 1 +
.../cpu/cpu41/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu42/online | 1 +
.../cpu/cpu42/topology/core_id | 1 +
.../cpu/cpu42/topology/physical_package_id | 1 +
.../cpu/cpu42/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu43/online | 1 +
.../cpu/cpu43/topology/core_id | 1 +
.../cpu/cpu43/topology/physical_package_id | 1 +
.../cpu/cpu43/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu44/online | 1 +
.../cpu/cpu44/topology/core_id | 1 +
.../cpu/cpu44/topology/physical_package_id | 1 +
.../cpu/cpu44/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu45/online | 1 +
.../cpu/cpu45/topology/core_id | 1 +
.../cpu/cpu45/topology/physical_package_id | 1 +
.../cpu/cpu45/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu46/online | 1 +
.../cpu/cpu46/topology/core_id | 1 +
.../cpu/cpu46/topology/physical_package_id | 1 +
.../cpu/cpu46/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu47/online | 1 +
.../cpu/cpu47/topology/core_id | 1 +
.../cpu/cpu47/topology/physical_package_id | 1 +
.../cpu/cpu47/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu5/online | 1 +
.../cpu/cpu5/topology/core_id | 1 +
.../cpu/cpu5/topology/physical_package_id | 1 +
.../cpu/cpu5/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu6/online | 1 +
.../cpu/cpu6/topology/core_id | 1 +
.../cpu/cpu6/topology/physical_package_id | 1 +
.../cpu/cpu6/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu7/online | 1 +
.../cpu/cpu7/topology/core_id | 1 +
.../cpu/cpu7/topology/physical_package_id | 1 +
.../cpu/cpu7/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu8/online | 1 +
.../cpu/cpu8/topology/core_id | 1 +
.../cpu/cpu8/topology/physical_package_id | 1 +
.../cpu/cpu8/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/cpu/cpu9/online | 1 +
.../cpu/cpu9/topology/core_id | 1 +
.../cpu/cpu9/topology/physical_package_id | 1 +
.../cpu/cpu9/topology/thread_siblings | 1 +
.../linux-nodeinfo-sysfs-test-3/node/node0/meminfo | 29 +
.../linux-nodeinfo-sysfs-test-3/node/node1/meminfo | 29 +
.../linux-nodeinfo-sysfs-test-3/node/node2/meminfo | 29 +
.../linux-nodeinfo-sysfs-test-3/node/node3/meminfo | 29 +
.../linux-nodeinfo-sysfs-test-3/node/node4/meminfo | 29 +
.../linux-nodeinfo-sysfs-test-3/node/node5/meminfo | 29 +
.../linux-nodeinfo-sysfs-test-3/node/node6/meminfo | 29 +
.../linux-nodeinfo-sysfs-test-3/node/node7/meminfo | 29 +
.../linux-nodeinfo-sysfs-test-3/node/possible | 1 +
tests/nodeinfotest.c | 50 +-
221 files changed, 1906 insertions(+), 94 deletions(-)
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2-cpu-x86-output.txt
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2-x86.cpuinfo
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/cpu/cpu0/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/cpu/cpu0/topology/core_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/cpu/cpu0/topology/core_siblings_list
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/cpu/cpu0/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/cpu/cpu0/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/cpu/cpu0/topology/thread_siblings_list
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/cpu/cpu1/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/cpu/cpu1/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/cpu/cpu1/topology/core_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/cpu/cpu1/topology/core_siblings_list
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/cpu/cpu1/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/cpu/cpu1/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/cpu/cpu1/topology/thread_siblings_list
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/node/node0/meminfo
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-2/node/possible
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3-cpu-x86-output.txt
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3-x86.cpuinfo
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu0/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu0/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu0/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu1/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu1/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu1/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu1/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu10/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu10/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu10/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu10/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu11/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu11/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu11/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu11/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu12/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu12/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu12/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu12/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu13/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu13/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu13/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu13/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu14/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu14/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu14/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu14/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu15/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu15/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu15/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu15/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu16/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu16/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu16/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu16/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu17/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu17/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu17/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu17/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu18/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu18/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu18/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu18/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu19/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu19/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu19/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu19/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu2/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu2/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu2/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu2/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu20/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu20/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu20/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu20/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu21/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu21/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu21/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu21/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu22/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu22/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu22/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu22/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu23/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu23/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu23/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu23/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu24/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu24/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu24/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu24/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu25/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu25/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu25/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu25/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu26/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu26/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu26/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu26/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu27/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu27/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu27/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu27/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu28/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu28/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu28/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu28/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu29/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu29/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu29/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu29/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu3/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu3/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu3/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu3/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu30/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu30/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu30/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu30/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu31/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu31/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu31/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu31/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu32/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu32/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu32/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu32/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu33/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu33/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu33/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu33/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu34/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu34/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu34/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu34/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu35/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu35/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu35/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu35/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu36/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu36/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu36/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu36/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu37/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu37/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu37/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu37/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu38/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu38/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu38/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu38/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu39/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu39/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu39/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu39/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu4/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu4/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu4/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu4/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu40/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu40/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu40/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu40/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu41/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu41/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu41/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu41/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu42/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu42/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu42/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu42/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu43/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu43/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu43/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu43/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu44/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu44/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu44/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu44/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu45/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu45/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu45/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu45/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu46/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu46/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu46/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu46/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu47/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu47/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu47/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu47/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu5/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu5/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu5/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu5/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu6/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu6/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu6/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu6/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu7/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu7/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu7/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu7/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu8/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu8/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu8/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu8/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu9/online
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu9/topology/core_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu9/topology/physical_package_id
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/cpu/cpu9/topology/thread_siblings
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node0/meminfo
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node1/meminfo
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node2/meminfo
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node3/meminfo
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node4/meminfo
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node5/meminfo
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node6/meminfo
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/node7/meminfo
create mode 100644 tests/nodeinfodata/linux-nodeinfo-sysfs-test-3/node/possible
--
1.7.7.6
3
15
[libvirt] [PATCH 1/2] qemu: Set memory policy using cgroup if placement is auto
by Osier Yang 15 May '12
by Osier Yang 15 May '12
15 May '12
Like for 'static' placement, when the memory policy mode is
'strict', set the memory policy by writing the advisory nodeset
returned from numad to cgroup file cpuset.mems,
---
src/qemu/qemu_cgroup.c | 15 +++++++++--
src/qemu/qemu_cgroup.h | 3 +-
src/qemu/qemu_process.c | 62 +++++++++++++++++++++++++----------------------
3 files changed, 47 insertions(+), 33 deletions(-)
diff --git a/src/qemu/qemu_cgroup.c b/src/qemu/qemu_cgroup.c
index a07b6cd..f8f375f 100644
--- a/src/qemu/qemu_cgroup.c
+++ b/src/qemu/qemu_cgroup.c
@@ -194,7 +194,8 @@ int qemuSetupHostUsbDeviceCgroup(usbDevice *dev ATTRIBUTE_UNUSED,
}
int qemuSetupCgroup(struct qemud_driver *driver,
- virDomainObjPtr vm)
+ virDomainObjPtr vm,
+ char *nodemask)
{
virCgroupPtr cgroup = NULL;
int rc;
@@ -391,10 +392,18 @@ int qemuSetupCgroup(struct qemud_driver *driver,
}
}
- if (vm->def->numatune.memory.nodemask &&
+ if ((vm->def->numatune.memory.nodemask ||
+ (vm->def->numatune.memory.placement_mode ==
+ VIR_DOMAIN_NUMATUNE_MEM_PLACEMENT_MODE_AUTO)) &&
vm->def->numatune.memory.mode == VIR_DOMAIN_NUMATUNE_MEM_STRICT &&
qemuCgroupControllerActive(driver, VIR_CGROUP_CONTROLLER_CPUSET)) {
- char *mask = virDomainCpuSetFormat(vm->def->numatune.memory.nodemask, VIR_DOMAIN_CPUMASK_LEN);
+ char *mask = NULL;
+ if (vm->def->numatune.memory.placement_mode ==
+ VIR_DOMAIN_NUMATUNE_MEM_PLACEMENT_MODE_AUTO)
+ mask = virDomainCpuSetFormat(nodemask, VIR_DOMAIN_CPUMASK_LEN);
+ else
+ mask = virDomainCpuSetFormat(vm->def->numatune.memory.nodemask,
+ VIR_DOMAIN_CPUMASK_LEN);
if (!mask) {
qemuReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to convert memory nodemask"));
diff --git a/src/qemu/qemu_cgroup.h b/src/qemu/qemu_cgroup.h
index 17164d9..c1023b3 100644
--- a/src/qemu/qemu_cgroup.h
+++ b/src/qemu/qemu_cgroup.h
@@ -48,7 +48,8 @@ int qemuSetupHostUsbDeviceCgroup(usbDevice *dev,
const char *path,
void *opaque);
int qemuSetupCgroup(struct qemud_driver *driver,
- virDomainObjPtr vm);
+ virDomainObjPtr vm,
+ char *nodemask);
int qemuSetupCgroupVcpuBW(virCgroupPtr cgroup,
unsigned long long period,
long long quota);
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index d226067..19bb22a 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -2544,6 +2544,7 @@ struct qemuProcessHookData {
virConnectPtr conn;
virDomainObjPtr vm;
struct qemud_driver *driver;
+ char *nodemask;
};
static int qemuProcessHook(void *data)
@@ -2551,8 +2552,6 @@ static int qemuProcessHook(void *data)
struct qemuProcessHookData *h = data;
int ret = -1;
int fd;
- char *nodeset = NULL;
- char *nodemask = NULL;
/* Some later calls want pid present */
h->vm->pid = getpid();
@@ -2582,37 +2581,16 @@ static int qemuProcessHook(void *data)
/* This must take place before exec(), so that all QEMU
* memory allocation is on the correct NUMA node
*/
- VIR_DEBUG("Moving procss to cgroup");
+ VIR_DEBUG("Moving process to cgroup");
if (qemuAddToCgroup(h->driver, h->vm->def) < 0)
goto cleanup;
- if ((h->vm->def->placement_mode ==
- VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO) ||
- (h->vm->def->numatune.memory.placement_mode ==
- VIR_DOMAIN_NUMATUNE_MEM_PLACEMENT_MODE_AUTO)) {
- nodeset = qemuGetNumadAdvice(h->vm->def);
- if (!nodeset)
- goto cleanup;
-
- VIR_DEBUG("Nodeset returned from numad: %s", nodeset);
-
- if (VIR_ALLOC_N(nodemask, VIR_DOMAIN_CPUMASK_LEN) < 0) {
- virReportOOMError();
- goto cleanup;
- }
-
- if (virDomainCpuSetParse(nodeset, 0, nodemask,
- VIR_DOMAIN_CPUMASK_LEN) < 0)
- goto cleanup;
- }
-
/* This must be done after cgroup placement to avoid resetting CPU
* affinity */
- VIR_DEBUG("Setup CPU affinity");
- if (qemuProcessInitCpuAffinity(h->driver, h->vm, nodemask) < 0)
+ if (qemuProcessInitCpuAffinity(h->driver, h->vm, h->nodemask) < 0)
goto cleanup;
- if (qemuProcessInitNumaMemoryPolicy(h->vm, nodemask) < 0)
+ if (qemuProcessInitNumaMemoryPolicy(h->vm, h->nodemask) < 0)
goto cleanup;
VIR_DEBUG("Setting up security labelling");
@@ -2623,8 +2601,6 @@ static int qemuProcessHook(void *data)
cleanup:
VIR_DEBUG("Hook complete ret=%d", ret);
- VIR_FREE(nodeset);
- VIR_FREE(nodemask);
return ret;
}
@@ -3300,6 +3276,8 @@ int qemuProcessStart(virConnectPtr conn,
struct qemuProcessHookData hookData;
unsigned long cur_balloon;
int i;
+ char *nodeset = NULL;
+ char *nodemask = NULL;
/* Okay, these are just internal flags,
* but doesn't hurt to check */
@@ -3455,8 +3433,32 @@ int qemuProcessStart(virConnectPtr conn,
flags & VIR_QEMU_PROCESS_START_COLD) < 0)
goto cleanup;
+ /* Get the advisory nodeset from numad if 'placement' of
+ * either <vcpu> or <numatune> is 'auto'.
+ */
+ if ((vm->def->placement_mode ==
+ VIR_DOMAIN_CPU_PLACEMENT_MODE_AUTO) ||
+ (vm->def->numatune.memory.placement_mode ==
+ VIR_DOMAIN_NUMATUNE_MEM_PLACEMENT_MODE_AUTO)) {
+ nodeset = qemuGetNumadAdvice(vm->def);
+ if (!nodeset)
+ goto cleanup;
+
+ VIR_DEBUG("Nodeset returned from numad: %s", nodeset);
+
+ if (VIR_ALLOC_N(nodemask, VIR_DOMAIN_CPUMASK_LEN) < 0) {
+ virReportOOMError();
+ goto cleanup;
+ }
+
+ if (virDomainCpuSetParse(nodeset, 0, nodemask,
+ VIR_DOMAIN_CPUMASK_LEN) < 0)
+ goto cleanup;
+ }
+ hookData.nodemask = nodemask;
+
VIR_DEBUG("Setting up domain cgroup (if required)");
- if (qemuSetupCgroup(driver, vm) < 0)
+ if (qemuSetupCgroup(driver, vm, nodemask) < 0)
goto cleanup;
if (VIR_ALLOC(priv->monConfig) < 0) {
@@ -3761,6 +3763,8 @@ cleanup:
/* We jump here if we failed to start the VM for any reason, or
* if we failed to initialize the now running VM. kill it off and
* pretend we never started it */
+ VIR_FREE(nodeset);
+ VIR_FREE(nodemask);
virCommandFree(cmd);
VIR_FORCE_CLOSE(logfile);
qemuProcessStop(driver, vm, 0, VIR_DOMAIN_SHUTOFF_FAILED);
--
1.7.7.3
2
2