From nobody Fri May 3 13:24:53 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1627489443; cv=none; d=zohomail.com; s=zohoarc; b=OYDGWh6A1mTZY4OwkpSYAM/VugCNc3g/St9rsiY0ivKrsTj4QmMRNeQJVZXZ+/ZflBm3KrHBsL/t+l9j8dNsdKCJ9TxpysW8lWBHQ7BTBwhuuvYkZEwR2EXCW7QnWWlI30slVh9uM+aA6TqZaBDlwrtzDAXjtlT5T9f1idiPSqI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1627489443; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=dPQKiV6kXZcBxIvsP3+8iwL3YChQJ9keafovgwa4538=; b=K8dZ8lLEjgOcg+CWvMS1F+LSnCzfIYMwDf6jT1YQPrqbycQBUEtrVk5M4RSem/Z9kFMd5yCy8dzgv+nvUTuTlsq0Xb8wZXfDDPClKxD3tHdCihd7ViahwGSHBuLcmJ1v5Nt3MAEn0+KE0Ys9duZN2BJoUCiVDW7Pm6YpZGUGDCQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1627489443576997.4598739810275; Wed, 28 Jul 2021 09:24:03 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-492-3FaNFo5wPMODjFfEIDDQ_A-1; Wed, 28 Jul 2021 12:24:00 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 932341084F56; Wed, 28 Jul 2021 16:23:53 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4FAEF5C1BB; Wed, 28 Jul 2021 16:23:51 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8222A4BB7C; Wed, 28 Jul 2021 16:23:47 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16SGHe1w020145 for ; Wed, 28 Jul 2021 12:17:40 -0400 Received: by smtp.corp.redhat.com (Postfix) id 31EF760C0F; Wed, 28 Jul 2021 16:17:40 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.34.244.239]) by smtp.corp.redhat.com (Postfix) with ESMTP id A1A4160C05 for ; Wed, 28 Jul 2021 16:17:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627489442; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=dPQKiV6kXZcBxIvsP3+8iwL3YChQJ9keafovgwa4538=; b=hf/JPmQl8LHlWPwKO/n+/BuvFwTxxbQEW0hLnvXfhkVvnnbNn7Af0ar/CQBEFJYegw03Ky bvkTVpSJe1KQrpnv1Zj9nY4Tx6ZYZ7uzZWyqHKfB9xRxW+fLqzNizm1ejQzukKbaSUggNc LQYZIFjISDgu4NSDK73tCRZ4+uiG10w= X-MC-Unique: 3FaNFo5wPMODjFfEIDDQ_A-1 From: Kristina Hanicova To: libvir-list@redhat.com Subject: [PATCH] qemu_migration: check for interface type 'hostdev' Date: Wed, 28 Jul 2021 18:17:25 +0200 Message-Id: <5be50dda9e52a64f9438a88711838c376e6dfdc7.1627488452.git.khanicov@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1627489444646100001 Content-Type: text/plain; charset="utf-8" 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=3D1942315 Signed-off-by: Kristina Hanicova --- src/qemu/qemu_migration.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index 4d651aeb1a..34eee9c8b6 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1272,9 +1272,15 @@ qemuMigrationSrcIsAllowedHostdev(const virDomainDef = *def) } =20 /* 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) { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, + _("cannot migrate a domain with "), + virDomainNetTypeToString(hostdev->paren= tnet->type)); + } else { + virReportError(VIR_ERR_OPERATION_UNSUPPORTED, + _("cannot migrate a domain with "), + virDomainHostdevSubsysTypeToString(host= dev->source.subsys.type)); + } return false; =20 case VIR_DOMAIN_HOSTDEV_SUBSYS_TYPE_LAST: --=20 2.31.1