[libvirt] summary of current vfio mdev upstreaming status
by Jike Song
Hi all,
In order to have a clear understanding about the VFIO mdev upstreaming
status, I'd like to summarize it. Please share your opinions on this,
and correct my misunderstandings.
The whole vfio mdev series can be logically divided into several parts,
they work together to provide the mdev support.
PART 1: mdev core driver
[task]
- the mdev bus/device support
- the utilities of mdev lifecycle management
- the physical device register/unregister interfaces
[status]
- basically agreed by community
PART 2: vfio bus driver for mdev
[task]
- interfaces with vendor drivers
- the vfio bus implementation
[status]
- basically agreed by community
PART 3: iommu support for mdev
[task]
- iommu support for mdev
[status]
- Kirti's v7 implementation, not yet fully reviewed
PART 4: sysfs interfaces for mdev
[task]
- define the hierarchy of minimal sysfs directories/files
- check the validity from vendor drivers, init/de-init them
[status]
- interfaces are in discussion
PART 6: Documentation
[task]
- clearly document the architecture and interfaces
- coding example for vendor drivers
[status]
- N/A
What I'm curious here is 'PART 4', which is needed by other parts to
perform further steps, is it possible to accelerate the process somehow? :-)
--
Thanks,
Jike
8 years, 1 month
[libvirt] [PATCH v2] virsh domdisplay: introduce '--all' for showing all possible graphical display
by Chen Hanxiao
From: Chen Hanxiao <chenhanxiao(a)gmail.com>
For one VM, it could had more than one graphical display.
Such as we coud add both vnc and spice display to a VM.
This patch introduces '--all' for showing all
possible graphical display of a active VM.
Signed-off-by: Chen Hanxiao <chenhanxiao(a)gmail.com>
---
v2: VIR_FREE befor use in loops
add descriptions in virsh.pod
tools/virsh-domain.c | 15 ++++++++++++++-
tools/virsh.pod | 3 ++-
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 3829b17..a6124b6 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -10648,6 +10648,10 @@ static const vshCmdOptDef opts_domdisplay[] = {
.help = N_("select particular graphical display "
"(e.g. \"vnc\", \"spice\", \"rdp\")")
},
+ {.name = "all",
+ .type = VSH_OT_BOOL,
+ .help = N_("show all possible graphical displays")
+ },
{.name = NULL}
};
@@ -10671,6 +10675,7 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd)
int tmp;
int flags = 0;
bool params = false;
+ bool all = vshCommandOptBool(cmd, "all");
const char *xpath_fmt = "string(/domain/devices/graphics[@type='%s']/%s)";
virSocketAddr addr;
@@ -10701,6 +10706,7 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd)
continue;
/* Create our XPATH lookup for the current display's port */
+ VIR_FREE(xpath);
if (virAsprintf(&xpath, xpath_fmt, scheme[iter], "@port") < 0)
goto cleanup;
@@ -10733,6 +10739,7 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd)
/* Attempt to get the listening addr if set for the current
* graphics scheme */
+ VIR_FREE(listen_addr);
listen_addr = virXPathString(xpath, ctxt);
VIR_FREE(xpath);
@@ -10788,6 +10795,7 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd)
goto cleanup;
/* Attempt to get the password */
+ VIR_FREE(passwd);
passwd = virXPathString(xpath, ctxt);
VIR_FREE(xpath);
@@ -10840,12 +10848,17 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd)
}
/* Print out our full URI */
+ VIR_FREE(output);
output = virBufferContentAndReset(&buf);
vshPrint(ctl, "%s", output);
/* We got what we came for so return successfully */
ret = true;
- break;
+ if (!all) {
+ break;
+ } else {
+ vshPrint(ctl, "\n");
+ }
}
if (!ret) {
diff --git a/tools/virsh.pod b/tools/virsh.pod
index 49abda9..6255b36 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -1229,7 +1229,8 @@ Output a URI which can be used to connect to the graphical display of the
domain via VNC, SPICE or RDP. The particular graphical display type can
be selected using the B<type> parameter (e.g. "vnc", "spice", "rdp"). If
I<--include-password> is specified, the SPICE channel password will be
-included in the URI.
+included in the URI. If I<--all> is specified, then all show all possible
+graphical displays, for a VM could have more than one graphical displays.
=item B<domfsinfo> I<domain>
--
1.8.3.1
8 years, 1 month
[libvirt] [PATCH] docs: correct version requirements for <kvm><hidden='on'/></kvm>
by Laine Stump
When support was added for the kvm hidden='on' attribute in commit
d07116, the version requirement was listed as "2.1.0 (QEMU
only)". However, this was added when libvirt was at version 1.2.8 - it
is *QEMU* that must be at version 2.1.0 or later.
This went unnoticed for a very long time (over 2 years). Then a week
or two ago a new Windows convert in the #virt channel on OFTC was told
he needed to use this feature (to prevent nvidia drivers in a guest
from refusing to work due to being run in a virtual machine). There
was some problem with it being recognized and "someone" (it may have
been me, or may have been someone else, I don't remember) pointed out
that the documentation at
http://www.libvirt.org/formatdomain.html
says that it requires libvirt 2.1.0. The next several days were filled
with agony as a new convert to Linux first tried to upgrade a Linux
Mint host running their "LTS" version to something newer, then tried
to install a libvirt build built for Ubuntu onto this, and later back
to the old LTS Linux Mint. After this he tried building his own
libvirt from source (with all the expected problems), and finally
switched to Fedora. In the end it was hours and hours of everybody's
lives that they will never get back. To now learn that he didn't need
to do this (his original libvirt version was 1.3.3, so whatever his
problem was, it was elsewhere) makes the pain all that much worse.
To prevent this from happening again, this simple patch changes the
version requirement for the kvm hidden attribute from "2.1.0 (QEMU
only)" to "1.2.8 (QEMU 2.1.0)".
---
docs/formatdomain.html.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 7008005..513bc0e 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -1703,7 +1703,7 @@
<td>hidden</td>
<td>Hide the KVM hypervisor from standard MSR based discovery</td>
<td>on, off</td>
- <td><span class="since">2.1.0 (QEMU only)</span></td>
+ <td><span class="since">1.2.8 (QEMU 2.1.0)</span></td>
</tr>
</table>
</dd>
--
2.7.4
8 years, 1 month
[libvirt] [PATCH 0/3] Fix io_timeout for sanlock
by Michal Privoznik
Just read the 3/3. I didn't know whether I should laugh or cry. I did both.
Michal Privoznik (3):
lock_driver_sanlock: Avoid global driver variable whenever possible
m4: Check for sanlock_write_lockspace
sanlock: Properly init io_timeout
m4/virt-sanlock.m4 | 14 +++++---
src/locking/lock_driver_sanlock.c | 69 +++++++++++++++++++++++++++++----------
2 files changed, 60 insertions(+), 23 deletions(-)
--
2.8.4
8 years, 1 month
[libvirt] support for qemu werror and rerror
by Vasiliy Tolstov
Sometimes ago qemu anounced support for action for disk:
werror=action,rerror=action
Specify which 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 iswerror=enospc and rerror=report.
Does somebody can write this support to libvirt ? Or how can i enable
werror and rerror ?
--
Vasiliy Tolstov,
e-mail: v.tolstov(a)selfip.ru
8 years, 1 month
[libvirt] [PATCH] qemu: Only use memory-backend-file with NUMA if needed
by Martin Kletzander
If this reminds you of a commit message from around a year ago, it's
41c2aa729f0af084ede95ee9a06219a2dd5fb5df and yes, we're dealing with
"the same thing" again. Or f309db1f4d51009bad0d32e12efc75530b66836b and
it's similar.
There is a logic in place that if there is no real need for
memory-backend-file, qemuBuildMemoryBackendStr() returns 0. However
that wasn't the case with hugepage backing. The reason for that was
that we abused the 'pagesize' variable for storing that information, but
we should rather have a separate one that specifies whether we really
need the new object for hugepage backing. And that variable should be
set only if this particular NUMA cell needs special treatment WRT
hugepages.
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1372153
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
Notes:
This fixes migration from older libvirts. By "older", I mean
pre-(circa-)1.2.7, also in some cases pre-1.2.11, in some other cases
pre-v1.2.20. It's pretty messy. It could be back-ported as far as it's
easy to do.
src/qemu/qemu_command.c | 8 +++++---
tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages2.args | 10 ++++------
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 1ac0fa116310..316aced5124a 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3202,6 +3202,7 @@ qemuBuildMemoryBackendStr(unsigned long long size,
int ret = -1;
virJSONValuePtr props = NULL;
bool nodeSpecified = virDomainNumatuneNodeSpecified(def->numa, guestNode);
+ bool needHugepage = !!pagesize;
*backendProps = NULL;
*backendType = NULL;
@@ -3224,10 +3225,10 @@ qemuBuildMemoryBackendStr(unsigned long long size,
mode = VIR_DOMAIN_NUMATUNE_MEM_STRICT;
if (pagesize == 0) {
+ bool thisHugepage = false;
+
/* Find the huge page size we want to use */
for (i = 0; i < def->mem.nhugepages; i++) {
- bool thisHugepage = false;
-
hugepage = &def->mem.hugepages[i];
if (!hugepage->nodemask) {
@@ -3249,6 +3250,7 @@ qemuBuildMemoryBackendStr(unsigned long long size,
if (thisHugepage) {
/* Hooray, we've found the page size */
+ needHugepage = true;
break;
}
}
@@ -3335,7 +3337,7 @@ qemuBuildMemoryBackendStr(unsigned long long size,
}
/* If none of the following is requested... */
- if (!pagesize && !userNodeset && !memAccess && !nodeSpecified && !force) {
+ if (!needHugepage && !userNodeset && !memAccess && !nodeSpecified && !force) {
/* report back that using the new backend is not necessary
* to achieve the desired configuration */
ret = 1;
diff --git a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages2.args b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages2.args
index 447bb52d00b7..a37f03d0d2ed 100644
--- a/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages2.args
+++ b/tests/qemuxml2argvdata/qemuxml2argv-hugepages-pages2.args
@@ -10,12 +10,10 @@ QEMU_AUDIO_DRV=none \
-M pc \
-m 1024 \
-smp 2,sockets=2,cores=1,threads=1 \
--object memory-backend-file,id=ram-node0,prealloc=yes,\
-mem-path=/dev/hugepages2M/libvirt/qemu,size=268435456 \
--numa node,nodeid=0,cpus=0,memdev=ram-node0 \
--object memory-backend-file,id=ram-node1,prealloc=yes,\
-mem-path=/dev/hugepages2M/libvirt/qemu,size=805306368 \
--numa node,nodeid=1,cpus=1,memdev=ram-node1 \
+-mem-prealloc \
+-mem-path /dev/hugepages2M/libvirt/qemu \
+-numa node,nodeid=0,cpus=0,mem=256 \
+-numa node,nodeid=1,cpus=1,mem=768 \
-uuid ef1bdff4-27f3-4e85-a807-5fb4d58463cc \
-nographic \
-nodefaults \
--
2.10.0
8 years, 1 month
[libvirt] [PATCH] vsh: Write out history on "quit" or "exit" in interactive mode
by John Ferlan
https://bugzilla.redhat.com/show_bug.cgi?id=1379895
Introduced by commit id '834c5720'.
During the code motion and creation of vsh.c, the function 'vshDeinit()'
in the (new) vsh.c was altered from whence it came in virsh.c such that
calling 'vshReadlineDeinit(ctl)' was conditional on "ctl->imode".
This causes a problem for the interactive running if the "quit" and "exit"
commands are used because 'cmdQuit' will clear ctl->imode, thus when the
interactive loop in main() of virsh.c exits because ctl->mode is clear and
virshDeinit is called which calls vshDeinit, the history file is now not
written. Conversely, if one had exited the interactive loop via pressing
<ctrl>D the file would be created because loop control is broken on EOF
and ctl->imode is not set to false.
This patch will remove the conditional call to vshReadlineDeinit and
restore the former behaviour.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
I realize some people don't like the comment I added; however, I'd
rather be "safe" when purely reading the code than expect someone
to do a git log -p looking at commit messages for "removed" lines of code.
An alternative approach would be to create/set a new boolean value
such as "iquit" (or "iexit") during cmdQuit and then in vshDeinit make
calling vshReadlineDeinit() conditional on "ctl->imode || ctl->iquit"
Calling the vshReadlineDeinit during non interactive mode would have no
affect since vshReadlineInit is only called if ctl->imode is set. The
Deinit function will essentially do nothing other than a couple of
VIR_FREE(NULL); and one extra "if"
tools/vsh.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tools/vsh.c b/tools/vsh.c
index 041113f..eba3f0f 100644
--- a/tools/vsh.c
+++ b/tools/vsh.c
@@ -3093,8 +3093,12 @@ vshInitReload(vshControl *ctl)
void
vshDeinit(vshControl *ctl)
{
- if (ctl->imode)
- vshReadlineDeinit(ctl);
+ /* Don't make calling vshReadlineDeinit conditional on imode. During
+ * interactive mode when "quit" or "exit" is typed, 'imode' is set
+ * to false so if this were conditional on imode, then history wouldn't
+ * be written when the "quit" or "exit" commands were used instead of
+ * when <ctrl>D is used */
+ vshReadlineDeinit(ctl);
vshCloseLogFile(ctl);
}
--
2.7.4
8 years, 1 month
[libvirt] [RFC] daemon: remove hardcode dep on libvirt-guests
by Nikolay Shirokovskiy
Hi, all.
In virtuozzo mgmt we do not use libvirt-guests service. First because
we need do extra steps on domain start and second we want to decice
whether to suspend or to shutdown a domain on per domain basis. Starting
is not the problem but system shutdown is. As domain in systemd based
systems is just another unit we need to set ordering dependency so
that domain will not be killed before mgmt service as ba79e387 do for
libvirt-guest service. So let's remove this hardcode. I see 2 options.
1. Take dependant service name from config.
2. Introduce intermediate service that will specify real dependency.
Looks like this one is more flexible.
By the way AFAIK this is the only place that harcode libvirt-guests in libvirtd.
Nikolay
8 years, 1 month
[libvirt] [libvirt-php][PATCH 00/11] Resolve reverse include order
by Michal Privoznik
These are not pushed yet as they might be somewhat controversial.
I'll wait if somebody wants to review them.
The ultimate goal is to, well drop libvirt-php.h completely. It
is needless. But before going there we must distribute the
interesting parts from it around. Therefore I'm introducing some
modules (like it should have been done from the start).
Anyway, happy coding!
Michal Privoznik (11):
vncfunc: Honour static function
Move DEFAULT_LOG_MAXSIZE to libvirt-php.c
Move VNC_MAX_AUTH_ATTEMPTS to vncfunc.c
libvirt-php.c: Move system headers together
src: Introduce util.h
src: Introduce util.c
src: Introduce vncfunc.h
src: Introduce sockets.h
vncfunc: Drop include of libvirt-php.h
sockets: Drop include of libvirt-php.h
Clean up debug macros
configure.ac | 1 +
src/Makefile.am | 5 ++--
src/config.m4 | 2 +-
src/libvirt-php.c | 69 +++++++++++++++++----------------------------
src/libvirt-php.h | 81 -----------------------------------------------------
src/sockets.c | 24 +++++++++++-----
src/sockets.h | 32 +++++++++++++++++++++
src/util.c | 73 ++++++++++++++++++++++++++++++++++++++++++++++++
src/util.h | 73 ++++++++++++++++++++++++++++++++++++++++++++++++
src/vncfunc.c | 83 +++++++++++++++++++++++++++++++++++++++++--------------
src/vncfunc.h | 38 +++++++++++++++++++++++++
11 files changed, 325 insertions(+), 156 deletions(-)
create mode 100644 src/sockets.h
create mode 100644 src/util.c
create mode 100644 src/util.h
create mode 100644 src/vncfunc.h
--
2.8.4
8 years, 1 month