[libvirt] [PATCH] vbox: Don't warn when the linker search path doesn't contain VBoxXPCOMC.so
by Matthias Bolte
This is actually a workaround, to unbreak make check on systems
without VirtualBox.
---
src/vbox/vbox_XPCOMCGlue.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/src/vbox/vbox_XPCOMCGlue.c b/src/vbox/vbox_XPCOMCGlue.c
index 7648e54..15a9622 100644
--- a/src/vbox/vbox_XPCOMCGlue.c
+++ b/src/vbox/vbox_XPCOMCGlue.c
@@ -124,7 +124,14 @@ static int tryLoadOne(const char *dir, bool setAppHome, bool ignoreMissing)
g_hVBoxXPCOMC = dlopen(name, RTLD_NOW | RTLD_LOCAL);
if (g_hVBoxXPCOMC == NULL) {
- VIR_WARN("Could not dlopen '%s': %s", name, dlerror());
+ /*
+ * FIXME: Don't warn in this case as it currently breaks make check
+ * on systems without VirtualBox.
+ */
+ if (dir != NULL) {
+ VIR_WARN("Could not dlopen '%s': %s", name, dlerror());
+ }
+
goto cleanup;
}
--
1.7.0.4
14 years
[libvirt] [PATCH C#] Don't add a column per item in the Mono virConnectOpenAuth example
by Matthias Bolte
---
.../MonoDevelop/virConnectOpenAuth/MainWindow.cs | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/examples/MonoDevelop/virConnectOpenAuth/MainWindow.cs b/examples/MonoDevelop/virConnectOpenAuth/MainWindow.cs
index d02acd4..4a3411d 100644
--- a/examples/MonoDevelop/virConnectOpenAuth/MainWindow.cs
+++ b/examples/MonoDevelop/virConnectOpenAuth/MainWindow.cs
@@ -36,6 +36,10 @@ public partial class MainWindow : Gtk.Window
treeview1.AppendColumn(tvcDomains);
treeview1.Model = domainListStore;
+
+ CellRendererText crtDomainCell = new CellRendererText();
+ tvcDomains.PackStart(crtDomainCell, true);
+ tvcDomains.AddAttribute(crtDomainCell, "text", 0);
}
protected void OnDeleteEvent (object sender, DeleteEventArgs a)
@@ -137,9 +141,6 @@ public partial class MainWindow : Gtk.Window
private void AddDomainInTreeView(string domainName)
{
domainListStore.AppendValues(domainName);
- CellRendererText crtDomainCell = new CellRendererText();
- tvcDomains.PackStart(crtDomainCell, true);
- tvcDomains.AddAttribute(crtDomainCell, "text", 0);
}
private static int AuthCallback(ref ConnectCredential[] creds, IntPtr cbdata)
--
1.7.0.4
14 years
[libvirt] [PATCH] vbox: Stop hardcoding a single path for VBoxXPCOMC.so
by Matthias Bolte
This partly reverts df90ca7661b0a789bd790ccf8258a4527c13eb8d.
Don't disable the VirtualBox driver when configure can't find
VBoxXPCOMC.so, rely on detection at runtime again instead.
Keep --with-vbox=/path/to/virtualbox intact, added to for:
https://bugzilla.redhat.com/show_bug.cgi?id=609185
Detection order for VBoxXPCOMC.so:
1. VBOX_APP_HOME environment variable
2. configure provided location
3. hardcoded list of known locations
4. dynamic linker search path
Also cleanup the glue code and improve error reporting.
---
Patch is based on Daniel's suggestion in:
https://www.redhat.com/archives/libvir-list/2010-October/msg00852.html
configure.ac | 53 +---------
po/POTFILES.in | 1 +
src/vbox/vbox_XPCOMCGlue.c | 232 +++++++++++++++++++++++---------------------
src/vbox/vbox_XPCOMCGlue.h | 14 ---
4 files changed, 130 insertions(+), 170 deletions(-)
diff --git a/configure.ac b/configure.ac
index e41f2b5..40d6b69 100644
--- a/configure.ac
+++ b/configure.ac
@@ -225,8 +225,8 @@ AC_ARG_WITH([xenapi],
AC_HELP_STRING([--with-xenapi], [add XenAPI support @<:@default=check@:>@]),[],[with_xenapi=check])
AC_ARG_WITH([vbox],
AC_HELP_STRING([--with-vbox=@<:@PFX@:>@],
- [VirtualBox XPCOMC location @<:@default=check@:>@]),[],
- [with_vbox=check])
+ [VirtualBox XPCOMC location @<:@default=yes@:>@]),[],
+ [with_vbox=yes])
AC_ARG_WITH([lxc],
AC_HELP_STRING([--with-lxc], [add Linux Container support @<:@default=check@:>@]),[],[with_lxc=check])
AC_ARG_WITH([one],
@@ -332,51 +332,10 @@ dnl
vbox_xpcomc_dir=
-if test "x$with_vbox" = "xyes" || test "x$with_vbox" = "xcheck"; then
- AC_MSG_CHECKING([for VirtualBox XPCOMC location])
-
- for vbox in \
- /usr/lib/virtualbox/VBoxXPCOMC.so \
- /usr/lib64/virtualbox/VBoxXPCOMC.so \
- /usr/lib/VirtualBox/VBoxXPCOMC.so \
- /opt/virtualbox/VBoxXPCOMC.so \
- /opt/VirtualBox/VBoxXPCOMC.so \
- /opt/virtualbox/i386/VBoxXPCOMC.so \
- /opt/VirtualBox/i386/VBoxXPCOMC.so \
- /opt/virtualbox/amd64/VBoxXPCOMC.so \
- /opt/VirtualBox/amd64/VBoxXPCOMC.so \
- /usr/local/lib/virtualbox/VBoxXPCOMC.so \
- /usr/local/lib/VirtualBox/VBoxXPCOMC.so \
- /Applications/VirtualBox.app/Contents/MacOS/VBoxXPCOMC.dylib \
- ; do
- if test -f "$vbox"; then
- vbox_xpcomc_dir=`AS_DIRNAME(["$vbox"])`
- break
- fi
- done
-
- if test -n "$vbox_xpcomc_dir"; then
- AC_MSG_RESULT([$vbox_xpcomc_dir])
- with_vbox=yes
- else
- if test "x$with_vbox" = "xcheck"; then
- AC_MSG_RESULT([not found, disabling VirtualBox driver])
- with_vbox=no
- else
- AC_MSG_RESULT([not found])
- AC_MSG_ERROR([VirtualBox XPCOMC is required for the VirtualBox driver])
- fi
- fi
-else
- if test "x$with_vbox" != "xno"; then
- if test -f ${with_vbox}/VBoxXPCOMC.so || \
- test -f ${with_vbox}/VBoxXPCOMC.dylib; then
- vbox_xpcomc_dir=$with_vbox
- with_vbox=yes
- else
- AC_MSG_ERROR([$with_vbox does not contain VirtualBox XPCOMC])
- fi
- fi
+if test "x$with_vbox" != "xyes" && test "x$with_vbox" != "xno"; then
+ # intentionally don't do any further checks here on the provided path
+ vbox_xpcomc_dir=$with_vbox
+ with_vbox=yes
fi
AC_DEFINE_UNQUOTED([VBOX_XPCOMC_DIR], ["$vbox_xpcomc_dir"],
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 541335e..dafef47 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -93,6 +93,7 @@ src/util/util.c
src/util/virtaudit.c
src/util/virterror.c
src/util/xml.c
+src/vbox/vbox_XPCOMCGlue.c
src/vbox/vbox_driver.c
src/vbox/vbox_tmpl.c
src/xen/proxy_internal.c
diff --git a/src/vbox/vbox_XPCOMCGlue.c b/src/vbox/vbox_XPCOMCGlue.c
index e8b0bd1..7648e54 100644
--- a/src/vbox/vbox_XPCOMCGlue.c
+++ b/src/vbox/vbox_XPCOMCGlue.c
@@ -32,13 +32,18 @@
#include <config.h>
-#include <stdio.h>
-#include <string.h>
#include <stdlib.h>
-#include <stdarg.h>
#include <dlfcn.h>
+#include <stdbool.h>
#include "vbox_XPCOMCGlue.h"
+#include "internal.h"
+#include "memory.h"
+#include "util.h"
+#include "logging.h"
+#include "virterror_internal.h"
+
+#define VIR_FROM_THIS VIR_FROM_VBOX
/*******************************************************************************
@@ -60,8 +65,6 @@
*******************************************************************************/
/** The dlopen handle for VBoxXPCOMC. */
void *g_hVBoxXPCOMC = NULL;
-/** The last load error. */
-char g_szVBoxErrMsg[256];
/** Pointer to the VBoxXPCOMC function table. */
PCVBOXXPCOM g_pVBoxFuncs = NULL;
/** Pointer to VBoxGetXPCOMCFunctions for the loaded VBoxXPCOMC so/dylib/dll. */
@@ -69,104 +72,97 @@ PFNVBOXGETXPCOMCFUNCTIONS g_pfnGetFunctions = NULL;
/**
- * Wrapper for setting g_szVBoxErrMsg. Can be an empty stub.
- *
- * @param fAlways When 0 the g_szVBoxErrMsg is only set if empty.
- * @param pszFormat The format string.
- * @param ... The arguments.
- */
-static void setErrMsg(int fAlways, const char *pszFormat, ...)
-{
-#ifndef LIBVIRT_VERSION
- if ( fAlways
- || !g_szVBoxErrMsg[0])
- {
- va_list va;
- va_start(va, pszFormat);
- vsnprintf(g_szVBoxErrMsg, sizeof(g_szVBoxErrMsg), pszFormat, va);
- va_end(va);
- }
-#else /* libvirt */
- (void)fAlways;
- (void)pszFormat;
-#endif /* libvirt */
-}
-
-
-/**
* Try load VBoxXPCOMC.so/dylib/dll from the specified location and resolve all
* the symbols we need.
*
- * @returns 0 on success, -1 on failure.
- * @param pszHome The director where to try load VBoxXPCOMC from. Can
- * be NULL.
- * @param fSetAppHome Whether to set the VBOX_APP_HOME env.var. or not
- * (boolean).
+ * @returns 0 on success, -1 on failure and 1 if VBoxXPCOMC was not found.
+ * @param dir The directory where to try load VBoxXPCOMC from. Can
+ * be NULL.
+ * @param setAppHome Whether to set the VBOX_APP_HOME env.var. or not.
+ * @param ignoreMissing Whether to ignore missing library or not.
*/
-static int tryLoadOne(const char *pszHome, int fSetAppHome)
+static int tryLoadOne(const char *dir, bool setAppHome, bool ignoreMissing)
{
- size_t cchHome = pszHome ? strlen(pszHome) : 0;
- size_t cbBufNeeded;
- char szName[4096];
- int rc = -1;
+ int result = -1;
+ char *name = NULL;
+ PFNVBOXGETXPCOMCFUNCTIONS pfnGetFunctions;
+
+ if (dir != NULL) {
+ if (virAsprintf(&name, "%s/%s", dir, DYNLIB_NAME) < 0) {
+ virReportOOMError();
+ return -1;
+ }
- /*
- * Construct the full name.
- */
- cbBufNeeded = cchHome + sizeof("/" DYNLIB_NAME);
- if (cbBufNeeded > sizeof(szName))
- {
- setErrMsg(1, "path buffer too small: %u bytes needed",
- (unsigned)cbBufNeeded);
- return -1;
- }
- if (cchHome)
- {
- memcpy(szName, pszHome, cchHome);
- szName[cchHome] = '/';
- cchHome++;
+ if (!virFileExists(name)) {
+ if (!ignoreMissing) {
+ VIR_ERROR(_("Libaray '%s' doesn't exist"), name);
+ }
+
+ return -1;
+ }
+ } else {
+ name = strdup(DYNLIB_NAME);
+
+ if (name == NULL) {
+ virReportOOMError();
+ return -1;
+ }
}
- memcpy(&szName[cchHome], DYNLIB_NAME, sizeof(DYNLIB_NAME));
/*
* Try load it by that name, setting the VBOX_APP_HOME first (for now).
* Then resolve and call the function table getter.
*/
- if (fSetAppHome)
- {
- if (pszHome)
- setenv("VBOX_APP_HOME", pszHome, 1 /* always override */);
- else
+ if (setAppHome) {
+ if (dir != NULL) {
+ setenv("VBOX_APP_HOME", dir, 1 /* always override */);
+ } else {
unsetenv("VBOX_APP_HOME");
+ }
}
- g_hVBoxXPCOMC = dlopen(szName, RTLD_NOW | RTLD_LOCAL);
- if (g_hVBoxXPCOMC)
- {
- PFNVBOXGETXPCOMCFUNCTIONS pfnGetFunctions;
- pfnGetFunctions = (PFNVBOXGETXPCOMCFUNCTIONS)
- dlsym(g_hVBoxXPCOMC, VBOX_GET_XPCOMC_FUNCTIONS_SYMBOL_NAME);
- if (pfnGetFunctions)
- {
- g_pVBoxFuncs = pfnGetFunctions(VBOX_XPCOMC_VERSION);
- if (g_pVBoxFuncs)
- {
- g_pfnGetFunctions = pfnGetFunctions;
- return 0;
- }
- /* bail out */
- setErrMsg(1, "%.80s: pfnGetFunctions(%#x) failed",
- szName, VBOX_XPCOMC_VERSION);
- }
- else
- setErrMsg(1, "dlsym(%.80s/%.32s): %.128s",
- szName, VBOX_GET_XPCOMC_FUNCTIONS_SYMBOL_NAME, dlerror());
+ g_hVBoxXPCOMC = dlopen(name, RTLD_NOW | RTLD_LOCAL);
+
+ if (g_hVBoxXPCOMC == NULL) {
+ VIR_WARN("Could not dlopen '%s': %s", name, dlerror());
+ goto cleanup;
+ }
+
+ pfnGetFunctions = (PFNVBOXGETXPCOMCFUNCTIONS)
+ dlsym(g_hVBoxXPCOMC, VBOX_GET_XPCOMC_FUNCTIONS_SYMBOL_NAME);
+
+ if (pfnGetFunctions == NULL) {
+ VIR_ERROR(_("Could not dlsym %s from '%s': %s"),
+ VBOX_GET_XPCOMC_FUNCTIONS_SYMBOL_NAME, name, dlerror());
+ goto cleanup;
+ }
+
+ g_pVBoxFuncs = pfnGetFunctions(VBOX_XPCOMC_VERSION);
+
+ if (g_pVBoxFuncs == NULL) {
+ VIR_ERROR(_("Calling %s from '%s' failed"),
+ VBOX_GET_XPCOMC_FUNCTIONS_SYMBOL_NAME, name);
+ goto cleanup;
+ }
+
+ g_pfnGetFunctions = pfnGetFunctions;
+ result = 0;
+
+ if (dir != NULL) {
+ VIR_DEBUG("Found %s in '%s'", DYNLIB_NAME, dir);
+ } else {
+ VIR_DEBUG("Found %s in dynamic linker search path", DYNLIB_NAME);
+ }
+
+cleanup:
+ if (g_hVBoxXPCOMC != NULL && result < 0) {
dlclose(g_hVBoxXPCOMC);
g_hVBoxXPCOMC = NULL;
}
- else
- setErrMsg(0, "dlopen(%.80s): %.160s", szName, dlerror());
- return rc;
+
+ VIR_FREE(name);
+
+ return result;
}
@@ -175,34 +171,53 @@ static int tryLoadOne(const char *pszHome, int fSetAppHome)
* function pointers.
*
* @returns 0 on success, -1 on failure.
- *
- * @remark This should be considered moved into a separate glue library since
- * its its going to be pretty much the same for any user of VBoxXPCOMC
- * and it will just cause trouble to have duplicate versions of this
- * source code all around the place.
*/
int VBoxCGlueInit(void)
{
- /*
- * If the user specifies the location, try only that.
- */
- const char *pszHome = getenv("VBOX_APP_HOME");
- if (pszHome)
- return tryLoadOne(pszHome, 0);
+ int i;
+ static const char *knownDirs[] = {
+ "/usr/lib/virtualbox",
+ "/usr/lib/virtualbox-ose",
+ "/usr/lib64/virtualbox",
+ "/usr/lib64/virtualbox-ose",
+ "/usr/lib/VirtualBox",
+ "/opt/virtualbox",
+ "/opt/VirtualBox",
+ "/opt/virtualbox/i386",
+ "/opt/VirtualBox/i386",
+ "/opt/virtualbox/amd64",
+ "/opt/VirtualBox/amd64",
+ "/usr/local/lib/virtualbox",
+ "/usr/local/lib/VirtualBox",
+ "/Applications/VirtualBox.app/Contents/MacOS"
+ };
+ const char *home = getenv("VBOX_APP_HOME");
+
+ /* If the user specifies the location, try only that. */
+ if (home != NULL) {
+ if (tryLoadOne(home, false, false) < 0) {
+ return -1;
+ }
+ }
- /*
- * Try the configured location.
- */
- g_szVBoxErrMsg[0] = '\0';
+ /* Try the additionally configured location. */
+ if (VBOX_XPCOMC_DIR[0] != '\0') {
+ if (tryLoadOne(VBOX_XPCOMC_DIR, true, true) >= 0) {
+ return 0;
+ }
+ }
- if (tryLoadOne(VBOX_XPCOMC_DIR, 1) == 0)
- return 0;
+ /* Try the known locations. */
+ for (i = 0; i < ARRAY_CARDINALITY(knownDirs); ++i) {
+ if (tryLoadOne(knownDirs[i], true, true) >= 0) {
+ return 0;
+ }
+ }
- /*
- * Finally try the dynamic linker search path.
- */
- if (tryLoadOne(NULL, 1) == 0)
+ /* Finally try the dynamic linker search path. */
+ if (tryLoadOne(NULL, false, true) >= 0) {
return 0;
+ }
/* No luck, return failure. */
return -1;
@@ -214,14 +229,13 @@ int VBoxCGlueInit(void)
*/
void VBoxCGlueTerm(void)
{
- if (g_hVBoxXPCOMC)
- {
+ if (g_hVBoxXPCOMC != NULL) {
#if 0 /* VBoxRT.so doesn't like being reloaded. See @bugref{3725}. */
dlclose(g_hVBoxXPCOMC);
#endif
g_hVBoxXPCOMC = NULL;
}
+
g_pVBoxFuncs = NULL;
g_pfnGetFunctions = NULL;
- memset(g_szVBoxErrMsg, 0, sizeof(g_szVBoxErrMsg));
}
diff --git a/src/vbox/vbox_XPCOMCGlue.h b/src/vbox/vbox_XPCOMCGlue.h
index c04eefa..6c44030 100644
--- a/src/vbox/vbox_XPCOMCGlue.h
+++ b/src/vbox/vbox_XPCOMCGlue.h
@@ -32,26 +32,12 @@
/* This has to be the oldest version we support. */
# include "vbox_CAPI_v2_2.h"
-# ifdef __cplusplus
-extern "C" {
-# endif
-
-/** The dlopen handle for VBoxXPCOMC. */
-extern void *g_hVBoxXPCOMC;
-/** The last load error. */
-extern char g_szVBoxErrMsg[256];
/** Pointer to the VBoxXPCOMC function table. */
extern PCVBOXXPCOM g_pVBoxFuncs;
/** Pointer to VBoxGetXPCOMCFunctions for the loaded VBoxXPCOMC so/dylib/dll. */
extern PFNVBOXGETXPCOMCFUNCTIONS g_pfnGetFunctions;
-
int VBoxCGlueInit(void);
void VBoxCGlueTerm(void);
-
-# ifdef __cplusplus
-}
-# endif
-
#endif
--
1.7.0.4
14 years
[libvirt] [PATCH] Fix typo
by Hu Tao
---
include/libvirt/libvirt.h.in | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index b45f7ec..3379210 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -2044,7 +2044,7 @@ typedef enum {
/**
- * virConnectDomainEventWatchdogCallback:
+ * virConnectDomainEventIOErrorCallback:
* @conn: connection object
* @dom: domain on which the event occurred
* @srcPath: The host file on which the IO error occurred
@@ -2064,7 +2064,7 @@ typedef void (*virConnectDomainEventIOErrorCallback)(virConnectPtr conn,
void *opaque);
/**
- * virConnectDomainEventWatchdogCallback:
+ * virConnectDomainEventIOErrorReasonCallback:
* @conn: connection object
* @dom: domain on which the event occurred
* @srcPath: The host file on which the IO error occurred
--
1.7.3
14 years
[libvirt] Fwd: Re: Lxc support
by Jean-Philippe Menil
-------- Message original --------
Sujet: Re: [libvirt] Lxc support
Date : Fri, 29 Oct 2010 13:13:16 +0200
De : Jean-Philippe Menil <jean-philippe.menil(a)univ-nantes.fr>
Répondre à : jean-philippe.menil(a)univ-nantes.fr
Organisation : IRTS - DSI - Université de Nantes
Pour : Daniel P. Berrange <berrange(a)redhat.com>
Le 29/10/2010 12:39, Daniel P. Berrange a écrit :
> On Fri, Oct 29, 2010 at 12:27:59PM +0200, Jean-Philippe Menil wrote:
>> Le 29/10/2010 12:00, Osier a écrit :
>>> On 10/29/2010 04:42 PM, Jean-Philippe Menil wrote:
>>>> Hi,
>>>>
>>>> i'm trying to test the lxc support in libvirt, but but libvirt failed to
>>>> start container with error "lxcContainerAvailable:897 : clone call
>>>> returned Operation not permitted, container support is not enabled"
>>>>
>>>
>>> What's the kernel version you use? Just as the error message says, the
>>> system call 'clone' failed, It's probly caused by lacking of kernel
>>> support.
>>>
>>> At least you should make sure 'clone' support these flags:
>>>
>>> CLONE_NEWPID, CLONE_NEWNS, CLONE_NEWUTS, CLONE_NEWIPC, SIGCHLD
>
>> thanks for your response.
>> The kernel is a 2.6.36 wit hthe following:
>> root@redbreast:/tmp# cat /boot/config-2.6.36-dsiun-1a | grep -i pid
>> CONFIG_PROC_PID_CPUSET=y
>> CONFIG_PID_NS=y
>> # CONFIG_SPI_SPIDEV is not set
>> CONFIG_HID_PID=y
>
> You need to check for _NS= here, and want to see the following
>
> $ grep _NS= /boot/config-2.6.34.6-54.fc13.x86_64
> CONFIG_CGROUP_NS=y
> CONFIG_UTS_NS=y
> CONFIG_IPC_NS=y
> CONFIG_USER_NS=y
> CONFIG_PID_NS=y
> CONFIG_NET_NS=y
>
> Daniel
Sorry, forgot to cc the list
Ok,
So my kernel lokks fine:
root@redbreast:/tmp# cat /boot/config-2.6.36-dsiun-1a | grep _NS
CONFIG_CGROUP_NS=y
CONFIG_UTS_NS=y
CONFIG_IPC_NS=y
CONFIG_USER_NS=y
CONFIG_PID_NS=y
CONFIG_NET_NS=y
Libvirt was compiled with following:
--with-qemu --with-qemu-user=libvirt-qemu --with-qemu-group=kvm
--without-xen --without-openvz --without-avahi --without-sasl
--without-polkit --without-udev --without-hal --with-storage-fs
--with-storage-lvm --without-storage-iscsi --with-storage-disk
--with-init-scripts=none --without-numactl --without-selinux
--without-esx --without-libssh2 --without-capng --with-macvtap
--enable-debug --with-lxc
14 years
[libvirt] [PATCH] qemu: Fix one memory leak in qemu driver.c
by Osier Yang
* src/qemu/qemu_driver.c (qemuDomainManagedSavePath)
---
src/qemu/qemu_driver.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 89b4d11..976fb72 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -5843,6 +5843,7 @@ qemuDomainManagedSavePath(struct qemud_driver *driver, virDomainObjPtr vm) {
char *ret;
if (virAsprintf(&ret, "%s/%s.save", driver->saveDir, vm->def->name) < 0) {
+ VIR_FREE(ret);
virReportOOMError();
return(NULL);
}
--
1.7.2.3
14 years
[libvirt] Fixing the output of "virsh help"
by Justin Clift
Hi all,
The output of virsh --help has become pretty unwieldy for people,
so I'd like to adjust it to display things in a fashion that's
easier to locate things in.
Below is my first mock up of what the new output should look like,
with it broken into functional categories.
Does this seem like the best approach? Open to completely
different ideas, different layout approaches, etc. :)
Notes:
+ In a final (working) solution, each of the commands would be
alphabetically sorted in its category. Only roughly manually
sorted them below, to show the general effect.
+ Some of the lines below looked like they might wrap in email,
so I manually cut them off with "...". Not thinking of doing
that in a coded up version. We'd just let them wrap. ;)
+ Pretty sure we'd need to adjust the test suite components that
leverage from virsh --help, but I don't think it can be avoided.
**********************************************************************
virsh # help
Commands:
CPU Management
**************
cpu-baseline compute baseline CPU
cpu-compare compare host CPU with a CPU described by an ...
maxvcpus connection vcpu maximum
setvcpus change number of virtual CPUs
vcpucount domain vcpu counts
vcpuinfo detailed domain vcpu information
vcpupin control domain vcpu affinity
Device Management
*****************
attach-device attach device from an XML file
attach-disk attach disk device
detach-device detach device from an XML file
detach-disk detach disk device
update-device update device from an XML file
Domain Management
*****************
autostart autostart a domain
create create a domain from an XML file
destroy destroy a domain
define define (but don't start) a domain from an XML...
domid convert a domain name or UUID to domain id
domuuid convert a domain name or id to domain UUID
dominfo domain information
domjobinfo domain job information
domjobabort abort active domain job
domname convert a domain id or UUID to domain name
domstate domain state
domblkstat get device block stats for a domain
domifstat get network interface stats for a domain
dommemstat get memory statistics for a domain
domblkinfo domain block device size information
domxml-from-native Convert native config to domain XML
domxml-to-native Convert domain XML to native config
dump dump the core of a domain to a file for anal...
dumpxml domain information in XML
edit edit XML configuration for a domain
list list domains
managedsave managed save of a domain state
managedsave-remove Remove managed save of a domain
memtune Get/Set memory paramters
migrate migrate domain to another host
migrate-setmaxdowntime set maximum tolerable downtime
reboot reboot a domain
restore restore a domain from a saved state in a file
resume resume a domain
save save a domain state to a file
setmem change memory allocation
setmaxmem change maximum memory limit
shutdown gracefully shutdown a domain
start start a (previously defined) inactive domain
suspend suspend a domain
undefine undefine an inactive domain
Management of Secrets
*********************
secret-define define or modify a secret from an XML file
secret-dumpxml secret attributes in XML
secret-set-value set a secret value
secret-get-value Output a secret value
secret-undefine undefine a secret
secret-list list secrets
Networking
**********
net-autostart autostart a network
net-create create a network from an XML file
net-define define (but don't start) a network from...
net-destroy destroy a network
net-dumpxml network information in XML
net-edit edit XML configuration for a network
net-list list networks
net-name convert a network UUID to network name
net-start start a (previously defined) inactive network
net-undefine undefine an inactive network
net-uuid convert a network name to network UUID
Network Interfaces
******************
attach-interface attach network interface
detach-interface detach network interface
iface-list list physical host interfaces
iface-name convert an interface MAC address to inte...
iface-mac convert an interface name to interface M...
iface-dumpxml interface information in XML
iface-define define (but don't start) a physical host...
iface-undefine undefine a physical host interface (remo...
iface-edit edit XML configuration for a physical ho...
iface-start start a physical host interface (enable ...
iface-destroy destroy a physical host interface (disab...
Nodes
*****
nodeinfo node information
nodedev-list enumerate devices on this host
nodedev-dumpxml node device details in XML
nodedev-dettach dettach node device from its device driver
nodedev-reattach reattach node device to its device driver
nodedev-reset reset node device
nodedev-create create a device defined by an XML file o...
nodedev-destroy destroy a device on the node
NWfilter
********
nwfilter-define define or update a network filter from a...
nwfilter-undefine undefine a network filter
nwfilter-dumpxml network filter information in XML
nwfilter-list list network filters
nwfilter-edit edit XML configuration for a network filter
Snapshots
*********
snapshot-create Create a snapshot
snapshot-current Get the current snapshot
snapshot-delete Delete a domain snapshot
snapshot-dumpxml Dump XML for a domain snapshot
snapshot-list List snapshots for a domain
snapshot-revert Revert a domain to a snapshot
Storage Pools
*************
find-storage-pool-sources discover potential storage poo...
find-storage-pool-sources-as find potential storage pool...
pool-autostart autostart a pool
pool-build build a pool
pool-create create a pool from an XML file
pool-create-as create a pool from a set of args
pool-define define (but don't start) a pool from an ...
pool-define-as define a pool from a set of args
pool-destroy destroy a pool
pool-delete delete a pool
pool-dumpxml pool information in XML
pool-edit edit XML configuration for a storage pool
pool-info storage pool information
pool-list list pools
pool-name convert a pool UUID to pool name
pool-refresh refresh a pool
pool-start start a (previously defined) inactive pool
pool-undefine undefine an inactive pool
pool-uuid convert a pool name to pool UUID
Storage Volumes
***************
vol-create create a vol from an XML file
vol-create-from create a vol, using another volume as input
vol-create-as create a volume from a set of args
vol-clone clone a volume.
vol-delete delete a vol
vol-wipe wipe a vol
vol-dumpxml vol information in XML
vol-info storage vol information
vol-list list vols
vol-pool returns the storage pool for a given ...
vol-path returns the volume path for a given ...
vol-name returns the volume name for a given ...
vol-key returns the volume key for a given ...
Virsh itself
**************
cd change the current directory
connect (re)connect to hypervisor
console connect to the guest console
echo echo arguments
exit quit this interactive terminal
help print help
pwd print the current directory
quit quit this interactive terminal
uri print the hypervisor canonical URI
version show version
vncdisplay vnc display
Not sure (need suggestions) :>
******************************
capabilities capabilities
freecell NUMA free memory
hostname print the hypervisor hostname
schedinfo show/set scheduler parameters
ttyconsole tty console
virsh #
**********************************************************************
14 years
[libvirt] "qemudDispatchSignalEvent" warning... but QEMU support not compiled in
by Justin Clift
Hi all,
Just noticed this warning message when shutting down foreground
libvirtd on OSX (via ^C):
17:24:04.247: warning : qemudDispatchSignalEvent:402 : Shutting down
on signal 2
Didn't think anything of it, till realising that libvirtd was compiled
without QEMU support.
It doesn't seem to be hurting anything, but mentioning it in case
someone knows what it's about and whether we should care. :)
Regards and best wishes,
Justin Clift
14 years
[libvirt] C# bindings raising an error
by arnaud.champion@devatom.fr
?Hi,
I start to work on a new sample code for C# bindings. The goal is to show how to use errors callbacks... Do you a way to raise an error for sample ? (I know it's an antagonist request )
Regards,
Arnaud
14 years
Re: [libvirt] SPAM-LOW: Re: Re: System.DllNotFoundException
by arnaud.champion@devatom.fr
?You're welcome, glad to help you.
Arnaud
From: 黄亮
Sent: Friday, October 29, 2010 10:07 AM
To: arnaud.champion(a)devatom.fr
Subject: SPAM-LOW: Re: Re: System.DllNotFoundException
Hi,
depends.exe really helps!
it turns out that there are 7 dlls I'm missing. Thanks to the dll-files.com, I can download all of them.
And put all of them in the same dir with my test exe, it works.
Thank you arnaud, you really help a lot.
Best wishes
2010-10-29
--------------------------------------------------------------------------------
Lancer
--------------------------------------------------------------------------------
发件人: arnaud.champion(a)devatom.fr
发送时间: 2010-10-29 15:38:47
收件人: 黄亮
抄送: libvir-list(a)redhat.com
主题: Re: System.DllNotFoundException
Hi,
what do you mean when you say "I use the .cs file you release to create a dll project" ?
C# bindings are provided with a visual studio 2010 solution, I think it's better to use it if you can. If you can't (because you have vs2005 or vs2008), please re-create a solution with all C# bindings codes.
Be sure you have the dll in your Debug directory :
libcurl-4.dll
libgcrypt-11.dll
libgnutls-26.dll
libgpg-error-0.dll
libportablexdr-0.dll
libtasn1-3.dll
libvirt-0.dll
libxml2-2.dll
Also, be carefull about one thing : these dll must be in the directory of the executable. I mean if you create a project "testBinding" which produce "testBindings.exe", then these dlls must be in the same directory of "testBindings.exe".
You can also use "depends.exe" (http://www.dependencywalker.com/) which is a tool used to check dll dependency. You open your libvirt-0.dll with it and see if there is no missing dll (maybe a dll miss you, and I don't see it because my system ever own it, I don't know).
Arnaud
From: 黄亮
Sent: Friday, October 29, 2010 3:51 AM
To: arnaud.champion(a)devatom.fr
Subject: System.DllNotFoundException
Hello Arnaud
I've compiled libvirt using photron scripts and got the libvirt-0.dll
I use the .cs file you released to create a dll project, and get CSharpDll.dll
Then I create a new project to invoke CSharpDll.dll, I got a System.DllNotFoundException while "Libvirt.Connect.Open" is trying to work.
The exception shows libvirt-0.dll cannot be found.
I tried to put libvirt-0.dll everywhere. In the same dir with .sln, with .cs file, in Debug dir, even in Windows/System32 dir. But I got no luck. It's still stuck.
So I need your help to get me out of the mess. Would you please tell me where I may go wrong?
Many Thanks
2010-10-29
--------------------------------------------------------------------------------
Lancer
__________ Information from ESET Smart Security, version of virus signature database 5573 (20101028) __________
The message was checked by ESET Smart Security.
http://www.eset.com
14 years