Re: [libvirt] [PATCH v8 00/14] PCI passthrough support on s390

2018-11-15 Thread Yi Min Zhao
在 2018/11/15 下午8:12, Andrea Bolognani 写道: On Thu, 2018-11-15 at 10:17 +, Daniel P. Berrangé wrote: On Tue, Nov 13, 2018 at 03:35:43PM +0100, Andrea Bolognani wrote: Dan, do you have any remaining concerns about the XML syntax, or can I go ahead and push? Honestly, I still don't much

Re: [libvirt] [PATCH v8 00/14] PCI passthrough support on s390

2018-11-13 Thread Yi Min Zhao
在 2018/11/13 下午10:35, Andrea Bolognani 写道: On Thu, 2018-11-08 at 19:00 +0800, Yi Min Zhao wrote: Abstract The PCI representation in QEMU has been extended for S390 allowing configuration of zPCI attributes like uid (user-defined identifier) and fid (PCI function identifier

Re: [libvirt] [PATCH v8 10/14] conf: Allocate/release 'uid' and 'fid' in PCI address

2018-11-13 Thread Yi Min Zhao
在 2018/11/13 下午10:29, Andrea Bolognani 写道: On Thu, 2018-11-08 at 19:00 +0800, Yi Min Zhao wrote: This patch adds new functions for reservation, assignment and release to handle the uid/fid. If the uid/fid is defined in the domain XML, they will be reserved directly in the collecting phase

[libvirt] [PATCH v8 10/14] conf: Allocate/release 'uid' and 'fid' in PCI address

2018-11-08 Thread Yi Min Zhao
hashtable, and reserve them. For the hotplug case there might not be a zPCI definition. So allocate and reserve uid/fid the case. Assign if needed and reserve uid/fid for the defined case. Signed-off-by: Yi Min Zhao Reviewed-by: Bjoern Walk Reviewed-by: Boris Fiuczynski --- src/conf/device_conf.c

[libvirt] [PATCH v8 14/14] news: Update news for PCI address extension attributes

2018-11-08 Thread Yi Min Zhao
Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Ján Tomko Reviewed-by: Andrea Bolognani --- docs/news.xml | 11 +++ 1 file changed, 11 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 9d98c34df2..4549c0a46f 100644

[libvirt] [PATCH v8 11/14] qemu: Generate and use zPCI device in QEMU command line

2018-11-08 Thread Yi Min Zhao
Add new functions to generate zPCI command string and append it to QEMU command line. And the related tests are added. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Bjoern Walk Reviewed-by: Ján Tomko Reviewed-by: Andrea Bolognani

[libvirt] [PATCH v8 13/14] docs: Add 'uid' and 'fid' information

2018-11-08 Thread Yi Min Zhao
Update 'Device address' section to describe 'zpci' element and its two attributes 'uid' and 'fid'. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Ján Tomko Reviewed-by: Andrea Bolognani --- docs/formatdomain.html.in | 10 +- 1

[libvirt] [PATCH v8 08/14] conf: Introduce parser, formatter for uid and fid

2018-11-08 Thread Yi Min Zhao
This patch introduces new XML parser/formatter functions. Uid is 16-bit and non-zero. Fid is 32-bit. They are the two attributes of zpci which is introduced as PCI address element. Zpci element is parsed and formatted along with PCI address. And add the related test cases. Signed-off-by: Yi Min

[libvirt] [PATCH v8 01/14] conf: Add definitions for 'uid' and 'fid' PCI address attributes

2018-11-08 Thread Yi Min Zhao
Add zPCI definitions in preparation of extending the PCI address with parameters uid (user-defined identifier) and fid (PCI function identifier). Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Bjoern Walk Reviewed-by: Ján Tomko Reviewed

[libvirt] [PATCH v8 00/14] PCI passthrough support on s390

2018-11-08 Thread Yi Min Zhao
irstly. 2. Spare some checks for zpci device. 3. Add vsock and controller support. 4. Add uin32 type schema. 5. Rename zpciuid and zpcifid to zpci_uid and zpci_fid. 6. Always return multibus support on S390. Yi Min Zhao (14): conf: Add definitions for 'uid' and 'fid' PCI address attributes

[libvirt] [PATCH v8 09/14] qemu: Add zPCI address definition check

2018-11-08 Thread Yi Min Zhao
-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Andrea Bolognani --- src/qemu/qemu_domain.c| 36 +++ .../hostdev-vfio-zpci-wrong-arch.xml | 34 ++ tests/qemuxml2argvtest.c | 2 ++ 3 files changed, 72

[libvirt] [PATCH v8 06/14] conf: Introduce address caching for PCI extensions

2018-11-08 Thread Yi Min Zhao
introduce our own callbacks for the two hashtables. In this way, uid/fid is saved in hash key and hash value could be any non-NULL pointer due to no operation on hash value. That is also the reason why we don't introduce hash value free callback. Signed-off-by: Yi Min Zhao Reviewed-by: Boris

[libvirt] [PATCH v8 05/14] qemu: Auto add pci-root for s390/s390x guests

2018-11-08 Thread Yi Min Zhao
The pci-root depends on zpci capability. So autogenerate pci-root if zpci exists. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Bjoern Walk Reviewed-by: Ján Tomko Reviewed-by: Andrea Bolognani --- src/qemu/qemu_domain.c | 1 + 1 file

[libvirt] [PATCH v8 04/14] qemu: Enable PCI multi bus for S390 guests

2018-11-08 Thread Yi Min Zhao
QEMU on s390 supports PCI multibus since forever. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Bjoern Walk Reviewed-by: Ján Tomko Reviewed-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 4 1 file changed, 4 insertions

[libvirt] [PATCH v8 07/14] conf: use virXMLFormatElement() in virDomainDeviceInfoFormat()

2018-11-08 Thread Yi Min Zhao
In order to add zPCI child element for PCI address, we update virDomainDeviceInfoFormat() to format device info by helper function virXMLFormatElement(). Then we could simply format zPCI address into child buffer later. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed

[libvirt] [PATCH v8 12/14] qemu: Add hotpluging support for PCI devices on S390 guests

2018-11-08 Thread Yi Min Zhao
-pci virtio-rng-pci virtio-input-host-pci virtio-keyboard-pci virtio-mouse-pci virtio-tablet-pci vfio-pci SCSIVhost device Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Bjoern Walk Reviewed-by: Ján Tomko Reviewed-by: Andrea

[libvirt] [PATCH v8 03/14] conf: Introduce extension flag and zPCI member for PCI address

2018-11-08 Thread Yi Min Zhao
. Currently only zPCI extension address is introduced to deal with 'uid' and 'fid' on the S390 platform. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Ján Tomko Reviewed-by: Andrea Bolognani --- src/conf/device_conf.h | 4 + src/conf/domain_addr.h | 5 ++ src

[libvirt] [PATCH v8 02/14] qemu: Introduce zPCI capability

2018-11-08 Thread Yi Min Zhao
Let's introduce zPCI capability. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Bjoern Walk Reviewed-by: Ján Tomko Reviewed-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h

Re: [libvirt] [PATCH v7 13/14] docs: Add 'uid' and 'fid' information

2018-11-06 Thread Yi Min Zhao
在 2018/11/5 下午9:22, Andrea Bolognani 写道: On Fri, 2018-10-19 at 11:40 +0800, Yi Min Zhao wrote: [...] @@ -3925,7 +3925,15 @@ (since 0.9.7, requires QEMU 0.13). multifunction defaults to 'off', but should be set to 'on' for function 0 of a slot

Re: [libvirt] [PATCH v7 00/14] PCI passthrough support on s390

2018-10-21 Thread Yi Min Zhao
Kindly ping. @Jan, could you please take a look? @Andrea, I have updated the code as your comments on previous version. 在 2018/10/19 上午11:40, Yi Min Zhao 写道: Abstract The PCI representation in QEMU has been extended for S390 allowing configuration of zPCI attributes like uid (user

Re: [libvirt] [PATCH v6 09/13] conf: Allocate/release 'uid' and 'fid' in PCI address

2018-10-19 Thread Yi Min Zhao
在 2018/10/19 下午3:54, Andrea Bolognani 写道: On Fri, 2018-10-19 at 11:29 +0800, Yi Min Zhao wrote: 在 2018/10/18 下午11:44, Andrea Bolognani 写道: There's still the question of whether Dan is now okay with the XML structure as currently implemented; assuming that's the case, it would be great

[libvirt] [PATCH v7 13/14] docs: Add 'uid' and 'fid' information

2018-10-18 Thread Yi Min Zhao
Update 'Device address' section to describe 'zpci' element and its two attributes 'uid' and 'fid'. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Ján Tomko Reviewed-by: Andrea Bolognani --- docs/formatdomain.html.in | 10 +- 1

[libvirt] [PATCH v7 14/14] news: Update news for PCI address extension attributes

2018-10-18 Thread Yi Min Zhao
Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Ján Tomko Reviewed-by: Andrea Bolognani --- docs/news.xml | 11 +++ 1 file changed, 11 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index dc08c96352..6c2e0f27f1 100644

[libvirt] [PATCH v7 08/14] conf: Introduce parser, formatter for uid and fid

2018-10-18 Thread Yi Min Zhao
This patch introduces new XML parser/formatter functions. Uid is 16-bit and non-zero. Fid is 32-bit. They are the two attributes of zpci which is introduced as PCI address element. Zpci element is parsed and formatted along with PCI address. And add the related test cases. Signed-off-by: Yi Min

[libvirt] [PATCH v7 07/14] conf: use virXMLFormatElement() in virDomainDeviceInfoFormat()

2018-10-18 Thread Yi Min Zhao
In order to add zPCI child element for PCI address, we update virDomainDeviceInfoFormat() to format device info by helper function virXMLFormatElement(). Then we could simply format zPCI address into child buffer later. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski --- src/conf

[libvirt] [PATCH v7 03/14] conf: Introduce a new PCI address extension flag

2018-10-18 Thread Yi Min Zhao
. Currently only zPCI extension address is introduced to deal with 'uid' and 'fid' on the S390 platform. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Ján Tomko Reviewed-by: Andrea Bolognani --- src/conf/device_conf.h | 4 + src/conf/domain_addr.h | 5 ++ src

[libvirt] [PATCH v7 11/14] qemu: Generate and use zPCI device in QEMU command line

2018-10-18 Thread Yi Min Zhao
Add new functions to generate zPCI command string and append it to QEMU command line. And the related tests are added. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Bjoern Walk Reviewed-by: Ján Tomko Reviewed-by: Andrea Bolognani

Re: [libvirt] [PATCH v6 09/13] conf: Allocate/release 'uid' and 'fid' in PCI address

2018-10-18 Thread Yi Min Zhao
在 2018/10/18 下午11:44, Andrea Bolognani 写道: On Thu, 2018-10-18 at 15:13 +0800, Yi Min Zhao wrote: 在 2018/10/17 下午10:30, Andrea Bolognani 写道: On Tue, 2018-10-16 at 11:28 +0800, Yi Min Zhao wrote: I think this would make things complex. If either PCI address or zPCI address exists, we have

[libvirt] [PATCH v7 06/14] conf: Introduce address caching for PCI extensions

2018-10-18 Thread Yi Min Zhao
introduce our own callbacks for the two hashtables. In this way, uid/fid is saved in hash key and hash value could be any non-NULL pointer due to no operation on hash value. That is also the reason why we don't introduce hash value free callback. Signed-off-by: Yi Min Zhao Reviewed-by: Boris

[libvirt] [PATCH v7 05/14] qemu: Auto add pci-root for s390/s390x guests

2018-10-18 Thread Yi Min Zhao
The pci-root depends on zpci capability. So autogenerate pci-root if zpci exists. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Bjoern Walk Reviewed-by: Ján Tomko Reviewed-by: Andrea Bolognani --- src/qemu/qemu_domain.c | 1 + 1 file

[libvirt] [PATCH v7 04/14] qemu: Enable PCI multi bus for S390 guests

2018-10-18 Thread Yi Min Zhao
QEMU on s390 supports PCI multibus since forever. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Bjoern Walk Reviewed-by: Ján Tomko Reviewed-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 4 1 file changed, 4 insertions

[libvirt] [PATCH v7 12/14] qemu: Add hotpluging support for PCI devices on S390 guests

2018-10-18 Thread Yi Min Zhao
-pci virtio-rng-pci virtio-input-host-pci virtio-keyboard-pci virtio-mouse-pci virtio-tablet-pci vfio-pci SCSIVhost device Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Bjoern Walk Reviewed-by: Ján Tomko Reviewed-by: Andrea

[libvirt] [PATCH v7 09/14] qemu: Add zPCI address definition check

2018-10-18 Thread Yi Min Zhao
-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Andrea Bolognani --- src/qemu/qemu_domain.c| 36 +++ .../hostdev-vfio-zpci-wrong-arch.xml | 34 ++ tests/qemuxml2argvtest.c | 2 ++ 3 files changed, 72

[libvirt] [PATCH v7 00/14] PCI passthrough support on s390

2018-10-18 Thread Yi Min Zhao
nd merge testcases into corresponding commits that introduce the functionalities firstly. 2. Spare some checks for zpci device. 3. Add vsock and controller support. 4. Add uin32 type schema. 5. Rename zpciuid and zpcifid to zpci_uid and zpci_fid. 6. Always return multibus support on S390. Yi Min

[libvirt] [PATCH v7 10/14] conf: Allocate/release 'uid' and 'fid' in PCI address

2018-10-18 Thread Yi Min Zhao
hashtable, and reserve them. For the hotplug case there might not be a zPCI definition. So allocate and reserve uid/fid the case. Assign if needed and reserve uid/fid for the defined case. Signed-off-by: Yi Min Zhao Reviewed-by: Bjoern Walk Reviewed-by: Boris Fiuczynski --- src/conf/device_conf.c

[libvirt] [PATCH v7 02/14] qemu: Introduce zPCI capability

2018-10-18 Thread Yi Min Zhao
Let's introduce zPCI capability. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Bjoern Walk Reviewed-by: Ján Tomko Reviewed-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h

[libvirt] [PATCH v7 01/14] conf: Add definitions for 'uid' and 'fid' PCI address attributes

2018-10-18 Thread Yi Min Zhao
Add zPCI definitions in preparation of extending the PCI address with parameters uid (user-defined identifier) and fid (PCI function identifier). Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Bjoern Walk Reviewed-by: Ján Tomko Reviewed

Re: [libvirt] [PATCH v6 09/13] conf: Allocate/release 'uid' and 'fid' in PCI address

2018-10-18 Thread Yi Min Zhao
在 2018/10/17 下午10:30, Andrea Bolognani 写道: On Tue, 2018-10-16 at 11:28 +0800, Yi Min Zhao wrote: 在 2018/10/11 下午10:50, Andrea Bolognani 写道: On Fri, 2018-09-28 at 16:46 +0800, Yi Min Zhao wrote: # conf/device_conf.h +virDeviceInfoPCIAddressExtensionIsPresent

Re: [libvirt] [PATCH v6 07/13] conf: Introduce parser, formatter for uid and fid

2018-10-16 Thread Yi Min Zhao
在 2018/10/16 下午11:38, Andrea Bolognani 写道: On Tue, 2018-10-16 at 11:12 +0800, Yi Min Zhao wrote: 在 2018/10/11 下午7:45, Andrea Bolognani 写道: You can move virZPCIDeviceAddressIsValid() to util/virpci and export it too, to be consistent with virPCIDeviceAddress*(). It has been moved to util

Re: [libvirt] [PATCH v6 07/13] conf: Introduce parser, formatter for uid and fid

2018-10-15 Thread Yi Min Zhao
在 2018/10/11 下午7:45, Andrea Bolognani 写道: On Fri, 2018-09-28 at 16:46 +0800, Yi Min Zhao wrote: This patch introduces new XML parser/formatter functions. Uid is 16-bit and non-zero. Fid is 32-bit. They are the two attributes of zpci which is introduced as PCI address element. Zpci element

Re: [libvirt] [PATCH v6 09/13] conf: Allocate/release 'uid' and 'fid' in PCI address

2018-10-15 Thread Yi Min Zhao
在 2018/10/11 下午10:50, Andrea Bolognani 写道: On Fri, 2018-09-28 at 16:46 +0800, Yi Min Zhao wrote: # conf/device_conf.h +virDeviceInfoPCIAddressExtensionIsPresent; +virDeviceInfoPCIAddressExtensionIsWanted; virDeviceInfoPCIAddressIsPresent; virDeviceInfoPCIAddressIsWanted

Re: [libvirt] [PATCH v6 08/13] qemu: Add zPCI address definition check

2018-10-15 Thread Yi Min Zhao
在 2018/10/15 下午2:59, Andrea Bolognani 写道: On Mon, 2018-10-15 at 09:31 +0800, Yi Min Zhao wrote: 在 2018/10/11 下午9:08, Andrea Bolognani 写道: Forgot to mention: it would be really nice if you added a negative test case showing that using zPCI addresses on eg. x86 will result in a validation

Re: [libvirt] [PATCH v6 00/13] PCI passthrough support on s390

2018-10-14 Thread Yi Min Zhao
在 2018/10/12 下午11:04, Daniel P. Berrangé 写道: On Fri, Sep 28, 2018 at 04:46:13PM +0800, Yi Min Zhao wrote: Abstract The PCI representation in QEMU has recently been extended for S390 allowing configuration of zPCI attributes like uid (user-defined identifier) and fid (PCI function

Re: [libvirt] [PATCH v6 11/13] qemu: Add hotpluging support for PCI devices on S390 guests

2018-10-14 Thread Yi Min Zhao
在 2018/10/12 下午10:57, Andrea Bolognani 写道: On Fri, 2018-09-28 at 16:46 +0800, Yi Min Zhao wrote: [...] @@ -1381,7 +1469,8 @@ qemuDomainAttachNetDevice(virQEMUDriverPtr driver, goto cleanup; } -if (qemuDomainIsS390CCW(vm->def) && +if (net

Re: [libvirt] [PATCH v6 10/13] qemu: Generate and use zPCI device in QEMU command line

2018-10-14 Thread Yi Min Zhao
在 2018/10/12 下午10:44, Andrea Bolognani 写道: On Fri, 2018-09-28 at 16:46 +0800, Yi Min Zhao wrote: [...] @@ -3089,6 +3146,10 @@ qemuBuildControllerDevCommandLine(virCommandPtr cmd, goto cleanup; if (devstr) { +if (qemuCommandAddExtDevice(cmd

Re: [libvirt] [PATCH v6 12/13] docs: Add 'uid' and 'fid' information

2018-10-14 Thread Yi Min Zhao
在 2018/10/12 下午11:03, Andrea Bolognani 写道: On Fri, 2018-09-28 at 16:46 +0800, Yi Min Zhao wrote: [...] @@ -3925,7 +3925,14 @@ (since 0.9.7, requires QEMU 0.13). multifunction defaults to 'off', but should be set to 'on' for function 0 of a slot

Re: [libvirt] [PATCH v6 08/13] qemu: Add zPCI address definition check

2018-10-14 Thread Yi Min Zhao
在 2018/10/11 下午9:08, Andrea Bolognani 写道: On Thu, 2018-10-11 at 14:44 +0200, Andrea Bolognani wrote: [...] With the above addressed, Reviewed-by: Andrea Bolognani Forgot to mention: it would be really nice if you added a negative test case showing that using zPCI addresses on eg. x86

Re: [libvirt] [PATCH v6 06/13] conf: Introduce address caching for PCI extensions

2018-10-14 Thread Yi Min Zhao
在 2018/10/11 下午6:31, Andrea Bolognani 写道: On Fri, 2018-09-28 at 16:46 +0800, Yi Min Zhao wrote: [...] +static void +virDomainPCIAddressSetExtensionFree(virDomainPCIAddressSetPtr addrs) +{ +if (!addrs || !addrs->zpciIds) +return; + +virHashFree(addrs->zpciIds

Re: [libvirt] [PATCH v6 00/13] PCI passthrough support on s390

2018-10-14 Thread Yi Min Zhao
在 2018/10/14 下午8:47, Andrea Bolognani 写道: On Fri, 2018-10-12 at 16:04 +0100, Daniel P. Berrangé wrote: On Fri, Sep 28, 2018 at 04:46:13PM +0800, Yi Min Zhao wrote: [...] I'm not sure if this was discussed in earlier versions, but to me

Re: [libvirt] [PATCH v6 13/13] news: Update news for PCI address extension attributes

2018-10-14 Thread Yi Min Zhao
在 2018/10/12 下午11:05, Andrea Bolognani 写道: On Fri, 2018-09-28 at 16:46 +0800, Yi Min Zhao wrote: [...] + + + qemu: Added support for PCI device passthrough on S390 Talking about "device passthrough" is not accurate, because the new feature can be used fo

Re: [libvirt] [PATCH v6 08/13] qemu: Add zPCI address definition check

2018-10-14 Thread Yi Min Zhao
在 2018/10/11 下午8:44, Andrea Bolognani 写道: On Fri, 2018-09-28 at 16:46 +0800, Yi Min Zhao wrote: [...] +static int +qemuDomainDeviceDefValidateAddress(const virDomainDeviceDef *dev, + virQEMUCapsPtr qemuCaps) +{ +virDomainDeviceInfoPtr info

Re: [libvirt] [PATCH v6 03/13] conf: Introduce a new PCI address extension flag

2018-10-11 Thread Yi Min Zhao
在 2018/10/11 下午4:49, Andrea Bolognani 写道: On Fri, 2018-09-28 at 16:46 +0800, Yi Min Zhao wrote: [...] @@ -166,6 +166,10 @@ struct _virDomainDeviceInfo { * assignment, never saved and never reported. */ int pciConnectFlags; /* enum virDomainPCIConnectFlags

Re: [libvirt] [PATCH v6 01/13] conf: Add definitions for 'uid' and 'fid' PCI address attributes

2018-10-11 Thread Yi Min Zhao
在 2018/10/11 下午3:17, Andrea Bolognani 写道: On Fri, 2018-09-28 at 16:46 +0800, Yi Min Zhao wrote: [...] struct _virPCIDeviceAddress { unsigned int domain; unsigned int bus; unsigned int slot; unsigned int function; int multi; /* virTristateSwitch

[libvirt] [PATCH v6 09/13] conf: Allocate/release 'uid' and 'fid' in PCI address

2018-09-28 Thread Yi Min Zhao
, and reserve it. For hotplug case, there might be or not zPCI definition. So allocate and reserve uid/fid for undefined case. Assign if needed and reserve uid/fid for defined case. Whether using zPCI address refers to extension flags in PCIDeviceAddress. Signed-off-by: Yi Min Zhao --- src/conf/device_conf.c

[libvirt] [PATCH v6 11/13] qemu: Add hotpluging support for PCI devices on S390 guests

2018-09-28 Thread Yi Min Zhao
-pci virtio-rng-pci virtio-input-host-pci virtio-keyboard-pci virtio-mouse-pci virtio-tablet-pci vfio-pci SCSIVhost device Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Bjoern Walk --- src/qemu/qemu_hotplug.c | 162

[libvirt] [PATCH v6 12/13] docs: Add 'uid' and 'fid' information

2018-09-28 Thread Yi Min Zhao
Update 'Device address' section to describe 'zpci' element and its two attributes 'uid' and 'fid'. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann --- docs/formatdomain.html.in | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git

[libvirt] [PATCH v6 13/13] news: Update news for PCI address extension attributes

2018-09-28 Thread Yi Min Zhao
Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann --- docs/news.xml | 11 +++ 1 file changed, 11 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 3ed6ff8aeb..9600c97102 100644 --- a/docs/news.xml +++ b/docs/news.xml @@ -44,6 +44,17

[libvirt] [PATCH v6 03/13] conf: Introduce a new PCI address extension flag

2018-09-28 Thread Yi Min Zhao
. Currently only zPCI extension address is introduced to deal with 'uid' and 'fid' on the S390 platform. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Ján Tomko Reviewed-by: Andrea Bolognani --- src/conf/device_conf.h | 4 + src/conf/domain_addr.h | 5 ++ src

[libvirt] [PATCH v6 00/13] PCI passthrough support on s390

2018-09-28 Thread Yi Min Zhao
troller support. 4. Add uin32 type schema. 5. Rename zpciuid and zpcifid to zpci_uid and zpci_fid. 6. Always return multibus support on S390. Yi Min Zhao (13): conf: Add definitions for 'uid' and 'fid' PCI address attributes qemu: Introduce zPCI capability conf: Introduce a new PCI address

[libvirt] [PATCH v6 10/13] qemu: Generate and use zPCI device in QEMU command line

2018-09-28 Thread Yi Min Zhao
Add new functions to generate zPCI command string and append it to QEMU command line. And the related tests are added. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Bjoern Walk --- src/qemu/qemu_command.c | 102

[libvirt] [PATCH v6 08/13] qemu: Add zPCI address definition check

2018-09-28 Thread Yi Min Zhao
address. Signed-off-by: Yi Min Zhao --- src/qemu/qemu_domain.c | 38 ++ 1 file changed, 38 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index fa9113e542..94a14c582b 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c

[libvirt] [PATCH v6 01/13] conf: Add definitions for 'uid' and 'fid' PCI address attributes

2018-09-28 Thread Yi Min Zhao
Add zPCI definitions in preparation of extending the PCI address with parameters uid (user-defined identifier) and fid (PCI function identifier). Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Bjoern Walk --- cfg.mk| 1 + src

[libvirt] [PATCH v6 04/13] qemu: Enable PCI multi bus for S390 guests

2018-09-28 Thread Yi Min Zhao
QEMU on s390 supports PCI multibus since forever. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Bjoern Walk Reviewed-by: Ján Tomko Reviewed-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 4 1 file changed, 4 insertions

[libvirt] [PATCH v6 07/13] conf: Introduce parser, formatter for uid and fid

2018-09-28 Thread Yi Min Zhao
This patch introduces new XML parser/formatter functions. Uid is 16-bit and non-zero. Fid is 32-bit. They are the two attributes of zpci which is introduced as PCI address element. Zpci element is parsed and formatted along with PCI address. And add the related test cases. Signed-off-by: Yi Min

[libvirt] [PATCH v6 02/13] qemu: Introduce zPCI capability

2018-09-28 Thread Yi Min Zhao
Let's introduce zPCI capability. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Bjoern Walk Reviewed-by: Ján Tomko Reviewed-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h

[libvirt] [PATCH v6 05/13] qemu: Auto add pci-root for s390/s390x guests

2018-09-28 Thread Yi Min Zhao
The pci-root depends on zpci capability. So autogenerate pci-root if zpci exists. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Bjoern Walk Reviewed-by: Ján Tomko Reviewed-by: Andrea Bolognani --- src/qemu/qemu_domain.c | 1 + 1 file

[libvirt] [PATCH v6 06/13] conf: Introduce address caching for PCI extensions

2018-09-28 Thread Yi Min Zhao
introduce our own callbacks for the two hashtables. In this way, uid/fid is saved in hash key and hash value could be any non-NULL pointer due to no operation on hash value. That is also the reason why we don't introduce hash value free callback. Signed-off-by: Yi Min Zhao Reviewed-by: Boris

Re: [libvirt] [PATCH v5 07/13] conf: Introduce parser, formatter for uid and fid

2018-09-25 Thread Yi Min Zhao
在 2018/9/25 下午4:02, Andrea Bolognani 写道: On Tue, 2018-09-25 at 13:15 +0800, Yi Min Zhao wrote: From the high level point of view, code outside of conf/ should, for the most part, not need to concern itself with zPCI at all: it would eg. ask for a PCI address to be allocated

Re: [libvirt] [PATCH v5 07/13] conf: Introduce parser, formatter for uid and fid

2018-09-24 Thread Yi Min Zhao
在 2018/9/20 下午4:28, Andrea Bolognani 写道: On Wed, 2018-09-19 at 16:59 +0800, Yi Min Zhao wrote: 在 2018/9/13 下午9:58, Andrea Bolognani 写道: I realize now that virPCIDeviceAddressIsValid() and virPCIDeviceAddressIsEmpty() are *not* in util/virpci, though I swear that I posted patches moving them

Re: [libvirt] [PATCH v5 07/13] conf: Introduce parser, formatter for uid and fid

2018-09-19 Thread Yi Min Zhao
在 2018/9/13 下午9:58, Andrea Bolognani 写道: On Thu, 2018-09-13 at 17:58 +0800, Yi Min Zhao wrote: 在 2018/9/11 下午8:05, Andrea Bolognani 写道: On Tue, 2018-09-04 at 16:39 +0800, Yi Min Zhao wrote: [...] +bool +virZPCIDeviceAddressIsEmpty(const virZPCIDeviceAddress *addr) +{ +return !(addr->

Re: [libvirt] [PATCH v5 09/13] conf: Allocate/release 'uid' and 'fid' in PCI address

2018-09-18 Thread Yi Min Zhao
在 2018/9/18 下午4:59, Andrea Bolognani 写道: On Tue, 2018-09-18 at 13:51 +0800, Yi Min Zhao wrote: +int +virDomainPCIAddressExtensionReserveNextAddr(virDomainPCIAddressSetPtr addrs, +virPCIDeviceAddressPtr dev

Re: [libvirt] [PATCH v5 11/13] qemu: Add hotpluging support for PCI devices on S390 guests

2018-09-18 Thread Yi Min Zhao
在 2018/9/17 下午8:40, Andrea Bolognani 写道: qemuDomainObjEnterMonitor(driver, vm); -ret = qemuMonitorAddDevice(priv->mon, devstr); + +if (qemuDomainAttachExtensionDevice(priv->mon, >info) < 0) { +ignore_value(qemuDomainObjExitMonitor(driver, vm)); +goto cleanup;

Re: [libvirt] [PATCH v5 10/13] qemu: Generate and use zPCI device in QEMU command line

2018-09-18 Thread Yi Min Zhao
在 2018/9/17 下午8:33, Andrea Bolognani 写道: On Mon, 2018-09-17 at 13:51 +0800, Yi Min Zhao wrote: 在 2018/9/11 下午10:31, Andrea Bolognani 写道: +{ +if (!virZPCIDeviceAddressIsEmpty(>addr.pci.zpci)) +return qemuAppendZPCIDevStr(cmd, dev); + +return 0; I'd rather

Re: [libvirt] [PATCH v5 09/13] conf: Allocate/release 'uid' and 'fid' in PCI address

2018-09-17 Thread Yi Min Zhao
在 2018/9/17 下午8:05, Andrea Bolognani 写道: On Mon, 2018-09-17 at 13:43 +0800, Yi Min Zhao wrote: 在 2018/9/11 下午9:59, Andrea Bolognani 写道: +static void +virDomainZPCIAddressReleaseUid(virHashTablePtr set, + virZPCIDeviceAddressPtr addr

Re: [libvirt] [PATCH v5 11/13] qemu: Add hotpluging support for PCI devices on S390 guests

2018-09-17 Thread Yi Min Zhao
在 2018/9/11 下午11:21, Andrea Bolognani 写道: On Tue, 2018-09-04 at 16:39 +0800, Yi Min Zhao wrote: [...] +static int +qemuDomainAttachExtensionDevice(qemuMonitorPtr mon, +virDomainDeviceInfoPtr info) +{ +if (!virZPCIDeviceAddressIsEmpty(>addr.pci.z

Re: [libvirt] [PATCH v5 10/13] qemu: Generate and use zPCI device in QEMU command line

2018-09-16 Thread Yi Min Zhao
在 2018/9/11 下午10:31, Andrea Bolognani 写道: On Tue, 2018-09-04 at 16:39 +0800, Yi Min Zhao wrote: [...] +char * +qemuBuildZPCIDevStr(virDomainDeviceInfoPtr dev) +{ +virBuffer buf = VIR_BUFFER_INITIALIZER; + +virBufferAddLit(, "zpci"); +virBufferAsprintf(, &quo

Re: [libvirt] [PATCH v5 09/13] conf: Allocate/release 'uid' and 'fid' in PCI address

2018-09-16 Thread Yi Min Zhao
在 2018/9/11 下午9:59, Andrea Bolognani 写道: On Tue, 2018-09-04 at 16:39 +0800, Yi Min Zhao wrote: [...] If the user define zPCI extension address but zPCI capability doesn't exist, an error will be reported. You're (no longer) checking for the capability here, so the commit message should

Re: [libvirt] [PATCH v5 08/13] qemu: Add zPCI address definition check

2018-09-16 Thread Yi Min Zhao
在 2018/9/13 下午7:47, Andrea Bolognani 写道: Just remove the full stop, like virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s", _("This QEMU binary doesn't support zPCI")); AhGot it. -- Yi Min -- libvir-list mailing list libvir-list@redhat.com

Re: [libvirt] [PATCH v5 08/13] qemu: Add zPCI address definition check

2018-09-13 Thread Yi Min Zhao
在 2018/9/11 下午8:44, Andrea Bolognani 写道: On Tue, 2018-09-04 at 16:39 +0800, Yi Min Zhao wrote: We should ensure that the Qemu should support zPCI when zPCI address is s/Qemu/QEMU/ Sure. [...] +static int +qemuDomainZPCIAddressDefValidate(virDomainDeviceDef *dev

Re: [libvirt] [PATCH v5 07/13] conf: Introduce parser, formatter for uid and fid

2018-09-13 Thread Yi Min Zhao
在 2018/9/11 下午8:05, Andrea Bolognani 写道: On Tue, 2018-09-04 at 16:39 +0800, Yi Min Zhao wrote: [...] +static int +virZPCIDeviceAddressIsValid(virZPCIDeviceAddressPtr zpci) This is a predicate, so it should return a bool. OK. [...] +virReportError(VIR_ERR_XML_ERROR

Re: [libvirt] [PATCH v5 06/13] conf: Introduce address caching for PCI extensions

2018-09-13 Thread Yi Min Zhao
在 2018/9/13 下午4:23, Andrea Bolognani 写道: On Thu, 2018-09-13 at 15:58 +0800, Yi Min Zhao wrote: 在 2018/9/12 下午6:37, Andrea Bolognani 写道: Too bad fid can go all the way to UINT32_MAX, otherwise we could have just stored them in the pointer after offsetting them by one and thus worked around

Re: [libvirt] [PATCH v5 06/13] conf: Introduce address caching for PCI extensions

2018-09-13 Thread Yi Min Zhao
在 2018/9/12 下午6:37, Andrea Bolognani 写道: On Wed, 2018-09-12 at 16:34 +0800, Yi Min Zhao wrote: 在 2018/9/12 下午3:35, Yi Min Zhao 写道: This makes sense and seems to work just fine; however, you are allocating and releasing a bunch of small integers, which seems a bit wasteful. vircgroup

Re: [libvirt] [PATCH v5 06/13] conf: Introduce address caching for PCI extensions

2018-09-12 Thread Yi Min Zhao
在 2018/9/12 下午6:37, Andrea Bolognani 写道: On Wed, 2018-09-12 at 16:34 +0800, Yi Min Zhao wrote: 在 2018/9/12 下午3:35, Yi Min Zhao 写道: This makes sense and seems to work just fine; however, you are allocating and releasing a bunch of small integers, which seems a bit wasteful. vircgroup

Re: [libvirt] [PATCH v5 06/13] conf: Introduce address caching for PCI extensions

2018-09-12 Thread Yi Min Zhao
在 2018/9/12 下午3:35, Yi Min Zhao 写道: +static void * +virZPCIAddrCopy(const void *name) +{ +    unsigned int *copy; + +    if (VIR_ALLOC(copy) < 0) +    return NULL; + +    *copy = *((unsigned int *)name); +    return (void *)copy; +} + + +static void +virZPCIAddrKeyFree(void *n

Re: [libvirt] [PATCH v5 06/13] conf: Introduce address caching for PCI extensions

2018-09-12 Thread Yi Min Zhao
在 2018/9/11 下午7:34, Andrea Bolognani 写道: On Tue, 2018-09-04 at 16:39 +0800, Yi Min Zhao wrote: This patch provides a caching mechanism for the device address extensions uid and fid on S390. For efficient sparse address allocation, we introduce two hash tables for uid/fid which hold

Re: [libvirt] [PATCH v5 03/13] conf: Introduce a new PCI address extension flag

2018-09-11 Thread Yi Min Zhao
在 2018/9/11 下午4:37, Andrea Bolognani 写道: On Tue, 2018-09-04 at 16:39 +0800, Yi Min Zhao wrote: [...] @@ -164,6 +164,7 @@ struct _virDomainDeviceInfo { * assignment, never saved and never reported. */ int pciConnectFlags; /* enum virDomainPCIConnectFlags */ +int

[libvirt] [PATCH v5 11/13] qemu: Add hotpluging support for PCI devices on S390 guests

2018-09-04 Thread Yi Min Zhao
-pci virtio-rng-pci virtio-input-host-pci virtio-keyboard-pci virtio-mouse-pci virtio-tablet-pci vfio-pci SCSIVhost device Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Bjoern Walk Reviewed-by: Ján Tomko --- src/qemu

[libvirt] [PATCH v5 08/13] qemu: Add zPCI address definition check

2018-09-04 Thread Yi Min Zhao
We should ensure that the Qemu should support zPCI when zPCI address is defined in XML. Otherwise the error should be reported. So this patch introduces the validation of zPCI address definition for qemuDomainDeviceDefValidate(). Signed-off-by: Yi Min Zhao --- src/qemu/qemu_domain.c | 26

[libvirt] [PATCH v5 04/13] qemu: Enable PCI multi bus for S390 guests

2018-09-04 Thread Yi Min Zhao
QEMU on s390 supports PCI multibus since forever. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Bjoern Walk Reviewed-by: Ján Tomko Reviewed-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 4 1 file changed, 4 insertions

[libvirt] [PATCH v5 05/13] qemu: Auto add pci-root for s390/s390x guests

2018-09-04 Thread Yi Min Zhao
The pci-root depends on zpci capability. So autogenerate pci-root if zpci exists. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Bjoern Walk Reviewed-by: Ján Tomko Reviewed-by: Andrea Bolognani --- src/qemu/qemu_domain.c | 1 + 1 file

[libvirt] [PATCH v5 03/13] conf: Introduce a new PCI address extension flag

2018-09-04 Thread Yi Min Zhao
This patch introduces a new attribute PCI address extension flag to deal with the extension PCI attributes such as 'uid' and 'fid' on the S390 platform. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Ján Tomko Reviewed-by: Andrea Bolognani --- src/conf/device_conf.h

[libvirt] [PATCH v5 02/13] qemu: Introduce zPCI capability

2018-09-04 Thread Yi Min Zhao
Let's introduce zPCI capability. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Bjoern Walk Reviewed-by: Ján Tomko Reviewed-by: Andrea Bolognani --- src/qemu/qemu_capabilities.c | 2 ++ src/qemu/qemu_capabilities.h

[libvirt] [PATCH v5 00/13] PCI passthrough support on s390

2018-09-04 Thread Yi Min Zhao
lways return multibus support on S390. Yi Min Zhao (13): conf: Add definitions for 'uid' and 'fid' PCI address attributes qemu: Introduce zPCI capability conf: Introduce a new PCI address extension flag qemu: Enable PCI multi bus for S390 guests qemu: Auto add pci-root for s390/s390x g

[libvirt] [PATCH v5 12/13] docs: Add 'uid' and 'fid' information

2018-09-04 Thread Yi Min Zhao
Update 'Device address' section to describe the 'uid' and 'fid' attributes. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Ján Tomko Reviewed-by: Andrea Bolognani --- docs/formatdomain.html.in | 9 - 1 file changed, 8 insertions

[libvirt] [PATCH v5 10/13] qemu: Generate and use zPCI device in QEMU command line

2018-09-04 Thread Yi Min Zhao
Add new functions to generate zPCI command string and append it to QEMU command line. And the related tests are added. Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Bjoern Walk Reviewed-by: Ján Tomko --- src/qemu/qemu_command.c

[libvirt] [PATCH v5 09/13] conf: Allocate/release 'uid' and 'fid' in PCI address

2018-09-04 Thread Yi Min Zhao
Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Ján Tomko --- src/conf/device_conf.c | 7 ++ src/conf/device_conf.h | 1 + src/conf/domain_addr.c | 242 + src/conf/domain_addr.h | 15 +++ src/libvirt_private.syms

[libvirt] [PATCH v5 06/13] conf: Introduce address caching for PCI extensions

2018-09-04 Thread Yi Min Zhao
introduce our own callbacks for the two hashtables. In this way, uid/fid is saved in hash key and hash value could be any non-NULL pointer due to no operation on hash value. That is also the reason why we don't introduce hash value free callback. Signed-off-by: Yi Min Zhao Reviewed-by: Boris

[libvirt] [PATCH v5 13/13] news: Update news for PCI address extension attributes

2018-09-04 Thread Yi Min Zhao
Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Ján Tomko --- docs/news.xml | 10 ++ 1 file changed, 10 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 9a17b2f612..fc54a3b6ff 100644 --- a/docs/news.xml +++ b/docs

[libvirt] [PATCH v5 01/13] conf: Add definitions for 'uid' and 'fid' PCI address attributes

2018-09-04 Thread Yi Min Zhao
Add zPCI definitions in preparation of extending the PCI address with parameters uid (user-defined identifier) and fid (PCI function identifier). Signed-off-by: Yi Min Zhao Reviewed-by: Boris Fiuczynski Reviewed-by: Stefan Zimmermann Reviewed-by: Bjoern Walk Reviewed-by: Ján Tomko

[libvirt] [PATCH v5 07/13] conf: Introduce parser, formatter for uid and fid

2018-09-04 Thread Yi Min Zhao
This patch introduces new XML parser/formatter functions. Uid is 16-bit and non-zero. Fid is 32-bit. They are added as two new attributes of PCI address, and parsed/formatted along with PCI address parser/formatter. The related test is also added. Signed-off-by: Yi Min Zhao Reviewed-by: Boris

  1   2   3   >