[libvirt] PATCH : Opennebula, adding xen i686 domain capability and updating some error messages
by "Abel Míguez Rodríguez"
Hi,
this patch uses "OPERATION_INVALID" error instead "OPERATION_FAILED" error where should be used, also adds a missing capability, defining Xen i686 domains.
Thanks for the patches,
--- one_driver.c.bak 2009-06-30 15:02:28.000000000 +0200
+++ one_driver.c 2009-06-30 15:02:29.000000000 +0200
@@ -505,7 +505,7 @@ static int oneDomainShutdown(virDomainPt
ret= 0;
goto return_point;
}
- oneError(dom->conn, dom, VIR_ERR_OPERATION_FAILED,
+ oneError(dom->conn, dom, VIR_ERR_OPERATION_INVALID,
_("Wrong state to perform action"));
goto return_point;
}
@@ -541,7 +541,7 @@ static int oneDomainDestroy(virDomainPtr
if(c_oneCancel(vm->pid)) {
/* VM not running, delete the instance at ONE DB */
if(c_oneFinalize(vm->pid)){
- oneError(dom->conn, dom, VIR_ERR_OPERATION_FAILED,
+ oneError(dom->conn, dom, VIR_ERR_OPERATION_INVALID,
_("Wrong state to perform action"));
goto return_point;
}
@@ -576,11 +576,11 @@ static int oneDomainSuspend(virDomainPtr
ret=0;
goto return_point;
}
- oneError(dom->conn, dom, VIR_ERR_OPERATION_FAILED,
+ oneError(dom->conn, dom, VIR_ERR_OPERATION_INVALID,
_("Wrong state to perform action"));
goto return_point;
}
- oneError(dom->conn,dom,VIR_ERR_OPERATION_FAILED,
+ oneError(dom->conn,dom,VIR_ERR_OPERATION_INVALID,
_("domain is not running"));
} else {
oneError(dom->conn, dom, VIR_ERR_INVALID_DOMAIN,
@@ -609,11 +609,11 @@ static int oneDomainResume(virDomainPtr
ret=0;
goto return_point;
}
- oneError(dom->conn, dom, VIR_ERR_OPERATION_FAILED,
+ oneError(dom->conn, dom, VIR_ERR_OPERATION_INVALID,
_("Wrong state to perform action"));
goto return_point;
}
- oneError(dom->conn,dom,VIR_ERR_OPERATION_FAILED,
+ oneError(dom->conn,dom,VIR_ERR_OPERATION_INVALID,
_("domain is not paused "));
} else {
oneError(dom->conn, dom, VIR_ERR_INVALID_DOMAIN,
--- one_conf.c.bak 2009-06-30 15:01:06.000000000 +0200
+++ one_conf.c 2009-06-30 15:00:58.000000000 +0200
@@ -94,6 +94,27 @@ virCapsPtr oneCapsInit(void)
{
goto no_memory;
}
+ if ((guest = virCapabilitiesAddGuest(caps,
+ "xen",
+ "i686",
+ 32,
+ NULL,
+ NULL,
+ 0,
+ NULL)) == NULL)
+ {
+ goto no_memory;
+ }
+ if (virCapabilitiesAddGuestDomain(guest,
+ "one",
+ NULL,
+ NULL,
+ 0,
+ NULL) == NULL)
+ {
+ goto no_memory;
+ }
+
return caps;
Abel Miguez Rodriguez
----
Distributed System Architecture Group
(http://dsa-research.org)
GridWay, http://www.gridway.org
OpenNEbula, http://www.opennebula.org
15 years, 4 months
[libvirt] [PATCH] logging: remove unused level 0
by Amy Griffis
Some more logging cleanup. Remove all references to log level 0,
and replace with VIR_LOG_DEBUG where appropriate. Also change any
hard numbers to the corresponding VirLogPriority and add
VIR_LOG_DEFAULT for the starting log level.
Signed-off-by: Amy Griffis <amy.griffis(a)hp.com
---
docs/logging.html.in | 6 ++----
qemud/libvirtd.conf | 5 ++---
qemud/qemud.c | 11 ++++++-----
src/logging.c | 10 +++++-----
src/logging.h | 2 ++
5 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/docs/logging.html.in b/docs/logging.html.in
index 11ea68c..fcd100f 100644
--- a/docs/logging.html.in
+++ b/docs/logging.html.in
@@ -49,7 +49,6 @@
<ul>
<li>log_level: accepts the following values:
<ul>
- <li>0: no logging at all</li>
<li>4: only errors</li>
<li>3: warnings and errors</li>
<li>2: informations, warnings and errors</li>
@@ -84,20 +83,19 @@
</ul>
<p>In all cases the x prefix is the minimal level, acting as a filter:</p>
<ul>
- <li>0: everything</li>
<li>1: DEBUG</li>
<li>2: INFO</li>
<li>3: WARNING</li>
<li>4: ERROR</li>
</ul>
<p>Multiple output can be defined , they just need to be separated by
- spaces, e.g.: <code>"3:syslog:libvirtd 0:file:/tmp/libvirt.log"</code>
+ spaces, e.g.: <code>"3:syslog:libvirtd 1:file:/tmp/libvirt.log"</code>
will log all warnings and errors to syslog under the libvirtd ident
but also log everything debugging and informations included in the
file <code>/tmp/libvirt.log</code></p>
<p>For example setting up the following:</p>
<pre>export LIBVIRT_DEBUG=1
-export LIBVIRT_LOG_OUTPUTS="0:file:virsh.log"</pre>
+export LIBVIRT_LOG_OUTPUTS="1:file:virsh.log"</pre>
<p>and then running virsh will accumulate the logs in the
<code>virsh.log</code> file in a way similar to:</p>
<pre>14:29:04.771: debug : virInitialize:278 : register drivers
diff --git a/qemud/libvirtd.conf b/qemud/libvirtd.conf
index 1fd5918..49de466 100644
--- a/qemud/libvirtd.conf
+++ b/qemud/libvirtd.conf
@@ -269,7 +269,7 @@
# Logging controls
#
-# Logging level: 0 none, 4 errors, 3 warnings, 2 informations, 1 debug
+# Logging level: 4 errors, 3 warnings, 2 informations, 1 debug
# basically 1 will log everything possible
#log_level = 3
@@ -303,13 +303,12 @@
# x:file:file_path
# output to a file, with the given filepath
# In all case the x prefix is the minimal level, acting as a filter
-# 0: everything
# 1: DEBUG
# 2: INFO
# 3: WARNING
# 4: ERROR
#
-# Multiple output can be defined , they just need to be separated by spaces.
+# Multiple output can be defined, they just need to be separated by spaces.
# e.g.:
# log_outputs="3:syslog:libvirtd"
# to log all warnings and errors to syslog under the libvirtd ident
diff --git a/qemud/qemud.c b/qemud/qemud.c
index b5e3665..da20aa9 100644
--- a/qemud/qemud.c
+++ b/qemud/qemud.c
@@ -128,7 +128,7 @@ static int sigwrite = -1; /* Signal handler pipe */
static int ipsock = 0; /* -l Listen for TCP/IP */
/* Defaults for logging */
-static int log_level = 3;
+static int log_level = VIR_LOG_DEFAULT;
static char *log_filters = NULL;
static char *log_outputs = NULL;
@@ -2499,15 +2499,16 @@ qemudSetLogging(virConfPtr conf, const char *filename) {
log_outputs = strdup(debugEnv);
}
if (!log_outputs) {
+ char *tmp = NULL;
if (godaemon) {
- char *tmp = NULL;
if (virAsprintf (&tmp, "%d:syslog:libvirtd", log_level) < 0)
goto free_and_fail;
- virLogParseOutputs (tmp);
- VIR_FREE (tmp);
} else {
- virLogParseOutputs("0:stderr:libvirtd");
+ if (virAsprintf(&tmp, "%d:stderr", log_level) < 0)
+ goto free_and_fail;
}
+ virLogParseOutputs(tmp);
+ VIR_FREE(tmp);
} else {
virLogParseOutputs(log_outputs);
}
diff --git a/src/logging.c b/src/logging.c
index fd1d5d4..d13ae0f 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -119,7 +119,7 @@ static int virLogNbOutputs = 0;
/*
* Default priorities
*/
-static virLogPriority virLogDefaultPriority = VIR_LOG_WARN;
+static virLogPriority virLogDefaultPriority = VIR_LOG_DEFAULT;
static int virLogResetFilters(void);
static int virLogResetOutputs(void);
@@ -174,7 +174,7 @@ int virLogStartup(void) {
virLogLen = 0;
virLogStart = 0;
virLogEnd = 0;
- virLogDefaultPriority = VIR_LOG_WARN;
+ virLogDefaultPriority = VIR_LOG_DEFAULT;
virLogUnlock();
return(0);
}
@@ -196,7 +196,7 @@ int virLogReset(void) {
virLogLen = 0;
virLogStart = 0;
virLogEnd = 0;
- virLogDefaultPriority = VIR_LOG_WARN;
+ virLogDefaultPriority = VIR_LOG_DEFAULT;
virLogUnlock();
return(0);
}
@@ -689,7 +689,7 @@ int virLogParseOutputs(const char *outputs) {
virSkipSpaces(&cur);
while (*cur != 0) {
prio= virParseNumber(&cur);
- if ((prio < 0) || (prio > 4))
+ if ((prio < VIR_LOG_DEBUG) || (prio > VIR_LOG_ERROR))
return(-1);
if (*cur != ':')
return(-1);
@@ -770,7 +770,7 @@ int virLogParseFilters(const char *filters) {
virSkipSpaces(&cur);
while (*cur != 0) {
prio= virParseNumber(&cur);
- if ((prio < 0) || (prio > 4))
+ if ((prio < VIR_LOG_DEBUG) || (prio > VIR_LOG_ERROR))
return(-1);
if (*cur != ':')
return(-1);
diff --git a/src/logging.h b/src/logging.h
index d99bb31..0b9ae79 100644
--- a/src/logging.h
+++ b/src/logging.h
@@ -77,6 +77,8 @@ typedef enum {
VIR_LOG_ERROR,
} virLogPriority;
+#define VIR_LOG_DEFAULT VIR_LOG_WARN
+
/**
* virLogOutputFunc:
* @category: the category for the message
15 years, 4 months
[libvirt] Upcoming 0.6.5 release and switching the main SCM engine (to git)
by Daniel Veillard
A couple of things I wanted to raise.
- First we have a release 0.6.5 at the end of the week, so we are in bug
fix mode, it would be good if people could make a round of testing of
the latest CVS/git version or the snapshot at
ftp://libvirt.org/libvirt/libvirt-cvs-snapshot.tar.gz
The snapshot generation was proken in the previous months but I fixed
it today.
- Another point is that we use CVS as the SCM, that's historical, that's
what I was used to when I created the project but clearly most people
now use the git mirror (or mercurial) to generate their patches. I tried
to assert how much git was prevalent, at least for patches embedded
within the mail content a large majority are git generated:
paphio:~/Mail -> tail -100000 libvir | grep "^diff" | wc -l
268
paphio:~/Mail -> tail -100000 libvir | grep "^diff" | grep -- '-git' | wc -l
182
that doesn't account mails which are attached and base64 encoded but
I think it's reasonnable to conclude most of people sending patches
generated them out of a git tree. CVS certainly show its age, too !
So my plan would be to switch out of CVS and make git the primary
SCM, Jim Meyering is already maintaining the current git tree, so the
plan would be to create a new main git tree on libvirt.org based on the
existing git://git.et.redhat.com/libvirt.git tree, maybe fixing a couple
of things in the process, and desactivate the CVS server after a couple of
week grace period. I think once the decision is taken it's better to
do it earlier than late, and I'm thinking that this could be done
earlier next week if Jim schedule allows and there is no objection. That
would allow to manage the set of patches for the following release only
under git and not need an SCM transition in the course of preparing
0.6.6 (or 0.7.0).
- Speaking of the following release, I'm shooting for a slightly smaller
development cycle, in order to be able to push the next version in time
for Fedora 12 Beta, this means a new release at the end of July, so only
a bit more than a couple of weeks for pushing the changes, I really hope
we will be able to include a first version of the ESX driver and Power
Hyprvisor, if it's the case I think it will be worth bumping the release
name to 0.7.0 .
Feedback and opinions welcome, I hope git is not too uncontroversial :-)
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
15 years, 4 months