[libvirt] [PATCH 0/5] fix query-command-line-options
by Amos Kong
This patchset fixed some issues of query-command-line-options:
* some new options haven't arguments can't be queried. (eg: -enable-fips)
* some legcy options have arguments can't be queried. (eg: -vnc display)
More discussion:
http://marc.info/?l=qemu-devel&m=139081830416684&w=2
Amos Kong (5):
qmp: rename query_option_descs() to get_param_infolist()
introduce two marcos to dump the options info
query-command-line-options: query all the options in qemu-options.hx
introduce QEMU_OPTIONS_GENERATE_HELPMSG
query-command-line-options: return help message for legacy options
qapi-schema.json | 5 ++++-
qemu-options-wrapper.h | 27 +++++++++++++++++++++++++++
util/qemu-config.c | 50 +++++++++++++++++++++++++++++++++++++++++---------
3 files changed, 72 insertions(+), 10 deletions(-)
--
1.8.4.2
10 years, 9 months
[libvirt] [PATCH v6 0/6] Support keyboard device
by Li Zhang
From: Li Zhang <zhlcindy(a)linux.vnet.ibm.com>
This patchset is to add keyboard input device.
For PPC64, it doesn't support a default keyboard device when the graphic
is enabled. Libvirt supports QEMU command line as "-device VGA" which
won't create any keyboard device for it. So it requires libvirt to add
a default USB keyboard device for it.
This patchset is to add keyboard input device and a default USB keyboard
for PPC64.
The related discussion in QEMU community:
http://lists.nongnu.org/archive/html/qemu-devel/2013-11/msg01734.html
Li Zhang (6):
conf: Add a keyboard input device type
conf: Add one interface to add default input devices
conf: Remove the implicit PS2 mouse for non-X86 platforms and
add an implicit PS2 keyboard device for X86 platforms.
qemu_cap: Add USB keyboard capability
qemu: parse qemu command line for USB keyboard
Add a default USB keyboard and USB mouse for PPC64
v6 -> v5:
* Change kbd to keyboard, and correct -usbdevice parameter.
* Remove implicit PS/2 keyboard output in XML in case
older libvirtd can read it. (Jan Tomko)
* Remove implicit keyboard for XEN to make it safer.
v5 -> v4:
* Add PS/2 KBD definition in XML file. (Daniel.P.Berrange)
* Allow PS/2 KBD devices and set KBD default bus as PS2 for X86,
USB for non-x86. (Daniel.P.Berrange)
* Add an implicit PS/2 KBD as PS/2 mouse. (Danniel.P.Berrange)
v4 -> v3:
* Don't remove PS2 mouse device for other virtualization drivers (Jan Tomko).
v3 -> v2:
* Handle the KBD device type in xen and QEMU driver. (Daniel.P.Berrange)
* Remove PS2 mouse device for non-X86 platforms.
* Move virDomainDefMaybeAddInput to a new patch. (Jan Tomko)
* Replace VIR_REALLOC_N with VIR_APPEND_ELEMENT. (Jan Tomoko)
* Fix several typos. (Jan Tomoko)
* Add a virReportError when QEMU_CAPS_DEVICE_USB_KBD can't be gotten. (Jan Tomoko)
v2 -> v1:
* change ifs to switch clause.
* reconstruct the patches
docs/schemas/domaincommon.rng | 1 +
src/conf/domain_conf.c | 115 ++++++++++++++-------
src/conf/domain_conf.h | 5 +
src/libvirt_private.syms | 1 +
src/qemu/qemu_capabilities.c | 3 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 41 ++++++--
src/qemu/qemu_domain.c | 23 ++++-
src/util/virarch.h | 2 +
src/xenxs/xen_sxpr.c | 27 +++--
src/xenxs/xen_xm.c | 30 ++++--
tests/qemucapabilitiesdata/caps_1.2.2-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.3.1-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.4.2-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.5.3-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.6.0-1.caps | 1 +
tests/qemucapabilitiesdata/caps_1.6.50-1.caps | 1 +
tests/qemuhelptest.c | 8 ++
.../qemuxml2argvdata/qemuxml2argv-pseries-disk.xml | 3 +-
.../qemuxml2argv-pseries-usb-kbd.args | 9 ++
.../qemuxml2argv-pseries-usb-kbd.xml | 19 ++++
tests/qemuxml2argvtest.c | 3 +
22 files changed, 229 insertions(+), 68 deletions(-)
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-pseries-usb-kbd.xml
--
1.8.2.1
10 years, 9 months
[libvirt] ANNOUNCE: virt-manager 1.0.0 released
by Cole Robinson
I'm happy to announce the release of virt-manager 1.0.0!
Our version numbers were starting to get awkward, and this release was
suitably featureful, so it felt like time to bump the major version. (And it's
trendy these days, right?).
virt-manager is a desktop application for managing KVM, Xen, and LXC
virtualization via libvirt.
The release can be downloaded from:
http://virt-manager.org/download.html
The direct download links are:
http://virt-manager.org/download/sources/virt-manager/virt-manager-1.0.0....
This release includes:
- virt-manager: Snapshot support
- New tool virt-xml: Edit libvirt XML in one shot from the command line:
http://www.redhat.com/archives/libvir-list/2014-January/msg01226.html
- Improved defaults: qcow2, USB2, host CPU model, guest agent channel, ...
- Introspect command line options like --disk=? or --network=help
- The virt-image tool will be removed before the next release, speak up
if you have a good reason not to remove it.
- virt-manager: Support arm vexpress VM creation
- virt-manager: Add guest memory usage graphs (Thorsten Behrens)
- virt-manager: UI for editing <filesystem> devices (Cédric Bosdonnat)
- Spice USB redirection support (Guannan Ren)
- <tpm> UI and command line support (Stefan Berger)
- <rng> UI and command line support (Giuseppe Scrivano)
- <panic> UI and command line support (Chen Hanxiao)
- <blkiotune> command line support (Chen Hanxiao)
- virt-manager: support for glusterfs storage pools (Giuseppe Scrivano)
- cli: New options --memory, --features, --clock, --metadata, --pm
- Greatly improve app responsiveness when connecting to remote hosts
- Lots of UI cleanup and improvements
Thanks to everyone who has contributed to this release through testing,
bug reporting, submitting patches, and otherwise sending in feedback!
Thanks,
Cole
10 years, 9 months
[libvirt] [PATCH v1 0/4] Time setting and getting in qemu guests
by Michal Privoznik
This can be used all, but 'virsh domtime --sync $dom'
is dependent on this qemu patch:
http://lists.nongnu.org/archive/html/qemu-devel/2014-01/msg04293.html
Anyway, once all the patches are merged, users can simply do:
virsh resume $dom
virsh domtime --sync $dom
and their guest time won't be off after the resume.
Michal Privoznik (4):
Introduce virDomain{Get,Set}Time APIs
remote: Implement remote{Get,Set}Time
virsh: Expose virDomain{Get,Set}Time
qemu: Implement virDomain{Get,Set}Time
daemon/remote.c | 35 +++++++++++
include/libvirt/libvirt.h.in | 13 +++++
src/access/viraccessperm.c | 2 +-
src/access/viraccessperm.h | 6 ++
src/driver.h | 13 +++++
src/libvirt.c | 91 +++++++++++++++++++++++++++++
src/libvirt_public.syms | 6 ++
src/qemu/qemu_agent.c | 81 ++++++++++++++++++++++++++
src/qemu/qemu_agent.h | 6 ++
src/qemu/qemu_driver.c | 135 +++++++++++++++++++++++++++++++++++++++++++
src/remote/remote_driver.c | 32 ++++++++++
src/remote/remote_protocol.x | 31 +++++++++-
src/remote_protocol-structs | 16 +++++
tools/virsh-domain-monitor.c | 126 ++++++++++++++++++++++++++++++++++++++++
tools/virsh.pod | 16 +++++
15 files changed, 607 insertions(+), 2 deletions(-)
--
1.8.5.3
10 years, 9 months
[libvirt] [PATCH 0/2] Test secret XML parsing and formatting
by Ján Tomko
Ján Tomko (2):
docs: remove <auth> from secret XML format
Add tests for secret XML parsing
docs/formatsecret.html.in | 2 -
tests/Makefile.am | 12 ++-
tests/secretschematest | 10 +++
tests/secretxml2xmlin/ephemeral-usage-volume.xml | 7 ++
tests/secretxml2xmlin/usage-ceph.xml | 7 ++
tests/secretxml2xmlin/usage-iscsi.xml | 7 ++
tests/secretxml2xmlin/usage-volume.xml | 7 ++
tests/secretxml2xmltest.c | 98 ++++++++++++++++++++++++
8 files changed, 147 insertions(+), 3 deletions(-)
create mode 100755 tests/secretschematest
create mode 100644 tests/secretxml2xmlin/ephemeral-usage-volume.xml
create mode 100644 tests/secretxml2xmlin/usage-ceph.xml
create mode 100644 tests/secretxml2xmlin/usage-iscsi.xml
create mode 100644 tests/secretxml2xmlin/usage-volume.xml
create mode 100644 tests/secretxml2xmltest.c
--
1.8.3.2
10 years, 9 months
[libvirt] [PATCH glib] Fix symfile checks in VPATH build
by Daniel P. Berrange
The check-symfile and check-symsorting rules were not
taking $(srcdir) into account when accessing the symfile
paths.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
build-aux/check-symsorting.pl | 3 +--
libvirt-gconfig/Makefile.am | 4 ++--
libvirt-glib/Makefile.am | 4 ++--
libvirt-gobject/Makefile.am | 4 ++--
4 files changed, 7 insertions(+), 8 deletions(-)
Pushed as a build-breaker fix.
diff --git a/build-aux/check-symsorting.pl b/build-aux/check-symsorting.pl
index 470247c..31b6059 100755
--- a/build-aux/check-symsorting.pl
+++ b/build-aux/check-symsorting.pl
@@ -19,10 +19,9 @@
use strict;
use warnings;
-die "syntax: $0 SRCDIR SYMFILE..." unless int(@ARGV) >= 2;
+die "syntax: $0 SYMFILE..." unless int(@ARGV) >= 1;
my $ret = 0;
-my $srcdir = shift;
my $incomment = 0;
my $name;
foreach my $symfile (@ARGV) {
diff --git a/libvirt-gconfig/Makefile.am b/libvirt-gconfig/Makefile.am
index e32d222..d328ca7 100644
--- a/libvirt-gconfig/Makefile.am
+++ b/libvirt-gconfig/Makefile.am
@@ -224,14 +224,14 @@ libvirt-gconfig-enum-types.c: $(GCONFIG_HEADER_FILES) libvirt-gconfig-enum-types
# rule for libosvirt-gconfig.la. However, checking symbols relies on Linux ELF layout
if WITH_LINUX
check-symfile: libvirt-gconfig.sym libvirt-gconfig-1.0.la
- $(AM_V_GEN)$(PERL) $(top_srcdir)/build-aux/check-symfile.pl libvirt-gconfig.sym \
+ $(AM_V_GEN)$(PERL) $(top_srcdir)/build-aux/check-symfile.pl $(srcdir)/libvirt-gconfig.sym \
.libs/libvirt-gconfig-1.0.so
else ! WITH_LINUX
check-symfile:
endif ! WITH_LINUX
check-symsorting:
$(AM_V_GEN)$(PERL) $(top_srcdir)/build-aux/check-symsorting.pl \
- $(srcdir) libvirt-gconfig.sym
+ $(srcdir)/libvirt-gconfig.sym
check-local: check-symfile check-symsorting
-include $(INTROSPECTION_MAKEFILE)
diff --git a/libvirt-glib/Makefile.am b/libvirt-glib/Makefile.am
index 15b9917..a48cfbb 100644
--- a/libvirt-glib/Makefile.am
+++ b/libvirt-glib/Makefile.am
@@ -41,14 +41,14 @@ libvirt_glib_1_0_la_LDFLAGS = \
# rule for libosvirt-glib.la. However, checking symbols relies on Linux ELF layout
if WITH_LINUX
check-symfile: libvirt-glib.sym libvirt-glib-1.0.la
- $(AM_V_GEN)$(PERL) $(top_srcdir)/build-aux/check-symfile.pl libvirt-glib.sym \
+ $(AM_V_GEN)$(PERL) $(top_srcdir)/build-aux/check-symfile.pl $(srcdir)/libvirt-glib.sym \
.libs/libvirt-glib-1.0.so
else ! WITH_LINUX
check-symfile:
endif ! WITH_LINUX
check-symsorting:
$(AM_V_GEN)$(PERL) $(top_srcdir)/build-aux/check-symsorting.pl \
- $(srcdir) libvirt-glib.sym
+ $(srcdir)/libvirt-glib.sym
check-local: check-symfile check-symsorting
-include $(INTROSPECTION_MAKEFILE)
diff --git a/libvirt-gobject/Makefile.am b/libvirt-gobject/Makefile.am
index b6b2a5d..516c10f 100644
--- a/libvirt-gobject/Makefile.am
+++ b/libvirt-gobject/Makefile.am
@@ -124,14 +124,14 @@ CLEANFILES = $(BUILT_SOURCES)
# rule for libosvirt-gobject.la. However, checking symbols relies on Linux ELF layout
if WITH_LINUX
check-symfile: libvirt-gobject.sym libvirt-gobject-1.0.la
- $(AM_V_GEN)$(PERL) $(top_srcdir)/build-aux/check-symfile.pl libvirt-gobject.sym \
+ $(AM_V_GEN)$(PERL) $(top_srcdir)/build-aux/check-symfile.pl $(srcdir)/libvirt-gobject.sym \
.libs/libvirt-gobject-1.0.so
else ! WITH_LINUX
check-symfile:
endif ! WITH_LINUX
check-symsorting:
$(AM_V_GEN)$(PERL) $(top_srcdir)/build-aux/check-symsorting.pl \
- $(srcdir) libvirt-gobject.sym
+ $(srcdir)/libvirt-gobject.sym
check-local: check-symfile check-symsorting
-include $(INTROSPECTION_MAKEFILE)
--
1.8.5.3
10 years, 9 months
[libvirt] [PATCH] Forgot to add lxcconf2xmldata to dist.
by Cédric Bosdonnat
---
tests/Makefile.am | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 0718a69..9bb61ca 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -72,6 +72,7 @@ EXTRA_DIST = \
domainsnapshotxml2xmlout \
fchostdata \
interfaceschemadata \
+ lxcconf2xmldata \
lxcxml2xmldata \
lxcxml2xmloutdata \
networkschematest \
--
1.8.5.2
10 years, 9 months
[libvirt] [PATCH] lxc: Add virCgroupSetOwner()
by Daniel P. Berrange
From: Richard Weinberger <richard(a)nod.at>
Add a new helper function to change the permissions of a control
group. This function is needed for user namespaces, we need to
chmod() the cgroup to the initial uid/gid such that systemd is
allowed to use the cgroup.
Only the systemd controller is made accessible to the container.
Others must remain read-only since it is generally not safe
to delegate resource controller write access to unprivileged
processes.
Signed-off-by: Richard Weinberger <richard(a)nod.at>
---
src/libvirt_private.syms | 1 +
src/lxc/lxc_cgroup.c | 9 ++++++++
src/util/vircgroup.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++
src/util/vircgroup.h | 5 +++++
4 files changed, 69 insertions(+)
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 0b28bac..cfa9f75 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1056,6 +1056,7 @@ virCgroupSetMemory;
virCgroupSetMemoryHardLimit;
virCgroupSetMemorySoftLimit;
virCgroupSetMemSwapHardLimit;
+virCgroupSetOwner;
virCgroupSupportsCpuBW;
diff --git a/src/lxc/lxc_cgroup.c b/src/lxc/lxc_cgroup.c
index cc0d5e8..0d0d9c0 100644
--- a/src/lxc/lxc_cgroup.c
+++ b/src/lxc/lxc_cgroup.c
@@ -484,6 +484,15 @@ virCgroupPtr virLXCCgroupCreate(virDomainDefPtr def)
&cgroup) < 0)
goto cleanup;
+ /* setup control group permissions for user namespace */
+ if (def->idmap.uidmap) {
+ if (virCgroupSetOwner(cgroup,
+ def->idmap.uidmap[0].target,
+ def->idmap.gidmap[0].target,
+ (1 << VIR_CGROUP_CONTROLLER_SYSTEMD)))
+ goto cleanup;
+ }
+
cleanup:
return cgroup;
}
diff --git a/src/util/vircgroup.c b/src/util/vircgroup.c
index a6d60c5..2dc6986 100644
--- a/src/util/vircgroup.c
+++ b/src/util/vircgroup.c
@@ -3253,6 +3253,60 @@ cleanup:
}
+int virCgroupSetOwner(virCgroupPtr cgroup,
+ uid_t uid,
+ gid_t gid,
+ int controllers)
+{
+ size_t i;
+
+ for (i = 0; i < VIR_CGROUP_CONTROLLER_LAST; i++) {
+ char *base, *entry;
+ DIR *dh;
+ struct dirent *de;
+
+ if (!((1 << i) & controllers))
+ continue;
+
+ if (!cgroup->controllers[i].mountPoint)
+ continue;
+
+ if (virAsprintf(&base, "%s%s", cgroup->controllers[i].mountPoint,
+ cgroup->controllers[i].placement) < 0) {
+ virReportOOMError();
+ return -1;
+ }
+
+ dh = opendir(base);
+ while ((de = readdir(dh)) != NULL) {
+ if (STREQ(de->d_name, ".") ||
+ STREQ(de->d_name, ".."))
+ continue;
+
+ if (virAsprintf(&entry, "%s/%s", base, de->d_name) < 0) {
+ VIR_FREE(base);
+ virReportOOMError();
+ }
+
+ if (chown(entry, uid, gid) < 0)
+ virReportSystemError(errno, _("cannot chown '%s' to (%u, %u)"),
+ entry, uid, gid);
+
+ VIR_FREE(entry);
+ }
+ closedir(dh);
+
+ if (chown(base, uid, gid) < 0)
+ virReportSystemError(errno, _("cannot chown '%s' to (%u, %u)"),
+ base, uid, gid);
+
+ VIR_FREE(base);
+ }
+
+ return 0;
+}
+
+
/**
* virCgroupSupportsCpuBW():
* Check whether the host supports CFS bandwidth.
diff --git a/src/util/vircgroup.h b/src/util/vircgroup.h
index a70eb18..38d94f3 100644
--- a/src/util/vircgroup.h
+++ b/src/util/vircgroup.h
@@ -225,4 +225,9 @@ int virCgroupIsolateMount(virCgroupPtr group,
bool virCgroupSupportsCpuBW(virCgroupPtr cgroup);
+int virCgroupSetOwner(virCgroupPtr cgroup,
+ uid_t uid,
+ gid_t gid,
+ int controllers);
+
#endif /* __VIR_CGROUP_H__ */
--
1.8.5.3
10 years, 9 months
[libvirt] Destroying a suspended LXC domain
by Richard Weinberger
Hi!
If we suspend a LXC domain libvirt freezes all tasks in the cgroup using the process freezer.
Upon destroy libvirt tries to kill all tasks using SIGTERM and later SIGKILL, but as they are frozen
the tasks are unkillable.
This seems to confuse libvirt, all tasks remain but libvirt forgets the domain.
Here a small example:
---cut---
lxc-host1:/etc # /opt/libvirt-dev/bin/virsh domstate my3rdcontainer
paused
lxc-host1:/etc # /opt/libvirt-dev/bin/virsh destroy my3rdcontainer
error: Failed to destroy domain my3rdcontainer
error: internal error: Some processes refused to die
lxc-host1:/etc # ps fax
...
2118 ? Dsl 0:00 /opt/libvirt-dev/lib/libvirt_lxc --name my3rdcontainer --console 19 --security=none --handshake 22 --backgr
2128 ? Ds 0:00 \_ /sbin/init
2152 ? Ds 0:00 \_ /usr/lib/systemd/systemd-journald
2171 ? Ds 0:00 \_ /bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
2174 ? Ds 0:00 \_ /usr/lib/systemd/systemd-logind
2189 ? Dsl 0:00 \_ /usr/sbin/rsyslogd -n
2778 ? Ds 0:00 \_ /usr/sbin/cron -n
2782 pts/0 Ds+ 0:00 \_ /sbin/agetty --noclear -s console 115200 38400 9600
2786 ? Ds 0:00 \_ /usr/sbin/sshd -D
...
---cut---
I can think of three options to deal with that.
a) Refuse to destroy a suspended LXC domain
b) Implicitly resume it upon destroy
c) Send a SIGKILL to each task and then thaw all tasks using the process freezer.
If the task is woken up the it sees immediately the pending SIGKILL and dies.
I'd vote for c) because I want to destroy a LXC domain without resuming it.
I.e. I want to kill it to avoid any further IO from the already suspended domain.
What do you think? I'd volunteer for a patch. :)
Thanks,
//richard
10 years, 9 months