[libvirt] [PATCH v4 0/9] Introduce display of IOThreads Information
by John Ferlan
v3:
http://www.redhat.com/archives/libvir-list/2015-February/msg00593.html
Changes since v3: (from code reviews)
- Updated to use 1.2.14 not 1.2.13
- Change struct from virDomainIOThreadsInfo to virDomainIOThreadInfo
- Remove the resources and nresources from virDomainIOThreadInfo
and of course all associated code as well as changing the remote
struct from iothreads_* to iothread_
- Create separate routines for virDomainGetIOThreadsInfo,
virDomainGetIOThreadPin, and virDomainPinIOThread... and of course
all the accompanying code
- Use EnterMonitor instead of EnterMonitorAsync
Still need to generate a v3 of the python code, but I'll wait for this
to be reviewed first.
John Ferlan (9):
Implement public API for virDomainGetIOThreadsInfo
remote: Implement the remote plumbing for virDomainGetIOThreadsInfo
qemu: Implement the qemu driver fetch for IOThreads
virsh: Add 'iothreadsinfo' command
Implement public API for getting/setting specific IOThread pinning
remote: Plumbing for getting/setting specific IOThread pinning
domain: Introduce virDomainIOThreadsPin{Add|Del}
qemu: Add support to get/set specific IOThread pinning data
virsh: Add iothreadpin command
daemon/remote.c | 123 ++++++++-
include/libvirt/libvirt-domain.h | 41 ++-
src/conf/domain_conf.c | 64 +++++
src/conf/domain_conf.h | 10 +
src/driver-hypervisor.h | 24 +-
src/libvirt-domain.c | 227 ++++++++++++++++-
src/libvirt_private.syms | 2 +
src/libvirt_public.syms | 8 +
src/qemu/qemu_driver.c | 526 +++++++++++++++++++++++++++++++++++++++
src/remote/remote_driver.c | 143 ++++++++++-
src/remote/remote_protocol.x | 61 ++++-
src/remote_protocol-structs | 43 ++++
src/rpc/gendispatch.pl | 2 +
tools/virsh-domain.c | 216 ++++++++++++++++
tools/virsh.pod | 38 +++
15 files changed, 1521 insertions(+), 7 deletions(-)
--
2.1.0
9 years, 8 months
[libvirt] ANNOUNCE: Libvirt Designer version 0.0.2 released
by Daniel P. Berrange
I'm pleased to announce the second release of the libvirt designer
library, version 0.0.2
ftp://ftp.libvirt.org/libvirt/designer/libvirt-designer-0.0.2.tar.gz
The release is signed
ftp://ftp.libvirt.org/libvirt/designer/libvirt-designer-0.0.2.tar.gz.asc
with the GPG key having the fingerprint
DAF3 A6FD B26B 6291 2D0E 8E3F BE86 EBB4 1510 4FDF (4096R)
In this release:
- Bumped soname & version for ABI change
- Remove use of deprecated libosinfo calls
- Fix various memory leaks
- Treat errors loading the libosinfo DB as non-fatal
as some data may be successfully loaded
- Improve building of libosinfo short-id from libvirt
capabilities information
- Expose the libosinfo DB object via a property on the
domain object
- Don't set PKG_CONFIG_PATH for g-ir-scanner
- Auto-generate list of AUTHORS
- Avoid redefining _FORTIFY_SOURCE macro
- Fix & add gtk-doc introspection annotation
- Add Vala APi binding
- Add support for floppy & CDROM devices
- Use libvirt style libtool versioning csheme
- Add API to set list of installed drivers
- Add API for querying supported devices
- Remove many bogus assumptions in disk bus handling
- Populate clock settings, input devices & console
- Add API for enabling sound devices
- Add AP ifor enabling choice of graphics backends
- Add SPICE agent if using SPICE
- Add API for enabling USB redirection
- Add API for enabling smartcard devices
- Add API for enabling video devices
- Import latest compiler warnings from gnulib
- Avoid using deprecated libvirt-gconfig APIs
- Rename virtxml binary to virt-designer
- Add API for choosing network backend type
- Add further test cases for validing domain builder
- Always build test programs
The libvirt-designer library builds on top of the libvirt-gconfig and
libosinfo libraries, to provide an API that assists applications in
building guest domain configurations based on libosinfo policy. The
intention is that it be usable from applications such as virt-manager
and GNOME boxes which currently duplicate this kind of policy based
configuration logic between them. It is still at an early experimental
stage of development so it is liable to have further ABI incompatible
changes in future releases, which will require recompiling applications
and possibly source level changes too.
Thanks to all the people who contributed towards this new release.
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
9 years, 8 months
[libvirt] [PATCH v2 0/3] unify memtune value representation in libvirt
by Pavel Hrdina
The first patch rewrites virsh memtune command to accept 0 as valid value
instead of ignoring it.
In the second patch I'll introduce a simple helper to crop the *_limit values
to VIR_DOMAIN_MEMORY_PARAM_UNLIMITED as its used several times while reading
values from cgroups and also a helper to check whether the memory limits are
set or not.
The last patch actually changes the internal representation of unlimited memtune
settings. More detailed description is in commit message. My motivation to
change it completely is to prevent future bugs with those limits.
Pavel Hrdina (3):
virsh: fix memtune to also accept 0 as valid value
virutil: introduce helper functions for memory limits
memtune: change the way how we store unlimited value
docs/formatdomain.html.in | 4 +-
src/conf/domain_conf.c | 75 +++++++++++++++----
src/libvirt-domain.c | 3 +
src/libvirt_private.syms | 3 +-
src/lxc/lxc_cgroup.c | 18 ++---
src/lxc/lxc_driver.c | 7 +-
src/lxc/lxc_fuse.c | 12 ++--
src/lxc/lxc_native.c | 6 +-
src/openvz/openvz_conf.c | 4 +-
src/openvz/openvz_driver.c | 4 +-
src/qemu/qemu_cgroup.c | 24 +++----
src/qemu/qemu_command.c | 8 ++-
src/qemu/qemu_driver.c | 10 +--
src/qemu/qemu_hotplug.c | 2 +-
src/qemu/qemu_migration.c | 5 +-
src/util/virutil.c | 47 ++++++------
src/util/virutil.h | 5 +-
tests/qemuxml2argvdata/qemuxml2argv-memtune.xml | 2 +-
.../qemuxml2xmloutdata/qemuxml2xmlout-memtune.xml | 2 +-
tools/virsh-domain.c | 83 ++++++++++------------
20 files changed, 185 insertions(+), 139 deletions(-)
--
2.0.5
9 years, 8 months
[libvirt] [PATCH v2 1/3] utils: Implement virCommandPassFDGetFDIndex
by Stefan Berger
Implement virCommandPassFDGetFDIndex to determine the index a given
file descriptor will have when passed to the child process.
Signed-off-by: Stefan Berger <stefanb(a)linux.vnet.ibm.com>
---
src/libvirt_private.syms | 1 +
src/util/vircommand.c | 24 ++++++++++++++++++++++++
src/util/vircommand.h | 3 +++
3 files changed, 28 insertions(+)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 6028002..96cfbf2 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1214,6 +1214,7 @@ virCommandNewArgList;
virCommandNewArgs;
virCommandNonblockingFDs;
virCommandPassFD;
+virCommandPassFDGetFDIndex;
virCommandPassListenFDs;
virCommandRawStatus;
virCommandRequireHandshake;
diff --git a/src/util/vircommand.c b/src/util/vircommand.c
index 6527d85..648f5ed 100644
--- a/src/util/vircommand.c
+++ b/src/util/vircommand.c
@@ -1019,6 +1019,30 @@ virCommandPassListenFDs(virCommandPtr cmd)
cmd->flags |= VIR_EXEC_LISTEN_FDS;
}
+/*
+ * virCommandPassFDGetFDIndex:
+ * @cmd: pointer to virCommand
+ * @fd: FD to get index of
+ *
+ * Determine the index of the FD in the transfer set.
+ *
+ * Returns index >= 0 if @set contains @fd,
+ * -1 otherwise.
+ */
+int
+virCommandPassFDGetFDIndex(virCommandPtr cmd, int fd)
+{
+ size_t i = 0;
+
+ while (i < cmd->npassfd) {
+ if (cmd->passfd[i].fd == fd)
+ return i;
+ i++;
+ }
+
+ return -1;
+}
+
/**
* virCommandSetPidFile:
* @cmd: the command to modify
diff --git a/src/util/vircommand.h b/src/util/vircommand.h
index bf65de4..198da2f 100644
--- a/src/util/vircommand.h
+++ b/src/util/vircommand.h
@@ -62,6 +62,9 @@ void virCommandPassFD(virCommandPtr cmd,
void virCommandPassListenFDs(virCommandPtr cmd);
+int virCommandPassFDGetFDIndex(virCommandPtr cmd,
+ int fd);
+
void virCommandSetPidFile(virCommandPtr cmd,
const char *pidfile) ATTRIBUTE_NONNULL(2);
--
1.9.3
9 years, 8 months
[libvirt] [PATCH] Document the effect of empty string as a rom file
by Ján Tomko
This can be used to disable the ROM.
---
docs/formatdomain.html.in | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 6276a61..050476f 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -4265,7 +4265,8 @@ qemu-kvm -net nic,model=? /dev/null
The optional <code>file</code> attribute is used to point to a
binary file to be presented to the guest as the device's ROM
BIOS. This can be useful to provide an alternative boot ROM for a
- network device.
+ network device. If the file attribute is present, but empty,
+ no ROM file will be loaded.
<span class="since">Since 0.9.10 (QEMU and KVM only)</span>.
</p>
<h5><a name="elementDomain">Setting up a network backend in a driver domain</a></h5>
--
2.0.5
9 years, 8 months
[libvirt] [PATCH v8 0/4] Introduce API to query IP addresses for given domain
by Nehal J Wani
This feature has been requested for a very long time. Since qemu guest
agent and leaseshelper give us reliable results, now the wait is over.
The RFC was first proposed by Michal Privoznik:
http://www.redhat.com/archives/libvir-list/2012-February/msg00437.html
A patch was submitted, using structs:
https://www.redhat.com/archives/libvir-list/2012-June/msg00220.html
Another patch was submitted, using XML:
https://www.redhat.com/archives/libvir-list/2012-June/msg00904.html
Neither of the patches were accepted, probably due to lack of extensibility
and usability. Hence, we thought of using virTypedParameters for reporting
list of interfaces along with their MAC address and IP addresses. The RFC
can be found here:
https://www.redhat.com/archives/libvir-list/2013-July/msg00084.html
The idea of extensibility was rejected and rendered out of scope of
libvirt. Hence, we were back to structs.
This API is called virDomainInterfaceAddresses which returns a dynamically
allocated array of virDomainInterface struct. The great disadvantage is
once this gets released, it's written in stone and we cannot change
or add an item into it.
The virsh CLI supports two methods:
* Return information (list of all associated interfaces with MAC address
and IP addresses) of all of the domain interfaces by default (if
no interface name is provided)
* Return information for the specified interface (if an interface name
is provided)
v8:
* qemuDomainInterfaceAddresses: redo logic related to flags
* Make sure that NIC(s) on guest is/are using libvirt virtual network
before querying leaseshelper
* domifaddr: change --network option from VSH_OT_DATA to VSH_OT_STRING
v7:
* Enable support for DHCP lease file parsing method
* http://www.redhat.com/archives/libvir-list/2014-December/msg00866.html
v6:
* Inclusion of flags, readonly check for guest agent connection
* Correction of memory leaks, other small nits.
* https://www.redhat.com/archives/libvir-list/2013-September/msg00350.html
v5:
* s/virDomainInterfacesAddresses/virDomainInterfaceAddresses.
* Case for IP aliasing handled using virHashTable.
* New test cases added, involving multiple and 0 IP addresse(s)
per interface.
* IP prefix changed from int to unsigned int.
* Changes to practice libvirt habits.
* https://www.redhat.com/archives/libvir-list/2013-September/msg00003.html
v4:
* Various style nits, indentation errors, memory leaks fixed.
* https://www.redhat.com/archives/libvir-list/2013-August/msg01265.html
v3:
* Upper bounds to number of interfaces and addresses per interface
introduced.
* Change from array of structs to array of pointers
* ifaces_count moved from function argument to return value
* Changes in variable names
* Test cases added for qemuAgentGetInterfaces.
* https://www.redhat.com/archives/libvir-list/2013-August/msg01215.html
v2:
* Logical errors, memory leaks and few other errors fixed.
* https://www.redhat.com/archives/libvir-list/2013-August/msg00631.html
v1:
* http://www.redhat.com/archives/libvir-list/2013-July/msg01553.html
Nehal J Wani (4):
domifaddr: Implement the public APIs
domifaddr: Implement the remote protocol
domifaddr: Implement the API for qemu
domifaddr: Add virsh support
daemon/remote.c | 134 ++++++++++++++++++++++++++
include/libvirt/libvirt-domain.h | 27 ++++++
src/driver-hypervisor.h | 5 +
src/libvirt-domain.c | 129 +++++++++++++++++++++++++
src/libvirt_public.syms | 6 ++
src/qemu/qemu_agent.c | 202 +++++++++++++++++++++++++++++++++++++++
src/qemu/qemu_agent.h | 4 +
src/qemu/qemu_driver.c | 173 +++++++++++++++++++++++++++++++++
src/remote/remote_driver.c | 100 +++++++++++++++++++
src/remote/remote_protocol.x | 36 ++++++-
src/remote_protocol-structs | 24 +++++
tests/qemuagenttest.c | 188 ++++++++++++++++++++++++++++++++++++
tools/virsh-domain-monitor.c | 141 +++++++++++++++++++++++++++
tools/virsh.pod | 16 ++++
14 files changed, 1184 insertions(+), 1 deletion(-)
--
2.1.0
9 years, 8 months
[libvirt] [libvirt-tck][PATCH] Add new api get_all_domain_stats testing
by Zhe Peng
$vmm->get_all_domain_stats
Sys::Virt::GET_ALL_STATS_ACTIVE
Sys::Virt::GET_ALL_STATS_INACTIVE
Sys::Virt::GET_ALL_STATS_OTHER
Sys::Virt::GET_ALL_STATS_PAUSED
Sys::Virt::GET_ALL_STATS_PERSISTENT
Sys::Virt::GET_ALL_STATS_RUNNING
Sys::Virt::GET_ALL_STATS_SHUTOFF
Sys::Virt::GET_ALL_STATS_TRANSIENT
Sys::Virt::GET_ALL_STATS_ENFORCE_STATS
Signed-off-by: Zhe Peng <zpeng(a)redhat.com>
---
scripts/domain/800-get-all-stats.t | 137 +++++++++++++++++++++++++++++++++++++
1 file changed, 137 insertions(+)
create mode 100644 scripts/domain/800-get-all-stats.t
diff --git a/scripts/domain/800-get-all-stats.t b/scripts/domain/800-get-all-stats.t
new file mode 100644
index 0000000..4ff4bf3
--- /dev/null
+++ b/scripts/domain/800-get-all-stats.t
@@ -0,0 +1,137 @@
+# -*- perl -*-
+#
+# Copyright (C) 2014 Red Hat, Inc.
+# Copyright (C) 2014 Zhe Peng
+#
+# 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/800-get-all-stats.t
+
+=head1 DESCRIPTION
+
+The test case validates that:
+$vmm->get_all_domain_stats
+Sys::Virt::GET_ALL_STATS_ACTIVE
+Sys::Virt::GET_ALL_STATS_INACTIVE
+Sys::Virt::GET_ALL_STATS_OTHER
+Sys::Virt::GET_ALL_STATS_PAUSED
+Sys::Virt::GET_ALL_STATS_PERSISTENT
+Sys::Virt::GET_ALL_STATS_RUNNING
+Sys::Virt::GET_ALL_STATS_SHUTOFF
+Sys::Virt::GET_ALL_STATS_TRANSIENT
+Sys::Virt::GET_ALL_STATS_ENFORCE_STATS
+
+=cut
+
+use strict;
+use warnings;
+
+use Test::More tests => 11;
+
+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;
+}
+
+my @doms = ("tck1", "tck2", "tck3", "tck4");
+
+#create two persistent domain, tck1 and tck2
+
+my $xml = $tck->generic_domain(name => "tck1")->as_xml;
+
+diag "Defining an inactive domain config";
+
+my $dom1;
+
+ok_domain(sub { $dom1 = $conn->define_domain($xml) }, "defined persistent domain config");
+
+my $xml2 = $tck->generic_domain(name => "tck2")->as_xml;
+
+diag "Defining an inactive domain config";
+
+my $dom2;
+
+ok_domain(sub { $dom2 = $conn->define_domain($xml2) }, "defined persistent domain config");
+
+my $stats_persistent = Sys::Virt::Domain::GET_ALL_STATS_PERSISTENT|Sys::Virt::Domain::GET_ALL_STATS_INACTIVE;
+my @dom_persistent = $conn->get_all_domain_stats(Sys::Virt::Domain::STATS_STATE, undef, $stats_persistent);
+
+is($#dom_persistent+1, 2, "list all persistent domain");
+
+#create two transient domain, tck3 and tck4
+
+my $xml3 = $tck->generic_domain(name => "tck3")->as_xml;
+
+diag "Creating a new transient domain";
+my $dom3;
+ok_domain(sub { $dom3 = $conn->create_domain($xml3) }, "created transient domain object");
+
+my $xml4 = $tck->generic_domain(name => "tck4")->as_xml;
+
+diag "Creating a new transient domain";
+my $dom4;
+ok_domain(sub { $dom4 = $conn->create_domain($xml4) }, "created transient domain object");
+
+my $stats_transient = Sys::Virt::Domain::GET_ALL_STATS_TRANSIENT|Sys::Virt::Domain::GET_ALL_STATS_RUNNING;
+
+my @dom_transient = $conn->get_all_domain_stats(Sys::Virt::Domain::STATS_STATE, undef, $stats_transient);
+
+is($#dom_transient+1, 2, "list all transient domain");
+
+#start & pause persistent domain 2 and one transient dom
+$dom2->create();
+$dom2->suspend();
+$dom3->suspend();
+
+my $stats_pause = Sys::Virt::Domain::GET_ALL_STATS_PAUSED;
+
+my @dom_pause = $conn->get_all_domain_stats(Sys::Virt::Domain::STATS_STATE, undef, $stats_pause);
+
+is($#dom_pause+1, 2, "list all pause domain");
+
+#resume dom2 and dom3
+$dom2->resume();
+$dom3->resume();
+
+my $stats_active = Sys::Virt::Domain::GET_ALL_STATS_ACTIVE;
+
+my@dom_active = $conn->get_all_domain_stats(Sys::Virt::Domain::STATS_STATE, undef, $stats_active);
+
+is($#dom_active+1, 3, "list all active domain");
+
+my $stats_shutoff = Sys::Virt::Domain::GET_ALL_STATS_SHUTOFF;
+
+my @dom_shutoff = $conn->get_all_domain_stats(Sys::Virt::Domain::STATS_STATE, undef, $stats_shutoff);
+
+is($#dom_shutoff+1, 1, "list all shutoff domain");
+
+my $stats_other = Sys::Virt::Domain::GET_ALL_STATS_OTHER;
+
+my @dom_other = $conn->get_all_domain_stats(Sys::Virt::Domain::STATS_STATE, undef, $stats_other);
+
+is($#dom_other+1, 0, "list all other domain");
+
+my $stats_enforce = Sys::Virt::Domain::GET_ALL_STATS_ENFORCE_STATS;
+
+my @dom_enforce = $conn->get_all_domain_stats(Sys::Virt::Domain::STATS_STATE, undef, $stats_enforce);
+
+is($#dom_enforce+1, 4, "list all enforce domain");
+
+
+
--
1.9.0
9 years, 8 months
[libvirt] [libvirt-tck][PATCH] This testcase tests if the open_graphics_fd function works properly.
by Zhe Peng
Signed-off-by: Hao Liu <hliu(a)redhat.com>
---
scripts/domain/275-open-graphics-fd.t | 76 +++++++++++++++++++++++++++++++++++
1 file changed, 76 insertions(+)
create mode 100644 scripts/domain/275-open-graphics-fd.t
diff --git a/scripts/domain/275-open-graphics-fd.t b/scripts/domain/275-open-graphics-fd.t
new file mode 100644
index 0000000..9377f50
--- /dev/null
+++ b/scripts/domain/275-open-graphics-fd.t
@@ -0,0 +1,76 @@
+# -*- perl -*-
+#
+# Copyright (C) 2012-2014 Red Hat, Inc.
+# Copyright (C) 2014 Hao Liu <hliu(a)redhat.com>
+#
+# 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/275-open-graphics-fd.t - Test open_graphics_fd function
+
+=head1 DESCRIPTION
+
+The test case validates that open_graphics_fd function works well
+
+=cut
+
+use strict;
+use warnings;
+
+use Test::More tests => 9;
+
+use Sys::Virt::TCK;
+use Test::Exception;
+use IO::Handle;
+
+my $tck = Sys::Virt::TCK->new();
+my $conn = eval { $tck->setup(); };
+BAIL_OUT "failed to setup test harness: $@" if $@;
+END {
+ $tck->cleanup if $tck;
+}
+
+
+# looking up domain
+my $dom_name ="tck";
+my $xml = $tck->generic_domain(name => $dom_name)->as_xml;
+diag "domain xml is $xml";
+my $dom = $conn->define_domain($xml);
+$dom->create;
+ok($dom->get_id() > 0, "running domain has an ID > 0");
+my $graphics_cnt = xpath($dom, "count(/domain/devices/graphics)")->value();
+my $valid_idx = $graphics_cnt - 1;
+my $invalid_idx = $graphics_cnt;
+
+my $fd = 0;
+my $fh = IO::Handle->new();
+
+diag "open fd for valid graphics device";
+lives_ok(sub {$fd = $dom->open_graphics_fd($valid_idx, 0)}, "open graphics fd");
+ok($fd > 0, "graphic fd is $fd");
+$fh->fdopen($fd, "r");
+ok($fh->opened, "fd is accessible");
+$fh->close();
+
+diag "open fd for valid graphics device skip auth";
+$fd = 0;
+lives_ok(sub {$fd = $dom->open_graphics_fd($valid_idx, Sys::Virt::Domain::OPEN_GRAPHICS_SKIPAUTH)}, "open graphics fd");
+ok($fd > 0, "graphic fd is $fd");
+$fh->fdopen($fd, "r");
+ok($fh->opened, "fd is accessible");
+$fh->close();
+
+diag "open fd for non-exist graphics device";
+$fd = 0;
+ok_error(sub {$fd = $dom->open_graphics_fd($invalid_idx, 0)}, "open graphics fd");
+ok($fd eq 0, "graphic fd is not returned");
--
1.9.0
9 years, 8 months
[libvirt] direct device assignment
by Raymond Durand
I read this in the context of direct device assignment: "All of the guest's
memory must kept permanently in memory. This is because the guest may
program the device with any address in its address space and the hypervisor
has no way of handling a DMA page fault"
is it still true?
Thanks,
Regards,
9 years, 8 months