[libvirt] One line logging fix
by Dave Allan
I noticed that I was incorrectly logging a debug message as an error in
a success path in the node device code. Here's the fix.
>From 0c65b2d1d90bf0d469ffe6d8a20a5566b359a61e Mon Sep 17 00:00:00 2001
From: David Allan <dallan(a)redhat.com>
Date: Fri, 17 Jul 2009 09:57:40 -0400
Subject: [PATCH 1/1] Remove spurious log message
A success path in part of the node device code contained a log message with severity ERROR; this fix makes it DEBUG.
---
src/node_device_hal_linux.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/node_device_hal_linux.c b/src/node_device_hal_linux.c
index ddb1eef..a119404 100644
--- a/src/node_device_hal_linux.c
+++ b/src/node_device_hal_linux.c
@@ -50,7 +50,7 @@ static int open_wwn_file(const char *prefix,
/* fd will be closed by caller */
if ((*fd = open(wwn_path, O_RDONLY)) != -1) {
- VIR_ERROR(_("Opened WWN path '%s' for reading"),
+ VIR_DEBUG(_("Opened WWN path '%s' for reading"),
wwn_path);
} else {
VIR_ERROR(_("Failed to open WWN path '%s' for reading"),
--
1.6.0.6
15 years, 4 months
[libvirt] Guest shutdown script
by Ján ONDREJ (SAL)
Hello,
when host server is shutting down, it's goot to shutdown also guests,
not only kill them. Host shutdown can be touched by an admin, but also can
be started by an UPS daemon or similar action. Then kill of guests is not a
best solution.
I have my own script, which can shutdown guest automatically:
http://www.salstar.sk/pub/salpack/etc/rc.d/init.d/virt-shutdown
You need to start this rc script after installation, otherwise it will not
do anything.
Another init script with save/restore ability is here:
http://marc.info/?l=kvm&m=124775655529836&w=4
I'm not using this so I don't know, if this will work well on Fedora.
A good solution can also be, if libvirt init script can shutdown guests
autoamtically. It starts them, when system is booting, but does not stop
them. I know, that libvirt sometimes need to be restarted without touching
guests, but you also can avoid this, if you shutdown guest only if one of:
- current runlevel is 0 (halt) or 6 (reboot). You can get current
runlevel by running:
runlevel | cut -d" " -f2
- if "service libvirt shutdown" is called, which is not very systematic,
but can work well
Just please do not create a new package only for guest shutdowns. :-)
I am not a member of this list, so please cc me.
SAL
15 years, 4 months
[libvirt] How to pass not xml parameters from Libvirt to Xen in xml definition
by Alexandre CABROL PERALES
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi everybody,
i need to define cpuid parameter for a specific Xen Virtual Machine.
This parameters doesn't exist in libvirt definition.
So how can i add this "unknow" parameter in virtual machine's xml
definition to be able to manage it from virt-manager?
regards,
- --
Alexandre CABROL PERALES
- --
Ingenieur Securite des Systemes d'Information
Mob. : 06.98.82.03.06
Mail : alexandre.cabrol(a)artal.fr
Key fingerprint = 1E6B B8DF 5001 A6A8 E057 9D31 7B3B EAB1 4AE4 8953
- --
ARTAL Technologies
Rue Pierre-Gilles de Gennes
Ens."La Rue", Bat. 9, BP 38138
31681 Labege cedex
Tel. : 05.61.00.39.30
Fax : 05.61.00.20.43
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkpgSWsACgkQezvqsUrkiVMqiwCgkigm/WZ5TPToQ7RzdY0R6UJz
tEAAoKIcdZ2fO5PdqZdcrzuTj6Ev4yh4
=8rlJ
-----END PGP SIGNATURE-----
15 years, 4 months
[libvirt] PATCH: Fix non-raw storage volume cloning
by Daniel P. Berrange
The recent storage patches broke cloning of non-raw volumes, due to a
small typo. THis was identified by the libvirt TCK storage tests!
Daniel
diff --git a/src/storage_backend.c b/src/storage_backend.c
index 1664804..67815d7 100644
--- a/src/storage_backend.c
+++ b/src/storage_backend.c
@@ -567,7 +567,7 @@ virStorageBackendGetBuildVolFromFunction(virConnectPtr conn,
(inputvol->type == VIR_STORAGE_VOL_FILE &&
inputvol->target.format != VIR_STORAGE_VOL_FILE_RAW)) {
- if ((tool_type = virStorageBackendFindFSImageTool(NULL)) != -1) {
+ if ((tool_type = virStorageBackendFindFSImageTool(NULL)) < 0) {
virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
"%s", _("creation of non-raw file images is "
"not supported without qemu-img."));
--
|: Red Hat, Engineering, London -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 :|
15 years, 4 months
[libvirt] [PATCH] build: do not emit a trailing blank line into VC'd file, NEWS
by Jim Meyering
Cole Robinson noticed that the generated NEWS file
would fail the "make syntax-check" tests.
This adjusts the rule that generates it not to emit
any of the offending trailing blank lines.
At the same time, it regenerates NEWS.
>From 53af8d848d78bcc5144b2c06b2109bbdc65803cf Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Thu, 16 Jul 2009 22:46:43 +0200
Subject: [PATCH] build: do not emit a trailing blank line into VC'd file, NEWS
* docs/Makefile.am ($(top_builddir)/NEWS): Adjust rule to filter
out any trailing blank lines when generating this file.
* NEWS: Regenerate.
---
NEWS | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
docs/Makefile.am | 7 ++++-
2 files changed, 61 insertions(+), 2 deletions(-)
diff --git a/NEWS b/NEWS
index 5733fa8..447d2b4 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,62 @@
http://libvirt.org/news.html
+0.6.5: Jul 3 2009:
+ - New features: create storage columes on disk backend (Henrik Persson),
+ drop of capabilities based on libcap-ng when possible (Daniel
+ Berrange)
+ - Portability: fix build on non-Linux targets (Daniel Berrange)
+ - Documentation: typo and english fixes (Runa Bhattacharjee and
+ Garry Dolley), Docs on extending APIs (Dave Allan), cleanup
+ of debug and logging documentation (Amy Griffis), add
+ HACKING doc to the website (Daniel Berrange),
+ documentation for OpenNebula driver (Abel Miguez Rodriguez)
+ - Bug fixes: forbid autostart on transcient networks,
+ xen device removal crash (Daniel Berrange), re-detection of
+ transient VMs after libvirtd restart(Daniel Berrange),
+ bug in virFindFileInPath (Daniel Berrange), handle new
+ availheap sysctl in Xen (Daniel Berrange), allow USB hostdev
+ product 0 (Cole Robinson), cleanup when creating a storage pool
+ fails (Henrik Persson), domain id fix on redefinition in
+ test driver (Cole Robinson), fix raw storage allocation (Cole
+ Robinson), memory reporting for inactive qemu drivers (Cole
+ Robinson), segfault if storage pool has no type attribute (Cole
+ Robinson), OpenNebula compilation issues (Javier Fontan),
+ dominfo command without security driver (Daniel Berrange),
+ domain state problems after migration or destroy (Federico
+ Simoncelli), leak in node device parsing (Dave Allan),
+ storage pool definitions reading at startup (Cole Robinson),
+ bogus WWN in NPIV support (David Allan), avoid a segfault with
+ recent Xen (Sascha), cope with libnuma failures on weird
+ topologies (Dan Berrange), crash in QEMU driver with bad capabilities
+ data (Dan Berrange), trying to re-create a pool should not destroy
+ it (Dave Allan), endless loop in node device XML dump (Cole Robinson),
+ Re-label shared and readonly images (Dan Berrange)
+ - Improvements: create and destroy NPIV support (David Allan),
+ networking in UML driver (Daniel Berrange), HAL driver restart
+ thread safety (Daniel Berrange), capabilities and nodeinfo
+ APIs for LXC (Daniel Berrange), iNUMA API for VBox (Daniel Berrange),
+ dynamically search and use kvm-img qemu-img or qcow-create (Doug
+ Goldstein), fix qemu and kvm version parsing (Mark McLoughlin),
+ serial number for HAL storage (Dave Allan), improve error reporting
+ for virConnectOpen URIs (Daniel Berrange), include OS driver name
+ in device XML (Daniel Berrange), fix qemu command flags fetching
+ (Cole Robinson), check that qemu support -drive format= (Cole
+ Robinson), improve emulator detection (Cole Robinson), changes
+ to config parser to accomodate VMX syntax (Matthias Bolte),
+ update network schemas and driver for missing elements (Satoru SATOH),
+ avoid changing file context if not needed (Tim Waugh),
+ skip labelling if no src path (Cole Robinson), add arm emulation
+ if qemu-system-arm is present (C.J. Adams-Collier)
+ - Cleanups: daemon check logging env variables (Daniel Berrange),
+ User Mode Linux start and stop cleanups (Daniel Berrange),
+ share the NUMA api implementations (Daniel Berrange), storage
+ module dependancies (Dave Allan), refactor storage XML parsing
+ (Cole Robinson), big cleanup of logging code (Amy Griffis),
+ superfluous % on format (Matthias Bolte), cleanups and updates
+ on OpenNebula driver (Daniel Berrange and Abel Miguez Rodriguez)
+
+
0.6.4: May 29 2009:
- New features: new API virStorageVolCreateXMLFrom (Cole Robinson),
full VBox graphic capabilities (Pritesh Kothari), Interface config
diff --git a/docs/Makefile.am b/docs/Makefile.am
index 4bdb827..9ac2f6d 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -127,8 +127,11 @@ libvirt-api.xml libvirt-refs.xml: apibuild.py \
-(./apibuild.py)
$(top_builddir)/NEWS: $(top_srcdir)/docs/news.xsl $(top_srcdir)/docs/news.html.in
- -@(if [ -x $(XSLTPROC) ] ; then \
- $(XSLTPROC) --nonet $(top_srcdir)/docs/news.xsl $(top_srcdir)/docs/news.html.in > $(top_builddir)/NEWS ; fi );
+ -@(if [ -x $(XSLTPROC) ] ; then \
+ $(XSLTPROC) --nonet $(top_srcdir)/docs/news.xsl \
+ $(top_srcdir)/docs/news.html.in \
+ | perl -0777 -pe 's/\n\n+$$/\n/' \
+ > $@-t && mv $@-t $@ ; fi );
clean-local:
rm -f *~ *.bak *.hierarchy *.signals *-unused.txt
--
1.6.4.rc0.127.g81400
15 years, 4 months
[libvirt] [PATCH 0/4] Storage disk backend fixes
by Cole Robinson
The following series fixes some issues in the disk storage backend, most
wrt the recently added ability to create disk volumes.
Cole Robinson (4):
storage: disk: Fix parthelper '-g' option handling.
storage: disk: Fix segfault creating volume without target path
storage: disk: Default to 'ext2' for new volumes.
storage: disk: Use capacity, not allocation, when creating volume.
src/parthelper.c | 4 ++--
src/storage_backend_disk.c | 33 +++++++++++++++++++--------------
src/storage_conf.c | 2 +-
3 files changed, 22 insertions(+), 17 deletions(-)
15 years, 4 months
[libvirt] [PATCH 0/9] Storage cloning for LVM and Disk backends
by Cole Robinson
This following series implements cloning for LVM and disk backends. Most
of the functionality is already here, it just needed some reorganization
to be accessible for every backend.
I verified the following scenarios produced a bootable image:
- Clone within a disk pool
- Clone within a logical pool
- Clone a raw file to a disk pool
- Clone a disk pool to a logical pool
Cole Robinson (9):
storage: Refactor FS backend 'create' function choosing.
storage: Always assume we are tracking alloc progress in FS backend
storage: Move most of the FS creation functions to common backend.
storage: cleanup: do away with 'createFile'
storage: Break out actual raw cloning to separate function.
storage: Implement 'CreateBlockFrom' helper.
storage: Don't try sparse detection if writing to block device.
storage: Implement CreateVolFrom for logical and disk backend.
storage: Fix deadlock when cloning across pools.
src/storage_backend.c | 471 +++++++++++++++++++++++++++++++++++++++++
src/storage_backend.h | 15 ++
src/storage_backend_disk.c | 15 ++
src/storage_backend_fs.c | 378 ++-------------------------------
src/storage_backend_logical.c | 17 ++
src/storage_driver.c | 6 +-
6 files changed, 540 insertions(+), 362 deletions(-)
15 years, 4 months
[libvirt] [PATCH 0/5] Add virConnectListDefinedInterfaces/NumOfDefinedInterfaces
by Laine Stump
This patch adds everything but the backend implementation of two APIs
that were requested during review of my patch to add virsh commands
that expose the virInterface* API. These count and list interfaces on
the host that are currently inactive (ie "down").
virConnectListInterfaces and virConnectNumOfInterfaces will list/count
*only* those interfaces that are currently active.
With these functions in place, I'll be able to add the "--inactive"
and "--all" flags to iface-list, as suggested by danpb.
Implementation of the backend of these two functions is waiting for
two things: 1) supporting code in libnetcf, and 2) implementation of
the rest of the backend driver functions for virInterface* (ready in
the wings and waiting to go).
15 years, 4 months
[libvirt] [PATCH] implement virsh dump for qemu guests
by Paolo Bonzini
This patch uses a "migrate"+"cont" combination to implement "virsh dump"
for QEMU guests (BZ507551).
The code is mostly based on qemudDomainSave, except that the XML
prolog is not included as it is not needed to examine the dump
with e.g. crash.
2009-07-08 Paolo Bonzini <bonzini(a)gnu.org>
* qemu_driver.c (qemudDomainCoreDump): New.
(qemuDriver): Add core dump function.
---
src/qemu_driver.c | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 84 insertions(+), 1 deletions(-)
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index 95ea882..546a691 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -2844,6 +2844,89 @@ cleanup:
}
+static int qemudDomainCoreDump(virDomainPtr dom,
+ const char *path,
+ int flags ATTRIBUTE_UNUSED) {
+ struct qemud_driver *driver = dom->conn->privateData;
+ virDomainObjPtr vm;
+ char *command = NULL;
+ char *info = NULL;
+ char *safe_path = NULL;
+ int ret = -1;
+
+ qemuDriverLock(driver);
+ vm = virDomainFindByUUID(&driver->domains, dom->uuid);
+
+ if (!vm) {
+ char uuidstr[VIR_UUID_STRING_BUFLEN];
+ virUUIDFormat(dom->uuid, uuidstr);
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_NO_DOMAIN,
+ _("no domain with matching uuid '%s'"), uuidstr);
+ goto cleanup;
+ }
+
+ if (!virDomainIsActive(vm)) {
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_INVALID,
+ "%s", _("domain is not running"));
+ goto cleanup;
+ }
+
+ /* Migrate to file */
+ safe_path = qemudEscapeShellArg(path);
+ if (!safe_path) {
+ virReportOOMError(dom->conn);
+ goto cleanup;
+ }
+ if (virAsprintf(&command, "migrate \"exec:"
+ "dd of='%s' 2>/dev/null"
+ "\"", safe_path) == -1) {
+ virReportOOMError(dom->conn);
+ command = NULL;
+ goto cleanup;
+ }
+
+ if (qemudMonitorCommand(vm, command, &info) < 0) {
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
+ "%s", _("migrate operation failed"));
+ goto cleanup;
+ }
+
+ DEBUG ("%s: migrate reply: %s", vm->def->name, info);
+
+ /* If the command isn't supported then qemu prints:
+ * unknown command: migrate" */
+ if (strstr(info, "unknown command:")) {
+ qemudReportError (dom->conn, dom, NULL, VIR_ERR_NO_SUPPORT,
+ "%s",
+ _("'migrate' not supported by this qemu"));
+ goto cleanup;
+ }
+
+ /* Migrate always stops the VM. However, since the monitor is always
+ attached to a pty for libvirt, it will support synchronous
+ operations so we get here just after the end of the migration. */
+ if (vm->state == VIR_DOMAIN_RUNNING) {
+ if (qemudMonitorCommand(vm, "cont", &info) < 0) {
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
+ "%s", _("continue operation failed"));
+ goto cleanup;
+ }
+ DEBUG("Reply %s", info);
+ VIR_FREE(info);
+ }
+ ret = 0;
+
+cleanup:
+ VIR_FREE(safe_path);
+ VIR_FREE(command);
+ VIR_FREE(info);
+ if (vm)
+ virDomainObjUnlock(vm);
+ qemuDriverUnlock(driver);
+ return ret;
+}
+
+
static int qemudDomainSetVcpus(virDomainPtr dom, unsigned int nvcpus) {
struct qemud_driver *driver = dom->conn->privateData;
virDomainObjPtr vm;
@@ -5310,7 +5393,7 @@ static virDriver qemuDriver = {
qemudDomainGetInfo, /* domainGetInfo */
qemudDomainSave, /* domainSave */
qemudDomainRestore, /* domainRestore */
- NULL, /* domainCoreDump */
+ qemudDomainCoreDump, /* domainCoreDump */
qemudDomainSetVcpus, /* domainSetVcpus */
#if HAVE_SCHED_GETAFFINITY
qemudDomainPinVcpu, /* domainPinVcpu */
--
1.6.2.5
15 years, 4 months