Re: [Libvir] Accessing qemu from windows
by Richard W.M. Jones
On Wed, Mar 19, 2008 at 03:14:44PM +0200, Gabriel Kaufmann wrote:
> Hi,
> Sorry for my late reply, I was having technical problems with the machine that has the KVM installed in.
>
> I run libvirtd with the --verbose flag, but I still receive the same message with no extra details
libvirtd prints nothing extra at all?
Can you follow up with the full output of libvirtd.
Also please send messages to the list.
Thanks,
Rich.
--
Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones
virt-top is 'top' for virtual machines. Tiny program with many
powerful monitoring features, net stats, disk stats, logging, etc.
http://et.redhat.com/~rjones/virt-top
16 years, 9 months
[libvir] How to seek a running QEMU instance
by Anton Protopopov
Hi,
I have the following question. How can virsh (or, more accurately, libvirt)
detect a running QEMU vm, when latter was already started? For example, I
have got the following:
[aspsk@localhost Server-4.0.1]$ qemu -hda Server-4.0.1.img -m 256 &
[1] 12001
[aspsk@localhost Server-4.0.1]$ Could not configure '/dev/rtc' to have a
1024 Hz timer. This is not a fatal
error, but for better emulation accuracy either use a 2.6 host Linux kernel
or
type 'echo 1024 > /proc/sys/dev/rtc/max-user-freq' as root.
Could not open '/dev/kqemu' - QEMU acceleration layer not activated: No such
file or directory
Could not open '/dev/qvm86' - QEMU acceleration layer not activated: No such
file or directory
[aspsk@localhost Server-4.0.1]$ sudo virsh -c qemu:///system list --all
Id Name State
----------------------------------
[aspsk@localhost Server-4.0.1]$
A.
16 years, 9 months
[Libvir] persistent guests (save guest at shutdown and reload it at boot)
by Matthias Pfafferodt
Hello,
I added the following entry to the libvirt bugzilla (Bugzilla Bug 437204).
Daniel Veillard ask me to post this to the list for discussion.
Description of problem:
libvirt can save and restore guests. It is also possible to autostart
guest at boot time. I miss a similar option: 'persistent'
booting the host:
* the guest is restored if there is a saved version
* else it is booted
shutdown of the host
* the guest is saved
The xendomain script does something like this. There the 'autostart' option
checks if the domain was saved. If it was this domain is restored else it
is created. At shutdown of the dom0 all running domU's are saved.
Matthias Pfafferodt
16 years, 9 months
[Libvir] PATCH: Fix dir/fs storage pool when SELinux is disabled
by Daniel P. Berrange
When SELinux is disabled fgetfilecon() may well return -1, if a file has no
extended attribute with security context data. This causes the storage pool
to skip that file. The fix is to check whether errno is ENODATA and treat
that as an expected error case & ignore it.
Dan.
Index: src/storage_backend.c
===================================================================
RCS file: /data/cvs/libvirt/src/storage_backend.c,v
retrieving revision 1.8
diff -u -p -r1.8 storage_backend.c
--- src/storage_backend.c 27 Feb 2008 10:37:19 -0000 1.8
+++ src/storage_backend.c 14 Mar 2008 21:21:05 -0000
@@ -240,17 +240,22 @@ virStorageBackendUpdateVolInfoFD(virConn
#if HAVE_SELINUX
if (fgetfilecon(fd, &filecon) == -1) {
- virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
- _("cannot get file context of %s: %s"),
- vol->target.path, strerror(errno));
- return -1;
- }
- vol->target.perms.label = strdup(filecon);
- if (vol->target.perms.label == NULL) {
- virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("context"));
- return -1;
+ if (errno != ENODATA) {
+ virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
+ _("cannot get file context of %s: %s"),
+ vol->target.path, strerror(errno));
+ return -1;
+ } else {
+ vol->target.perms.label = NULL;
+ }
+ } else {
+ vol->target.perms.label = strdup(filecon);
+ if (vol->target.perms.label == NULL) {
+ virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("context"));
+ return -1;
+ }
+ freecon(filecon);
}
- freecon(filecon);
#else
vol->target.perms.label = NULL;
#endif
--
|: Red Hat, Engineering, Boston -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
16 years, 9 months
[Libvir] PATCH: Fix xen unified driver open logic
by Daniel P. Berrange
When adding PolicyKit support we disabled the proxy driver, but did not
correctly fix up the Xen unified driver. The result is that it is still
trying to run the proxy setuid helper which doesn't exist and thus it fails
the open operation before the remote driver gets the opportunity to process
the URI. I attempted to fix this by just disabling the proxy driver in the
unified driver, but came to the conclusion the logic of the current code is
just not flexible enough for what we need to be able todo these days.
THe core problem is the 'for(;;)' loop iterating over the drivers - it
already has several special cases in the loop body to skip drivers, or
ignore errors and adding more special cases is making my mind hurt trying
to trace the logic.
So I have removed the loop, and encode the desired logic explicitly. The
diff a little unpleasant to read, so to summarize the logic is thus:
- If root only, try open the hypervisor driver
-> Failure to open is fatal, do not try other drivers
- Try to open the XenD driver
- If XenD suceeds
-> If XenD < 3.0.4, then open the XM driver for inactive domains
-> Try to open the XS driver
=> Failure to open is fatal if root
- Else XenD fails
->.If proxy is compiled in, try to open proxy
=> Failure to open is fatal
This should result in one of the following combinations of drivers being
activated:
root: (HV + XenD + XS)
root: (HV + XenD + XS + XM)
non-root: (XenD)
non-root: (XenD + XS)
non-root: (proxy)
If non-root, and the proxy is not compiled in, we'll hand off to the remote
driver. Any other scenario will result in an explicit fail.
Dan.
? docs/apibuild.pyc
Index: configure.in
===================================================================
RCS file: /data/cvs/libvirt/configure.in,v
retrieving revision 1.133
diff -u -p -r1.133 configure.in
--- configure.in 3 Mar 2008 14:42:37 -0000 1.133
+++ configure.in 10 Mar 2008 18:59:23 -0000
@@ -873,6 +873,9 @@ fi
AC_MSG_RESULT([$with_xen_proxy])
AM_CONDITIONAL(WITH_PROXY,[test "$with_xen_proxy" = "yes"])
+if test "$with_xen_proxy" = "yes"; then
+ AC_DEFINE(WITH_PROXY, 1, [Whether Xen proxy is enabled])
+fi
dnl Enable building libvirtd?
AM_CONDITIONAL(WITH_LIBVIRTD,[test "x$with_libvirtd" = "xyes"])
Index: src/remote_internal.c
===================================================================
RCS file: /data/cvs/libvirt/src/remote_internal.c,v
retrieving revision 1.61
diff -u -p -r1.61 remote_internal.c
--- src/remote_internal.c 26 Feb 2008 07:05:18 -0000 1.61
+++ src/remote_internal.c 10 Mar 2008 18:59:24 -0000
@@ -835,6 +835,14 @@ remoteOpen (virConnectPtr conn,
}
}
#endif
+#if WITH_XEN
+ if (uri &&
+ uri->scheme && STREQ (uri->scheme, "xen") &&
+ (!uri->server || STREQ (uri->server, "")) &&
+ (!uri->path || STREQ(uri->path, "/"))) {
+ rflags |= VIR_DRV_OPEN_REMOTE_UNIX;
+ }
+#endif
priv->magic = DEAD;
priv->sock = -1;
Index: src/xen_unified.c
===================================================================
RCS file: /data/cvs/libvirt/src/xen_unified.c,v
retrieving revision 1.38
diff -u -p -r1.38 xen_unified.c
--- src/xen_unified.c 27 Feb 2008 10:37:19 -0000 1.38
+++ src/xen_unified.c 10 Mar 2008 18:59:24 -0000
@@ -42,6 +42,7 @@
#include "util.h"
#define DEBUG(fmt,...) VIR_DEBUG(__FILE__, fmt,__VA_ARGS__)
+#define DEBUG0(msg) VIR_DEBUG(__FILE__, "%s", msg)
static int
xenUnifiedNodeGetInfo (virConnectPtr conn, virNodeInfoPtr info);
@@ -239,7 +242,7 @@ xenUnifiedProbe (void)
static int
xenUnifiedOpen (virConnectPtr conn, xmlURIPtr uri, virConnectAuthPtr auth, int flags)
{
- int i, j;
+ int i;
xenUnifiedPrivatePtr priv;
/* Refuse any scheme which isn't "xen://" or "http://". */
@@ -276,41 +279,69 @@ xenUnifiedOpen (virConnectPtr conn, xmlU
priv->xshandle = NULL;
priv->proxy = -1;
- for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i) {
- priv->opened[i] = 0;
- /* Only use XM driver for Xen <= 3.0.3 (ie xendConfigVersion <= 2) */
- if (drivers[i] == &xenXMDriver &&
- priv->xendConfigVersion > 2)
- continue;
-
- /* Ignore proxy for root */
- if (i == XEN_UNIFIED_PROXY_OFFSET && getuid() == 0)
- continue;
-
- if (drivers[i]->open) {
- DEBUG("trying Xen sub-driver %d", i);
- if (drivers[i]->open (conn, uri, auth, flags) == VIR_DRV_OPEN_SUCCESS)
- priv->opened[i] = 1;
- DEBUG("Xen sub-driver %d open %s\n",
- i, priv->opened[i] ? "ok" : "failed");
- }
+ /* Hypervisor is only run as root & required to succeed */
+ if (getuid() == 0) {
+ DEBUG0("Trying hypervisor sub-driver");
+ if (drivers[XEN_UNIFIED_HYPERVISOR_OFFSET]->open(conn, uri, auth, flags) !=
+ VIR_DRV_OPEN_SUCCESS)
+ goto fail;
+
+ priv->opened[XEN_UNIFIED_HYPERVISOR_OFFSET] = 1;
+ }
- /* If as root, then all drivers must succeed.
- If non-root, then only proxy must succeed */
- if (!priv->opened[i] &&
- (getuid() == 0 || i == XEN_UNIFIED_PROXY_OFFSET)) {
- for (j = 0; j < i; ++j)
- if (priv->opened[j]) drivers[j]->close (conn);
- free (priv);
- /* The assumption is that one of the underlying drivers
- * has set virterror already.
- */
- return VIR_DRV_OPEN_ERROR;
+ /* XenD is required to suceed if root.
+ * If it fails as non-root, then the proxy driver may take over
+ */
+ DEBUG0("Trying XenD sub-driver");
+ if (drivers[XEN_UNIFIED_XEND_OFFSET]->open(conn, uri, auth, flags) ==
+ VIR_DRV_OPEN_SUCCESS) {
+ priv->opened[XEN_UNIFIED_XEND_OFFSET] = 1;
+
+ /* XenD is active, so try the xm & xs drivers too, both requird to
+ * succeed if root, optional otherwise */
+ if (priv->xendConfigVersion <= 2) {
+ DEBUG0("Trying XM sub-driver");
+ if (drivers[XEN_UNIFIED_XM_OFFSET]->open(conn, uri, auth, flags) ==
+ VIR_DRV_OPEN_SUCCESS) {
+ priv->opened[XEN_UNIFIED_XM_OFFSET] = 1;
+ }
+ }
+ DEBUG0("Trying XS sub-driver");
+ if (drivers[XEN_UNIFIED_XS_OFFSET]->open(conn, uri, auth, flags) ==
+ VIR_DRV_OPEN_SUCCESS) {
+ priv->opened[XEN_UNIFIED_XS_OFFSET] = 1;
+ } else {
+ if (getuid() == 0)
+ goto fail; /* XS is mandatory as root */
+ }
+ } else {
+ if (getuid() == 0) {
+ goto fail; /* XenD is mandatory as root */
+ } else {
+#if WITH_PROXY
+ DEBUG0("Trying proxy sub-driver");
+ if (drivers[XEN_UNIFIED_PROXY_OFFSET]->open(conn, uri, auth, flags) ==
+ VIR_DRV_OPEN_SUCCESS) {
+ priv->opened[XEN_UNIFIED_PROXY_OFFSET] = 1;
+ } else {
+ goto fail; /* Proxy is mandatory if XenD failed */
+ }
+#else
+ DEBUG0("Handing off for remote driver");
+ return VIR_DRV_OPEN_DECLINED; /* Let remote_driver try instead */
+#endif
}
}
return VIR_DRV_OPEN_SUCCESS;
+
+ fail:
+ DEBUG0("Failed mandatory driver");
+ for (i = 0 ; i < XEN_UNIFIED_NR_DRIVERS ; i++)
+ if (priv->opened[i]) drivers[i]->close(conn);
+ free(priv);
+ return VIR_DRV_OPEN_ERROR;
}
#define GET_PRIVATE(conn) \
Index: src/xend_internal.c
===================================================================
RCS file: /data/cvs/libvirt/src/xend_internal.c,v
retrieving revision 1.173
diff -u -p -r1.173 xend_internal.c
--- src/xend_internal.c 7 Mar 2008 09:23:30 -0000 1.173
+++ src/xend_internal.c 10 Mar 2008 18:59:24 -0000
@@ -234,14 +234,13 @@ do_connect(virConnectPtr xend)
close(s);
errno = serrno;
s = -1;
- /*
- * not being able to connect via the socket as a normal user
- * is rather normal, this should fallback to the proxy (or
- * remote) mechanism.
- */
- if ((getuid() == 0) || (xend->flags & VIR_CONNECT_RO)) {
- virXendError(xend, VIR_ERR_INTERNAL_ERROR,
- _("failed to connect to xend"));
+
+ /*
+ * Connecting to XenD as root is mandatory, so log this error
+ */
+ if (getuid() == 0) {
+ virXendError(xend, VIR_ERR_INTERNAL_ERROR,
+ _("failed to connect to xend"));
}
}
--
|: Red Hat, Engineering, Boston -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
16 years, 9 months
[Libvir] [PATCH] fix typos (part?)
by Atsushi SAKAI
Various typos fix.
priviledged => privileged
neccessary => necessary
hve => have
advertizement => advertisement
supervizing => supervising (Saori Fukuta suggest us as typo)
poool => pool
persitent => persistent
numbber => number
overriden => overridden
independantly => independently
hypvisor => hypervisor
adminstrator => administrator
maintainance => maintenance
targetted => targeted
from Longman Dictionary of Contemporary English
http://pewebdic2.cw.idm.fr/
I hope no one suggest typo on libvirt.
docs/FAQ.html | 6 +++---
docs/architecture.html | 12 ++++++------
docs/auth.html | 14 +++++++-------
docs/devhelp/libvirt-libvirt.html | 30 +++++++++++++++---------------
docs/html/libvirt-libvirt.html | 30 +++++++++++++++---------------
docs/libvir.html | 20 ++++++++++----------
docs/libvirt-api.xml | 34 +++++++++++++++++-----------------
docs/libvirt-refs.xml | 10 +++++-----
docs/news.html | 2 +-
docs/virsh.pod | 2 +-
include/libvirt/libvirt.h | 2 +-
include/libvirt/libvirt.h.in | 2 +-
qemud/mdns.h | 12 ++++++------
src/libvirt.c | 28 ++++++++++++++--------------
src/qemu.conf | 2 +-
src/remote_internal.c | 2 +-
src/xend_internal.c | 2 +-
tests/confdata/libvirtd.conf | 2 +-
tests/confdata/libvirtd.out | 2 +-
virsh.1 | 2 +-
20 files changed, 108 insertions(+), 108 deletions(-)
Thanks
Atsushi SAKAI
16 years, 9 months
[Libvir] regarding libvirt windows support...
by Deepa.Lingaraj@cognizant.com
We are not able to execute make command....
The errors we ae getting
make[2]: *** [libvirt_la-libvirt.lo] Error 1
make[2]: Leaving directory `/cygdrive/d/libvirt-0.4.1/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/cygdrive/d/libvirt-0.4.1'
make: *** [all] Error 2
Thanks and Regards,
Deepa Lingaraj.
This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly
prohibited and may be unlawful.
16 years, 9 months
[Libvir] PATCH: Fix virStoragePoolCreate() operation
by Daniel P. Berrange
The virStoragePoolCreate() was not checking for a potentially NULL field
against startPool() backend driver. It was also failing to run the refresh
operation after starting it. The former caused a crash, the latter caused
no volumes to show up
Dan.
Index: src/storage_driver.c
===================================================================
RCS file: /data/cvs/libvirt/src/storage_driver.c,v
retrieving revision 1.2
diff -u -p -r1.2 storage_driver.c
--- src/storage_driver.c 22 Feb 2008 16:26:13 -0000 1.2
+++ src/storage_driver.c 14 Mar 2008 21:34:04 -0000
@@ -416,8 +416,12 @@ storagePoolCreate(virConnectPtr conn,
return NULL;
}
- if (backend->startPool(conn, pool) < 0) {
- virStoragePoolObjRemove(driver, pool);
+ if (backend->startPool &&
+ backend->startPool(conn, pool) < 0)
+ return NULL;
+ if (backend->refreshPool(conn, pool) < 0) {
+ if (backend->stopPool)
+ backend->stopPool(conn, pool);
return NULL;
}
pool->active = 1;
--
|: Red Hat, Engineering, Boston -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
16 years, 9 months
[Libvir] java-libvirt on cvs:libvirt.org
by Daniel Schwager
Hallo list,
i took the java-libvirt port from Tóth István (Thank you - great work !!) and
added
- the some features from libvirt 0.4.0
- integrate of xsd XML-description / validator
- added auto generation of XML-beans related to the XSD file.
- project build.xml file
- integration of testng
- remote building of JNI library
- remote testing of junit/testing tests
So, I want to publish to port to a public cvs-tree. Is there
a little space on the libvirt website for this port ?
regards
Danny
16 years, 9 months
[Libvir] question about "informations"
by Atsushi SAKAI
Hi,
I have a question about "informations".
Is this english word usual?
Since this "informations" exists in many places.
(over 100 in libvirt code)
I do not want to change this to "information".
Thanks
Atsushi SAKAI
16 years, 9 months