[libvirt] Node devices capability xml
by arnaud.champion@devatom.fr
?Hi,
I'm looking for informations about node devices capibility xml (not driver capabilities), and there's nothing on libvirt.org, can anyone can point me to find the infos ?
regards,
Arnaud
13 years, 9 months
[libvirt] nodedev-list and qemu
by arnaud.champion@devatom.fr
?Hi,
I've just installed libvirt 0.8.7 on my fedora x86_64 14 test host. It seems that the function virNodeNumOfDevices is no more supported by the qemu driver. Is that true ? or I'm wrong anywhere ?
Regards,
Arnaud
13 years, 9 months
[libvirt] Connecting with a remote libvirt
by Marcela Castro León
Hello
i'm trying to connect with a remote libvirt.
The option I selected was tcp because it's a development environment and a
secure and isolated network,
I've configured
listen_tcp = 1
tcp_port = "16509"
in libvirtd.conf at the destition.
I've tried to connect to host "santacruz" from a remote host "aoniken" and
locally but pn both cases I've got:
REMOTE
marcela@aoniken:~$ virsh -c qemu+tcp://santacruz:16509 list
error: unable to connect to libvirtd at 'santacruz': Connection refused
error: failed to connect to the hypervisor
LOCALLY
radic@santacruz:/etc/libvirt$ virsh -c qemu+tcp://santacruz:16509 list
error: unable to connect to libvirtd at 'santacruz': Connection refused
error: failed to connect to the hypervisor
I've try to use ssh but i've got an error two on both cases.
REMOTE (SSH)
marcela@aoniken:~$ virsh -c qemu+ssh://radic@santacruz list
radic@santacruz's password:
error: internal error no QEMU URI path given, try qemu:///system
error: failed to connect to the hypervisor
marcela@aoniken:~$
radic@santacruz:/etc/libvirt$ virsh -c qemu+ssh://radic@santacruz list
radic@santacruz's password:
error: internal error no QEMU URI path given, try qemu:///system
error: failed to connect to the hypervisor
Can you help me?
Thank you
13 years, 9 months
[libvirt] [PATCH] docs: renamed hudson project link to jenkins, matching project rename
by Justin Clift
---
docs/apps.html.in | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/docs/apps.html.in b/docs/apps.html.in
index 2516844..d8bc265 100644
--- a/docs/apps.html.in
+++ b/docs/apps.html.in
@@ -132,10 +132,10 @@
</dl>
<dl>
- <dt><a href="http://wiki.hudson-ci.org/display/HUDSON/Libvirt+Slaves+Plugin">Hudson</a></dt>
+ <dt><a href="http://wiki.jenkins-ci.org/display/JENKINS/Libvirt+Slaves+Plugin">Jenkins</a></dt>
<dd>
- This plugin for Hudson adds a way to control guest domains hosted
- on Xen or QEMU/KVM. You configure a Hudson Slave,
+ This plugin for Jenkins adds a way to control guest domains hosted
+ on Xen or QEMU/KVM. You configure a Jenkins Slave,
selecting the guest domain and hypervisor. When you need to build a
job on a specific Slave, its guest domain is started, then the job is
run. When the build process is finished, the guest domain is shut
--
1.7.3.5
13 years, 9 months
[libvirt] Logging VM startup and shutdown
by Ed Swierk
When troubleshooting a libvirt system the most obvious question I face
is when a given VM started and stopped.
The only way I've been able to obtain this information is by setting
log_level = 1 in libvirtd.conf, which turns on the firehose,
generating an enormous amount of output. I then have to sift through
the logs for magic strings like "virExecWithHook" to see when a VM
started, and "Shutting down VM" to see when a VM stopped. Is there no
concise message that indicates a VM starting up? "virExecWithHook"
doesn't exactly jump out.
I'd consider starting up and shutting down a VM to be at least worth
an info-level message in the log. I monkeyed with the log_filters
setting but I couldn't figure out how to filter those two strings. Any
hints?
--Ed
13 years, 9 months
[libvirt] libvirt 0.8.7 LOCALSTATEDIR ubuntu patch
by Philipp Schmid
Hi,
I'm using ubuntu for our libvirt/kvm host server and needed IPv6 connectivity, so I started to update the latest ubuntu libvirt package (0.8.5) to 0.8.7.
I got all but one ubuntu specific patch to apply. The patch moves the ebiptables script from /tmp to "LOCALSTATEDIR" /lib/libvirt.
I renamed LOCAL_STATE_DIR in the patch below to LOCALSTATEDIR, because this seems to have changed between 0.8.5 and 0.8.7, but I still get the following compile error.
Since this is my first contact with the libvirt source or build system, I would be happy for any pointers on how to fix this and make LOCALSTATEDIR visible to nwfilter/nwfilter_ebiptables_driver.c.
Best regards,
Philipp Schmid
PS: if anyone is interested in working (at least for me with kvm) packages (without the mentioned patch), you can grab them here: http://www.schmidp.com/public/libvirt_0.8.7_ubuntu_natty/
-Wall -Wformat -Wformat-security -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wextra -Wshadow -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Winline -Wredundant-decls -Wno-sign-compare -Wlogical-op -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fasynchronous-unwind-tables -fdiagnostics-show-option -DIN_LIBVIRT -I../src/conf -g -O2 -g -O2 -c nwfilter/nwfilter_ebiptables_driver.c -fPIC -DPIC -o .libs/libvirt_driver_nwfilter_la-nwfilter_ebiptables_driver.o
nwfilter/nwfilter_ebiptables_driver.c: In function 'ebiptablesWriteToTempFile':
nwfilter/nwfilter_ebiptables_driver.c:2444:23: error: 'LOCALSTATEDIR' undeclared (first use in this function)
nwfilter/nwfilter_ebiptables_driver.c:2444:23: note: each undeclared identifier is reported only once for each function it appears in
nwfilter/nwfilter_ebiptables_driver.c:2444:37: error: expected ',' or ';' before string constant
make[4]: *** [libvirt_driver_nwfilter_la-nwfilter_ebiptables_driver.lo] Error 1
make[4]: Leaving directory `/tmp/buildd/libvirt-0.8.7/src'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/tmp/buildd/libvirt-0.8.7/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/tmp/buildd/libvirt-0.8.7'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/tmp/buildd/libvirt-0.8.7'
make: *** [debian/stamp-makefile-build] Error 2
#########
Author: Jamie Strandboge <jamie(a)canonical.com>
Description: move ebiptables script from /tmp to /var/lib/libvirt
Forwarded: yes
Index: libvirt-0.8.7/src/nwfilter/nwfilter_ebiptables_driver.c
===================================================================
--- libvirt-0.8.7.orig/src/nwfilter/nwfilter_ebiptables_driver.c 2011-01-30 20:57:49.132301999 +0000
+++ libvirt-0.8.7/src/nwfilter/nwfilter_ebiptables_driver.c 2011-01-30 20:58:35.762302000 +0000
@@ -2441,7 +2441,7 @@
*/
static char *
ebiptablesWriteToTempFile(const char *string) {
- char filename[] = "/tmp/virtdXXXXXX";
+ char filename[] = LOCAL_STATE_DIR "/lib/libvirt/virtdXXXXXX";
int len;
char *filnam;
virBuffer buf = VIR_BUFFER_INITIALIZER;
13 years, 9 months
[libvirt] macvtap: fix variable in debugging output
by Stefan Berger
This patch fixes a variable in the debugging output.
Signed-off-by: Stefan Berger <stefanb(a)linux.vnet.ibm.com>
---
src/util/macvtap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: libvirt-acl/src/util/macvtap.c
===================================================================
--- libvirt-acl.orig/src/util/macvtap.c
+++ libvirt-acl/src/util/macvtap.c
@@ -1349,7 +1349,7 @@ doPortProfileOp8021Qbg(const char *ifnam
break;
default:
macvtapError(VIR_ERR_INTERNAL_ERROR,
- _("operation type %d not supported"), op);
+ _("operation type %d not supported"), virtPortOp);
rc = 1;
goto err_exit;
}
13 years, 9 months
Re: [libvirt] Rudimentary (basic) s390x architecture functions for libvirt
by Patrick Siegl
A few more details for s390x: why you can't set param '-S' and need
'-chardev vc,id=cons -device virtio-serial-s390 -device
virtconsole,chardev=cons' on s390x:
1) qemu-system-s390x -M s390-virtio -vnc :0 -enable-kvm -smp 1 -m 1024
-k de -kernel /boot/image-2.6.34-tue01 -initrd
/boot/initrd-2.6.34-tue01_GUEST -drive file=/data/sle11.img -append
"root=/dev/vda1 rw"
=> screenshot 1
2) qemu-system-s390x -S -M s390-virtio -vnc :0 -enable-kvm -smp 1 -m
1024 -k de -kernel /boot/image-2.6.34-tue01 -initrd
/boot/initrd-2.6.34-tue01_GUEST -drive file=/data/sle11.img -append
"root=/dev/vda1 rw"
=> screenshot 2
3) qemu-system-s390x -M s390-virtio -vnc :0 -enable-kvm -smp 1 -m 1024
-k de -kernel /boot/image-2.6.34-tue01 -initrd
/boot/initrd-2.6.34-tue01_GUEST -drive file=/data/sle11.img -append
"root=/dev/vda1 rw" -chardev vc,id=cons -device virtio-serial-s390
-device virtconsole,chardev=cons
=> RUN
4) qemu-system-s390x -S -M s390-virtio -vnc :0 -enable-kvm -smp 1 -m
1024 -k de -kernel /boot/image-2.6.34-tue01 -initrd
/boot/initrd-2.6.34-tue01_GUEST -drive file=/data/sle11.img -append
"root=/dev/vda1 rw" -chardev vc,id=cons -device virtio-serial-s390
-device virtconsole,chardev=cons
=> screenshot 4
Regards,
Patrick Siegl
Am 25.01.2011 19:37, schrieb Justin Clift:
> On 26/01/2011, at 5:11 AM, Patrick Siegl wrote:
>> <screenshot_paramS.png>
> Interestingly, I'm guessing that's the QEMU "monitor console".
>
> Apparently it's a key feature of QEMU, but it's not something I've personally had
> anything to do with (yet). :)
>
> Just mentioning, in case it's a useful thought. The guys on the mailing list
> have a lot deeper knowledge about this stuff that me. ;)
>
> Regards and best wishes,
>
> Justin Clift
13 years, 9 months
[libvirt] [PATCH] storage: Allow to delete device mapper disk partition
by Osier Yang
From: root <root(a)amd-1352-8-2.englab.nay.redhat.com>
The name convention of device mapper disk is different, and 'parted'
can't be used to delete a device mapper disk partition. e.g.
[root@amd-1352-8-2 ~]# virsh vol-list --pool osier
Name Path
-----------------------------------------
3600a0b80005ad1d7000093604cae912fp1 /dev/mapper/3600a0b80005ad1d7000093604cae912fp1
[root@amd-1352-8-2 ~]# parted /dev/mapper/3600a0b80005adb0b0000ab2d4cae9254 rm p1
Error: Expecting a partition number.
This patch introduces 'dmsetup' to fix it.
Changes:
- New function 'virIsDeviceMapperDevice' in src/utils/utils.c
- Delete 'is_dm_device' in src/storage/parthelper.c, use
'virIsDeviceMapperDevice' instead.
- Requires device-mapper for 'with-storage-disk' in libvirt.spec.in
- Check 'dmsetup' in configure.ac for 'with-storage-disk'
- Changes on src/Makefile.am to link against libdevmapper
- New entry for 'virIsDeviceMapperDevice' in src/libvirt_private.syms
e.g.
[root@amd-1352- ~]# virsh vol-list --pool osier
Name Path
-----------------------------------------
3600a0b80005ad1d7000093604cae912fp1 /dev/mapper/3600a0b80005ad1d7000093604cae912fp1
[root@amd-1352- ~]# virsh vol-delete /dev/mapper/3600a0b80005ad1d7000093604cae912fp1
Vol /dev/mapper/3600a0b80005ad1d7000093604cae912fp1 deleted
[root@amd-1352- ~]# virsh vol-list --pool osier
Name Path
-----------------------------------------
---
configure.ac | 21 ++++++++++++++
libvirt.spec.in | 1 +
src/Makefile.am | 7 ++--
src/libvirt_private.syms | 1 +
src/storage/parthelper.c | 14 +--------
src/storage/storage_backend_disk.c | 54 ++++++++++++++++++++++-------------
src/util/util.c | 14 +++++++++
src/util/util.h | 1 +
8 files changed, 76 insertions(+), 37 deletions(-)
diff --git a/configure.ac b/configure.ac
index f310a5e..b101faa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1705,6 +1705,8 @@ LIBPARTED_CFLAGS=
LIBPARTED_LIBS=
if test "$with_storage_disk" = "yes" || test "$with_storage_disk" = "check"; then
AC_PATH_PROG([PARTED], [parted], [], [$PATH:/sbin:/usr/sbin])
+ AC_PATH_PROG([DMSETUP], [dmsetup], [], [$PATH:/sbin:/usr/sbin])
+
if test -z "$PARTED" ; then
with_storage_disk=no
PARTED_FOUND=no
@@ -1712,9 +1714,17 @@ if test "$with_storage_disk" = "yes" || test "$with_storage_disk" = "check"; the
PARTED_FOUND=yes
fi
+ if test -z "$DMSETUP" ; then
+ with_storage_disk=no
+ DMSETUP_FOUND=no
+ else
+ DMSETUP_FOUND=yes
+ fi
+
if test "$with_storage_disk" != "no" && test "x$PKG_CONFIG" != "x" ; then
PKG_CHECK_MODULES(LIBPARTED, libparted >= $PARTED_REQUIRED, [], [PARTED_FOUND=no])
fi
+
if test "$PARTED_FOUND" = "no"; then
# RHEL-5 vintage parted is missing pkg-config files
save_LIBS="$LIBS"
@@ -1738,9 +1748,20 @@ if test "$with_storage_disk" = "yes" || test "$with_storage_disk" = "check"; the
with_storage_disk=yes
fi
+ if test "$DMSETUP_FOUND" = "no"; then
+ if test "$with_storage_disk" = "yes" ; then
+ AC_MSG_ERROR([We need dmsetup for disk storage driver])
+ else
+ with_storage_disk=no
+ fi
+ else
+ with_storage_disk=yes
+ fi
+
if test "$with_storage_disk" = "yes"; then
AC_DEFINE_UNQUOTED([WITH_STORAGE_DISK], 1, [whether Disk backend for storage driver is enabled])
AC_DEFINE_UNQUOTED([PARTED],["$PARTED"], [Location or name of the parted program])
+ AC_DEFINE_UNQUOTED([DMSETUP],["$DMSETUP"], [Location or name of the dmsetup program])
fi
fi
AM_CONDITIONAL([WITH_STORAGE_DISK], [test "$with_storage_disk" = "yes"])
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 0a2d10e..27e6a99 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -279,6 +279,7 @@ Requires: iscsi-initiator-utils
%if %{with_storage_disk}
# For disk driver
Requires: parted
+Requires: device-mapper
%endif
%if %{with_storage_mpath}
# For multipath support
diff --git a/src/Makefile.am b/src/Makefile.am
index f8b8434..3680074 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -437,9 +437,9 @@ libvirt_la_BUILT_LIBADD = libvirt_util.la
libvirt_util_la_SOURCES = \
$(UTIL_SOURCES)
libvirt_util_la_CFLAGS = $(CAPNG_CFLAGS) $(YAJL_CFLAGS) $(LIBNL_CFLAGS) \
- $(AM_CFLAGS) $(AUDIT_CFLAGS)
+ $(AM_CFLAGS) $(AUDIT_CFLAGS) $(DEVMAPPER_LIBS)
libvirt_util_la_LIBADD = $(CAPNG_LIBS) $(YAJL_LIBS) $(LIBNL_LIBS) \
- $(LIB_PTHREAD) $(AUDIT_LIBS)
+ $(LIB_PTHREAD) $(AUDIT_LIBS) $(DEVMAPPER_LIBS)
noinst_LTLIBRARIES += libvirt_conf.la
@@ -1154,7 +1154,6 @@ libvirt_parthelper_SOURCES = $(STORAGE_HELPER_DISK_SOURCES)
libvirt_parthelper_LDFLAGS = $(WARN_LDFLAGS) $(AM_LDFLAGS)
libvirt_parthelper_LDADD = \
$(LIBPARTED_LIBS) \
- $(DEVMAPPER_LIBS) \
libvirt_util.la \
../gnulib/lib/libgnu.la
@@ -1179,7 +1178,7 @@ libvirt_lxc_SOURCES = \
libvirt_lxc_LDFLAGS = $(WARN_CFLAGS) $(AM_LDFLAGS)
libvirt_lxc_LDADD = $(CAPNG_LIBS) $(YAJL_LIBS) \
$(LIBXML_LIBS) $(NUMACTL_LIBS) $(LIB_PTHREAD) \
- $(LIBNL_LIBS) $(AUDIT_LIBS) ../gnulib/lib/libgnu.la
+ $(LIBNL_LIBS) $(AUDIT_LIBS) $(DEVMAPPER_LIBS) ../gnulib/lib/libgnu.la
libvirt_lxc_CFLAGS = \
$(LIBPARTED_CFLAGS) \
$(NUMACTL_CFLAGS) \
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 3a5aec9..9d974e8 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -900,6 +900,7 @@ virStrcpy;
virStrncpy;
virTimestamp;
virVasprintf;
+virIsDeviceMapperDevice;
# uuid.h
diff --git a/src/storage/parthelper.c b/src/storage/parthelper.c
index 6ef413d..1f662fb 100644
--- a/src/storage/parthelper.c
+++ b/src/storage/parthelper.c
@@ -59,18 +59,6 @@ enum diskCommand {
DISK_GEOMETRY
};
-static int
-is_dm_device(const char *devname)
-{
- struct stat buf;
-
- if (devname && !stat(devname, &buf) && dm_is_dm_major(major(buf.st_rdev))) {
- return 1;
- }
-
- return 0;
-}
-
int main(int argc, char **argv)
{
PedDevice *dev;
@@ -96,7 +84,7 @@ int main(int argc, char **argv)
}
path = argv[1];
- if (is_dm_device(path)) {
+ if (virIsDeviceMapperDevice(path)) {
partsep = "p";
canonical_path = strdup(path);
if (canonical_path == NULL) {
diff --git a/src/storage/storage_backend_disk.c b/src/storage/storage_backend_disk.c
index c7ade6b..45e43c4 100644
--- a/src/storage/storage_backend_disk.c
+++ b/src/storage/storage_backend_disk.c
@@ -660,34 +660,48 @@ virStorageBackendDiskDeleteVol(virConnectPtr conn ATTRIBUTE_UNUSED,
srcname = basename(pool->def->source.devices[0].path);
DEBUG("devname=%s, srcname=%s", devname, srcname);
- if (!STRPREFIX(devname, srcname)) {
+ if (!virIsDeviceMapperDevice(devpath) && !STRPREFIX(devname, srcname)) {
virStorageReportError(VIR_ERR_INTERNAL_ERROR,
_("Volume path '%s' did not start with parent "
"pool source device name."), devname);
goto cleanup;
}
- part_num = devname + strlen(srcname);
+ if (!virIsDeviceMapperDevice(devpath)) {
+ part_num = devname + strlen(srcname);
- if (*part_num == 0) {
- virStorageReportError(VIR_ERR_INTERNAL_ERROR,
- _("cannot parse partition number from target "
- "'%s'"), devname);
- goto cleanup;
- }
-
- /* eg parted /dev/sda rm 2 */
- const char *prog[] = {
- PARTED,
- pool->def->source.devices[0].path,
- "rm",
- "--script",
- part_num,
- NULL,
- };
+ if (*part_num == 0) {
+ virStorageReportError(VIR_ERR_INTERNAL_ERROR,
+ _("cannot parse partition number from target "
+ "'%s'"), devname);
+ goto cleanup;
+ }
- if (virRun(prog, NULL) < 0)
- goto cleanup;
+ /* eg parted /dev/sda rm 2 */
+ const char *prog[] = {
+ PARTED,
+ pool->def->source.devices[0].path,
+ "rm",
+ "--script",
+ part_num,
+ NULL,
+ };
+
+ if (virRun(prog, NULL) < 0)
+ goto cleanup;
+ } else {
+ const char *prog[] = {
+ DMSETUP,
+ "remove",
+ "-f",
+ devpath,
+ NULL,
+ NULL,
+ };
+
+ if (virRun(prog, NULL) < 0)
+ goto cleanup;
+ }
rc = 0;
cleanup:
diff --git a/src/util/util.c b/src/util/util.c
index ee04ca9..6e2f966 100644
--- a/src/util/util.c
+++ b/src/util/util.c
@@ -45,6 +45,7 @@
#include <string.h>
#include <signal.h>
#include <termios.h>
+#include <libdevmapper.h>
#include "c-ctype.h"
#ifdef HAVE_PATHS_H
@@ -3100,3 +3101,16 @@ virTimestamp(void)
return timestamp;
}
+
+int
+virIsDeviceMapperDevice(const char *devname)
+{
+ struct stat buf;
+
+ if (devname && !stat(devname, &buf) && dm_is_dm_major(major(buf.st_rdev))) {
+ return 1;
+ }
+
+ return 0;
+}
+
diff --git a/src/util/util.h b/src/util/util.h
index 8373038..dd683ea 100644
--- a/src/util/util.h
+++ b/src/util/util.h
@@ -296,4 +296,5 @@ int virBuildPathInternal(char **path, ...) ATTRIBUTE_SENTINEL;
char *virTimestamp(void);
+int virIsDeviceMapperDevice(const char *devname);
#endif /* __VIR_UTIL_H__ */
--
1.7.1
13 years, 9 months
[libvirt] NIC model in domain description
by arnaud.champion@devatom.fr
?Hi,
in domain xml description, for the NIC interfaces, there is a model that specify the model of NIC exposed to the domain. I've understand that the model is driver dependent. Is there a way to know what is the driver default model ?
Regards,
Arnaud
13 years, 9 months