[libvirt PATCH 0/2] Fix bonehead errors in <hostdev> <teaming> support

I hadn't caught the code omission because my migration tester system was out of commission, and I stupidly assumed migration would work. The docs typo was pure lack of attention. This (sub) feature will be new for this release, and there is an open BZ for it downstream, so it would be nice to get the fix ACKed and pushed in time for the release. Laine Stump (2): qemu: allow migration of generic <hostdev> with <teaming> docs: fix bad cut/paste in <teaming> example docs/formatdomain.rst | 3 +-- src/qemu/qemu_migration.c | 16 ++++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) -- 2.29.2

Commit 010ed0856b and commit db64acfbda introduced the ability to use the <teaming> element in a generic <hostdev> (previously it could only be used with <interface type='hostdev'>). However, the patch omitted one crucial detail - along with parsing the <teaming> element in <hostdev>, and adding the necessary info to the qemu commandline, we also need to modify qemuMigrationSrcIsAllowedHostdev() to allow migration when the generic <hostdev> has a <teaming> element. https://bugzilla.redhat.com/1927984 Fixes: 010ed0856bb06f439e6fdf44e4f529f53441c398 Reported-by: Yalan Zhang <yalzhang@redhat.com> Signed-off-by: Laine Stump <laine@redhat.com> --- src/qemu/qemu_migration.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 08f60c6db3..d7231f68ae 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1247,13 +1247,17 @@ qemuMigrationSrcIsAllowedHostdev(const virDomainDef *def) case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_PCI: /* - * if this is a network interface with <teaming - * type='transient'>, migration *is* allowed because - * the device will be auto-unplugged by QEMU during - * migration. + * if the device has a <teaming type='transient'> + * element, then migration *is* allowed because the + * device will be auto-unplugged by QEMU during + * migration. Generic <hostdev> and <interface + * type='hostdev'> have their teaming configuration + * stored in different places. */ - if (hostdev->parentnet && hostdev->parentnet->teaming && - hostdev->parentnet->teaming->type == VIR_DOMAIN_NET_TEAMING_TYPE_TRANSIENT) { + if ((hostdev->teaming && + hostdev->teaming->type == VIR_DOMAIN_NET_TEAMING_TYPE_TRANSIENT) || + (hostdev->parentnet && hostdev->parentnet->teaming && + hostdev->parentnet->teaming->type == VIR_DOMAIN_NET_TEAMING_TYPE_TRANSIENT)) { continue; } -- 2.29.2

When the parser and docs were enhanced to support a <teaming> element in a generic <hostdev>, the example XML for formatdomain.rst was cut/pasted from the example for <interface type='hostdev'>. In my haste I neglected to remove the <mac address='blah'/> element (which is unused/ignored for generic <hostdev> and change the closing tag from </interface> to </hostdev> https://bugzilla.redhat.com/1927984 Fixes: db64acfbda59ad22b671580fda13968c60bb8c1a Reported-by: Yalan Zhang <yalzhang@redhat.com> Signed-off-by: Laine Stump <laine@redhat.com> --- docs/formatdomain.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/formatdomain.rst b/docs/formatdomain.rst index e23bcc3e5a..937b0da012 100644 --- a/docs/formatdomain.rst +++ b/docs/formatdomain.rst @@ -4884,9 +4884,8 @@ plain ``<hostdev>`` device. <source> <address domain='0x0000' bus='0x00' slot='0x07' function='0x0'/> </source> - <mac address='00:11:22:33:44:55:66'/> <teaming type='transient' persistent='ua-backup0'/> - </interface> + </hostdev> ... This device must be a network device, but not necessarily an SRIOV -- 2.29.2

On a Tuesday in 2021, Laine Stump wrote:
I hadn't caught the code omission because my migration tester system was out of commission, and I stupidly assumed migration would work. The docs typo was pure lack of attention.
This (sub) feature will be new for this release, and there is an open BZ for it downstream, so it would be nice to get the fix ACKed and pushed in time for the release.
Laine Stump (2): qemu: allow migration of generic <hostdev> with <teaming> docs: fix bad cut/paste in <teaming> example
docs/formatdomain.rst | 3 +-- src/qemu/qemu_migration.c | 16 ++++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-)
Reviewed-by: Ján Tomko <jtomko@redhat.com> Jano
participants (2)
-
Ján Tomko
-
Laine Stump