From nobody Mon Feb 9 08:57:19 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1652351767; cv=none; d=zohomail.com; s=zohoarc; b=evM6igAHbYAJbEGKLMzKYD2TxH1DZxtqI/MMLmjx4FZieQEgTJ0sM2TftputyhhkM3gUUKgcCVpuUmhosKNiNNgK1qmpDhT/AqbsFVzwEo6dBsuuQiZjgbGnzzj6kdDbMkBxDb8Yz5kAHR43XZnilCQ4h11Zk11y0pzFNNLKbqE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652351767; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Ldw0eYpD+6ALEshK6JHBfxjRzWpa1iSABwzabi40Uxs=; b=nPRNCy3w3KDeaZVzXXJ6wLuRVKHdsFfhZF+0GWYDYa2mQZ5AfNhIx6HcfdZHF0ear8hNUpI0UiEOHOAiZQm6uXqH7WbYtj1AAuos+B17tzo0SenJsuJZOhh3lUnpcAB8KNRSKWVFIebsSPTPuH1mKCgSMTrlwmwOJgEwR/Bb/wE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1652351767650805.4505209925204; Thu, 12 May 2022 03:36:07 -0700 (PDT) Received: from localhost ([::1]:38426 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1np6Aw-0004A8-J7 for importer@patchew.org; Thu, 12 May 2022 06:36:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53704) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1np651-0001Pi-UQ for qemu-devel@nongnu.org; Thu, 12 May 2022 06:30:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:49790) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1np650-0000oI-9N for qemu-devel@nongnu.org; Thu, 12 May 2022 06:29:59 -0400 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-633-Pz-qvhTdPCqPzHIzAfvB5Q-1; Thu, 12 May 2022 06:29:53 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 088803C0D18E; Thu, 12 May 2022 10:29:53 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.223]) by smtp.corp.redhat.com (Postfix) with ESMTP id 049D556D19D; Thu, 12 May 2022 10:29:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652351397; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ldw0eYpD+6ALEshK6JHBfxjRzWpa1iSABwzabi40Uxs=; b=RVyt9Wm8DIoSl6pFO8sP6DITcCMhs+U76V9Y7IsVTjkTB/aqyM7qXkLQ4nVnc+a1/Y/lMZ mZwMg6kTotIGTDjvqLSg8e+5JtoGcBmh8pE0RvP039cIc5c0NJOq2KOm74b+8gzLEK1dHp fd9rCrW3lNsE+jo5cn4qNXlXqYsrmb8= X-MC-Unique: Pz-qvhTdPCqPzHIzAfvB5Q-1 From: Thomas Huth To: qemu-devel@nongnu.org, Richard Henderson Cc: Alex Williamson , "Michael S. Tsirkin" , Cornelia Huck , Paolo Bonzini , Matthew Rosato Subject: [PULL 2/2] vfio: tolerate migration protocol v1 uapi renames Date: Thu, 12 May 2022 12:29:42 +0200 Message-Id: <20220512102942.1134141-3-thuth@redhat.com> In-Reply-To: <20220512102942.1134141-1-thuth@redhat.com> References: <20220512102942.1134141-1-thuth@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1652351769652100001 Content-Type: text/plain; charset="utf-8" From: Matthew Rosato The v1 uapi is deprecated and will be replaced by v2 at some point; this patch just tolerates the renaming of uapi fields to reflect v1 / deprecated status. Signed-off-by: Matthew Rosato Message-Id: <20220404181726.60291-3-mjrosato@linux.ibm.com> Signed-off-by: Thomas Huth --- hw/vfio/common.c | 2 +- hw/vfio/migration.c | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 159f910421..8e73d3714a 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -381,7 +381,7 @@ static bool vfio_devices_all_running_and_saving(VFIOCon= tainer *container) return false; } =20 - if ((migration->device_state & VFIO_DEVICE_STATE_SAVING) && + if ((migration->device_state & VFIO_DEVICE_STATE_V1_SAVING) && (migration->device_state & VFIO_DEVICE_STATE_RUNNING)) { continue; } else { diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index ff6b45de6b..e109cee551 100644 --- a/hw/vfio/migration.c +++ b/hw/vfio/migration.c @@ -432,7 +432,7 @@ static int vfio_save_setup(QEMUFile *f, void *opaque) } =20 ret =3D vfio_migration_set_state(vbasedev, VFIO_DEVICE_STATE_MASK, - VFIO_DEVICE_STATE_SAVING); + VFIO_DEVICE_STATE_V1_SAVING); if (ret) { error_report("%s: Failed to set state SAVING", vbasedev->name); return ret; @@ -532,7 +532,7 @@ static int vfio_save_complete_precopy(QEMUFile *f, void= *opaque) int ret; =20 ret =3D vfio_migration_set_state(vbasedev, ~VFIO_DEVICE_STATE_RUNNING, - VFIO_DEVICE_STATE_SAVING); + VFIO_DEVICE_STATE_V1_SAVING); if (ret) { error_report("%s: Failed to set state STOP and SAVING", vbasedev->name); @@ -569,7 +569,7 @@ static int vfio_save_complete_precopy(QEMUFile *f, void= *opaque) return ret; } =20 - ret =3D vfio_migration_set_state(vbasedev, ~VFIO_DEVICE_STATE_SAVING, = 0); + ret =3D vfio_migration_set_state(vbasedev, ~VFIO_DEVICE_STATE_V1_SAVIN= G, 0); if (ret) { error_report("%s: Failed to set state STOPPED", vbasedev->name); return ret; @@ -730,7 +730,7 @@ static void vfio_vmstate_change(void *opaque, bool runn= ing, RunState state) * start saving data. */ if (state =3D=3D RUN_STATE_SAVE_VM) { - value =3D VFIO_DEVICE_STATE_SAVING; + value =3D VFIO_DEVICE_STATE_V1_SAVING; } else { value =3D 0; } @@ -768,8 +768,9 @@ static void vfio_migration_state_notifier(Notifier *not= ifier, void *data) case MIGRATION_STATUS_FAILED: bytes_transferred =3D 0; ret =3D vfio_migration_set_state(vbasedev, - ~(VFIO_DEVICE_STATE_SAVING | VFIO_DEVICE_STATE_RESUM= ING), - VFIO_DEVICE_STATE_RUNNING); + ~(VFIO_DEVICE_STATE_V1_SAVING | + VFIO_DEVICE_STATE_RESUMING), + VFIO_DEVICE_STATE_RUNNING); if (ret) { error_report("%s: Failed to set state RUNNING", vbasedev->name= ); } @@ -864,8 +865,10 @@ int vfio_migration_probe(VFIODevice *vbasedev, Error *= *errp) goto add_blocker; } =20 - ret =3D vfio_get_dev_region_info(vbasedev, VFIO_REGION_TYPE_MIGRATION, - VFIO_REGION_SUBTYPE_MIGRATION, &info); + ret =3D vfio_get_dev_region_info(vbasedev, + VFIO_REGION_TYPE_MIGRATION_DEPRECATED, + VFIO_REGION_SUBTYPE_MIGRATION_DEPRECATE= D, + &info); if (ret) { goto add_blocker; } --=20 2.27.0