[libvirt] [PATCH v4 0/2] add blkio.weight_device support
by Hu Tao
This series adds support for blkio.weight_device.
changes from v3:
- fix some memory leaks
- don't store major/minor, do the convertion from device path to
major/minor only when enforcing the weight_device limits
- use virStrToLong_i instead of atoi
- use c_isdigit instead of isdigit
- fix some typos
Hu Tao (2):
Add VIR_TYPED_PARAM_STRING
add interface for blkio.weight_device
daemon/remote.c | 34 +++++++-
include/libvirt/libvirt.h.in | 34 +++++++-
src/conf/domain_conf.c | 129 ++++++++++++++++++++++++++-
src/conf/domain_conf.h | 16 ++++
src/libvirt.c | 38 ++++++++
src/libvirt_private.syms | 2 +
src/qemu/qemu_cgroup.c | 22 +++++
src/qemu/qemu_driver.c | 199 +++++++++++++++++++++++++++++++++++++++--
src/remote/remote_driver.c | 30 ++++++-
src/remote/remote_protocol.x | 2 +
src/remote_protocol-structs | 2 +
src/rpc/gendispatch.pl | 2 +-
src/util/cgroup.c | 33 +++++++
src/util/cgroup.h | 3 +
src/util/util.c | 15 +++
src/util/util.h | 2 +
tools/virsh.c | 69 +++++++++++++--
tools/virsh.pod | 5 +-
18 files changed, 608 insertions(+), 29 deletions(-)
--
1.7.3.1
13 years, 1 month
[libvirt] [PATCH] doc: Correct the default werror policy
by Osier Yang
<quote>
@item werror=@var{action},rerror=@var{action}
Specify which @var{action} to take on write and read errors. Valid actions are:
"ignore" (ignore the error and try to continue), "stop" (pause QEMU),
"report" (report the error to the guest), "enospc" (pause QEMU only if the
host disk is full; report the error to the guest otherwise).
The default setting is @option{werror=enospc} and @option{rerror=report}.
@item readonly
</quote>
libvirt doesn't set any default value for "(r)error_policy", the
original doc should mean QEMU sets "report" as the default value
for "werror", but it's not true, QEMU uses "enospc" as the default.
And it's better to document "(r)error_policy" are only supported
by QEMU.
---
docs/formatdomain.html.in | 20 +++++++++-----------
1 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index dc6b152..e98e709 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1011,19 +1011,17 @@
The optional <code>error_policy</code> attribute controls
how the hypervisor will behave on a disk read or write
error, possible values are "stop", "report", "ignore", and
- "enospace".<span class="since">Since 0.8.0, "report" since
- 0.9.7</span> The default setting of error_policy is "report".
- There is also an
- optional <code>rerror_policy</code> that controls behavior
- for read errors only. <span class="since">Since
- 0.9.7</span>. If no rerror_policy is given, error_policy
- is used for both read and write errors. If rerror_policy
- is given, it overrides the <code>error_policy</code> for
- read errors. Also note that "enospace" is not a valid
+ "enospace".<span class="since">Since 0.8.0 (QEMU and KVM only),
+ "report" since 0.9.7</span>. QEMU sets error_policy as "enospc"
+ by default. There is also an optional <code>rerror_policy</code>
+ that controls behavior for read errors only. <span class="since">
+ Since 0.9.7 (QEMU and KVM only)</span>. If no rerror_policy is
+ given, error_policy is used for both read and write errors. If
+ rerror_policy is given, it overrides the <code>error_policy</code>
+ for read errors. Also note that "enospace" is not a valid
policy for read errors, so if <code>error_policy</code> is
set to "enospace" and no <code>rerror_policy</code> is
- given, the read error policy will be left at its default,
- which is "report".
+ given, QEMU will set the read error policy as "report" by default.
</li>
<li>
The optional <code>io</code> attribute controls specific
--
1.7.6
13 years, 1 month
[libvirt] building failed
by Wen Congyang
When I try to build libvirt, I meet the following error messages:
==============================
Generating internals/rpc.html.tmp
Validating internals/rpc.html
GEN libvirt-api.xml
GEN html/index.html
GEN devhelp/libvirt.devhelp
convert -rotate 90 libvirt-net-logical.fig libvirt-net-logical.png
make[1]: convert: Command not found
make[1]: *** [libvirt-net-logical.png] Error 127
==============================
The command convert does not exist. Which package should I install?
PS: I find another command fig2dev can convert *.fig to *.png.
Thanks
Wen Congyang
13 years, 1 month
[libvirt] [PATCH] Fix URI alias prefix matching
by Wen Ruo Lv (none)
From: lvroyce <lvroyce(a)lvroyce-ThinkPad-T420.(none)>
URI alias always do prefix matching,because we count length of entry according to config file entry, which should be the given alias' length.
e.g.:
/etc/libvirt/libvirt.conf
uri_aliases = [
"hail=qemu:///system",
"sleet=qemu+ssh://root@9.115.122.57/system",
"sam=qemu+unix:///system?socket=/var/run/libvirt/libvirt-sock",
]
when issue "virsh -c hailly" it will match "hail=qemu:///system"
Signed-off-by: Wen Ruo Lv <lvroyce(a)lvroyce-ThinkPad-T420.(none)>
---
src/libvirt.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/libvirt.c b/src/libvirt.c
index e9d1a29..54e283f 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -1022,7 +1022,7 @@ virConnectOpenFindURIAliasMatch(virConfValuePtr value, const char *alias, char *
return -1;
}
- if (STREQLEN(entry->str, alias, offset-entry->str)) {
+ if (STREQLEN(entry->str, alias, strlen(alias))) {
VIR_DEBUG("Resolved alias '%s' to '%s'",
alias, offset+1);
if (!(*uri = strdup(offset+1))) {
--
1.7.4.1
13 years, 1 month
[libvirt] [PATCH] python: Fix documentation of virStream recv
by Matthias Bolte
This was fixed in be757a3f7baf93b for libvirt.c.
---
I'm pushing this one under the trivial rule.
python/libvirt-override-virStream.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/python/libvirt-override-virStream.py b/python/libvirt-override-virStream.py
index 92e6fb1..ff53a16 100644
--- a/python/libvirt-override-virStream.py
+++ b/python/libvirt-override-virStream.py
@@ -90,7 +90,7 @@
"nonblocking stream")
def recv(self, nbytes):
- """Write a series of bytes to the stream. This method may
+ """Reads a series of bytes from the stream. This method may
block the calling application for an arbitrary amount
of time.
--
1.7.4.1
13 years, 1 month
[libvirt] [PATCH] startupPolicty: Minor cleanups
by Michal Privoznik
This patch does some cleanups to my previous startupPolicy patchset.
---
daemon/remote.c | 2 ++
src/conf/domain_conf.c | 2 +-
src/qemu/qemu_domain.c | 20 +++++++++-----------
3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/daemon/remote.c b/daemon/remote.c
index 9d70163..f736e5f 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -496,6 +496,8 @@ static int remoteRelayDomainEventDiskChange(virConnectPtr conn ATTRIBUTE_UNUSED,
return 0;
mem_error:
+ VIR_FREE(oldSrcPath_p);
+ VIR_FREE(newSrcPath_p);
virReportOOMError();
return -1;
}
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 557d0b9..8f72d37 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -2657,7 +2657,7 @@ virDomainDiskDefParseXML(virCapsPtr caps,
if (startupPolicy) {
int i;
- if ((i = virDomainStartupPolicyTypeFromString(startupPolicy)) < 0) {
+ if ((i = virDomainStartupPolicyTypeFromString(startupPolicy)) <= 0) {
virDomainReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("unknown startupPolicy value '%s'"),
startupPolicy);
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 198ebcc..572ea7d 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -1617,9 +1617,8 @@ qemuDomainCheckDiskPresence(struct qemud_driver *driver,
{
int ret = -1;
int i;
- int accessRet;
virDomainDiskDefPtr disk;
- char uuid[VIR_UUID_STRING_BUFLEN] ATTRIBUTE_UNUSED;
+ char uuid[VIR_UUID_STRING_BUFLEN];
virDomainEventPtr event = NULL;
virUUIDFormat(vm->def->uuid, uuid);
@@ -1630,11 +1629,10 @@ qemuDomainCheckDiskPresence(struct qemud_driver *driver,
if (!disk->startupPolicy || !disk->src)
continue;
- if ((accessRet = virFileAccessibleAs(disk->src, F_OK,
- driver->user,
- driver->group)) >= 0) {
- /* disk accessible or virFileAccessibleAs()
- * terminated with signal*/
+ if (virFileAccessibleAs(disk->src, F_OK,
+ driver->user,
+ driver->group) >= 0) {
+ /* disk accessible */
continue;
}
@@ -1643,7 +1641,7 @@ qemuDomainCheckDiskPresence(struct qemud_driver *driver,
break;
case VIR_DOMAIN_STARTUP_POLICY_MANDATORY:
- virReportSystemError(-accessRet,
+ virReportSystemError(errno,
_("cannot access file '%s'"),
disk->src);
goto cleanup;
@@ -1651,7 +1649,7 @@ qemuDomainCheckDiskPresence(struct qemud_driver *driver,
case VIR_DOMAIN_STARTUP_POLICY_REQUISITE:
if (!start_with_state) {
- virReportSystemError(-accessRet,
+ virReportSystemError(errno,
_("cannot access file '%s'"),
disk->src);
goto cleanup;
@@ -1664,8 +1662,8 @@ qemuDomainCheckDiskPresence(struct qemud_driver *driver,
break;
}
- VIR_DEBUG("Droping disk '%s' on domain '%s' (UUID '%s') "
- "due to not accessible source '%s'",
+ VIR_DEBUG("Dropping disk '%s' on domain '%s' (UUID '%s') "
+ "due to inaccessible source '%s'",
disk->dst, vm->def->name, uuid, disk->src);
event = virDomainEventDiskChangeNewFromObj(vm, disk->src, NULL, disk->info.alias,
--
1.7.3.4
13 years, 1 month
[libvirt] [PATCH V4 0/4] Support for multiple IP addresses using lists
by Stefan Berger
This patch series builds on the previously posted patch series
https://www.redhat.com/archives/libvir-list/2011-October/msg00912.html
and introduces the capability to assign a list to a variable and
have multiple rules instantiated, one for each item in the list.
This means, that if for example a variable like IP has been assigned
a list of values
IP = [1.2.3.4, 5.6.7.8, 10.0.0.1]
it will instantiate 3 rules, which in turn allows us to build filters
that can evaluate multiple possible values per field, i.e., allow
the filtering for multiple IP addresses (per interface).
It would then need David Steven's patch for support of 'RETURN' (and
'CONTINUE') target(s).
v4:
- following Daniel Berrange's comments
- changed (default) behavior of iterator
v3:
- following Daniel Berrange's comment regarding how a list of items
should be represented in the XML
v2:
- reimplementation of iterator
- other nits
Regards,
Stefan
13 years, 1 month
[libvirt] how can I get these packages?
by chang liu
I wanna to build the rpm package, but it tells me that I need to install
this packages, and I could not found them all.
Who can tell me where can I get it?
The packages are :
xhtml1-dtds
augeas
libpciaccess-devel
yajl-devel
libpcap-devel
avahi-devel
parted-devel
device-mapper-devel
netcf-devel.
13 years, 1 month
[libvirt] [PATCH] storage: add lvchange operation while lvremove fails.
by zituan@taobao.com
From: Chang Liu <lingjiao.lc(a)taobao.com>
We found an issue that virStorageBackendLogicalDeleteVol() could not remove
the lv with notificaton "could not remove open logical volume.", in such
situation, we should disable the lv first, then delete it. this patch fix it.
*src/storage/storage_backend_logical.c
(virStorageBackendLogicalDeleteVol):lvremove fail, lvchange the volume
and then lvremove it second.
Signed-off-by: Chang Liu <lingjiao.lc(a)taobao.com>
---
configure.ac | 4 ++++
src/storage/storage_backend_logical.c | 14 ++++++++++++--
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 5753c08..6092c47 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1691,6 +1691,7 @@ if test "$with_storage_lvm" = "yes" || test "$with_storage_lvm" = "check"; then
AC_PATH_PROG([PVREMOVE], [pvremove], [], [$PATH:/sbin:/usr/sbin])
AC_PATH_PROG([VGREMOVE], [vgremove], [], [$PATH:/sbin:/usr/sbin])
AC_PATH_PROG([LVREMOVE], [lvremove], [], [$PATH:/sbin:/usr/sbin])
+ AC_PATH_PROG([LVCHANGE], [lvchange], [], [$PATH:/sbin:/usr/sbin])
AC_PATH_PROG([VGCHANGE], [vgchange], [], [$PATH:/sbin:/usr/sbin])
AC_PATH_PROG([VGSCAN], [vgscan], [], [$PATH:/sbin:/usr/sbin])
AC_PATH_PROG([PVS], [pvs], [], [$PATH:/sbin:/usr/sbin])
@@ -1704,6 +1705,7 @@ if test "$with_storage_lvm" = "yes" || test "$with_storage_lvm" = "check"; then
if test -z "$PVREMOVE" ; then AC_MSG_ERROR([We need pvremove for LVM storage driver]) ; fi
if test -z "$VGREMOVE" ; then AC_MSG_ERROR([We need vgremove for LVM storage driver]) ; fi
if test -z "$LVREMOVE" ; then AC_MSG_ERROR([We need lvremove for LVM storage driver]) ; fi
+ if test -z "$LVCHANGE" ; then AC_MSG_ERROR([We need lvchange for LVM storage driver]) ; fi
if test -z "$VGCHANGE" ; then AC_MSG_ERROR([We need vgchange for LVM storage driver]) ; fi
if test -z "$VGSCAN" ; then AC_MSG_ERROR([We need vgscan for LVM storage driver]) ; fi
if test -z "$PVS" ; then AC_MSG_ERROR([We need pvs for LVM storage driver]) ; fi
@@ -1716,6 +1718,7 @@ if test "$with_storage_lvm" = "yes" || test "$with_storage_lvm" = "check"; then
if test -z "$PVREMOVE" ; then with_storage_lvm=no ; fi
if test -z "$VGREMOVE" ; then with_storage_lvm=no ; fi
if test -z "$LVREMOVE" ; then with_storage_lvm=no ; fi
+ if test -z "$LVCHANGE" ; then with_storage_lvm=no ; fi
if test -z "$VGCHANGE" ; then with_storage_lvm=no ; fi
if test -z "$VGSCAN" ; then with_storage_lvm=no ; fi
if test -z "$PVS" ; then with_storage_lvm=no ; fi
@@ -1733,6 +1736,7 @@ if test "$with_storage_lvm" = "yes" || test "$with_storage_lvm" = "check"; then
AC_DEFINE_UNQUOTED([PVREMOVE],["$PVREMOVE"],[Location of pvremove program])
AC_DEFINE_UNQUOTED([VGREMOVE],["$VGREMOVE"],[Location of vgremove program])
AC_DEFINE_UNQUOTED([LVREMOVE],["$LVREMOVE"],[Location of lvremove program])
+ AC_DEFINE_UNQUOTED([LVCHANGE],["$LVCHANGE"],[Location of lvchange program])
AC_DEFINE_UNQUOTED([VGCHANGE],["$VGCHANGE"],[Location of vgchange program])
AC_DEFINE_UNQUOTED([VGSCAN],["$VGSCAN"],[Location of vgscan program])
AC_DEFINE_UNQUOTED([PVS],["$PVS"],[Location of pvs program])
diff --git a/src/storage/storage_backend_logical.c b/src/storage/storage_backend_logical.c
index 3c3e736..4a2acf1 100644
--- a/src/storage/storage_backend_logical.c
+++ b/src/storage/storage_backend_logical.c
@@ -772,13 +772,23 @@ virStorageBackendLogicalDeleteVol(virConnectPtr conn ATTRIBUTE_UNUSED,
LVREMOVE, "-f", vol->target.path, NULL
};
+ const char *lvchange_cmd[] = {
+ LVCHANGE, "-a", "n", vol->target.path, NULL
+ };
+
virCheckFlags(0, -1);
virFileWaitForDevices();
if (virRun(cmdargv, NULL) < 0)
- return -1;
-
+ {
+ if(virRun(lvchange_cmd, NULL) < 0)
+ return -1;
+ else{
+ if(virRun(cmdargv,NULL) < 0)
+ return -1;
+ }
+ }
return 0;
}
--
1.7.6.2
13 years, 1 month