Re: [libvirt] [PATCH 00/30] conf: eliminate use of virCapsPtr for parsing/formatting XML

2019-12-05 Thread Michal Privoznik
On 12/4/19 3:20 PM, Daniel P. Berrangé wrote: The virCapsPtr object is a serious source of performance problems for the QEMU driver, because populating it means probing every QEMU system emulator binary installed on the host. This is is crazy because parsing any single XML document only ever nee

Re: [libvirt] [PATCH 0/3] Remove deprecated pc-0.x machine types and related hacks

2019-12-05 Thread Markus Armbruster
Thomas Huth writes: > These have been on the deprecation list since a year now, so it's > time to finally remove the pc-0.x machine types. > > We then can also remove some compatibility hacks in the devices, i.e. > the "use_broken_id" in ac97 and "command_serr_enable" in PCI devices. > > Note tha

Re: [libvirt] [RFC PATCH 4/9] vfio-pci: register default dynamic-trap-bar-info region

2019-12-05 Thread Yan Zhao
On Fri, Dec 06, 2019 at 07:55:30AM +0800, Alex Williamson wrote: > On Wed, 4 Dec 2019 22:26:50 -0500 > Yan Zhao wrote: > > > Dynamic trap bar info region is a channel for QEMU and vendor driver to > > communicate dynamic trap info. It is of type > > VFIO_REGION_TYPE_DYNAMIC_TRAP_BAR_INFO and sub

Re: [libvirt] [RFC PATCH 3/9] vfio/pci: register a default migration region

2019-12-05 Thread Yan Zhao
On Fri, Dec 06, 2019 at 07:55:15AM +0800, Alex Williamson wrote: > On Wed, 4 Dec 2019 22:26:38 -0500 > Yan Zhao wrote: > > > Vendor driver specifies when to support a migration region through cap > > VFIO_PCI_DEVICE_CAP_MIGRATION in vfio_pci_mediate_ops->open(). > > > > If vfio-pci detects this

Re: [libvirt] [PATCH 2/3] hw/audio: Remove the "use_broken_id" hack from the AC97 device

2019-12-05 Thread Philippe Mathieu-Daudé
On 12/5/19 5:06 PM, Thomas Huth wrote: Now that the old pc-0.x machine types are gone, we do not need the "use_broken_id" hack anymore. Signed-off-by: Thomas Huth --- hw/audio/ac97.c | 9 - 1 file changed, 9 deletions(-) diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c index a136b97f6

Re: [libvirt] [PATCH 1/3] hw/i386: Remove the deprecated machines 0.12 up to 0.15

2019-12-05 Thread Philippe Mathieu-Daudé
On 12/5/19 5:06 PM, Thomas Huth wrote: They can't be used reliable for live-migration anymore (see https://lists.gnu.org/archive/html/qemu-devel/2018-12/msg04516.html "reliably"? I'd keep the reference, but also paste Paolo's 7 lines here. Reviewed-by: Philippe Mathieu-Daudé for details) a

[libvirt] [PATCH 1/2] net: Drop the legacy "name" parameter from the -net option

2019-12-05 Thread Thomas Huth
It's been deprecated since QEMU v3.1, so it's time to finally remove it. The "id" parameter can simply be used instead. Signed-off-by: Thomas Huth --- net/net.c| 10 +- qapi/net.json| 4 +--- qemu-deprecated.texi | 12 +++- 3 files changed, 9 insertions(+), 1

[libvirt] [PATCH 0/2] net: Drop legacy "name" from -net and remove NetLegacy

2019-12-05 Thread Thomas Huth
It's time to remove the deprecated "name" parameter from -net. Please have a closer look at the second patch ... I think it should be fine, but I'm not 100% sure whether it's ok for all cases to drop NetLegacy, so please double-check. Thomas Huth (2): net: Drop the legacy "name" parameter from

[libvirt] [PATCH 2/2] net: Drop the NetLegacy structure, always use Netdev instead

2019-12-05 Thread Thomas Huth
Now that the "name" parameter is gone, there is hardly any difference between NetLegacy and Netdev anymore. Drop NetLegacy and always use Netdev to simplify the code quite a bit. Signed-off-by: Thomas Huth --- net/net.c | 74 --- qapi/net.json

Re: [libvirt] [PATCH 1/3] hw/i386: Remove the deprecated machines 0.12 up to 0.15

2019-12-05 Thread Thomas Huth
On 05/12/2019 23.00, Eric Blake wrote: > On 12/5/19 10:06 AM, Thomas Huth wrote: >> They can't be used reliable for live-migration anymore (see >> https://lists.gnu.org/archive/html/qemu-devel/2018-12/msg04516.html >> for details) and have been marked as deprecated since QEMU v4.0, >> so time to re

Re: [libvirt] [PATCH v2 1/4] news: Support for kvm dedicated performance hint in 5.7

2019-12-05 Thread Han Han
On Thu, Dec 5, 2019 at 6:31 PM Andrea Bolognani wrote: > On Mon, 2019-11-11 at 09:58 +0800, Han Han wrote: > > + > > + > > + qemu: Support kvm-hint-dedicated performance hint > > + > > + > > + With state='on'/> and > > + <

[libvirt] [PATCH] news: Update the qemu version that dedicated performance hint is from

2019-12-05 Thread Han Han
KVM dedicated performance hint is added since qemu version 2.10.0 not 2.10.1. Signed-off-by: Han Han --- docs/news.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/news.xml b/docs/news.xml index 2eb3bfdf6e..3ddebfddfb 100644 --- a/docs/news.xml +++ b/docs/news.xml @@

Re: [libvirt] [RFC PATCH 1/9] vfio/pci: introduce mediate ops to intercept vfio-pci ops

2019-12-05 Thread Alex Williamson
On Wed, 4 Dec 2019 22:25:36 -0500 Yan Zhao wrote: > when vfio-pci is bound to a physical device, almost all the hardware > resources are passthroughed. > Sometimes, vendor driver of this physcial device may want to mediate some > hardware resource access for a short period of time, e.g. dirty pa

Re: [libvirt] [RFC PATCH 3/9] vfio/pci: register a default migration region

2019-12-05 Thread Alex Williamson
On Wed, 4 Dec 2019 22:26:38 -0500 Yan Zhao wrote: > Vendor driver specifies when to support a migration region through cap > VFIO_PCI_DEVICE_CAP_MIGRATION in vfio_pci_mediate_ops->open(). > > If vfio-pci detects this cap, it creates a default migration region on > behalf of vendor driver with r

Re: [libvirt] [RFC PATCH 4/9] vfio-pci: register default dynamic-trap-bar-info region

2019-12-05 Thread Alex Williamson
On Wed, 4 Dec 2019 22:26:50 -0500 Yan Zhao wrote: > Dynamic trap bar info region is a channel for QEMU and vendor driver to > communicate dynamic trap info. It is of type > VFIO_REGION_TYPE_DYNAMIC_TRAP_BAR_INFO and subtype > VFIO_REGION_SUBTYPE_DYNAMIC_TRAP_BAR_INFO. > > This region has two fi

[libvirt] Offline manipulation of Dirty Bitmaps by qemu-img

2019-12-05 Thread John Snow
This has come up in the past, and I believe we discussed this at KVM Forum, too: There have been requests from oVirt (via Nir Soffer) to add some offline bitmap manipulation functionality. In the past, our stance has generally been "Use QEMU without an accelerator, and use QMP to manipulate the im

[libvirt] [PATCH] i386: Resolve CPU models to v1 by default

2019-12-05 Thread Eduardo Habkost
When using `query-cpu-definitions` using `-machine none`, QEMU is resolving all CPU models to their latest versions. The actual CPU model version being used by another machine type (e.g. `pc-q35-4.0`) might be different. In theory, this was OK because the correct CPU model version is returned whe

Re: [libvirt] [PATCH 0/8] Don't hold both monitor and agent jobs at the same time

2019-12-05 Thread Eric Blake
On 12/5/19 10:08 AM, Jonathon Jongsma wrote: We have to assume that the guest agent may be malicious, so we don't want to allow any agent queries to block any other libvirt API. By holding a monitor job and an agent job while we're querying the agent, any other threads will be blocked from using

Re: [libvirt] [PATCH for-4.2?] block/qcow2-bitmap: fix crash bug in qcow2_co_remove_persistent_dirty_bitmap

2019-12-05 Thread John Snow
On 12/5/19 4:53 PM, Eric Blake wrote: > On 12/5/19 2:16 PM, John Snow wrote: > Last minute edit: hmm, actually, transaction action introduced in 4.2, so crash is not a regression, only broken block-dirty-bitmap-remove command is a regression... Maybe it's OK for stable. >>>

Re: [libvirt] [PATCH 1/3] hw/i386: Remove the deprecated machines 0.12 up to 0.15

2019-12-05 Thread Eric Blake
On 12/5/19 10:06 AM, Thomas Huth wrote: They can't be used reliable for live-migration anymore (see https://lists.gnu.org/archive/html/qemu-devel/2018-12/msg04516.html for details) and have been marked as deprecated since QEMU v4.0, so time to remove them now. And while we're at it, mark the rem

Re: [libvirt] [PATCH for-4.2?] block/qcow2-bitmap: fix crash bug in qcow2_co_remove_persistent_dirty_bitmap

2019-12-05 Thread Eric Blake
On 12/5/19 2:16 PM, John Snow wrote: Last minute edit: hmm, actually, transaction action introduced in 4.2, so crash is not a regression, only broken block-dirty-bitmap-remove command is a regression... Maybe it's OK for stable. Libvirt REALLY wants to use transaction bitmap management (and re

Re: [libvirt] [PATCH for-4.2?] block/qcow2-bitmap: fix crash bug in qcow2_co_remove_persistent_dirty_bitmap

2019-12-05 Thread John Snow
On 12/5/19 3:09 PM, Eric Blake wrote: > On 12/5/19 1:30 PM, Vladimir Sementsov-Ogievskiy wrote: >> Here is double bug: >> >> First, return error but not set errp. This may lead to: >> qmp block-dirty-bitmap-remove may report success when actually failed >> >> block-dirty-bitmap-remove used in a

Re: [libvirt] [PATCH for-4.2?] block/qcow2-bitmap: fix crash bug in qcow2_co_remove_persistent_dirty_bitmap

2019-12-05 Thread Eric Blake
On 12/5/19 1:30 PM, Vladimir Sementsov-Ogievskiy wrote: Here is double bug: First, return error but not set errp. This may lead to: qmp block-dirty-bitmap-remove may report success when actually failed block-dirty-bitmap-remove used in a transaction will crash, as qmp_transaction will think tha

Re: [libvirt] [PATCH v2 21/25] qemu: backup: Implement stats gathering while the job is running

2019-12-05 Thread Eric Blake
On 12/3/19 11:17 AM, Peter Krempa wrote: We can use the output of 'query-jobs' to figure out some useful information about a backup job. That is progress in case of a push job and scratch file use in case of a pull job. [I still need to finish my review on 20, but this one's easier to knock ou

Re: [libvirt] [PATCH v2 20/25] qemu: Implement backup job APIs and qemu handling

2019-12-05 Thread Eric Blake
[adding some qemu visibility] On 12/5/19 7:34 AM, Peter Krempa wrote: +if (!(mergebitmapsstore = virJSONValueCopy(mergebitmaps))) +return -1; + +if (qemuMonitorTransactionBitmapAdd(actions, +dd->domdisk->src->nodeformat, +

[libvirt] [patch v2 1/1] virt-aa-helper: Add support for smartcard host-certificates

2019-12-05 Thread Arnaud Patard
When emulating smartcard with host certificates, qemu needs to be able to read the certificates files. Add necessary code to add the smartcard certificates file path to the apparmor profile. Passthrough support has been tested with spicevmc and remote-viewer. v2: - Fix CodingStyle - Add support f

Re: [libvirt] [PATCH] net: Remove deprecated [hub_id name] tuple of 'hostfwd_add' / 'hostfwd_remove'

2019-12-05 Thread Dr. David Alan Gilbert
* Thomas Huth (th...@redhat.com) wrote: > It's been deprecated since QEMU v3.1.0. Time to finally remove it now. > > Signed-off-by: Thomas Huth > --- > hmp-commands.hx | 8 > net/hub.c| 23 --- > net/hub.h| 2 -- > net/slirp.c

[libvirt] [PATCH 5/8] qemu: don't hold monitor job for fsinfo

2019-12-05 Thread Jonathon Jongsma
We have to assume that the guest agent may be malicious so we don't want to allow any agent queries to block any other libvirt API. By holding a monitor job while we're querying the agent, we open ourselves up to a DoS. This function does not issue any monitor commands, so we can drop the monitor

[libvirt] [PATCH 8/8] qemu: remove qemuDomainObjBegin/EndJobWithAgent()

2019-12-05 Thread Jonathon Jongsma
This function potentially grabs both a monitor job and an agent job at the same time. This is problematic because it means that a malicious (or just buggy) guest agent can cause a denial of service on the host. The presence of this function makes it easy to do the wrong thing and hold both jobs at

[libvirt] [PATCH 7/8] qemu: remove use of qemuDomainObjBeginJobWithAgent()

2019-12-05 Thread Jonathon Jongsma
This function will be removed in a future commit because it allows the caller to acquire both monitor and agent jobs at the same time. Holding both job types creates a vulnerability to denial of service from a malicious guest agent. qemuDomainSetVcpusFlags() always passes NONE for either the monit

[libvirt] [PATCH 1/8] qemu: don't take agent and monitor job for shutdown

2019-12-05 Thread Jonathon Jongsma
We have to assume that the guest agent may be malicious so we don't want to allow any agent queries to block any other libvirt API. By holding a monitor job while we're querying the agent, we open ourselves up to a DoS. So split the function into separate parts: one that does the agent shutdown an

[libvirt] [PATCH 2/8] qemu: don't hold a monitor and agent job for reboot

2019-12-05 Thread Jonathon Jongsma
We have to assume that the guest agent may be malicious so we don't want to allow any agent queries to block any other libvirt API. By holding a monitor job while we're querying the agent, we open ourselves up to a DoS. Split the function so that we only hold the appropriate type of job while rebo

[libvirt] [PATCH 3/8] qemu: don't hold both jobs for suspend

2019-12-05 Thread Jonathon Jongsma
We have to assume that the guest agent may be malicious so we don't want to allow any agent queries to block any other libvirt API. By holding a monitor job while we're querying the agent, we open ourselves up to a DoS. So split the function up a bit to only hold the monitor job while querying qem

[libvirt] [PATCH 0/8] Don't hold both monitor and agent jobs at the same time

2019-12-05 Thread Jonathon Jongsma
We have to assume that the guest agent may be malicious, so we don't want to allow any agent queries to block any other libvirt API. By holding a monitor job and an agent job while we're querying the agent, any other threads will be blocked from using the monitor while the agent is unresponsive. Be

[libvirt] [PATCH 6/8] qemu: don't hold monitor job for GetGuestInfo()

2019-12-05 Thread Jonathon Jongsma
We have to assume that the guest agent may be malicious so we don't want to allow any agent queries to block any other libvirt API. By holding a monitor job while we're querying the agent, we open ourselves up to a DoS. This function issues several agent commands, but does not issue any monitor co

[libvirt] [PATCH 4/8] qemu: don't hold monitor and agent job when setting time

2019-12-05 Thread Jonathon Jongsma
We have to assume that the guest agent may be malicious so we don't want to allow any agent queries to block any other libvirt API. By holding a monitor job while we're querying the agent, we open ourselves up to a DoS. Split the function so that the portion issuing the agent command only holds an

[libvirt] [PATCH 1/3] hw/i386: Remove the deprecated machines 0.12 up to 0.15

2019-12-05 Thread Thomas Huth
They can't be used reliable for live-migration anymore (see https://lists.gnu.org/archive/html/qemu-devel/2018-12/msg04516.html for details) and have been marked as deprecated since QEMU v4.0, so time to remove them now. And while we're at it, mark the remaining pc-1.x machine types as deprecated

[libvirt] [PATCH 2/3] hw/audio: Remove the "use_broken_id" hack from the AC97 device

2019-12-05 Thread Thomas Huth
Now that the old pc-0.x machine types are gone, we do not need the "use_broken_id" hack anymore. Signed-off-by: Thomas Huth --- hw/audio/ac97.c | 9 - 1 file changed, 9 deletions(-) diff --git a/hw/audio/ac97.c b/hw/audio/ac97.c index a136b97f68..78cda88333 100644 --- a/hw/audio/ac97.c

[libvirt] [PATCH 0/3] Remove deprecated pc-0.x machine types and related hacks

2019-12-05 Thread Thomas Huth
These have been on the deprecation list since a year now, so it's time to finally remove the pc-0.x machine types. We then can also remove some compatibility hacks in the devices, i.e. the "use_broken_id" in ac97 and "command_serr_enable" in PCI devices. Note that there is also the "rombar" prope

[libvirt] [PATCH 3/3] hw/pci: Remove the "command_serr_enable" property

2019-12-05 Thread Thomas Huth
Now that the old pc-0.x machine types have been removed, this config knob is not required anymore. Signed-off-by: Thomas Huth --- hw/pci/pci.c | 6 +- include/hw/pci/pci.h | 3 --- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index cbc7a32

Re: [libvirt] [PATCH v2 20/25] qemu: Implement backup job APIs and qemu handling

2019-12-05 Thread Peter Krempa
On Wed, Dec 04, 2019 at 17:12:14 -0600, Eric Blake wrote: > On 12/3/19 11:17 AM, Peter Krempa wrote: > > This allows to start and manage the backup job. > > > > Signed-off-by: Peter Krempa > > --- > > po/POTFILES.in | 1 + > > src/qemu/Makefile.inc.am | 2 + > > src/qemu/qemu_ba

Re: [libvirt] [PATCH v3] qga: fence guest-set-time if hwclock not available

2019-12-05 Thread Philippe Mathieu-Daudé
On 12/5/19 2:12 PM, Cornelia Huck wrote: On Thu, 5 Dec 2019 14:05:19 +0100 Philippe Mathieu-Daudé wrote: Hi Cornelia, On 12/5/19 12:53 PM, Cornelia Huck wrote: The Posix implementation of guest-set-time invokes hwclock to set/retrieve the time to/from the hardware clock. If hwclock is not av

Re: [libvirt] [PATCH v2 22/25] qemu: driver: Allow cancellation of the backup job

2019-12-05 Thread Peter Krempa
On Wed, Dec 04, 2019 at 11:20:55 +, Daniel Berrange wrote: > On Tue, Dec 03, 2019 at 06:17:44PM +0100, Peter Krempa wrote: > > Use the helper which cancels all blockjobs to perform the backup job > > cancellation in qemuDomainAbortJob. > > > > Signed-off-by: Peter Krempa > > --- > > src/qemu

Re: [libvirt] [RFC PATCH 0/9] Introduce mediate ops in vfio-pci

2019-12-05 Thread Jason Wang
On 2019/12/5 下午4:51, Yan Zhao wrote: On Thu, Dec 05, 2019 at 02:33:19PM +0800, Jason Wang wrote: Hi: On 2019/12/5 上午11:24, Yan Zhao wrote: For SRIOV devices, VFs are passthroughed into guest directly without host driver mediation. However, when VMs migrating with passthroughed VFs, dynamic ho

Re: [libvirt] [PATCH 0/2] qemu: Refactor qemuDomainAbortJob

2019-12-05 Thread Jiri Denemark
On Thu, Dec 05, 2019 at 12:54:37 +0100, Peter Krempa wrote: > Review of my incremental backup series prompted for refactor of > qemuDomainAbortJob > > Peter Krempa (2): > qemu: driver: Split out cancellation of migration from > qemuDomainAbortJob > qemu: Convert aborting of a domain job to

[libvirt] [PATCH 1/2] qemu: driver: Split out cancellation of migration from qemuDomainAbortJob

2019-12-05 Thread Peter Krempa
Following patch will refactor qemuDomainAbortJob to use a per-job-type switch where we will need to abort a migration job in various branches. Save some code duplication by introducing a helper. Signed-off-by: Peter Krempa --- src/qemu/qemu_driver.c | 25 +++-- 1 file change

[libvirt] [PATCH 2/2] qemu: Convert aborting of a domain job to a switch statement

2019-12-05 Thread Peter Krempa
Until now we only really aborted migration via qemuDomainAbortJob. This will change with the upcoming addition of the backup job. Additionally there were a bunch of if statements checking various aspects of the current job. To make it more obvious convert qemuDomainAbortJob to use a switch stateme

[libvirt] [PATCH 0/2] qemu: Refactor qemuDomainAbortJob

2019-12-05 Thread Peter Krempa
Review of my incremental backup series prompted for refactor of qemuDomainAbortJob Peter Krempa (2): qemu: driver: Split out cancellation of migration from qemuDomainAbortJob qemu: Convert aborting of a domain job to a switch statement src/qemu/qemu_driver.c | 90

Re: [libvirt] [PATCH v2] qemuProcessStop: Remove image metadata only when allowed

2019-12-05 Thread Peter Krempa
On Thu, Dec 05, 2019 at 11:51:13 +0100, Michal Privoznik wrote: > In v5.9.0-370-g8fa0374c5b I've tried to fix a bug by removing > some stale XATTRs in qemuProcessStop(). However, I forgot to > do nothing when the VIR_QEMU_PROCESS_STOP_NO_RELABEL flag was > specified. > > Signed-off-by: Michal Priv

Re: [libvirt] [PATCH] docs: document some recent news items

2019-12-05 Thread Michal Privoznik
On 12/5/19 11:36 AM, Daniel P. Berrangé wrote: Document xz compression improvements, docutils build requirements, and dropped python 2 support. Signed-off-by: Daniel P. Berrangé --- docs/news.xml | 37 + 1 file changed, 37 insertions(+) Reviewed-by: Mich

[libvirt] [PATCH v2] qemuProcessStop: Remove image metadata only when allowed

2019-12-05 Thread Michal Privoznik
In v5.9.0-370-g8fa0374c5b I've tried to fix a bug by removing some stale XATTRs in qemuProcessStop(). However, I forgot to do nothing when the VIR_QEMU_PROCESS_STOP_NO_RELABEL flag was specified. Signed-off-by: Michal Privoznik --- src/qemu/qemu_process.c | 12 +++- 1 file changed, 7 ins

Re: [libvirt] [PATCH v2 4/4] news: Introduce virConnectSetIdentity API in 5.8

2019-12-05 Thread Andrea Bolognani
On Mon, 2019-11-11 at 09:58 +0800, Han Han wrote: > + > + > + Introduce virConnectSetIdentity API > + > + > + For splited libvirt daemons, this API can be used to forward uid, > gid s/For splited libvirt daemons/When split daemons are in use/ > +

Re: [libvirt] [PATCH v2 3/4] news: Support vhost-user-gpu in 5.8

2019-12-05 Thread Andrea Bolognani
On Mon, 2019-11-11 at 09:58 +0800, Han Han wrote: > + > + > + qemu: Support vhost-user-gpu > + > + > + Support for running virtio GPUs in seperate processes by vhost-user s/seperate/separate/ s/by vhost-user/with vhost-user/ > + backend. It

[libvirt] [PATCH] docs: document some recent news items

2019-12-05 Thread Daniel P . Berrangé
Document xz compression improvements, docutils build requirements, and dropped python 2 support. Signed-off-by: Daniel P. Berrangé --- docs/news.xml | 37 + 1 file changed, 37 insertions(+) diff --git a/docs/news.xml b/docs/news.xml index 43aa96f497..63d57a85

Re: [libvirt] [PATCH v2 2/4] news: Support to run SLIRP in a separate process in 5.8

2019-12-05 Thread Andrea Bolognani
On Mon, 2019-11-11 at 09:58 +0800, Han Han wrote: > + > + > + > + qemu: Support to run SLIRP networking in a separate process s/to run/running/ > + > + > + User can configure the slirp-helper path in qemu.conf. > + It will start a slirp

[libvirt] [PATCH] net: Remove deprecated [hub_id name] tuple of 'hostfwd_add' / 'hostfwd_remove'

2019-12-05 Thread Thomas Huth
It's been deprecated since QEMU v3.1.0. Time to finally remove it now. Signed-off-by: Thomas Huth --- hmp-commands.hx | 8 net/hub.c| 23 --- net/hub.h| 2 -- net/slirp.c | 44 qemu-

Re: [libvirt] [PATCH v2 1/4] news: Support for kvm dedicated performance hint in 5.7

2019-12-05 Thread Andrea Bolognani
On Mon, 2019-11-11 at 09:58 +0800, Han Han wrote: > + > + > + qemu: Support kvm-hint-dedicated performance hint > + > + > + With and > + , it No need to use "'", a simple "'" will wo

[libvirt] [RFC PATCH 7/9] i40e/vf_migration: register mediate_ops to vfio-pci

2019-12-05 Thread Yan Zhao
register to vfio-pci vfio_pci_mediate_ops when i40e binds to PF to support mediating of VF's vfio-pci ops. unregister vfio_pci_mediate_ops when i40e unbinds from PF. vfio_pci_mediate_ops->open will return success if the device passed in equals to devfn of its VFs Cc: Shaopeng He Signed-off-by:

[libvirt] [RFC PATCH 6/9] sample/vfio-pci/igd_dt: dynamically trap/untrap subregion of IGD bar0

2019-12-05 Thread Yan Zhao
This sample code first returns device cap |= VFIO_PCI_DEVICE_CAP_DYNAMIC_TRAP_BAR, so that vfio-pci driver would create for it a dynamic-trap-bar-info region (of type VFIO_REGION_TYPE_DYNAMIC_TRAP_BAR_INFO and subtype VFIO_REGION_SUBTYPE_DYNAMIC_TRAP_BAR_INFO) Then in igd_dt_get_region_info(), thi

[libvirt] [RFC PATCH 1/9] vfio/pci: introduce mediate ops to intercept vfio-pci ops

2019-12-05 Thread Yan Zhao
when vfio-pci is bound to a physical device, almost all the hardware resources are passthroughed. Sometimes, vendor driver of this physcial device may want to mediate some hardware resource access for a short period of time, e.g. dirty page tracking during live migration. Here we introduce mediate

[libvirt] [RFC PATCH 5/9] samples/vfio-pci/igd_dt: sample driver to mediate a passthrough IGD

2019-12-05 Thread Yan Zhao
This is a sample driver to use mediate ops for passthrough IGDs. This sample driver does not directly bind to IGD device but defines what IGD devices to support via a pciidlist. It registers its vfio_pci_mediate_ops to vfio-pci on driver loading. when vfio_pci->open() calls vfio_pci_mediate_ops-

Re: [libvirt] [RFC PATCH 0/9] Introduce mediate ops in vfio-pci

2019-12-05 Thread Jason Wang
Hi: On 2019/12/5 上午11:24, Yan Zhao wrote: For SRIOV devices, VFs are passthroughed into guest directly without host driver mediation. However, when VMs migrating with passthroughed VFs, dynamic host mediation is required to (1) get device states, (2) get dirty pages. Since device states as well

Re: [libvirt] [RFC PATCH 0/9] Introduce mediate ops in vfio-pci

2019-12-05 Thread Yan Zhao
On Thu, Dec 05, 2019 at 02:33:19PM +0800, Jason Wang wrote: > Hi: > > On 2019/12/5 上午11:24, Yan Zhao wrote: > > For SRIOV devices, VFs are passthroughed into guest directly without host > > driver mediation. However, when VMs migrating with passthroughed VFs, > > dynamic host mediation is required

[libvirt] [RFC PATCH 0/9] Introduce mediate ops in vfio-pci

2019-12-05 Thread Yan Zhao
For SRIOV devices, VFs are passthroughed into guest directly without host driver mediation. However, when VMs migrating with passthroughed VFs, dynamic host mediation is required to (1) get device states, (2) get dirty pages. Since device states as well as other critical information required for d

[libvirt] [RFC PATCH 8/9] i40e/vf_migration: mediate migration region

2019-12-05 Thread Yan Zhao
in vfio_pci_mediate_ops->get_region_info(), migration region's len and flags are overridden and its region index is saved. vfio_pci_mediate_ops->rw() and vfio_pci_mediate_ops->mmap() overrides default rw/mmap for migration region. This is only a sample implementation in i440 vf migration to demon

[libvirt] [RFC PATCH 4/9] vfio-pci: register default dynamic-trap-bar-info region

2019-12-05 Thread Yan Zhao
Dynamic trap bar info region is a channel for QEMU and vendor driver to communicate dynamic trap info. It is of type VFIO_REGION_TYPE_DYNAMIC_TRAP_BAR_INFO and subtype VFIO_REGION_SUBTYPE_DYNAMIC_TRAP_BAR_INFO. This region has two fields: dt_fd and trap. When QEMU detects a device regions of this

[libvirt] [RFC PATCH 3/9] vfio/pci: register a default migration region

2019-12-05 Thread Yan Zhao
Vendor driver specifies when to support a migration region through cap VFIO_PCI_DEVICE_CAP_MIGRATION in vfio_pci_mediate_ops->open(). If vfio-pci detects this cap, it creates a default migration region on behalf of vendor driver with region len=0 and region->ops=null. Vendor driver should override

[libvirt] [RFC PATCH 9/9] i40e/vf_migration: support dynamic trap of bar0

2019-12-05 Thread Yan Zhao
mediate dynamic_trap_info region to dynamically trap bar0. bar0 is sparsely mmaped into 5 sub-regions, of which only two need to be dynamically trapped. By mediating dynamic_trap_info region and telling QEMU this information, the two sub-regions of bar0 can be trapped when migration starts and put

[libvirt] [RFC PATCH 2/9] vfio/pci: test existence before calling region->ops

2019-12-05 Thread Yan Zhao
For regions registered through vfio_pci_register_dev_region(), before calling region->ops, first check whether region->ops is not null. As in the next two patches, dev regions of null region->ops are to be registered by default on behalf of vendor driver, we need to check here to prevent null poin

Re: [libvirt] [PATCH] qemuProcessStop: Remove image metadata only when allowed

2019-12-05 Thread Peter Krempa
On Wed, Dec 04, 2019 at 17:40:53 +0100, Michal Privoznik wrote: > In v5.9.0-370-g8fa0374c5b I've tried to fix a bug by removing > some stale XATTRs in qemuProcessStop(). However, I forgot to > do nothing when the VIR_QEMU_PROCESS_STOP_NO_RELABEL flag was > specified. 🤦 My font does not have the sy