Re: [libvirt PATCH 0/6] libxl: remove enum libxlHwcapVersion

2021-09-07 Thread Jim Fehlig
On 9/6/21 08:58, Ján Tomko wrote: While looking at users of virCPU.*Free, I found some code that is supposed to deal with Xen < 4.7. The minimum version is 4.9 since the following commit: commit 68940b3fb3c43b8aa03cb6fd2f1d00b1737c9b2c Author: Jim Fehlig CommitDate: 2021-06-17 10:11:56

[libvirt][PATCH v7 5/5] Add get domaincaps unit test

2021-09-07 Thread Haibin Huang
Signed-off-by: Haibin Huang --- tests/domaincapsdata/bhyve_basic.x86_64.xml | 1 + tests/domaincapsdata/bhyve_fbuf.x86_64.xml| 1 + tests/domaincapsdata/bhyve_uefi.x86_64.xml| 1 + tests/domaincapsdata/empty.xml| 1 + tests/domaincapsdata/libxl-xenfv.xml

[libvirt][PATCH v7 4/5] Support to query SGX capability

2021-09-07 Thread Haibin Huang
1.Add SGX feature in domain capabilities 2.Get sgx capabilities by query-sgx-capabilities 3.Transfer the B to KB for epc_size Signed-off-by: Haibin Huang --- docs/schemas/domaincaps.rng| 19 - src/conf/domain_capabilities.c | 29 +++ src/conf/domain_capabilities.h | 13 +++

[libvirt][PATCH v7 3/5] Add unit tests for guest VM creation command with SGX EPC

2021-09-07 Thread Haibin Huang
From: Lin Yang --- .../sgx-epc.x86_64-5.1.0.args | 37 + tests/qemuxml2argvdata/sgx-epc.xml| 40 +++ tests/qemuxml2argvtest.c | 1 + 3 files changed, 78 insertions(+) create mode 100644

[libvirt][PATCH v7 2/5] qemu: Add command-line to generate SGX EPC memory backend

2021-09-07 Thread Haibin Huang
From: Lin Yang According to the result parsing from xml, add the argument of SGX EPC memory backend into QEMU command line: #qemu-system-x86_64 \ .. \ -object memory-backend-epc,id=mem1,size=64M,prealloc=on \ -object memory-backend-epc,id=mem2,size=28M \

[libvirt][PATCH v7 1/5] conf: Introduce SGX EPC element into device memory xml

2021-09-07 Thread Haibin Huang
From: Lin Yang ... 512 ... --- docs/schemas/domaincommon.rng| 1 + src/conf/domain_conf.c | 5 + src/conf/domain_conf.h | 1 + src/conf/domain_validate.c | 1 + src/qemu/qemu_alias.c| 3 +++ src/qemu/qemu_command.c

[libvirt][PATCH v7 0/5] Support query and use SGX

2021-09-07 Thread Haibin Huang
This patch series provides support for enabling Intel's Software Guard Extensions (SGX) feature in guest VM. Giving the SGX support in QEMU be accepted and will be merged in two days Intel Software Guard Extensions (Intel?? SGX) is a set of instructions that increases the security of

[PATCH 4/6] conf: Don't call 'virDomainDiskDefAssignAddress' when disk->dst is NULL

2021-09-07 Thread Peter Krempa
The code rejecting a XML when the disk target is missing was moved to the validation code which goes after post parse. One of the cases in the disk post parse code didn't check whether 'disk->dst' is set which at that point isn't guaranteed. Fixes: 61fd7174c2afbe128ef1896198919429bcaca3d7

[PATCH 3/6] conf: validate: Run global device definition validation before callbacks

2021-09-07 Thread Peter Krempa
The validation infrastructure doesn't modify the definition and additionally it makes sense to run the global code first as it's validating certain corner cases. The changed error messages from qemuxml2argvtest show that this is indeed the proper ordering as all changed messages are actually

[PATCH 6/6] qemuxml2argvtest: Add test case for missing disk ''

2021-09-07 Thread Peter Krempa
Cover the case of missing disk target to cover the case fixed by previous commit. Signed-off-by: Peter Krempa --- .../disk-missing-target-invalid.err | 1 + .../disk-missing-target-invalid.xml | 22 +++ tests/qemuxml2argvtest.c | 1 + 3

[PATCH 5/6] virDomainDiskDefValidate: Move validation of disk target

2021-09-07 Thread Peter Krempa
The disk target is mandatory and used as a designator in error messages of other validation steps, so we must validate it first. Signed-off-by: Peter Krempa --- src/conf/domain_validate.c | 27 ++- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git

[PATCH 1/6] qemuDomainDefValidateDiskLunSource: Unbreak error messages

2021-09-07 Thread Peter Krempa
Simplify looking for the error messages. Signed-off-by: Peter Krempa --- src/qemu/qemu_domain.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 25b7f03204..7f7d6dcfcc 100644 --- a/src/qemu/qemu_domain.c +++

[PATCH 2/6] conf: validate: Move qemu-specific LUN disk validation to global validation

2021-09-07 Thread Peter Krempa
LUN disks are supported only by VMX and QEMU drivers and the VMX implementation is a subset of qemu's implementation, thus we can move the qemu-specific validator to the global validation code providing that we allow the format to be 'none' (qemu driver always sets 'raw' if it's not set) and allow

[PATCH 0/6] qemu: Fix crash when validating a XML without disk's

2021-09-07 Thread Peter Krempa
Apart from fixing the crash the validation code is fixed to do the correct thing and a test case is added. Peter Krempa (6): qemuDomainDefValidateDiskLunSource: Unbreak error messages conf: validate: Move qemu-specific LUN disk validation to global validation conf: validate: Run global

[PATCH v2 1/3] qemu: probe for virtio-blk-pci discard option support

2021-09-07 Thread yuxiating
From: yuxiating Signed-off-by: yuxiating --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h | 1 + tests/qemucapabilitiesdata/caps_4.0.0.aarch64.xml | 1 + tests/qemucapabilitiesdata/caps_4.0.0.ppc64.xml | 1 +

[PATCH v2 0/3] support for virtio-blk-pci discard option

2021-09-07 Thread yuxiating
From: yuxiating v1->v2 add docs/formatdomain.rst for discard_enable add qemuxml2argvtest change virDomainDiskDiscardEnable to virTristateSwitch yuxiating (3): qemu: probe for virtio-blk-pci discard option support conf: support for virtio-blk-pci discard option qemu: command: support for

[PATCH v2 3/3] qemu: command: support for virtio-blk-pci discard option

2021-09-07 Thread yuxiating
From: yuxiating This patch introduces a new attribute "discard". An example of the XML: The corresponding QEMU command line: -device virtio-blk-pci,scsi=off,discard=off,id=virtio-disk0 Signed-off-by: yuxiating --- src/qemu/qemu_command.c | 5 +++

[PATCH v2 2/3] conf: support for virtio-blk-pci discard option

2021-09-07 Thread yuxiating
From: yuxiating DISCARD and WRITE_ZEROES features for machine type >= 4.0 is enabled by default since 5c81161f8041("virtio-blk: add "discard" and "write-zeroes" properties). Virtio_blk kernel driver has a bug that causes memory corruption in virtblk_setup_discard_write_zeroes(); af822aa68fbd

Re: [PATCH 2/2] qemu: support for virtio-blk-pci discard options

2021-09-07 Thread y005616296
>On Tue, Aug 31, 2021 at 20:50:04 +0800, yuxiating wrote: >> DISCARD and WRITE_ZEROES features for machine type >= 4.0 is enabled by default since >> commit 5c81161f804144b146607f890e84613a4cbad95c >> virtio-blk: add "discard" and "write-zeroes" properties >> Sometimes guestos has bugs