[libvirt] Planning for libvirt-0.8.2 release
by Daniel Veillard
As some may have noticed I'm a bit away from the list, and will
still for one more week. If we want to plan for a friday 25 release
as suggested a couple of week ago this means we have one more week
for commiting big changes (e.g. the new CreateWithFlags API but that
looks uncontroversial), and start the freeze week next Friday the 18th.
I didn't see anything big which may need more than one more week
of devel and need pushing on 0.8.2, but maybe I overlooked something,
in which case please tell me :-)
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
14 years, 5 months
[libvirt] wrong path of domblkstat
by jbuy0710
Hi all:
I tried to use virsh domblkstat to get block information of a vm(xen
para-virtualized), and it returns error message like this
error: Failed to get block stats vm1 hda
error: internal error read_bd_stats: Failed to read any block statistics
I found the code in \src\xen\block_stats.c is wrong
in line 121
"/sys/devices/xen-backend/vbd-%d-%d/statistics/%s",
should be
"/sys/devices/vbd-%d-%d/statistics/%s",
in line 127 should be
"/sys/devices/tap-%d-%d/statistics/%s",
After modified and rebuild the soure code,the domblkstat can work fine.
Anyone can help to update the code in the git?
14 years, 5 months
[libvirt] [PATCHv3 1/2] virsh: add pool support to vol-key command
by Justin Clift
Presently the vol-key command only supports being provided with
a volume path.
This patch adds support for providing it with a pool and volume
identifier pair as well.
virsh # vol-key --pool <pool-name-or-uuid> <vol-name-or-path>
---
This is a clean patch against current git head, plus avoids a
potential memory leak in the v1 code. It's identical to the v2
code, except now I may have the PATCHv3 subject prefix correct. :)
Also unlike the v1 patch, this one doesn't change the help text for
other volume commands.
The patch following this one addresses the help text of the vol-name
and vol-path commands.
tools/virsh.c | 6 +++---
tools/virsh.pod | 7 ++++---
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index 546e247..db8b28d 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -6032,12 +6032,13 @@ cmdVolPool(vshControl *ctl, const vshCmd *cmd)
* "vol-key" command
*/
static const vshCmdInfo info_vol_key[] = {
- {"help", N_("convert a vol UUID to vol key")},
+ {"help", N_("returns the volume key for a given volume name or path")},
{"desc", ""},
{NULL, NULL}
};
static const vshCmdOptDef opts_vol_key[] = {
+ {"pool", VSH_OT_STRING, 0, N_("pool name or uuid")},
{"vol", VSH_OT_DATA, VSH_OFLAG_REQ, N_("vol uuid")},
{NULL, 0, 0, NULL}
};
@@ -6050,8 +6051,7 @@ cmdVolKey(vshControl *ctl, const vshCmd *cmd)
if (!vshConnectionUsability(ctl, ctl->conn, TRUE))
return FALSE;
- if (!(vol = vshCommandOptVolBy(ctl, cmd, "vol", "pool", NULL,
- VSH_BYUUID)))
+ if (!(vol = vshCommandOptVol(ctl, cmd, "vol", "pool", NULL)))
return FALSE;
vshPrint(ctl, "%s\n", virStorageVolGetKey(vol));
diff --git a/tools/virsh.pod b/tools/virsh.pod
index b54003c..f6d7808 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -855,10 +855,11 @@ I<vol-name-or-key> is the name or key of the volume to return the path for.
Return the name for a given volume.
I<vol-key-or-path> is the key or path of the volume to return the name for.
-=item B<vol-key> I<vol-uuid>
+=item B<vol-key> [optional I<--pool> I<pool-or-uuid>] I<vol-name-or-path>
-Return the volume key for a given volume UUID.
-I<vol-uuid> is the UUID of the volume to return the volume key for.
+Return the volume key for a given volume.
+I<--pool> I<pool-or-uuid> is the name or UUID of the storage pool the volume is in.
+I<vol-name-or-path> is the name or path of the volume to return the volume key for.
=back
--
1.7.0.1
14 years, 5 months
[libvirt] Virtual disk size associated with a Domain
by IKI-サガル バルウェ
Hello,
Is there any way to fetch the size of all the virtual disks associated with
a Domain??
I could not find one in the libvirt API., I tried using 'virStorageVol' and
'virStoragePool', but they returned null objects.
Also I fetched 'virDomainBlockStats', but did not understand the information
returned. i.e. 'rd_bytes' and 'wr_bytes'. Can we use this info for
calculating the disk sizes?
Any method for finding this is welcome. using virt or xm or virsh command
line tools also.
Also, What does the size of the "img" file for a Domain represent? Is it the
disc size?
Please help.
Thanks and Regards
Sagar Barve
14 years, 5 months
[libvirt] Segfault in libvirtd when run as a service
by Emre Erenoglu
Dear list,
I'm trying to package libvirt 0.8.1 for our distribution, Pardus 2009.2.
libvirt is installed perfectly normal, and libvirtd runs OK when I start it
in a console using root account.
However, when I start libvirtd as a service, with the same parameters,
through the normal service startup functions, it segfaults.
The services in Pardus 2009.2 are started using a management backend which
works with python and service start/stop scripts are python based.
For libvirt, it's the following:
http://svn.pardus.org.tr/pardus/playground/ozan/libvirt/comar/service.py
Whatever I did, I couldn't find why libvirt is crashing. It works normal
when I run it from console with exactly the same parameters. Here's an
earlier syslog section ending with the crash:
May 21 17:34:31 voyager kernel: [148326.330658] Bridge firewalling
registered
May 21 17:34:31 voyager kernel: [148326.626654] virbr0: starting userspace
STP failed, starting kernel STP
May 21 17:34:31 voyager avahi-daemon[559]: Joining mDNS multicast group on
interface virbr0.IPv4 with address 192.168.122.1.
May 21 17:34:31 voyager avahi-daemon[559]: New relevant interface
virbr0.IPv4 for mDNS.
May 21 17:34:31 voyager avahi-daemon[559]: Registering new address record
for 192.168.122.1 on virbr0.IPv4.
May 21 17:34:32 voyager kernel: [148327.158860] ip_tables: (C) 2000-2006
Netfilter Core Team
May 21 17:34:32 voyager kernel: [148327.359921] nf_conntrack version 0.5.0
(16384 buckets, 65536 max)
May 21 17:34:32 voyager kernel: [148327.360680] CONFIG_NF_CT_ACCT is
deprecated and will be removed soon. Please use
May 21 17:34:32 voyager kernel: [148327.360682] nf_conntrack.acct=1 kernel
parameter, acct=1 nf_conntrack module option or
May 21 17:34:32 voyager kernel: [148327.360683] sysctl
net.netfilter.nf_conntrack_acct=1 to enable it.
May 21 17:34:33 voyager dnsmasq[13918]: started, version 2.47 cachesize
150
May 21 17:34:33 voyager dnsmasq[13918]: compile time options: IPv6
GNU-getopt DBus no-I18N TFTP
May 21 17:34:33 voyager dnsmasq[13918]: DHCP, IP range 192.168.122.2 --
192.168.122.254, lease time 1h
May 21 17:34:33 voyager dnsmasq[13918]: reading
/etc/resolv.conf
May 21 17:34:33 voyager dnsmasq[13918]: using nameserver
193.140.100.215#53
May 21 17:34:33 voyager dnsmasq[13918]: using nameserver
193.140.100.210#53
May 21 17:34:33 voyager dnsmasq[13918]: using nameserver 192.168.1.1#53
May 21 17:34:33 voyager dnsmasq[13918]: read /etc/hosts - 7 addresses
May 21 17:34:33 voyager kernel: [148328.620605] libvirtd[13826]: segfault at
0 ip b74aa8f3 sp bfcd24fc error 4 in libc-2.9.so[b7431000+161000]
Thanks for any insight,
Best Regards,
--
Emre Erenoglu
14 years, 5 months
[libvirt] guest clock offset, configuration
by Jakub Hrozek
Hi,
I'm having some trouble with guests booting up with huge clock offset
(4 hrs). The offset is always the same which leads me to suspecting a
configuration issue rather than a bug.
I looked around libvirt documentation and so far checked these:
* the hosts clock is correct (ntpd, manually verified)
* the timezones are correct (and the same) on both host and guest
* the clock element in the guest xml seems to be correct for a Linux
guest - "<clock offset='utc'/>"
Is there anything else I should check?
FWIW, hosts are Fedora 12, guests are a mix of recent Fedoras.
Thanks for any pointers,
Jakub
14 years, 5 months
[libvirt] [PATCH] virsh: add snapshot backing store support to vol-create-as
by Justin Clift
This patch adds two new parameters to the vol-create-as command:
--backing-vol <volume-name-or-key-or-path>
--backing-vol-format <format-of-backing-vol>
virsh # vol-create-as guest_images_lvm snapvol1 5G --backing-vol \
rhel6vm1lun1
Vol snapvol1 created
virsh # vol-create-as image_dir qcow2snap2 5G --format qcow2 \
--backing-vol imagevol1.qcow2 \
--backing-vol-format qcow2
Vol qcow2snap2 created
Additionally, the virsh man page update fixes incorrect snapshot
parameters that were included in my prior bulk volume command patch.
---
tools/virsh.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
tools/virsh.pod | 10 ++++----
2 files changed, 65 insertions(+), 6 deletions(-)
diff --git a/tools/virsh.c b/tools/virsh.c
index 1e00114..f990ccd 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -5274,6 +5274,8 @@ static const vshCmdOptDef opts_vol_create_as[] = {
{"capacity", VSH_OT_DATA, VSH_OFLAG_REQ, N_("size of the vol with optional k,M,G,T suffix")},
{"allocation", VSH_OT_STRING, 0, N_("initial allocation size with optional k,M,G,T suffix")},
{"format", VSH_OT_STRING, 0, N_("file format type raw,bochs,qcow,qcow2,vmdk")},
+ {"backing-vol", VSH_OT_STRING, 0, N_("the backing volume if taking a snapshot")},
+ {"backing-vol-format", VSH_OT_STRING, 0, N_("format of backing volume if taking a snapshot")},
{NULL, 0, 0, NULL}
};
@@ -5313,6 +5315,7 @@ cmdVolCreateAs(vshControl *ctl, const vshCmd *cmd)
int found;
char *xml;
char *name, *capacityStr, *allocationStr, *format;
+ char *snapshotStrVol, *snapshotStrFormat;
unsigned long long capacity, allocation = 0;
virBuffer buf = VIR_BUFFER_INITIALIZER;
@@ -5339,6 +5342,8 @@ cmdVolCreateAs(vshControl *ctl, const vshCmd *cmd)
vshError(ctl, _("Malformed size %s"), allocationStr);
format = vshCommandOptString(cmd, "format", &found);
+ snapshotStrVol = vshCommandOptString(cmd, "backing-vol", &found);
+ snapshotStrFormat = vshCommandOptString(cmd, "backing-vol-format", &found);
virBufferAddLit(&buf, "<volume>\n");
virBufferVSprintf(&buf, " <name>%s</name>\n", name);
@@ -5351,8 +5356,62 @@ cmdVolCreateAs(vshControl *ctl, const vshCmd *cmd)
virBufferVSprintf(&buf, " <format type='%s'/>\n",format);
virBufferAddLit(&buf, " </target>\n");
}
- virBufferAddLit(&buf, "</volume>\n");
+ /* Convert the snapshot parameters into backingStore XML */
+ if (snapshotStrVol) {
+ /* Lookup snapshot backing volume. Try the backing-vol
+ * parameter as a name */
+ vshDebug(ctl, 5, "%s: Look up backing store volume '%s' as name\n",
+ cmd->def->name, snapshotStrVol);
+ virStorageVolPtr snapVol = virStorageVolLookupByName(pool, snapshotStrVol);
+ if (snapVol)
+ vshDebug(ctl, 5, "%s: Backing store volume found using '%s' as name\n",
+ cmd->def->name, snapshotStrVol);
+
+ if (snapVol == NULL) {
+ /* Snapshot backing volume not found by name. Try the
+ * backing-vol parameter as a key */
+ vshDebug(ctl, 5, "%s: Look up backing store volume '%s' as key\n",
+ cmd->def->name, snapshotStrVol);
+ snapVol = virStorageVolLookupByKey(ctl->conn, snapshotStrVol);
+ if (snapVol)
+ vshDebug(ctl, 5, "%s: Backing store volume found using '%s' as key\n",
+ cmd->def->name, snapshotStrVol);
+ }
+ if (snapVol == NULL) {
+ /* Snapshot backing volume not found by key. Try the
+ * backing-vol parameter as a path */
+ vshDebug(ctl, 5, "%s: Look up backing store volume '%s' as path\n",
+ cmd->def->name, snapshotStrVol);
+ snapVol = virStorageVolLookupByPath(ctl->conn, snapshotStrVol);
+ if (snapVol)
+ vshDebug(ctl, 5, "%s: Backing store volume found using '%s' as path\n",
+ cmd->def->name, snapshotStrVol);
+ }
+ if (snapVol == NULL) {
+ vshError(ctl, _("failed to get vol '%s'"), snapshotStrVol);
+ return FALSE;
+ }
+
+ char *snapshotStrVolPath;
+ if ((snapshotStrVolPath = virStorageVolGetPath(snapVol)) == NULL) {
+ virStorageVolFree(snapVol);
+ return FALSE;
+ }
+
+ /* Create XML for the backing store */
+ virBufferAddLit(&buf, " <backingStore>\n");
+ virBufferVSprintf(&buf, " <path>%s</path>\n",snapshotStrVolPath);
+ if (snapshotStrFormat)
+ virBufferVSprintf(&buf, " <format type='%s'/>\n",snapshotStrFormat);
+ virBufferAddLit(&buf, " </backingStore>\n");
+
+ /* Cleanup snapshot allocations */
+ VIR_FREE(snapshotStrVolPath);
+ virStorageVolFree(snapVol);
+ }
+
+ virBufferAddLit(&buf, "</volume>\n");
if (virBufferError(&buf)) {
vshPrint(ctl, "%s", _("Failed to allocate XML buffer"));
diff --git a/tools/virsh.pod b/tools/virsh.pod
index 3b0cf16..56afd52 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -782,8 +782,8 @@ source volume is in.
I<vol-name-or-key-or-path> is the name or key or path of the source volume.
=item B<vol-create-as> I<pool-or-uuid> I<name> I<capacity> optional
-I<--allocation> I<size> I<--format> I<string> I<--snapshot-source-vol>
-I<vol-name-or-key-or-path> I<--snapshot-source-format> I<string>
+I<--allocation> I<size> I<--format> I<string> I<--backing-vol>
+I<vol-name-or-key-or-path> I<--backing-vol-format> I<string>
Create a volume from a set of arguments.
I<pool-or-uuid> is the name or UUID of the storage pool to create the volume
@@ -795,10 +795,10 @@ I<--allocation> I<size> is the initial size to be allocated in the volume, with
optional k, M, G, or T suffix.
I<--format> I<string> is used in file based storage pools to specify the volume
file format to use; raw, bochs, qcow, qcow2, vmdk.
-I<--snapshot-source-vol> I<vol-name-or-key-or-path> is the source backing
+I<--backing-vol> I<vol-name-or-key-or-path> is the source backing
volume to be used if taking a snapshot of an existing volume.
-I<--snapshot-source-format> I<string> is the format of the snapshot backing volume;
-raw, bochs, qcow, qcow2, vmdk.
+I<--backing-vol-format> I<string> is the format of the snapshot backing volume;
+raw, bochs, qcow, qcow2, vmdk, host_device.
=item B<vol-clone> [optional I<--pool> I<pool-or-uuid>] I<vol-name-or-key-or-path> I<name>
--
1.7.0.1
14 years, 5 months
[libvirt] [PATCH 0/3] allow starting qemu in paused state
by Eric Blake
https://bugzilla.redhat.com/show_bug.cgi?id=589465
This patch series only works for creation of a transient domain from
XML, because only virDomainCreateXML() had a flag parameter (the
virDomainCreate() API is rather lacking, in that respect). As such,
the series is minimally invasive, and can hopefully be backported
easily to places like RHEL6. If desired, a later patch can add hooks
(either a new XML element, or a new command comparable to autostart
that can toggle the state of a hidden field associated with domains)
so that virDomainCreate() can also be used to start a paused domain,
but that will be more invasive.
Eric Blake (3):
virDomainCreateXML: support new flag
qemu: allow creation of a paused domain
virsh: add --paused option to create
include/libvirt/libvirt.h.in | 3 ++-
src/libvirt.c | 2 +-
src/lxc/lxc_driver.c | 7 +++++--
src/opennebula/one_driver.c | 8 ++++++--
src/openvz/openvz_driver.c | 4 +++-
src/phyp/phyp_driver.c | 4 +++-
src/qemu/qemu_driver.c | 28 +++++++++++++++++++---------
src/test/test_driver.c | 4 +++-
src/uml/uml_driver.c | 4 +++-
src/vbox/vbox_tmpl.c | 8 ++++++--
src/xen/xend_internal.c | 4 +++-
src/xenapi/xenapi_driver.c | 4 +++-
tools/virsh.c | 6 +++++-
tools/virsh.pod | 6 ++++--
14 files changed, 66 insertions(+), 26 deletions(-)
14 years, 5 months
[libvirt] [PATCH 0/2] Fix reference counting bugs on qemu monitor
by Daniel P. Berrange
The previous change
commit d84bb6d6a3bd2fdd530184cc9743249ebddbee71
Author: Jiri Denemark <jdenemar(a)redhat.com>
Date: Wed May 12 11:50:52 2010 +0200
Fix monitor ref counting when adding event handle
actually introduced a couple of bugs in freeing the QEMU monitor
object, resulting in priv->mon never being set to NULL and a
reference leak on virDomainObjPtr. This interacted with anothe
bug in the QEMU driver to cause a hang of the libvirtd daemon
14 years, 5 months