[libvirt PATCH] cputestdata: Fix test data for EPYC 7502
by Tim Wiederhake
Commit 5c17a7ba41 introduced a new feature (ibrs) but did not update
existing cputestdata.
Signed-off-by: Tim Wiederhake <twiederh(a)redhat.com>
---
tests/cputestdata/x86_64-cpuid-EPYC-7502-32-Core-disabled.xml | 1 +
1 file changed, 1 insertion(+)
diff --git a/tests/cputestdata/x86_64-cpuid-EPYC-7502-32-Core-disabled.xml b/tests/cputestdata/x86_64-cpuid-EPYC-7502-32-Core-disabled.xml
index ca71b9efb5..82b6c1bc1a 100644
--- a/tests/cputestdata/x86_64-cpuid-EPYC-7502-32-Core-disabled.xml
+++ b/tests/cputestdata/x86_64-cpuid-EPYC-7502-32-Core-disabled.xml
@@ -5,5 +5,6 @@
<cpuid eax_in='0x0000000f' ecx_in='0x01' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000006'/>
<cpuid eax_in='0x80000001' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x01423408' edx='0x00000000'/>
<cpuid eax_in='0x80000007' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x00000100'/>
+ <cpuid eax_in='0x80000008' ecx_in='0x00' eax='0x00000000' ebx='0x00004000' ecx='0x00000000' edx='0x00000000'/>
<cpuid eax_in='0x8000000a' ecx_in='0x00' eax='0x00000000' ebx='0x00000000' ecx='0x00000000' edx='0x000014f6'/>
</cpudata>
--
2.36.1
2 years, 5 months
[PATCH 0/5] qemu: Refresh rx-filters more often
by Michal Privoznik
See the last patch for explanation. I haven't found a gitlab issue for
this nor a bug open. But I remember somebody complaining about problems
during restore from a save file, on IRC perhaps?
Michal Prívozník (5):
processNicRxFilterChangedEvent: Free @guestFilter and @hostFilter
automatically
qemu: Move parts of NIC_RX_FILTER_CHANGED even handling into a
function
qemu: Acquire QUERY job instead of MODIFY when handling
NIC_RX_FILTER_CHANGED event
qemu: Refresh state after restore from a save image
qemu: Refresh rx-filters more often
src/qemu/qemu_domain.c | 254 ++++++++++++++++++++++++++++++++++++++
src/qemu/qemu_domain.h | 5 +
src/qemu/qemu_driver.c | 250 +------------------------------------
src/qemu/qemu_process.c | 27 ++++
src/qemu/qemu_saveimage.c | 2 +
5 files changed, 291 insertions(+), 247 deletions(-)
--
2.37.3
2 years, 5 months
[PATCH v2 0/9] qemu: tpm: Add support for migration across shared storage
by Stefan Berger
This series of patches adds support for migrating vTPMs across hosts whose
storage has been set up to share the directory structure holding the state
of the TPM (swtpm). A new migration flag VIR_MIGRATE_TPM_SHARED_STORAGE is
added to enable this. This flag influences the management of the directory
structure holding the TPM state, which for example is only removed when a
domain is undefined and not when a VM is removed on the migration source
host. Further, when shared storage is used then security labeling on the
destination side is skipped assuming that the labeling was already done on
the source side.
I have tested this with an NFS setup where I had to turn SELinux off on
the hosts since the SELinux MLS range labeling is not supported by NFS.
Shared storage migration requires (upcoming) swtpm v0.8.
Stefan
Stefan Berger (9):
util: Add parsing support for swtpm's cmdarg-migration capability
qemu: Introduced VIR_MIGRATE_TPM_SHARED_STORAGE for TPM migration
qemu: tpm: Conditionally create storage on incoming migration
qemu: tpm: Pass --migration option to swtpm if supported
qemu: tpm: Avoid security labels on incoming migration with shared
storage
qemu: tpm: Require UNDEFINE_TPM to be set to remove TPM state
qemu: tpm: Determine whether to remove TPM state during migration
qemu: tpm: Enable migration with VIR_MIGRATE_TPM_SHARED_STORAGE
virsh: Add support for --tpm-shared-storage flag for migration
docs/manpages/virsh.rst | 6 +++
include/libvirt/libvirt-domain.h | 8 +++
src/conf/domain_conf.h | 1 +
src/qemu/qemu_driver.c | 4 +-
src/qemu/qemu_extdevice.c | 5 +-
src/qemu/qemu_extdevice.h | 3 +-
src/qemu/qemu_migration.c | 23 +++++++--
src/qemu/qemu_migration.h | 1 +
src/qemu/qemu_process.c | 10 ++--
src/qemu/qemu_process.h | 6 ++-
src/qemu/qemu_saveimage.c | 2 +-
src/qemu/qemu_snapshot.c | 4 +-
src/qemu/qemu_tpm.c | 87 ++++++++++++++++++++++++++++----
src/qemu/qemu_tpm.h | 24 ++++++++-
src/util/virtpm.c | 1 +
src/util/virtpm.h | 1 +
tools/virsh-domain.c | 7 +++
17 files changed, 164 insertions(+), 29 deletions(-)
--
2.37.3
2 years, 5 months
[PATCH 0/3] test: Fix regression parsing nested <volume> XML
by Cole Robinson
This adds a couple extensions to the example/ testdriver XML, and
fixes a regression introduced in b3e33a0ef7e
Cole Robinson (3):
examples: testdriver: Add xmlns runstate example
examples: testdriver: Add a nested inline <volume> example
test: Fix parsing nested <volume> XML
examples/xml/test/testnodeinline.xml | 25 ++++++++++++++++++++++++-
src/test/test_driver.c | 2 +-
2 files changed, 25 insertions(+), 2 deletions(-)
--
2.37.3
2 years, 5 months
[PATCH] NEWS: Mention new channel and redirdev devices in domcaps
by Jim Fehlig
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
NEWS.rst | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/NEWS.rst b/NEWS.rst
index b6bcb5524d..cd297c4fed 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -32,6 +32,11 @@ v8.9.0 (unreleased)
* Improved documentation of CPU ``usable`` attribute in domain capabilities
+ * Report ``channel`` and ``redirdev`` devices in domain capabilities
+
+ The channel and redirect devices supported by the hypervisor are now
+ reported in domain capabilities.
+
* **Bug fixes**
* qemu: Disable all blocker features in CPU baseline
--
2.37.3
2 years, 5 months
[PATCH 00/15] schema: Fix forgotten interleaving of elements (part 1)
by Peter Krempa
Context:
https://listman.redhat.com/archives/libvir-list/2022-October/234860.html
This series fixes the trivial/straightforward cases found by using
Daniel's "fuzzing" script. Note that you have to exclude '-invalid.xml'
files and all output-only XMLs (domaincaps, capabilities).
Best viewed with 'git show -w'.
There's 7 more pathces needed to fix the schema to work with the above
mentioned script but they have more complex interactions and I'll need
to re-consider them.
Peter Krempa (15):
schema: domain: Allow interleaving of character device config elements
schema: domain: Allow interleaving of PCI controller config elements
schema: domain: Allow interleaving of 'tpm' config elements
schema: domain: Allow interleaving of subelements of 'memtune'
schema: domain: Allow interleaving of subelements of disk's 'mirror'
schema: domain: Allow interleaving 'ip' and 'route' sub-elements of
interface
schema: domain: Add the 'type' subelement of the osexe case of 'os'
element to interleave
schema: domain: Allow interleaving of <bootloader> and <os>
schema: domain: Allow interleaving of 'watchdog' subelements
schema: networkport: Allow interleaving of subelements of 'owner'
schema: networkport: Allow interleaving of subelements of 'driver'
subelement of hostdev-pci
schema: nwfilter: Allow interleaving subelements of the top level
'filter' element
schema: nwfilterbinding: Allow interleaving of subelements of 'owner'
element
schema: storagepool: Allow interleaving of per-pool custom namespace
elements
schema: cpu: include 'arch' subelement in interleave definition of
'hostcpu'
src/conf/schemas/cputypes.rng | 6 +-
src/conf/schemas/domaincommon.rng | 813 ++++++++++++++-------------
src/conf/schemas/networkport.rng | 42 +-
src/conf/schemas/nwfilter.rng | 36 +-
src/conf/schemas/nwfilterbinding.rng | 14 +-
src/conf/schemas/storagepool.rng | 12 +-
6 files changed, 476 insertions(+), 447 deletions(-)
--
2.37.3
2 years, 5 months
[libvirt PATCH] docs: formatdomain: fix since tag for TPM PCR banks
by Ján Tomko
Fixes: a5bbe1a8b6321852634817c423695e58518c4f4f
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
Pushed as trivial.
docs/formatdomain.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst
index 34e4906eb4..e28b805009 100644
--- a/docs/formatdomain.rst
+++ b/docs/formatdomain.rst
@@ -7784,7 +7784,7 @@ Example: usage of the TPM Emulator
active PCR banks upon VM start but leave them at their last configuration.
This attribute requires that swtpm_setup v0.7 or later is installed
and may not have any effect otherwise. The selection of PCR banks only works
- with the ``emulator`` backend. since:`Since 7.10.0`
+ with the ``emulator`` backend. :since:`Since 7.10.0`
``encryption``
The ``encryption`` element allows the state of a TPM emulator to be
--
2.37.3
2 years, 5 months
[PATCH v2] capabilities: use g_autofree in capabilities.c
by Jiang Jiacheng
Use g_autofree in capabilities.c for some pointers still using manual cleanup,
and remove unnecessary cleanup.
Signed-off-by: Jiang Jiacheng <jiangjiacheng(a)huawei.com>
---
src/conf/capabilities.c | 38 ++++++++++++--------------------------
1 file changed, 12 insertions(+), 26 deletions(-)
diff --git a/src/conf/capabilities.c b/src/conf/capabilities.c
index 1a7ebf4a13..e498c77efc 100644
--- a/src/conf/capabilities.c
+++ b/src/conf/capabilities.c
@@ -1489,15 +1489,14 @@ virCapabilitiesGetNUMADistances(int node,
virNumaDistance **distancesRet,
int *ndistancesRet)
{
- virNumaDistance *tmp = NULL;
+ g_autofree virNumaDistance *tmp = NULL;
int tmp_size = 0;
- int ret = -1;
- int *distances = NULL;
+ g_autofree int *distances = NULL;
int ndistances = 0;
size_t i;
if (virNumaGetDistances(node, &distances, &ndistances) < 0)
- goto cleanup;
+ return -1;
if (!distances) {
*distancesRet = NULL;
@@ -1521,11 +1520,8 @@ virCapabilitiesGetNUMADistances(int node,
*ndistancesRet = tmp_size;
*distancesRet = g_steal_pointer(&tmp);
tmp_size = 0;
- ret = 0;
- cleanup:
- VIR_FREE(distances);
- VIR_FREE(tmp);
- return ret;
+
+ return 0;
}
static int
@@ -1533,13 +1529,12 @@ virCapabilitiesGetNUMAPagesInfo(int node,
virCapsHostNUMACellPageInfo **pageinfo,
int *npageinfo)
{
- int ret = -1;
- unsigned int *pages_size = NULL;
- unsigned long long *pages_avail = NULL;
+ g_autofree unsigned int *pages_size = NULL;
+ g_autofree unsigned long long *pages_avail = NULL;
size_t npages, i;
if (virNumaGetPages(node, &pages_size, &pages_avail, NULL, &npages) < 0)
- goto cleanup;
+ return -1;
*pageinfo = g_new0(virCapsHostNUMACellPageInfo, npages);
*npageinfo = npages;
@@ -1549,12 +1544,7 @@ virCapabilitiesGetNUMAPagesInfo(int node,
(*pageinfo)[i].avail = pages_avail[i];
}
- ret = 0;
-
- cleanup:
- VIR_FREE(pages_avail);
- VIR_FREE(pages_size);
- return ret;
+ return 0;
}
@@ -2034,22 +2024,18 @@ virCapabilitiesHostNUMANewHost(void)
int
virCapabilitiesInitPages(virCaps *caps)
{
- int ret = -1;
- unsigned int *pages_size = NULL;
+ g_autofree unsigned int *pages_size = NULL;
size_t npages;
if (virNumaGetPages(-1 /* Magic constant for overall info */,
&pages_size, NULL, NULL, &npages) < 0)
- goto cleanup;
+ return -1;
caps->host.pagesSize = g_steal_pointer(&pages_size);
caps->host.nPagesSize = npages;
npages = 0;
- ret = 0;
- cleanup:
- VIR_FREE(pages_size);
- return ret;
+ return 0;
}
--
2.33.0
2 years, 5 months
[libvirt PATCH] virvhba.c: use g_autofree
by ttxine
Change strings to use g_autofree.
Signed-off-by: Maxim Kostin <ttxinee(a)outlook.com>
---
src/util/virvhba.c | 21 +++++++--------------
1 file changed, 7 insertions(+), 14 deletions(-)
diff --git a/src/util/virvhba.c b/src/util/virvhba.c
index a4e88024d1..76c39e5f2b 100644
--- a/src/util/virvhba.c
+++ b/src/util/virvhba.c
@@ -49,7 +49,7 @@ bool
virVHBAPathExists(const char *sysfs_prefix,
int host)
{
- char *sysfs_path = NULL;
+ g_autofree char *sysfs_path = NULL;
bool ret = false;
sysfs_path = g_strdup_printf("%s/host%d",
@@ -58,7 +58,6 @@ virVHBAPathExists(const char *sysfs_prefix,
if (virFileExists(sysfs_path))
ret = true;
- VIR_FREE(sysfs_path);
return ret;
}
@@ -79,8 +78,8 @@ bool
virVHBAIsVportCapable(const char *sysfs_prefix,
int host)
{
- char *scsi_host_path = NULL;
- char *fc_host_path = NULL;
+ g_autofree char *scsi_host_path = NULL;
+ g_autofree char *fc_host_path = NULL;
bool ret = false;
fc_host_path = g_strdup_printf("%s/host%d/%s",
@@ -94,8 +93,6 @@ virVHBAIsVportCapable(const char *sysfs_prefix,
if (virFileExists(fc_host_path) || virFileExists(scsi_host_path))
ret = true;
- VIR_FREE(fc_host_path);
- VIR_FREE(scsi_host_path);
return ret;
}
@@ -115,9 +112,9 @@ virVHBAGetConfig(const char *sysfs_prefix,
int host,
const char *entry)
{
- char *sysfs_path = NULL;
+ g_autofree char *sysfs_path = NULL;
char *p = NULL;
- char *buf = NULL;
+ g_autofree char *buf = NULL;
char *result = NULL;
sysfs_path = g_strdup_printf("%s/host%d/%s",
@@ -140,8 +137,6 @@ virVHBAGetConfig(const char *sysfs_prefix,
result = g_strdup(p);
cleanup:
- VIR_FREE(sysfs_path);
- VIR_FREE(buf);
return result;
}
@@ -315,8 +310,8 @@ vhbaReadCompareWWN(const char *prefix,
const char *f_name,
const char *wwn)
{
- char *path;
- char *buf = NULL;
+ g_autofree char *path = NULL;
+ g_autofree char *buf = NULL;
char *p;
int ret = -1;
@@ -343,8 +338,6 @@ vhbaReadCompareWWN(const char *prefix,
ret = 1;
cleanup:
- VIR_FREE(path);
- VIR_FREE(buf);
return ret;
}
--
2.34.1
2 years, 5 months
Re: [PATCH 2/3] qemu: get the stackManager lock before getting nested lock
by Michal Prívozník
[please keep the list on CC]
On 10/15/22 13:55, Jiang Jiacheng wrote:
> Thanks for your reply.
> In other similar situation, we will get the StacksecurityManager lock
> before get other driver's lock to keep the use of the security drivers
> is internally serialized(in 'virSecurityManagerGenLabel').
>
> In the functions of this patch, we haven't get the StacksecurityManager
> lock but get the lock of other drivers in qemuSecurityGetBaseLabel. I
> think it's the reason of this problem.
>
> And I think 'virSecurityManagerGetNested' is used to get a list of other
> SecurityManager, i'm not sure whether we need a lock here.
Yeah, we might need to rework locking a bit. Or shuffle some code
around, but locking the object from outside does not feel right, since
it's supposed to manage locks itself.
Michal
2 years, 5 months