Hyper-V CPU details
by Matt Coleman
Hello,
I'm implementing domainGetVcpus and could use some guidance on what
value to use for virVcpuInfo->cpu.
Hyper-V does not allow the user to pin vCPUs to host CPUs and doesn't
allow the user to see which host CPU a vCPU is currently running on.
Since it's a type 1 hypervisor, none of its scheduling data is
available to the Windows userspace: there aren't any processes or
threads that correspond to vCPUs that I could query the OS scheduler
about.
My code currently sets it to -1, which produces the following `virsh
vcpuinfo` output for a running VM with two cores:
VCPU: 0
CPU: -1
State: running
CPU time: 1684.5s
CPU Affinity: yyyy
VCPU: 1
CPU: -1
State: running
CPU time: 1346.0s
CPU Affinity: yyyy
However, this doesn't match the comment in _virVcpuInfo's declaration,
which says that -1 signifies an offline CPU:
https://gitlab.com/libvirt/libvirt/-/blob/v6.8.0/include/libvirt/libvirt-...
Should I stick with -1? Or, should I introduce -2 as a value that
indicates that the hypervisor doesn't provide that information? Or, is
there some better way to handle this that I'm not aware of?
--
Matt
4 years
[libvirt PATCH v2 0/3] Add script to sync from QEMU i386 cpu models
by Tim Wiederhake
This hopefully makes synchronization with QEMU faster and less
error prone.
Patch #3 showcases the changes to the cpu models the script
suggests for qemu 8d90bfc5c31ad60f6049dd39be636b06bc00b652.
V1: https://www.redhat.com/archives/libvir-list/2020-October/msg01008.html
Changes since last version:
* Use apostrophes instead of quotation marks in XML.
Tim Wiederhake (3):
cpu_map: Unify apostrophe and quotation mark usage
cpu_map: Add script to sync from QEMU i386 cpu models
[DONTMERGE] Sample output of new sync script
src/cpu_map/arm_vendors.xml | 24 +-
src/cpu_map/index.xml | 140 +++----
src/cpu_map/sync_qemu_i386.py | 361 ++++++++++++++++++
src/cpu_map/x86_486.xml | 8 +
src/cpu_map/x86_Broadwell-IBRS.xml | 19 +-
src/cpu_map/x86_Broadwell-noTSX-IBRS.xml | 19 +-
src/cpu_map/x86_Broadwell-noTSX.xml | 19 +-
src/cpu_map/x86_Broadwell.xml | 18 +-
src/cpu_map/x86_Cascadelake-Server-noTSX.xml | 20 +-
src/cpu_map/x86_Cascadelake-Server.xml | 17 +-
src/cpu_map/x86_Conroe.xml | 10 +-
src/cpu_map/x86_Cooperlake.xml | 174 +++++----
src/cpu_map/x86_Denverton.xml | 74 ++++
src/cpu_map/x86_Dhyana.xml | 12 +-
src/cpu_map/x86_EPYC-IBPB.xml | 19 +-
src/cpu_map/x86_EPYC-Rome.xml | 9 +
src/cpu_map/x86_EPYC.xml | 14 +-
src/cpu_map/x86_Haswell-IBRS.xml | 20 +-
src/cpu_map/x86_Haswell-noTSX-IBRS.xml | 20 +-
src/cpu_map/x86_Haswell-noTSX.xml | 20 +-
src/cpu_map/x86_Haswell.xml | 18 +-
src/cpu_map/x86_Icelake-Client-noTSX.xml | 14 +-
src/cpu_map/x86_Icelake-Client.xml | 11 +-
src/cpu_map/x86_Icelake-Server-noTSX.xml | 29 +-
src/cpu_map/x86_Icelake-Server.xml | 11 +-
src/cpu_map/x86_IvyBridge-IBRS.xml | 13 +-
src/cpu_map/x86_IvyBridge.xml | 12 +-
src/cpu_map/x86_KnightsMill.xml | 77 ++++
src/cpu_map/x86_Nehalem-IBRS.xml | 14 +-
src/cpu_map/x86_Nehalem.xml | 13 +-
src/cpu_map/x86_Opteron_G1.xml | 9 +-
src/cpu_map/x86_Opteron_G2.xml | 10 +-
src/cpu_map/x86_Opteron_G3.xml | 10 +-
src/cpu_map/x86_Opteron_G4.xml | 11 +-
src/cpu_map/x86_Opteron_G5.xml | 11 +-
src/cpu_map/x86_Penryn.xml | 10 +-
src/cpu_map/x86_SandyBridge-IBRS.xml | 14 +-
src/cpu_map/x86_SandyBridge.xml | 13 +-
src/cpu_map/x86_Skylake-Client-IBRS.xml | 16 +-
src/cpu_map/x86_Skylake-Client-noTSX-IBRS.xml | 18 +-
src/cpu_map/x86_Skylake-Client.xml | 15 +-
src/cpu_map/x86_Skylake-Server-IBRS.xml | 12 +-
src/cpu_map/x86_Skylake-Server-noTSX-IBRS.xml | 15 +-
src/cpu_map/x86_Skylake-Server.xml | 12 +-
src/cpu_map/x86_Snowridge.xml | 79 ++++
src/cpu_map/x86_Westmere-IBRS.xml | 13 +-
src/cpu_map/x86_Westmere.xml | 14 +-
src/cpu_map/x86_athlon.xml | 8 +
src/cpu_map/x86_core2duo.xml | 12 +-
src/cpu_map/x86_coreduo.xml | 10 +-
src/cpu_map/x86_kvm32.xml | 9 +
src/cpu_map/x86_kvm64.xml | 9 +
src/cpu_map/x86_n270.xml | 12 +-
src/cpu_map/x86_pentium.xml | 9 +
src/cpu_map/x86_pentium2.xml | 9 +
src/cpu_map/x86_pentium3.xml | 9 +
src/cpu_map/x86_phenom.xml | 17 +-
src/cpu_map/x86_qemu32.xml | 8 +
src/cpu_map/x86_qemu64.xml | 17 +-
59 files changed, 1345 insertions(+), 295 deletions(-)
create mode 100755 src/cpu_map/sync_qemu_i386.py
create mode 100644 src/cpu_map/x86_Denverton.xml
create mode 100644 src/cpu_map/x86_KnightsMill.xml
create mode 100644 src/cpu_map/x86_Snowridge.xml
--
2.26.2
4 years
[PATCH] security: Use org namespace for xattrs on macOS
by Roman Bolshakov
There're no guidelines on what namespace should be used but it seems
thirdparty apps can select the one they like [1], i.e. freedekstop
xattrs are prefixed with xdg.
qemusecuritytest passes after that.
1. https://www.freedesktop.org/wiki/CommonExtendedAttributes/
Signed-off-by: Roman Bolshakov <r.bolshakov(a)yadro.com>
---
src/security/security_util.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/security/security_util.c b/src/security/security_util.c
index 7fa5163fe4..5d50acb574 100644
--- a/src/security/security_util.c
+++ b/src/security/security_util.c
@@ -56,6 +56,8 @@ VIR_LOG_INIT("security.security_util");
# define XATTR_NAMESPACE "trusted"
#elif defined(__FreeBSD__)
# define XATTR_NAMESPACE "system"
+#elif defined(__APPLE__)
+# define XATTR_NAMESPACE "org"
#endif
static char *
--
2.28.0
4 years
Call for Volunteers: Summaries of a few KVMForum-2020 talks for an LWN article
by Kashyap Chamarthy
Hi, folks
Like last year[1], we're aiming to submit a KVM Forum 2020 "recap"
article for LWN.
This won't be a comprehensive summary of a lot of talks — LWN normally
aims for 1500 words; they say "fewer can sometimes work, and more is
generally OK too". Given that, the write-up can cover about four
topics, similar to previous year's recap.
So I'm looking for a couple of volunteers. Meanwhile, I'll write LWN
folks an email to see if they're amenable to this. If they can't accept
it for some reason, Plan-B is qemu.org blog articles.
- KVM Forum 2020 schedule: https://kvmforum2020.sched.com/
- And LWN.net's author guidelines: https://lwn.net/op/AuthorGuide.lwn
I volunteer to summarize Janosch Frank's "The Common Challenges of
Secure VMs" talk.
Let me know, on-list or off-list, on what topic you'd like to pick.
PS: Just like it was noted in the last year's call for volunteers, we
will not ask LWN.net for money.
[1] https://lwn.net/Articles/805097/ -- A recap of KVM Forum 2019
[2] https://lists.gnu.org/archive/html/qemu-devel/2019-09/msg03536.html
--
/kashyap
4 years
[PATCH 0/6] Hyper-V code cleanup
by Matt Coleman
Here's a draft GitLab MR if you'd prefer to review the changes there:
https://gitlab.com/iammattcoleman/libvirt/-/merge_requests/3/diffs
Matt Coleman (6):
hyperv: reformat WQL query strings
hyperv: remove duplicate function hypervGetVSSDFromUUID()
hyperv: remove duplicate function hypervGetMemSDByVSSDInstanceId()
hyperv: remove unneeded braces in hypervDomainGetInfo() and
hypervDomainGetXMLDesc()
hyperv: reduce duplicate code for Msvm_ComputerSystem lookups
hyperv: do not overwrite errors from hypervInvokeMethod()
src/hyperv/hyperv_driver.c | 169 +++++++++----------------------------
src/hyperv/hyperv_wmi.c | 57 +++++++------
src/hyperv/hyperv_wmi.h | 4 +
3 files changed, 75 insertions(+), 155 deletions(-)
--
2.27.0
4 years
[PATCH 0/3] qemu: Prevent breakage of libvirt-6.9.0 with qemu-5.2.0
by Peter Krempa
Justification from 1/3:
Unfortunately qemu wants to change the interface of 'block-export-add'
before the release. Since we've tried to stay up to date and added the
code before it was written in stone, we need to disable the use of the
new interface for the upcoming libvirt release so that we don't have a
version of libvirt which would not work with the upcoming qemu version.
Patch 2/3 is the fix itself which uses the new interface.
Patch 1/3 and 3/3 are a plan-B option if qemu doesn't include the fix
until libvirt-6.9.0 will be about to be released. In such case I'll
push patch 1/3 and patches 2-3/3 will be left for a subsequent release.
Peter Krempa (3):
qemu: capabilities: Disable detection of QEMU_CAPS_BLOCK_EXPORT_ADD
qemu: Update to new design of 'block-export-add'
qemu: capabilities: Re-enable detection of QEMU_CAPS_BLOCK_EXPORT_ADD
src/qemu/qemu_block.c | 17 +-
src/qemu/qemu_block.h | 2 +-
.../caps_5.2.0.x86_64.replies | 2377 +++++++++--------
.../caps_5.2.0.x86_64.xml | 2 +-
tests/qemumonitorjsontest.c | 3 +-
5 files changed, 1339 insertions(+), 1062 deletions(-)
--
2.26.2
4 years
Proposal: drop support for Hyper-V 2008R2
by Matt Coleman
Hello,
I've been getting familiar with Hyper-V recently and have gotten
stymied by inconsistencies in its API.
While Hyper-V has V1 and V2 APIs, neither one is consistent between
Windows versions. For example...
* Windows 2012 only supports a subset of the V2 API
* Windows 2012 implements some V1 functions differently than 2008R2
* Windows 2016 broke compatibility with 2012R2 by replacing some classes
Some of these differences are undocumented, too, which is just lovely.
Most of these changes are relatively easy to handle, but the
differences between 2008R2's and 2012's implementations of the V1 API
result in libvirt code with a lot of conditionals containing obscure
format strings in the 2008R2 blocks.
Windows 2008R2's extended support ended January 14, 2020:
https://docs.microsoft.com/en-us/lifecycle/products/windows-server-2008-r2
Windows 2012's mainstream support ended in 2018, but it still has
extended support through October 10, 2023:
https://docs.microsoft.com/en-us/lifecycle/products/windows-server-2012
Since 2008R2 is no longer supported by Microsoft, I propose removing
support for it from libvirt.
Thoughts?
--
Matt
4 years
[libvirt PATCH 0/2] Run full unit tests on i686 too
by Daniel P. Berrangé
Daniel P. Berrangé (2):
gitlab: run unit tests in i686 cross build
scripts: trim "__attribute__((packed))" in RPC struct diff
.gitlab-ci.yml | 1 +
scripts/check-remote-protocol.py | 6 ++++++
2 files changed, 7 insertions(+)
--
2.28.0
4 years
[PATCH] storagepoolxml2argvtest: Populate test entries for macOS
by Roman Bolshakov
One of the cases fails on macOS:
15) Storage Pool XML-2-argv pool-netfs-gluster
...
In
'/Users/roolebo/dev/libvirt/tests/storagepoolxml2argvdata/pool-netfs-gluster-darwin.argv':
Offset 39
Expect [-o direct-io-mode=1 /mnt/gluster]
Actual [/mnt/gluster -o direct-io-mode=1]
glusterfs has not been tested on macOS but for now we can just make
tests happy by providing them with the data they expect. Likely,
there'll be updates to the argv files in the future.
storagepoolxml2argvtest passes after the change.
Signed-off-by: Roman Bolshakov <r.bolshakov(a)yadro.com>
---
tests/storagepoolxml2argvdata/pool-fs-darwin.argv | 1 +
tests/storagepoolxml2argvdata/pool-netfs-auto-darwin.argv | 1 +
tests/storagepoolxml2argvdata/pool-netfs-cifs-darwin.argv | 1 +
tests/storagepoolxml2argvdata/pool-netfs-darwin.argv | 1 +
tests/storagepoolxml2argvdata/pool-netfs-gluster-darwin.argv | 1 +
.../storagepoolxml2argvdata/pool-netfs-protocol-ver-darwin.argv | 1 +
tests/storagepoolxml2argvtest.c | 2 ++
7 files changed, 8 insertions(+)
create mode 100644 tests/storagepoolxml2argvdata/pool-fs-darwin.argv
create mode 100644 tests/storagepoolxml2argvdata/pool-netfs-auto-darwin.argv
create mode 100644 tests/storagepoolxml2argvdata/pool-netfs-cifs-darwin.argv
create mode 100644 tests/storagepoolxml2argvdata/pool-netfs-darwin.argv
create mode 100644 tests/storagepoolxml2argvdata/pool-netfs-gluster-darwin.argv
create mode 100644 tests/storagepoolxml2argvdata/pool-netfs-protocol-ver-darwin.argv
diff --git a/tests/storagepoolxml2argvdata/pool-fs-darwin.argv b/tests/storagepoolxml2argvdata/pool-fs-darwin.argv
new file mode 100644
index 0000000000..537ce4cee5
--- /dev/null
+++ b/tests/storagepoolxml2argvdata/pool-fs-darwin.argv
@@ -0,0 +1 @@
+mount -t ext3 /dev/sda6 /mnt
diff --git a/tests/storagepoolxml2argvdata/pool-netfs-auto-darwin.argv b/tests/storagepoolxml2argvdata/pool-netfs-auto-darwin.argv
new file mode 100644
index 0000000000..888a0161b8
--- /dev/null
+++ b/tests/storagepoolxml2argvdata/pool-netfs-auto-darwin.argv
@@ -0,0 +1 @@
+mount localhost:/var/lib/libvirt/images /mnt
diff --git a/tests/storagepoolxml2argvdata/pool-netfs-cifs-darwin.argv b/tests/storagepoolxml2argvdata/pool-netfs-cifs-darwin.argv
new file mode 100644
index 0000000000..2fef6f5782
--- /dev/null
+++ b/tests/storagepoolxml2argvdata/pool-netfs-cifs-darwin.argv
@@ -0,0 +1 @@
+mount -t cifs //example.com/samba_share /mnt/cifs -o guest
diff --git a/tests/storagepoolxml2argvdata/pool-netfs-darwin.argv b/tests/storagepoolxml2argvdata/pool-netfs-darwin.argv
new file mode 100644
index 0000000000..04127c5087
--- /dev/null
+++ b/tests/storagepoolxml2argvdata/pool-netfs-darwin.argv
@@ -0,0 +1 @@
+mount -t nfs localhost:/var/lib/libvirt/images /mnt
diff --git a/tests/storagepoolxml2argvdata/pool-netfs-gluster-darwin.argv b/tests/storagepoolxml2argvdata/pool-netfs-gluster-darwin.argv
new file mode 100644
index 0000000000..97be9cbeb3
--- /dev/null
+++ b/tests/storagepoolxml2argvdata/pool-netfs-gluster-darwin.argv
@@ -0,0 +1 @@
+mount -t glusterfs example.com:/volume /mnt/gluster -o direct-io-mode=1
diff --git a/tests/storagepoolxml2argvdata/pool-netfs-protocol-ver-darwin.argv b/tests/storagepoolxml2argvdata/pool-netfs-protocol-ver-darwin.argv
new file mode 100644
index 0000000000..f26656d5b8
--- /dev/null
+++ b/tests/storagepoolxml2argvdata/pool-netfs-protocol-ver-darwin.argv
@@ -0,0 +1 @@
+mount -t nfs localhost:/var/lib/libvirt/images /mnt -o nfsvers=3
diff --git a/tests/storagepoolxml2argvtest.c b/tests/storagepoolxml2argvtest.c
index 967d1f21a8..ecce3ab7d0 100644
--- a/tests/storagepoolxml2argvtest.c
+++ b/tests/storagepoolxml2argvtest.c
@@ -126,6 +126,8 @@ mymain(void)
const char *platform = "-linux";
#elif defined(__FreeBSD__)
const char *platform = "-freebsd";
+#elif defined(__APPLE__)
+ const char *platform = "-darwin";
#else
const char *platform = "";
#endif
--
2.28.0
4 years
[PATCH] tests: Enable virpcimock on macOS
by Roman Bolshakov
In general, it has little sense to use Linux pci mock on macOS but
virPCIDeviceAddressGetIOMMUGroupNum() is relying on the filesystem
layout mocked by virpcimock. And all tests that rely on correct
execution of virPCIDeviceAddressGetIOMMUGroupNum() fail.
Additionally, missing initialization is added to close() to avoid
invocation of real_close() before it's set up.
The change fixes qemuhotplugtest, qemumemlocktest and qemuxml2xmltest.
Signed-off-by: Roman Bolshakov <r.bolshakov(a)yadro.com>
---
tests/virpcimock.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tests/virpcimock.c b/tests/virpcimock.c
index 064218d275..5cd688c825 100644
--- a/tests/virpcimock.c
+++ b/tests/virpcimock.c
@@ -18,7 +18,7 @@
#include <config.h>
-#if defined(__linux__) || defined(__FreeBSD__)
+#if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__)
# include "virmock.h"
# include <unistd.h>
# include <fcntl.h>
@@ -1123,6 +1123,8 @@ opendir(const char *path)
int
close(int fd)
{
+ init_syms();
+
if (remove_fd(fd) < 0)
return -1;
return real_close(fd);
--
2.28.0
4 years