[libvirt] [RFC] [PATCH v2 1/6] add configure option --with-fuse for libvirt
by Gao feng
add a configure option --with-fuse to prepare introduction
of fuse support for libvirt lxc.
With help from Daniel
Signed-off-by: Gao feng <gaofeng(a)cn.fujitsu.com>
---
configure.ac | 36 ++++++++++++++++++++++++++++++++++++
libvirt.spec.in | 9 +++++++++
2 files changed, 45 insertions(+), 0 deletions(-)
diff --git a/configure.ac b/configure.ac
index 3cc7b3c..e6d207e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1695,6 +1695,37 @@ AC_SUBST([CAPNG_CFLAGS])
AC_SUBST([CAPNG_LIBS])
+dnl libfuse
+AC_ARG_WITH([fuse],
+ AC_HELP_STRING([--with-fuse], [use libfuse to proivde fuse filesystem support for libvirt lxc]),
+ [],
+ [with_fuse=check])
+
+dnl
+dnl This check looks for 'fuse'
+dnl
+FUSE_CFLAGS=
+FUSE_LIBS=
+if test "x$with_fuse" != "xno"; then
+ PKG_CHECK_MODULES([FUSE], [fuse],
+ [with_fuse=yes], [
+ if test "x$with_fuse" = "xcheck" ; then
+ with_fuse=no
+ else
+ AC_MSG_ERROR(
+ [You must install fuse-devel to compile libvirt])
+ fi
+ ])
+ if test "x$with_fuse" = "xyes" ; then
+ FUSE_LIBS="-lfuse"
+ FUSE_CFLAGS="-D_FILE_OFFSET_BITS=64"
+ AC_DEFINE_UNQUOTED([HAVE_FUSE], 1, [whether fuse is available for libvirt lxc])
+ fi
+fi
+AM_CONDITIONAL([HAVE_FUSE], [test "x$with_fuse" = "xyes"])
+AC_SUBST([FUSE_CFLAGS])
+AC_SUBST([FUSE_LIBS])
+
dnl virsh libraries
AC_CHECK_HEADERS([readline/readline.h])
@@ -2944,6 +2975,11 @@ AC_MSG_NOTICE([ capng: $CAPNG_CFLAGS $CAPNG_LIBS])
else
AC_MSG_NOTICE([ capng: no])
fi
+if test "$with_fuse" = "yes" ; then
+AC_MSG_NOTICE([ fuse: $FUSE_CFLAGS $FUSE_LIBS])
+else
+AC_MSG_NOTICE([ fuse: no])
+fi
if test "$with_xen" = "yes" ; then
AC_MSG_NOTICE([ xen: $XEN_CFLAGS $XEN_LIBS])
else
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 140a182..939569e 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -91,6 +91,7 @@
# A few optional bits off by default, we enable later
%define with_polkit 0%{!?_without_polkit:0}
%define with_capng 0%{!?_without_capng:0}
+%define with_fuse 0%{!?_without_fuse:0}
%define with_netcf 0%{!?_without_netcf:0}
%define with_udev 0%{!?_without_udev:0}
%define with_hal 0%{!?_without_hal:0}
@@ -466,6 +467,9 @@ BuildRequires: numactl-devel
%if %{with_capng}
BuildRequires: libcap-ng-devel >= 0.5.0
%endif
+%if %{with_fuse}
+BuildRequires: fuse-devel
+%endif
%if %{with_phyp}
BuildRequires: libssh2-devel
%endif
@@ -1116,6 +1120,10 @@ of recent versions of Linux (and other OSes).
%define _without_capng --without-capng
%endif
+%if ! %{with_fuse}
+%define _without_fuse --without-fuse
+%endif
+
%if ! %{with_netcf}
%define _without_netcf --without-netcf
%endif
@@ -1206,6 +1214,7 @@ autoreconf -if
%{?_without_numactl} \
%{?_without_numad} \
%{?_without_capng} \
+ %{?_without_fuse} \
%{?_without_netcf} \
%{?_without_selinux} \
%{?_without_hal} \
--
1.7.7.6
12 years, 2 months
[libvirt] [PATCH] Fix adding ports to OVS bridges without VLAN tags
by Kyle Mestery
The introduction of the new VLAN code, along with the fix
from 5e465df6be8bcb00f0b4bff831e91f4042fae272, caused the
addition of OVS ports to fail with the following message:
ovs-vsctl: 00002|vsctl|ERR|: missing column name
This fix takes into account the VLAN arguments are optional,
and correctly sets up the command line to run the "ovs-vsctl"
command to add ports to the OVS bridge.
Signed-off-by: Kyle Mestery <kmestery(a)cisco.com>
CC: Eric Blake <eblake(a)redhat.com>
---
V2:
- Use virBufferUse() to check if a buffer is in use. Found
by Eric Blake.
---
src/util/virnetdevopenvswitch.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/src/util/virnetdevopenvswitch.c b/src/util/virnetdevopenvswitch.c
index 00271a0..764f478 100644
--- a/src/util/virnetdevopenvswitch.c
+++ b/src/util/virnetdevopenvswitch.c
@@ -104,9 +104,15 @@ int virNetDevOpenvswitchAddPort(const char *brname, const char *ifname,
}
cmd = virCommandNew(OVSVSCTL);
+
+ virCommandAddArgList(cmd, "--", "--may-exist", "add-port",
+ brname, ifname, NULL);
+
+ if (virBufferUse(&buf) != 0)
+ virCommandAddArgList(cmd, virBufferCurrentContent(&buf), NULL);
+
if (ovsport->profileID[0] == '\0') {
- virCommandAddArgList(cmd, "--", "--may-exist", "add-port",
- brname, ifname, virBufferCurrentContent(&buf),
+ virCommandAddArgList(cmd,
"--", "set", "Interface", ifname, attachedmac_ex_id,
"--", "set", "Interface", ifname, ifaceid_ex_id,
"--", "set", "Interface", ifname, vmid_ex_id,
@@ -114,8 +120,7 @@ int virNetDevOpenvswitchAddPort(const char *brname, const char *ifname,
"external-ids:iface-status=active",
NULL);
} else {
- virCommandAddArgList(cmd, "--", "--may-exist", "add-port",
- brname, ifname, virBufferCurrentContent(&buf),
+ virCommandAddArgList(cmd,
"--", "set", "Interface", ifname, attachedmac_ex_id,
"--", "set", "Interface", ifname, ifaceid_ex_id,
"--", "set", "Interface", ifname, vmid_ex_id,
--
1.7.11.4
12 years, 2 months
[libvirt] [PATCH] (updated) additional parameters needed for dnsmasq
by Gene Czarcinski
As I said in a previous message, dnsmasq is forwarding a number of
queries upstream that should not be done. There still remains an MX
query for a plain name with no domain specified that will be forwarded
is dnsmasq has --domain=xxx --local=/xxx/ specified. This does not
happen with no domain name and --local=// ... not a libvirt problem.
BTW, thanks again to Claudio Bley!
====================================================
diff -uNr libvirt-0.9.11.4.orig/src/network/bridge_driver.c
libvirt-0.9.11.4/src/network/bridge_driver.c
--- libvirt-0.9.11.4.orig/src/network/bridge_driver.c 2012-06-15
14:23:21.000000000 -0400
+++ libvirt-0.9.11.4/src/network/bridge_driver.c 2012-08-22
12:16:45.263488789 -0400
@@ -490,8 +490,15 @@
*/
virCommandAddArgList(cmd, "--strict-order", "--bind-interfaces",
NULL);
- if (network->def->domain)
+ if (network->def->domain) {
virCommandAddArgList(cmd, "--domain", network->def->domain, NULL);
+ virCommandAddArgFormat(cmd, "--local=/%s/", network->def->domain);
+ virCommandAddArgList(cmd, "--domain-needed", "--filterwin2k",
NULL);
+ }
+ else { /* need to specify local even if no domain specified */
+ virCommandAddArg(cmd, "--local=//");
+ virCommandAddArgList(cmd, "--domain-needed", "--filterwin2k",
NULL);
+ }
if (pidfile)
virCommandAddArgPair(cmd, "--pid-file", pidfile);
diff -uNr
libvirt-0.9.11.4.orig/tests/networkxml2argvdata/isolated-network.argv
libvirt-0.9.11.4/tests/networkxml2argvdata/isolated-network.argv
---
libvirt-0.9.11.4.orig/tests/networkxml2argvdata/isolated-network.argv
2012-06-15 14:21:54.000000000 -0400
+++ libvirt-0.9.11.4/tests/networkxml2argvdata/isolated-network.argv
2012-08-22 12:20:37.700995728 -0400
@@ -1,4 +1,5 @@
-@DNSMASQ@ --strict-order --bind-interfaces --conf-file= \
+@DNSMASQ@ --strict-order --bind-interfaces \
+--local=// --domain-needed --filterwin2k --conf-file= \
--except-interface lo --dhcp-option=3 --no-resolv \
--listen-address 192.168.152.1 \
--dhcp-range 192.168.152.2,192.168.152.254 \
diff -uNr
libvirt-0.9.11.4.orig/tests/networkxml2argvdata/nat-network.argv
libvirt-0.9.11.4/tests/networkxml2argvdata/nat-network.argv
--- libvirt-0.9.11.4.orig/tests/networkxml2argvdata/nat-network.argv
2012-06-15 14:21:54.000000000 -0400
+++ libvirt-0.9.11.4/tests/networkxml2argvdata/nat-network.argv
2012-08-22 12:21:24.481703184 -0400
@@ -1,4 +1,5 @@
-@DNSMASQ@ --strict-order --bind-interfaces --conf-file= \
+@DNSMASQ@ --strict-order --bind-interfaces \
+--local=// --domain-needed --filterwin2k --conf-file= \
--except-interface lo --listen-address 192.168.122.1 \
--listen-address 192.168.123.1 --listen-address 2001:db8:ac10:fe01::1 \
--listen-address 2001:db8:ac10:fd01::1 --listen-address 10.24.10.1 \
diff -uNr
libvirt-0.9.11.4.orig/tests/networkxml2argvdata/nat-network-dns-hosts.argv
libvirt-0.9.11.4/tests/networkxml2argvdata/nat-network-dns-hosts.argv
---
libvirt-0.9.11.4.orig/tests/networkxml2argvdata/nat-network-dns-hosts.argv
2012-06-15 14:21:54.000000000 -0400
+++
libvirt-0.9.11.4/tests/networkxml2argvdata/nat-network-dns-hosts.argv
2012-08-22 12:25:30.378218203 -0400
@@ -1,3 +1,4 @@
@DNSMASQ@ --strict-order --bind-interfaces --domain example.com \
+--local=/example.com/ --domain-needed --filterwin2k \
--conf-file= --except-interface lo --listen-address 192.168.122.1 \
--expand-hosts --addn-hosts=/var/lib/libvirt/dnsmasq/default.addnhosts\
diff -uNr
libvirt-0.9.11.4.orig/tests/networkxml2argvdata/nat-network-dns-srv-record.argv
libvirt-0.9.11.4/tests/networkxml2argvdata/nat-network-dns-srv-record.argv
---
libvirt-0.9.11.4.orig/tests/networkxml2argvdata/nat-network-dns-srv-record.argv
2012-06-15 14:21:54.000000000 -0400
+++
libvirt-0.9.11.4/tests/networkxml2argvdata/nat-network-dns-srv-record.argv
2012-08-22 12:22:35.471268869 -0400
@@ -1,7 +1,7 @@
@DNSMASQ@ \
--strict-order \
--bind-interfaces \
---conf-file= \
+--local=// --domain-needed --filterwin2k --conf-file= \
--except-interface lo \
--srv-host=name.tcp.test-domain-name,.,1024,10,10 \
--listen-address 192.168.122.1 \
diff -uNr
libvirt-0.9.11.4.orig/tests/networkxml2argvdata/nat-network-dns-srv-record-minimal.argv
libvirt-0.9.11.4/tests/networkxml2argvdata/nat-network-dns-srv-record-minimal.argv
---
libvirt-0.9.11.4.orig/tests/networkxml2argvdata/nat-network-dns-srv-record-minimal.argv
2012-06-15 14:21:54.000000000 -0400
+++
libvirt-0.9.11.4/tests/networkxml2argvdata/nat-network-dns-srv-record-minimal.argv
2012-08-22 12:22:48.422191468 -0400
@@ -1,7 +1,7 @@
@DNSMASQ@ \
--strict-order \
--bind-interfaces \
---conf-file= \
+--local=// --domain-needed --filterwin2k --conf-file= \
--except-interface lo \
--srv-host=name.tcp.,,,, \
--listen-address 192.168.122.1 \
diff -uNr
libvirt-0.9.11.4.orig/tests/networkxml2argvdata/nat-network-dns-txt-record.argv
libvirt-0.9.11.4/tests/networkxml2argvdata/nat-network-dns-txt-record.argv
---
libvirt-0.9.11.4.orig/tests/networkxml2argvdata/nat-network-dns-txt-record.argv
2012-06-15 14:21:54.000000000 -0400
+++
libvirt-0.9.11.4/tests/networkxml2argvdata/nat-network-dns-txt-record.argv
2012-08-22 12:23:47.642834970 -0400
@@ -1,4 +1,5 @@
-@DNSMASQ@ --strict-order --bind-interfaces --conf-file= \
+@DNSMASQ@ --strict-order --bind-interfaces \
+--local=// --domain-needed --filterwin2k --conf-file= \
--except-interface lo --txt-record=example,example value \
--listen-address 192.168.122.1 --listen-address 192.168.123.1 \
--listen-address 2001:db8:ac10:fe01::1 \
diff -uNr
libvirt-0.9.11.4.orig/tests/networkxml2argvdata/netboot-network.argv
libvirt-0.9.11.4/tests/networkxml2argvdata/netboot-network.argv
--- libvirt-0.9.11.4.orig/tests/networkxml2argvdata/netboot-network.argv
2012-06-15 14:21:54.000000000 -0400
+++ libvirt-0.9.11.4/tests/networkxml2argvdata/netboot-network.argv
2012-08-22 12:24:31.838569611 -0400
@@ -1,5 +1,6 @@
@DNSMASQ@ --strict-order --bind-interfaces --domain example.com \
---conf-file= --except-interface lo --listen-address 192.168.122.1 \
+--local=/example.com/ --domain-needed --filterwin2k --conf-file= \
+--except-interface lo --listen-address 192.168.122.1 \
--dhcp-range 192.168.122.2,192.168.122.254 \
--dhcp-leasefile=/var/lib/libvirt/dnsmasq/netboot.leases \
--dhcp-lease-max=253 --dhcp-no-override --expand-hosts --enable-tftp \
diff -uNr
libvirt-0.9.11.4.orig/tests/networkxml2argvdata/netboot-proxy-network.argv
libvirt-0.9.11.4/tests/networkxml2argvdata/netboot-proxy-network.argv
---
libvirt-0.9.11.4.orig/tests/networkxml2argvdata/netboot-proxy-network.argv
2012-06-15 14:21:54.000000000 -0400
+++
libvirt-0.9.11.4/tests/networkxml2argvdata/netboot-proxy-network.argv
2012-08-22 12:27:24.586499884 -0400
@@ -1,5 +1,6 @@
@DNSMASQ@ --strict-order --bind-interfaces --domain example.com \
---conf-file= --except-interface lo --listen-address 192.168.122.1 \
+--local=/example.com/ --domain-needed --filterwin2k --conf-file= \
+--except-interface lo --listen-address 192.168.122.1 \
--dhcp-range 192.168.122.2,192.168.122.254 \
--dhcp-leasefile=/var/lib/libvirt/dnsmasq/netboot.leases \
--dhcp-lease-max=253 --dhcp-no-override --expand-hosts \
diff -uNr
libvirt-0.9.11.4.orig/tests/networkxml2argvdata/routed-network.argv
libvirt-0.9.11.4/tests/networkxml2argvdata/routed-network.argv
--- libvirt-0.9.11.4.orig/tests/networkxml2argvdata/routed-network.argv
2012-06-15 14:21:54.000000000 -0400
+++ libvirt-0.9.11.4/tests/networkxml2argvdata/routed-network.argv
2012-08-22 12:28:06.111841912 -0400
@@ -1,2 +1,3 @@
-@DNSMASQ@ --strict-order --bind-interfaces --conf-file= \
+@DNSMASQ@ --strict-order --bind-interfaces \
+--local=// --domain-needed --filterwin2k --conf-file= \
--except-interface lo --listen-address 192.168.122.1\
==========================================
Just in case, I also attached the patch.
Gene
12 years, 2 months
[libvirt] [PATCH 00/45 v3] Atomic APIs to list objects
by Osier Yang
v3 - v4:
* Except a few patches are pushed, it's just rebasing on the top
v2 - v3:
* Various document fixes/improvements (Suggested by Laine and Eric)
* Destroy virdomainlist.[ch], and folder all list helper funcs
into its own *_conf.[ch]
* Improve the helpers to get the object list. See
https://www.redhat.com/archives/libvir-list/2012-July/msg01267.html
* Rebased on top of commit 3df9626 by Peter and the virReportError
series by Daniel.
* Rebased on top of virsh split series. (I'm luck there is no
change on those commands since v2).
Except the already supported APIs for domain and domain snapshot,
this series add the APIs for the left objects, including storage
pool, storage vol, network, interface, node device, nwfilter, and
secret.
* Storage pool:
- Support filtering the returned pool objects by active|inactive,
persistent|transient, autostart|no-autostart, and pool types.
- New options for virsh, --type to accept multiple pool types.
* Storage vol:
- Simply returns all the vol objects of a pool.
* Network:
- Support filtering the results using flags active|inactive,
persistent|transient, autostart|no-autostart
- New options for virsh.
* Interface:
- Support filtering the results using flags active|inactive.
It's still O(n) underlying, as interface driver doesn't manage
the objects itself, but using netcf lib instead. And netcf
APIs don't support returning the struct yet.
* Node Device:
- Support filtering the results using capabilities type of
the devices.
- Extend --cap to accept multiple capability type.
* Network Filter:
- Simply returns all the objects.
* Secret:
- Simply returns all the objects.
Osier Yang (45):
list: Define new API virStorageListAllStoragePools
list: Add helpers for listing storage pool objects
list: Implement the RPC calls for virConnectListAllStoragePools
list: Implement listAllStoragePools for storage driver
list: Implement listAllStoragePools for test driver
list: Add helper to convert strings separated by ', ' to array
virsh: Fix the wrong doc for pool-list
list: Change MATCH for common use in virsh
list: Use virConnectListAllStoragePools in virsh
python: Expose virStorageListAllStoragePools to python binding
list: Define new API virStoragePoolListAllVolumes
list: Implemente RPC calls for virStoragePoolListAllVolumes
list: Implement virStoragePoolListAllVolumes for storage driver
list: Implement virStoragePoolListAllVolumes for test driver
list: Use virStoragePoolListAllVolumes in virsh
list: Expose virStoragePoolListAllVolumes to Python binding
list: Define new API virConnectListAllNetworks
list: Implement RPC calls for virConnectListAllNetworks
list: Add helpers to list network objects
list: Implement listAllNetworks for network driver
list: Implement listAllNetworks for test driver
list: Use virConnectListAllNetworks in virsh
list: Expose virConnectListAllNetworks to Python binding
list: Define new API virConnectListAllInterfaces
list: Implemente RPC calls for virConnectListAllInterfaces
list: Implement listAllInterfaces
list: Use virConnectListAllInterfaces in virsh
list: Expose virConnectListAllInterfaces to Python binding
list: Define new API virConnectListAllNodeDevices
list: Implemente RPC calls for virConnectListAllNodeDevices
list: Add helpers for listing node devices
list: Implement listAllNodeDevices
list: Expose virConnectListAllNodeDevices to Python binding
virsh: Fix a bug of nodedev-list
list: Use virConnectListAllNodeDevices in virsh
list: Define new API virConnectListAllNWFilters
list: Implement RPC calls for virConnectListAllNWFilters
list: Implement listAllNWFilters
list: Use virConnectListAllNWFilters in virsh
list: Expose virConnectListAllNWFilters to Python binding
list: Define new API virConnectListAllSecrets
list: Implement RPC calls for virConnectListAllSecrets
list: Implement listAllSecrets
list: Use virConnectListAllSecrets in virsh
list: Expose virConnectListAllSecrets to Python binding
daemon/remote.c | 382 ++++++++++++++++++++++
include/libvirt/libvirt.h.in | 101 ++++++-
python/generator.py | 11 +-
python/libvirt-override-api.xml | 44 +++-
python/libvirt-override-virConnect.py | 72 +++++
python/libvirt-override-virStoragePool.py | 11 +
python/libvirt-override.c | 337 ++++++++++++++++++++
src/conf/network_conf.c | 91 ++++++
src/conf/network_conf.h | 22 ++
src/conf/node_device_conf.c | 103 ++++++
src/conf/node_device_conf.h | 16 +
src/conf/storage_conf.c | 116 +++++++
src/conf/storage_conf.h | 35 ++
src/driver.h | 35 ++-
src/interface/netcf_driver.c | 135 ++++++++
src/libvirt.c | 487 ++++++++++++++++++++++++++++-
src/libvirt_private.syms | 4 +
src/libvirt_public.syms | 7 +
src/network/bridge_driver.c | 17 +
src/node_device/node_device_driver.c | 15 +
src/node_device/node_device_driver.h | 3 +
src/node_device/node_device_hal.c | 1 +
src/node_device/node_device_udev.c | 1 +
src/nwfilter/nwfilter_driver.c | 56 ++++
src/remote/remote_driver.c | 449 ++++++++++++++++++++++++++
src/remote/remote_protocol.x | 80 +++++-
src/remote_protocol-structs | 85 +++++
src/secret/secret_driver.c | 59 ++++-
src/storage/storage_driver.c | 85 +++++
src/test/test_driver.c | 101 ++++++
tools/virsh-domain-monitor.c | 2 -
tools/virsh-domain.c | 19 +-
tools/virsh-interface.c | 259 +++++++++++-----
tools/virsh-network.c | 351 ++++++++++++++++-----
tools/virsh-nodedev.c | 302 ++++++++++++++++---
tools/virsh-nwfilter.c | 163 ++++++++--
tools/virsh-pool.c | 441 ++++++++++++++++++++------
tools/virsh-secret.c | 182 +++++++++--
tools/virsh-volume.c | 197 +++++++++---
tools/virsh.c | 56 +++-
tools/virsh.pod | 51 +++-
41 files changed, 4521 insertions(+), 463 deletions(-)
create mode 100644 python/libvirt-override-virStoragePool.py
--
1.7.7.3
12 years, 2 months
[libvirt] [PATCH 0/2] Support for Block Device IO Limits
by Viktor Mihajlovski
Depending on the hypervisor (e.g. QEMU) it is possible to override
certain properties of a block device. In Linux these are called
IO limits and can be observed in the guest's sysfs under
/sys/block/<dev>/queue.
This patch set enables libvirt to override the logical and physical
block size for QEMU guests.
I wasn't expecting the 0.10.1 release *that* early, so I have added
the since 0.10.1 in formatdomain.html.in :-) calling for a v2 patch.
Still I wanted to collect review feedback.
Viktor Mihajlovski (2):
conf: Support for Block Device IO Limits
qemu: Support for Block Device IO Limits.
docs/formatdomain.html.in | 18 +++++++
docs/schemas/domaincommon.rng | 17 +++++++
src/conf/domain_conf.c | 49 ++++++++++++++++++++
src/conf/domain_conf.h | 5 ++
src/qemu/qemu_capabilities.c | 11 ++++
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 8 +++
tests/qemuhelptest.c | 12 +++--
.../qemuxml2argv-disk-iolimits.args | 9 ++++
.../qemuxml2argv-disk-iolimits.xml | 33 +++++++++++++
tests/qemuxml2argvtest.c | 3 +
11 files changed, 162 insertions(+), 4 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-iolimits.xml
12 years, 2 months
[libvirt] [libvirt-perl PATCH] Fix several APIs
by Osier Yang
These APIs accept one more argument (flags), which was ignored in
the XS implementations.
---
Virt.xs | 46 ++++++++++++++++++++++++++--------------------
1 files changed, 26 insertions(+), 20 deletions(-)
diff --git a/Virt.xs b/Virt.xs
index 2b8d74c..100ca43 100644
--- a/Virt.xs
+++ b/Virt.xs
@@ -2844,19 +2844,20 @@ set_scheduler_parameters(dom, newparams, flags=0)
HV *
-get_memory_parameters(dom)
+get_memory_parameters(dom, flags=0)
virDomainPtr dom;
+ unsigned int flags;
PREINIT:
virMemoryParameter *params;
int nparams;
CODE:
nparams = 0;
- if (virDomainGetMemoryParameters(dom, NULL, &nparams, 0) < 0)
+ if (virDomainGetMemoryParameters(dom, NULL, &nparams, flags) < 0)
_croak_error();
Newx(params, nparams, virMemoryParameter);
- if (virDomainGetMemoryParameters(dom, params, &nparams, 0) < 0) {
+ if (virDomainGetMemoryParameters(dom, params, &nparams, flags) < 0) {
Safefree(params);
_croak_error();
}
@@ -2868,45 +2869,47 @@ get_memory_parameters(dom)
void
-set_memory_parameters(dom, newparams)
+set_memory_parameters(dom, newparams, flags=0)
virDomainPtr dom;
HV *newparams;
+ unsigned int flags;
PREINIT:
virTypedParameter *params;
int nparams;
PPCODE:
nparams = 0;
- if (virDomainGetMemoryParameters(dom, NULL, &nparams, 0) < 0)
+ if (virDomainGetMemoryParameters(dom, NULL, &nparams, flags) < 0)
_croak_error();
Newx(params, nparams, virMemoryParameter);
- if (virDomainGetMemoryParameters(dom, params, &nparams, 0) < 0) {
+ if (virDomainGetMemoryParameters(dom, params, &nparams, flags) < 0) {
Safefree(params);
_croak_error();
}
vir_typed_param_from_hv(newparams, params, nparams);
- if (virDomainSetMemoryParameters(dom, params, nparams, 0) < 0)
+ if (virDomainSetMemoryParameters(dom, params, nparams, flags) < 0)
_croak_error();
Safefree(params);
HV *
-get_numa_parameters(dom)
+get_numa_parameters(dom, flags)
virDomainPtr dom;
+ unsigned int flags;
PREINIT:
virTypedParameter *params;
int nparams;
CODE:
nparams = 0;
- if (virDomainGetNumaParameters(dom, NULL, &nparams, 0) < 0)
+ if (virDomainGetNumaParameters(dom, NULL, &nparams, flags) < 0)
_croak_error();
Newx(params, nparams, virTypedParameter);
- if (virDomainGetNumaParameters(dom, params, &nparams, 0) < 0) {
+ if (virDomainGetNumaParameters(dom, params, &nparams, flags) < 0) {
Safefree(params);
_croak_error();
}
@@ -2918,45 +2921,47 @@ get_numa_parameters(dom)
void
-set_numa_parameters(dom, newparams)
+set_numa_parameters(dom, newparams, flags=0)
virDomainPtr dom;
HV *newparams;
+ unsigned int flags;
PREINIT:
virTypedParameter *params;
int nparams;
PPCODE:
nparams = 0;
- if (virDomainGetNumaParameters(dom, NULL, &nparams, 0) < 0)
+ if (virDomainGetNumaParameters(dom, NULL, &nparams, flags) < 0)
_croak_error();
Newx(params, nparams, virTypedParameter);
- if (virDomainGetNumaParameters(dom, params, &nparams, 0) < 0) {
+ if (virDomainGetNumaParameters(dom, params, &nparams, flags) < 0) {
Safefree(params);
_croak_error();
}
vir_typed_param_from_hv(newparams, params, nparams);
- if (virDomainSetNumaParameters(dom, params, nparams, 0) < 0)
+ if (virDomainSetNumaParameters(dom, params, nparams, flags) < 0)
_croak_error();
Safefree(params);
HV *
-get_blkio_parameters(dom)
+get_blkio_parameters(dom, flags=0)
virDomainPtr dom;
+ unsigned int flags;
PREINIT:
virTypedParameter *params;
int nparams;
CODE:
nparams = 0;
- if (virDomainGetBlkioParameters(dom, NULL, &nparams, 0) < 0)
+ if (virDomainGetBlkioParameters(dom, NULL, &nparams, flags) < 0)
_croak_error();
Newx(params, nparams, virBlkioParameter);
- if (virDomainGetBlkioParameters(dom, params, &nparams, 0) < 0) {
+ if (virDomainGetBlkioParameters(dom, params, &nparams, flags) < 0) {
Safefree(params);
_croak_error();
}
@@ -2968,21 +2973,22 @@ get_blkio_parameters(dom)
void
-set_blkio_parameters(dom, newparams)
+set_blkio_parameters(dom, newparams, flags=0)
virDomainPtr dom;
HV *newparams;
+ unsigned int flags;
PREINIT:
virTypedParameter *params;
int nparams;
int needString;
PPCODE:
nparams = 0;
- if (virDomainGetBlkioParameters(dom, NULL, &nparams, 0) < 0)
+ if (virDomainGetBlkioParameters(dom, NULL, &nparams, flags) < 0)
_croak_error();
Newx(params, nparams, virBlkioParameter);
- if (virDomainGetBlkioParameters(dom, params, &nparams, 0) < 0) {
+ if (virDomainGetBlkioParameters(dom, params, &nparams, flags) < 0) {
Safefree(params);
_croak_error();
}
--
1.7.7.3
12 years, 2 months
[libvirt] [libvirt-tck PATCH] New test to test numa parameters tuning APIs
by Osier Yang
To make sure the domain config is not broken after the API calls.
---
This depends on https://www.redhat.com/archives/libvir-list/2012-August/msg01792.html
---
scripts/domain/202-numa-set-parameters.t | 99 ++++++++++++++++++++++++++++++
1 files changed, 99 insertions(+), 0 deletions(-)
create mode 100644 scripts/domain/202-numa-set-parameters.t
diff --git a/scripts/domain/202-numa-set-parameters.t b/scripts/domain/202-numa-set-parameters.t
new file mode 100644
index 0000000..fd96866
--- /dev/null
+++ b/scripts/domain/202-numa-set-parameters.t
@@ -0,0 +1,99 @@
+# -*- perl -*-
+#
+# Copyright (C) 2009-2012 Red Hat, Inc.
+# Copyright (C) 2012 Osier Yang
+#
+# This program is free software; You can redistribute it and/or modify
+# it under the GNU General Public License as published by the Free
+# Software Foundation; either version 2, or (at your option) any
+# later version
+#
+# The file "LICENSE" distributed along with this file provides full
+# details of the terms and conditions
+#
+
+=pod
+
+=head1 NAME
+
+domain/212-set-numa-parameters.t - Set NUMA parameters
+
+=head1 DESCRIPTION
+
+The test case validates the internal data structure is consistent
+after the API call to set NUMA parameters for a domain.
+
+=cut
+
+use strict;
+use warnings;
+
+use Test::More tests => 10;
+
+use Sys::Virt::TCK;
+use Test::Exception;
+
+my $tck = Sys::Virt::TCK->new();
+my $conn = eval { $tck->setup(); };
+BAIL_OUT "failed to setup test harness: $@" if $@;
+END {
+ $tck->cleanup if $tck;
+ unlink "tck.img" if -f "tck.img";
+}
+
+
+my $xml = $tck->generic_domain("tck")->as_xml;
+
+diag "Creating a new persistent domain";
+my $dom;
+ok_domain(sub { $dom = $conn->define_domain($xml) }, "created persistent domain object");
+
+diag "Starting inactive domain";
+$dom->create;
+ok($dom->get_id > 0, "running domain with ID > 0");
+
+# NUMA mode can't be changed for a live domain
+my %params = (
+ Sys::Virt::Domain::NUMA_NODESET => '0',
+);
+
+diag "Set numa parameters, affects live config";
+lives_ok(sub {$dom->set_numa_parameters(\%params, Sys::Virt::Domain::AFFECT_LIVE)}, "set_numa_parameters");
+
+diag "Destroy the domain";
+$dom->destroy;
+
+diag "Make sure the domain can be started after setting numa parameters";
+$dom->create;
+ok($dom->get_id > 0, "running domain with ID > 0");
+
+diag "Get numa parameters";
+my $params = $dom->get_numa_parameters(Sys::Virt::Domain::AFFECT_LIVE);
+ok($params->{Sys::Virt::Domain::NUMA_NODESET} eq '0', 'Check nodeset');
+
+diag "Destroy the domain";
+$dom->destroy;
+
+$params{Sys::Virt::Domain::NUMA_MODE} = Sys::Virt::Domain::NUMATUNE_MEM_STRICT;
+
+diag "Set numa parameters, affects next boot";
+lives_ok(sub {$dom->set_numa_parameters(\%params, Sys::Virt::Domain::AFFECT_CONFIG)}, "set_numa_parameters");
+
+diag "Get numa parameters";
+my $params = $dom->get_numa_parameters(Sys::Virt::Domain::AFFECT_LIVE);
+ok($params->{Sys::Virt::Domain::NUMA_MODE} == Sys::Virt::Domain::NUMATUNE_MEM_STRICT, 'Check mode');
+ok($params->{Sys::Virt::Domain::NUMA_NODESET} eq '0', 'Check nodeset');
+
+diag "Make sure the domain can be started after setting numa parameters";
+$dom->create;
+ok($dom->get_id > 0, "running domain with ID > 0");
+
+diag "Destroying the persistent domain";
+$dom->destroy;
+$dom->undefine;
+
+diag "Checking that transient domain has gone away";
+ok_error(sub { $conn->get_domain_by_name("tck") }, "NO_DOMAIN error raised from missing domain",
+ Sys::Virt::Error::ERR_NO_DOMAIN);
+
+# end
--
1.7.7.3
12 years, 2 months
[libvirt] [PATCH 0/4] Support to set disk wwn
by Osier Yang
This introduces new element <wwn> for disk, to allow to set wwn
(just like setting serial number) for the virtual disk (Only QEMU
devices like ide-drive, ide-hd, ide-cd, scsi-disk, scsi-hd, and
scsi-cd support it).
Osier Yang (4):
schema: Add schema for disk <wwn>
conf: Parse and format disk <wwn>
qemu: Add caps to indentify if setting wwn is supported by qemu
qemu: Use disk wwn in qemu command line
docs/formatdomain.html.in | 5 +++
docs/schemas/basictypes.rng | 6 +++
docs/schemas/domaincommon.rng | 5 +++
docs/schemas/nodedev.rng | 6 ---
src/conf/domain_conf.c | 8 ++++
src/conf/domain_conf.h | 1 +
src/qemu/qemu_capabilities.c | 4 ++
src/qemu/qemu_capabilities.h | 2 +
src/qemu/qemu_command.c | 35 ++++++++++++++++++++
.../qemuxml2argv-disk-ide-wwn.args | 6 +++
.../qemuxml2argvdata/qemuxml2argv-disk-ide-wwn.xml | 28 ++++++++++++++++
.../qemuxml2argv-disk-scsi-disk-wwn.args | 10 ++++++
.../qemuxml2argv-disk-scsi-disk-wwn.xml | 35 ++++++++++++++++++++
tests/qemuxml2argvtest.c | 7 ++++
14 files changed, 152 insertions(+), 6 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-ide-wwn.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-ide-wwn.xml
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-disk-wwn.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-disk-scsi-disk-wwn.xml
--
1.7.7.3
12 years, 2 months
[libvirt] [PATCH] pci: Read bridge control register from the bridge
by Osier Yang
Though I don't quite understand it well enough, but it looks
wrong to read the control register from the device, and then
write to its parent twice, while doing the secondary bus reset.
---
src/util/pci.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/util/pci.c b/src/util/pci.c
index 0742d07..c3f1b2b 100644
--- a/src/util/pci.c
+++ b/src/util/pci.c
@@ -642,7 +642,7 @@ pciTrySecondaryBusReset(pciDevice *dev,
/* Read the control register, set the reset flag, wait 200ms,
* unset the reset flag and wait 200ms.
*/
- ctl = pciRead16(dev, PCI_BRIDGE_CONTROL);
+ ctl = pciRead16(parent, PCI_BRIDGE_CONTROL);
pciWrite16(parent, PCI_BRIDGE_CONTROL, ctl | PCI_BRIDGE_CTL_RESET);
--
1.7.7.3
12 years, 2 months
[libvirt] Heads up 0.10.1 release on Friday
by Daniel Veillard
I was a bit afraid of the .0 effect on release name, but we really
have a number of problem with 0.10.0 that ought to be fixed in a
"brown paper bag" release. I would urge people to report and try to
fix the problem being raised in 0.10.0, let's try to get them fixed
today or tomorrow and I will cut a new release on Friday,
Sorry about that, but somehow we didn't managed to catch even serious
problem during the freeze, at some point we need to fix the problem of
testing the code that we push on git on a daily basis, we have many
tools but we lack at doing the continuous testing :-\
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/
12 years, 2 months