[libvirt] libvirtd can not start up
by Lin Qing
Hi all:
I met a issue during boot libvirtd.When I use "libvirtd --daemon
" , libvirtd didn't start up. And I am using the latest libvirt source
code .
Here is the libvirtd.log
/usr/local/var/log/libvirt/libvirtd.log
2012-06-15 06:35:04.230+0000: 16193: info : libvirt version: 0.9.12
2012-06-15 06:35:04.230+0000: 16193: error : virStateInitialize:781 :
Initialization of NWFilter state driver failed
2012-06-15 06:35:05.079+0000: 16193: error : daemonRunStateInit:752 :
Driver state initialization failed
anybody konws what 's going on ?
Thanks
Lin Qing.
12 years, 6 months
[libvirt] libvirtd stopped launching
by Zeeshan Ali (Khattak)
Hi everyone,
After I updated my libvirt repo/install from latest git master
yesterday, libvirtd won't just launch for me anymore. The error in log
was:
2012-06-13 11:59:47.427+0000: 30501: error : virStateInitialize:781 :
Initialization of NWFilter state driver failed
2012-06-13 11:59:48.601+0000: 30501: error : daemonRunStateInit:752 :
Driver state initialization failed
Daniel asked me to enable more debug to find the cause and here is the
output: http://static.fi/~zeenix/tmp/libvirt.out
Does anyone know whats going on and how can I fix this? In the
meantime I'll try to see reverting to some older commit helps and if
so, I'll do a git bisect..
--
Regards,
Zeeshan Ali (Khattak)
FSF member#5124
12 years, 6 months
[libvirt] [PATCH] docs: Update domain XML schema
by Osier Yang
'boot' tag shouldn't be exclusive with 'kernel', 'initrd', and 'cmdline',
though the boot sequence doesn't make sense when the guest boots from
kernel directly. But it's useful if booting from kernel is to install
a newly guest, even it's not to install a guest, there is no hurt. And
on the other hand, we allow 'boot' and the kernel tags when parsing.
---
docs/schemas/domaincommon.rng | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 62c28c8..46e539d 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -222,12 +222,14 @@
<ref name="absFilePath"/>
</element>
</optional>
- <choice>
+ <optional>
<ref name="osbootkernel"/>
+ </optional>
+ <optional>
<zeroOrMore>
<ref name="osbootdev"/>
</zeroOrMore>
- </choice>
+ </optional>
<optional>
<element name="bootmenu">
<attribute name="enable">
--
1.7.7.3
12 years, 6 months
[libvirt] [PATCH] Add more debug logging for libvirtd startup
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
To facilitate future troubleshooting add a bunch more debugging
statements into important startup parts of libvirt
---
daemon/libvirtd.c | 40 +++++++++++++++++++++++++++++-----------
src/libvirt.c | 15 +++++++++------
src/util/hooks.c | 3 +++
src/util/virnetlink.c | 1 +
4 files changed, 42 insertions(+), 17 deletions(-)
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index c1ee3f4..9c06344 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -461,6 +461,7 @@ static int daemonSetupNetworking(virNetServerPtr srv,
goto error;
}
+ VIR_DEBUG("Registering unix socket %s", sock_path);
if (!(svc = virNetServerServiceNewUNIX(sock_path,
unix_sock_rw_mask,
unix_sock_gid,
@@ -469,15 +470,17 @@ static int daemonSetupNetworking(virNetServerPtr srv,
config->max_client_requests,
NULL)))
goto error;
- if (sock_path_ro &&
- !(svcRO = virNetServerServiceNewUNIX(sock_path_ro,
- unix_sock_ro_mask,
- unix_sock_gid,
- config->auth_unix_ro,
- true,
- config->max_client_requests,
- NULL)))
- goto error;
+ if (sock_path_ro) {
+ VIR_DEBUG("Registering unix socket %s", sock_path_ro);
+ if (!(svcRO = virNetServerServiceNewUNIX(sock_path_ro,
+ unix_sock_ro_mask,
+ unix_sock_gid,
+ config->auth_unix_ro,
+ true,
+ config->max_client_requests,
+ NULL)))
+ goto error;
+ }
if (virNetServerAddService(srv, svc,
config->mdns_adv && !ipsock ?
@@ -491,6 +494,8 @@ static int daemonSetupNetworking(virNetServerPtr srv,
if (ipsock) {
if (config->listen_tcp) {
+ VIR_DEBUG("Registering TCP socket %s:%s",
+ config->listen_addr, config->tcp_port);
if (!(svcTCP = virNetServerServiceNewTCP(config->listen_addr,
config->tcp_port,
config->auth_tcp,
@@ -527,6 +532,8 @@ static int daemonSetupNetworking(virNetServerPtr srv,
goto error;
}
+ VIR_DEBUG("Registering TLS socket %s:%s",
+ config->listen_addr, config->tls_port);
if (!(svcTLS =
virNetServerServiceNewTCP(config->listen_addr,
config->tls_port,
@@ -1070,8 +1077,10 @@ int main(int argc, char **argv) {
}
if (!privileged &&
- migrateProfile() < 0)
+ migrateProfile() < 0) {
+ VIR_ERROR(_("Exiting due to failure to migrate profile"));
exit(EXIT_FAILURE);
+ }
if (config->host_uuid &&
virSetHostUUIDStr(config->host_uuid) < 0) {
@@ -1090,6 +1099,7 @@ int main(int argc, char **argv) {
VIR_ERROR(_("Can't determine pid file path."));
exit(EXIT_FAILURE);
}
+ VIR_DEBUG("Decided on pid file path '%s'", NULLSTR(pid_file));
if (daemonUnixSocketPaths(config,
privileged,
@@ -1098,6 +1108,8 @@ int main(int argc, char **argv) {
VIR_ERROR(_("Can't determine socket paths"));
exit(EXIT_FAILURE);
}
+ VIR_DEBUG("Decided on socket paths '%s' and '%s'",
+ sock_file, NULLSTR(sock_file_ro));
if (godaemon) {
char ebuf[1024];
@@ -1135,6 +1147,7 @@ int main(int argc, char **argv) {
old_umask = umask(022);
else
old_umask = umask(077);
+ VIR_DEBUG("Ensuring run dir '%s' exists", run_dir);
if (virFileMakePath(run_dir) < 0) {
char ebuf[1024];
VIR_ERROR(_("unable to create rundir %s: %s"), run_dir,
@@ -1171,6 +1184,7 @@ int main(int argc, char **argv) {
/* Beyond this point, nothing should rely on using
* getuid/geteuid() == 0, for privilege level checks.
*/
+ VIR_DEBUG("Dropping privileges (if required)");
if (daemonSetupPrivs() < 0) {
ret = VIR_DAEMON_ERR_PRIVS;
goto cleanup;
@@ -1207,11 +1221,13 @@ int main(int argc, char **argv) {
goto cleanup;
}
- if (timeout != -1)
+ if (timeout != -1) {
+ VIR_DEBUG("Registering shutdown timeout %d", timeout);
virNetServerAutoShutdown(srv,
timeout,
daemonShutdownCheck,
NULL);
+ }
if ((daemonSetupSignals(srv)) < 0) {
ret = VIR_DAEMON_ERR_SIGNAL;
@@ -1219,11 +1235,13 @@ int main(int argc, char **argv) {
}
if (config->audit_level) {
+ VIR_DEBUG("Attempting to configure auditing subsystem");
if (virAuditOpen() < 0) {
if (config->audit_level > 1) {
ret = VIR_DAEMON_ERR_AUDIT;
goto cleanup;
}
+ VIR_DEBUG("Proceeding without auditing");
}
}
virAuditLog(config->audit_logging);
diff --git a/src/libvirt.c b/src/libvirt.c
index 16afd58..99e85e4 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -769,20 +769,23 @@ virRegisterStateDriver(virStateDriverPtr driver)
* Returns 0 if all succeed, -1 upon any failure.
*/
int virStateInitialize(int privileged) {
- int i, ret = 0;
+ int i;
if (virInitialize() < 0)
return -1;
for (i = 0 ; i < virStateDriverTabCount ; i++) {
- if (virStateDriverTab[i]->initialize &&
- virStateDriverTab[i]->initialize(privileged) < 0) {
- VIR_ERROR(_("Initialization of %s state driver failed"),
+ if (virStateDriverTab[i]->initialize) {
+ VIR_DEBUG("Running global init for %s state driver",
virStateDriverTab[i]->name);
- ret = -1;
+ if (virStateDriverTab[i]->initialize(privileged) < 0) {
+ VIR_ERROR(_("Initialization of %s state driver failed"),
+ virStateDriverTab[i]->name);
+ return -1;
+ }
}
}
- return ret;
+ return 0;
}
/**
diff --git a/src/util/hooks.c b/src/util/hooks.c
index f89a40f..e0d6bf0 100644
--- a/src/util/hooks.c
+++ b/src/util/hooks.c
@@ -271,6 +271,9 @@ virHookCall(int driver,
return -1;
}
+ VIR_DEBUG("Calling hook opstr=%s subopstr=%s extra=%s",
+ opstr, subopstr, extra);
+
cmd = virCommandNewArgList(path, id, opstr, subopstr, extra, NULL);
virCommandAddEnvPassCommon(cmd);
diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c
index 9539694..bb0dae9 100644
--- a/src/util/virnetlink.c
+++ b/src/util/virnetlink.c
@@ -130,6 +130,7 @@ virNetlinkStartup(void)
{
if (placeholder_nlhandle)
return 0;
+ VIR_DEBUG("Running global netlink initialization");
placeholder_nlhandle = virNetlinkAlloc();
if (!placeholder_nlhandle) {
virReportSystemError(errno, "%s",
--
1.7.10.2
12 years, 6 months
[libvirt] [PATCH] Fix launch of libvirtd when DHCP snooping support is not available.
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
When libpcap is not available, the NWFilter driver provides a
no-op stub for the DHCP snooping initialization. This was
mistakenly returning '-1' instead of '0', so the entire driver
initialization failed
---
src/nwfilter/nwfilter_dhcpsnoop.c | 5 ++++-
src/nwfilter/nwfilter_gentech_driver.c | 1 +
src/nwfilter/nwfilter_learnipaddr.c | 1 +
3 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcpsnoop.c
index 22f76e2..5dffaad 100644
--- a/src/nwfilter/nwfilter_dhcpsnoop.c
+++ b/src/nwfilter/nwfilter_dhcpsnoop.c
@@ -2056,6 +2056,8 @@ virNWFilterDHCPSnoopInit(void)
if (virNWFilterSnoopState.snoopReqs)
return 0;
+ VIR_DEBUG("Initializing DHCP snooping");
+
if (virMutexInitRecursive(&virNWFilterSnoopState.snoopLock) < 0 ||
virMutexInit(&virNWFilterSnoopState.activeLock) < 0 ||
virAtomicIntInit(&virNWFilterSnoopState.nLeases) < 0 ||
@@ -2176,7 +2178,8 @@ virNWFilterDHCPSnoopShutdown(void)
int
virNWFilterDHCPSnoopInit(void)
{
- return -1;
+ VIR_DEBUG("No DHCP snooping support available");
+ return 0;
}
void
diff --git a/src/nwfilter/nwfilter_gentech_driver.c b/src/nwfilter/nwfilter_gentech_driver.c
index 4769d21..d833bbb 100644
--- a/src/nwfilter/nwfilter_gentech_driver.c
+++ b/src/nwfilter/nwfilter_gentech_driver.c
@@ -57,6 +57,7 @@ static virNWFilterTechDriverPtr filter_tech_drivers[] = {
void virNWFilterTechDriversInit(bool privileged) {
int i = 0;
+ VIR_DEBUG("Initializing NWFilter technology drivers");
while (filter_tech_drivers[i]) {
if (!(filter_tech_drivers[i]->flags & TECHDRV_FLAG_INITIALIZED))
filter_tech_drivers[i]->init(privileged);
diff --git a/src/nwfilter/nwfilter_learnipaddr.c b/src/nwfilter/nwfilter_learnipaddr.c
index af13738..a891377 100644
--- a/src/nwfilter/nwfilter_learnipaddr.c
+++ b/src/nwfilter/nwfilter_learnipaddr.c
@@ -782,6 +782,7 @@ virNWFilterLearnInit(void) {
if (pendingLearnReq)
return 0;
+ VIR_DEBUG("Initializing IP address learning");
threadsTerminate = false;
pendingLearnReq = virHashCreate(0, freeLearnReqEntry);
--
1.7.10.2
12 years, 6 months
[libvirt] RFC: spice-server default listen behaviour change
by David Jaša
Hi,
I learned few things about ipv6 lately. Most importantly about
dual-socket that means that a process that opens ::0 automatically
listens on both ipv4 _and_ ipv6 unless it sets IPV6_ONLY option of
setsockopt() to 0.
This is pretty important wrt dual-stack configurations because they can
be implemented with just slight changes to spice server (unlike the old
RFE requesting listening on multiple addresses):
* when no addr= or ipvx options are set, listen on ::0
* when ipv4 and no addr= option is set, listen on 0.0.0.0
* when ipv6 is set, set IPV6_ONLY to 1 to make sure that spice server
won't listen on ipv4
* when conflicting ipvx and addr= options are set, error out (this
already works fine)
This will affect upper layers though, given bugs like
https://bugzilla.redhat.com/show_bug.cgi?id=832121 , but it seems to me
like the step in the right direction. Any thoughts/comments before I
file this as a bug?
David
--
David Jaša, RHCE
SPICE QE based in Brno
GPG Key: 22C33E24
Fingerprint: 513A 060B D1B4 2A72 7F0D 0278 B125 CD00 22C3 3E24
12 years, 6 months
[libvirt] [PATCH 0/3 v5] use qemu's dump-guest-meory when vm uses host device
by Wen Congyang
Currently, we use migrate to dump guest's memory. There is one
restriction in migrate command: the device's status should be
stored in qemu because the device's status should be passed to
target machine.
If we passthrough a host device to guest, the device's status
is stored in the real device. So migrate command will fail.
We usually use dump when guest is panicked. So there is no need
to store device's status in the vmcore.
qemu have a new monitor command dump-guest-memory to dump
guest memory, but it doesn't support async now(it will support
later when the common async API is implemented).
Changes from v4 to v5:
1. address Martin Kletzander's comment
Changes from v3 to v4:
1. allow the user to specify the core file's format
Changes from v2 to v3:
1. qemu supports the fd that is associated with a pipe, socket, or FIFO.
So pass a pipe fd to qemu and O_DIRECT can work now.
Change from v1 to v2:
1. remove the implemention for text mode.
Wen Congyang (3):
qemu: implement qemu's dump-guest-memory
qemu: allow the client to choose the vmcore's format
virsh: allow the user to specify vmcore's format
include/libvirt/libvirt.h.in | 1 +
src/qemu/qemu_capabilities.c | 5 +++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_domain.c | 1 +
src/qemu/qemu_domain.h | 1 +
src/qemu/qemu_driver.c | 60 ++++++++++++++++++++++++++++++++---------
src/qemu/qemu_monitor.c | 37 ++++++++++++++++++++++++++
src/qemu/qemu_monitor.h | 12 ++++++++
src/qemu/qemu_monitor_json.c | 34 +++++++++++++++++++++++
src/qemu/qemu_monitor_json.h | 6 ++++
tools/virsh.c | 3 ++
tools/virsh.pod | 5 +++-
12 files changed, 152 insertions(+), 14 deletions(-)
12 years, 6 months
[libvirt] [PATCH] qemu: fix potential dead lock
by Wen Congyang
If we lock the qemu_driver, we should call qemuDomainObjBeginJobWithDriver()
not qemuDomainObjBeginJob().
---
src/qemu/qemu_driver.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 39b27b1..3d62aab 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -8905,7 +8905,7 @@ qemuDomainMigrateBegin3(virDomainPtr domain,
goto cleanup;
asyncJob = QEMU_ASYNC_JOB_MIGRATION_OUT;
} else {
- if (qemuDomainObjBeginJob(driver, vm, QEMU_JOB_MODIFY) < 0)
+ if (qemuDomainObjBeginJobWithDriver(driver, vm, QEMU_JOB_MODIFY) < 0)
goto cleanup;
asyncJob = QEMU_ASYNC_JOB_NONE;
}
--
1.7.1
12 years, 6 months