From: Kristina Hanicova Date: Wed, 28 Jul 2021 16:17:25 +0000 (+0200) Subject: qemu_migration: check for interface type 'hostdev' X-Git-Tag: v7.7.0-rc1~304 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=814a8aaeeb51fa0fd65a030853cc86bc6d29b9d8;p=thirdparty%2Flibvirt.git qemu_migration: check for interface type 'hostdev' When we try to migrate vm, we check if it contains only devices that are able to migrate. If a hostdev device is not able to migrate we raise an error with , but it can actually be , so we need to check if hostdev device was created by us from interface and show the right error message. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1942315 Signed-off-by: Kristina Hanicova Signed-off-by: Michal Privoznik Reviewed-by: Michal Privoznik --- diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 4d651aeb1a..b441d0226c 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1272,9 +1272,17 @@ qemuMigrationSrcIsAllowedHostdev(const virDomainDef *def) } /* all other PCI hostdevs can't be migrated */ - virReportError(VIR_ERR_OPERATION_UNSUPPORTED, - _("cannot migrate a domain with "), - virDomainHostdevSubsysTypeToString(hostdev->source.subsys.type)); + if (hostdev->parentnet) { + virDomainNetType actualType = virDomainNetGetActualType(hostdev->parentnet); + + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, + _("cannot migrate a domain with "), + virDomainNetTypeToString(actualType)); + } else { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, + _("cannot migrate a domain with "), + virDomainHostdevSubsysTypeToString(hostdev->source.subsys.type)); + } return false; case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST: