[libvirt] [PATCH v3 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 input devices.
Remove PS2 mouse device for non-X86 platforms
qemu_cap: Add USB keyboard capability
qemu: parse qemu command line for USB keyboard.
Add a default USB keyboard for PPC64
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 | 91 ++++++++++++----------
src/conf/domain_conf.h | 5 ++
src/libvirt_private.syms | 1 +
src/qemu/qemu_capabilities.c | 2 +
src/qemu/qemu_capabilities.h | 1 +
src/qemu/qemu_command.c | 41 +++++++---
src/qemu/qemu_domain.c | 29 ++++++-
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 | 2 +
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, 211 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, 11 months
[libvirt] about libvirt install
by 奇查-老张
hello:
when i configure libvirt-0.9.0 it always show:
configure: error: You must install kernel-headers in order to compile libvirt with QEMU or LXC support
but i am allready install latest kerne-headers.
Please help.
Thank you
10 years, 11 months
[libvirt] [PATCH] storage: fix omitted slash in gluster volume URI
by Eric Blake
When doing 'virsh vol-dumpxml' on a gluster pool's volume, the
resulting URI incorrectly omitted a slash between hostname and
path: gluster://192.168.122.206rhsvol1/fedora-19.img
This is fallout from me rebasing earlier versions of my patch,
I had originally played with always requiring the gluster volume
to have a leading slash, but it was easier to use the gluster
API if the gluster volume name was guaranteed to have no slash;
while I got the URI of the pool correct, I forgot to fix the URI
of a libvirt volume.
* src/storage/storage_backend_gluster.c
(virStorageBackendGlusterRefreshVol): Use correct starting point
since uri construction requires leading slash.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Once approved, I'm also pushing to v1.2.0-maint
src/storage/storage_backend_gluster.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/storage/storage_backend_gluster.c b/src/storage/storage_backend_gluster.c
index 1be9034..622526b 100644
--- a/src/storage/storage_backend_gluster.c
+++ b/src/storage/storage_backend_gluster.c
@@ -227,7 +227,10 @@ virStorageBackendGlusterRefreshVol(virStorageBackendGlusterStatePtr state,
goto cleanup;
tmp = state->uri->path;
- state->uri->path = vol->key;
+ if (virAsprintf(&vol->key, "%s%s", state->uri->path, name) < 0) {
+ state->uri->path = tmp;
+ goto cleanup;
+ }
if (!(vol->target.path = virURIFormat(state->uri))) {
state->uri->path = tmp;
goto cleanup;
--
1.8.4.2
10 years, 11 months
[libvirt] [PATCH] Revert "virtlockd: treat SIGHUP like SIGUSR1"
by Michal Privoznik
This reverts commit 8355d42dd3df514c8584e0e5082b945b79671fc5.
After some discussion upstream [1] this patch turns out to be spurious.
It better gets reverted prior to a release.
1: https://www.redhat.com/archives/libvir-list/2013-December/msg00563.html
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/locking/lock_daemon.c | 2 --
src/locking/virtlockd.pod.in | 6 +++---
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/src/locking/lock_daemon.c b/src/locking/lock_daemon.c
index ae09ef8..a6be43c 100644
--- a/src/locking/lock_daemon.c
+++ b/src/locking/lock_daemon.c
@@ -592,8 +592,6 @@ virLockDaemonSetupSignals(virNetServerPtr srv)
return -1;
if (virNetServerAddSignalHandler(srv, SIGUSR1, virLockDaemonExecRestartHandler, NULL) < 0)
return -1;
- if (virNetServerAddSignalHandler(srv, SIGHUP, virLockDaemonExecRestartHandler, NULL) < 0)
- return -1;
return 0;
}
diff --git a/src/locking/virtlockd.pod.in b/src/locking/virtlockd.pod.in
index 022d67f..99612aa 100644
--- a/src/locking/virtlockd.pod.in
+++ b/src/locking/virtlockd.pod.in
@@ -54,9 +54,9 @@ Display version information then exit.
=head1 SIGNALS
-On receipt of B<SIGUSR1> or B<SIGHUP> virtlockd will re-exec() its
-binary, while maintaining all current locks and clients. This allows
-for live upgrades of the virtlockd service.
+On receipt of B<SIGUSR1> virtlockd will re-exec() its binary, while
+maintaining all current locks and clients. This allows for live
+upgrades of the virtlockd service.
=head1 FILES
--
1.8.5.1
10 years, 11 months
[libvirt] [PATCH]lxc: remove redundant mount operation
by Chen Hanxiao
From: Chen Hanxiao <chenhanxiao(a)cn.fujitsu.com>
If we do not specify a readonly mount, we don't need to
re-mount it again.
Signed-off-by: Chen Hanxiao <chenhanxiao(a)cn.fujitsu.com>
---
src/lxc/lxc_container.c | 7 -------
1 file changed, 7 deletions(-)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index 255c711..351217a 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -1126,13 +1126,6 @@ static int lxcContainerMountFSBind(virDomainFSDefPtr fs,
_("Failed to make directory %s readonly"),
fs->dst);
}
- } else {
- VIR_DEBUG("Binding %s readwrite", fs->dst);
- if (mount(src, fs->dst, NULL, MS_BIND|MS_REMOUNT, NULL) < 0) {
- virReportSystemError(errno,
- _("Failed to make directory %s readwrite"),
- fs->dst);
- }
}
ret = 0;
--
1.8.2.1
10 years, 11 months
[libvirt] Timing proposal for the next couple of releases
by Daniel Veillard
In general December is a month with low productivity, especially over
the end of the month, as a result doing a freeze at that time may not
be very efficient. Also I will be rather busy around end of January
with travels and FOSDEM it's also the chinese new year, then February
is a short month.
My suggestion would be to rather plan 2 releases in 3 months, i.e.
one around the 15th January with a freeze around Jan 8th, and then a
release at the end of February with a freeze around 21st Feb. After that
we are back to monthly end of month usual schedule.
Does that sounds okay with everybody ?
Daniel
--
Daniel Veillard | Open Source and Standards, Red Hat
veillard(a)redhat.com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | virtualization library http://libvirt.org/
10 years, 11 months
[libvirt] [PATCH] qemu_process: Read errors from child
by Michal Privoznik
https://bugzilla.redhat.com/show_bug.cgi?id=1035955
There's a window when starting a qemu process between fork() and exec()
during which we are doing things that may fail but not tunnelling the
error to the daemon. This is basically all within qemuProcessHook().
So whenever we fail in something, e.g. placing a process onto numa node,
users ale left with:
error: Child quit during startup handshake: Input/output error
while the original error is thrown into the domain log:
libvirt: error : internal error: NUMA memory tuning in 'preferred'
mode only supports single node
Hence, we should read the log file and search for the error message and
report it to users.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_process.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 66 insertions(+)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index a26c079..d0d8b54 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -1563,6 +1563,70 @@ cleanup:
/*
+ * Read domain log and probably overwrite error if there's one in
+ * the domain log file. This functions exists to cover the small
+ * window between fork() and exec() during which child may fail
+ * by libvirt hand, e.g. placing onto a NUMA node failed.
+ */
+static int
+qemuProcessReadChildErrors(virQEMUDriverPtr driver,
+ virDomainObjPtr vm,
+ off_t originalOff)
+{
+ int ret = -1;
+ int logfd;
+ off_t off = 0;
+ ssize_t bytes;
+ char buf[1024] = {0};
+ char *eol, *filter_next = buf;
+
+ if ((logfd = qemuDomainOpenLog(driver, vm, originalOff)) < 0)
+ goto cleanup;
+
+ while (off < sizeof(buf) - 1) {
+ bytes = saferead(logfd, buf + off, sizeof(buf) - off - 1);
+ if (bytes < 0) {
+ VIR_WARN("unable to read from log file: %s",
+ virStrerror(errno, buf, sizeof(buf)));
+ goto cleanup;
+ }
+
+ off += bytes;
+ buf[off] = '\0';
+
+ if (bytes == 0)
+ break;
+
+ while ((eol = strchr(filter_next, '\n'))) {
+ *eol = '\0';
+ if (STRPREFIX(filter_next, "libvirt: ")) {
+ filter_next = eol + 1;
+ *eol = '\n';
+ break;
+ } else {
+ memmove(filter_next, eol + 1, off - (eol - buf));
+ off -= eol + 1 - filter_next;
+ }
+ }
+ }
+
+ if (off > 0) {
+ /* Found an error in the log. Report it */
+ virResetLastError();
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Process exited prior exec: %s"),
+ buf);
+ }
+
+ ret = 0;
+
+cleanup:
+ VIR_FORCE_CLOSE(logfd);
+ return ret;
+}
+
+
+/*
* Look at a chunk of data from the QEMU stdout logs and try to
* find a TTY device, as indicated by a line like
*
@@ -3888,6 +3952,8 @@ int qemuProcessStart(virConnectPtr conn,
VIR_DEBUG("Waiting for handshake from child");
if (virCommandHandshakeWait(cmd) < 0) {
+ /* Read errors from child that occurred between fork and exec. */
+ qemuProcessReadChildErrors(driver, vm, pos);
goto cleanup;
}
--
1.8.4.4
10 years, 11 months
[libvirt] [libvirt-glib 0/4] Add symbol files checks to make check
by Christophe Fergeau
Hey,
This series is based of the libosinfo work danpb did recently to reuse
libvirt scripts to validate the symbol files. These make sure the exported
symbols match what is listed in the sym file, and that these files are alphabetically
ordered. This caught 2 minor errors in the sym files we currently ship.
10 years, 11 months
[libvirt] [PATCH] docs: Enhance memoryBacking/locked documentation
by Jiri Denemark
Mention the need to set memtune/hard_limit.
https://bugzilla.redhat.com/show_bug.cgi?id=1035954
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
docs/formatdomain.html.in | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 1850a2b..b4ee9f3 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -638,7 +638,10 @@
<dt><code>locked</code></dt>
<dd>When set and supported by the hypervisor, memory pages belonging
to the domain will be locked in host's memory and the host will not
- be allowed to swap them out.
+ be allowed to swap them out. For QEMU/KVM this requires
+ <code>hard_limit</code> <a href="#elementsMemoryTuning">memory tunning</a>
+ element to be used and set to the maximum memory configured for the
+ domain plus any memory consumed by the QEMU process itself.
<span class="since">Since 1.0.6</span></dd>
</dl>
--
1.8.5.1
10 years, 11 months
[libvirt] [v3 00/32] network events feature
by Cédric Bosdonnat
Changes with v2:
* This patch serie includes fixes for Daniel's comments.
* The two commits adding the network events API have been merged into
one to get rid of build problems between those two.
* Otherwise one commit has been dropped to fix the void* returns of
domain events creation functions
Cédric Bosdonnat (32):
Added domain start/stop/define/undefine event unit tests
Rename virDomainEventCallback to virObjectEventCallback
Renamed virDomainMeta to virObjectMeta
Renamed virDomainEventQueue to virObjectEventQueue
Renamed virDomainEventState to virObjectEventState
Renamed virDomainEventCallbackList* to virObjectEventCallbackList*
Created virObjectEventStateRegisterID
virObject-ified virDomainEvent
Create virDomainEventLifecycle to start removing the huge union
Renamed virDomainEventNew* to virDomainEventLifecycleNew*
Renamed virDomainEventNewInternal to virDomainEventNew
Create virDomainEventRTCChange to get rid of the huge union
Created virDomainEventWatchdog to get rid of the huge union
Created virDomainEventIOError
Created virDomainEventGraphics
Created virDomainEventBlockJob
Create virDomainEventDiskChange
Created virDomainEventTrayChange
Created virDomainEventBalloonChange
Created virDomainEventDeviceRemoved and removed the huge union
Use virObjectEventPtr instead of virDomainEventPtr
Add object event namespaces for the event IDs
Renamed virDomainEventTimer to virObjectEventTimer
Split the virObjectEvent and virDomainEvent* to separate them after
Extracted common parts of domain_event.[ch] to object_event.[ch]
Added Network events API and virNetworkEventLifecycle.
test driver: renamed testDomainEventQueue into testObjectEventQueue
test driver: implemented network events
Add network events unit tests
daemon/remote.c: renamed remoteDispatchDomainEventSend
Add network events to the remote driver
Added network events to the bridged network driver
.gitignore | 1 +
cfg.mk | 6 +-
daemon/libvirtd.h | 1 +
daemon/remote.c | 176 +++-
include/libvirt/libvirt.h.in | 77 ++
src/Makefile.am | 11 +
src/conf/domain_event.c | 1904 ++++++++++++++--------------------
src/conf/domain_event.h | 169 ++-
src/conf/network_event.c | 152 +++
src/conf/network_event.h | 50 +
src/conf/object_event.c | 797 ++++++++++++++
src/conf/object_event.h | 98 ++
src/conf/object_event_private.h | 113 ++
src/driver.h | 14 +
src/libvirt.c | 125 +++
src/libvirt_private.syms | 25 +-
src/libvirt_public.syms | 7 +
src/libxl/libxl_conf.h | 2 +-
src/libxl/libxl_driver.c | 46 +-
src/lxc/lxc_conf.h | 2 +-
src/lxc/lxc_driver.c | 54 +-
src/lxc/lxc_process.c | 20 +-
src/network/bridge_driver.c | 90 ++
src/network/bridge_driver_platform.h | 3 +
src/parallels/parallels_utils.h | 2 +-
src/qemu/qemu_conf.h | 2 +-
src/qemu/qemu_domain.c | 6 +-
src/qemu/qemu_domain.h | 2 +-
src/qemu/qemu_driver.c | 116 +--
src/qemu/qemu_hotplug.c | 10 +-
src/qemu/qemu_migration.c | 38 +-
src/qemu/qemu_process.c | 70 +-
src/remote/remote_driver.c | 179 +++-
src/remote/remote_protocol.x | 46 +-
src/test/test_driver.c | 198 ++--
src/uml/uml_conf.h | 2 +-
src/uml/uml_driver.c | 44 +-
src/vbox/vbox_tmpl.c | 22 +-
src/xen/xen_driver.c | 10 +-
src/xen/xen_driver.h | 4 +-
src/xen/xen_inotify.c | 10 +-
src/xen/xs_internal.c | 20 +-
tests/Makefile.am | 7 +
tests/objecteventtest.c | 411 ++++++++
tests/qemuhotplugtest.c | 2 +-
45 files changed, 3584 insertions(+), 1560 deletions(-)
create mode 100644 src/conf/network_event.c
create mode 100644 src/conf/network_event.h
create mode 100644 src/conf/object_event.c
create mode 100644 src/conf/object_event.h
create mode 100644 src/conf/object_event_private.h
create mode 100644 tests/objecteventtest.c
--
1.8.4.4
10 years, 11 months