From patchwork Wed Nov 23 15:21:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 627926 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp3233083pvb; Wed, 23 Nov 2022 07:22:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf5v8q6jsXp4D1hg8PfNJ+XO3HcYTJNJIMtaLiaDndSL0VHA3kZasAKKRMsc3aBlZgoHGA8+ X-Received: by 2002:ac8:1001:0:b0:3a4:ee86:d3a4 with SMTP id z1-20020ac81001000000b003a4ee86d3a4mr12363867qti.596.1669216939141; Wed, 23 Nov 2022 07:22:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669216939; cv=none; d=google.com; s=arc-20160816; b=OOgDCQRdhKnRD/EueWX2ql8e2lefHd8TMMhuQndXusUtFLyBs08vFlWL6fG90qjNG4 5Qceg6ZE/eLAJKTWj6ktR+jYCYxMn6uq/WTB58N8/5eRnsBmUiwuSXrY+vjWoT4D8X4y z0xKqDmrahiozn16BgfCb4+JjxTyS88kclOEXwpv2fwxiQkwgzKbJOCAh8Yah1VlFvl4 ZhoYXjTm/c2pKBOVpibhPsr5wZhFBIXJdUnq3APJf5xHGjF6esV/KJmzmb8nHdVohjo3 CFRWj9hJ1QSO0KLYerea+SmFWIhICSsoAAyP/TJxxfcqUTpx8IPCvOKgHkFeVn/jc2GJ RTtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=t6i2chXybZhHzH7CmCmYDx3Yy0sdjv4ra3ikgYcmUMA=; b=FQ47giOf/bLCpMIg07/t1XZLIQDiJYYOwUhC/CuYqCTtT+jaXfgoirmGkEzgfI8o9b 6j2rGWRFgBdJZ7dnETJASbNdK2d5Z3E6cwC0xBdNt4vEBJURhOLOVbxx93mZTDEIsBBF Uue3g/UE1NxeMV7AaTE8SsLWUQABbji0e/BNqhadHh/ft8mgkFLcIlQiQkZL+0P2gQKG B+b43cxHyK3d0LgRWT567sNt3Lcg0NCHDFLL08Ba9Uj+MRgdvcbu0m3niIG/VzssrHBx 5HB7SuMYNidfJzR4mI7cZhSPnLimSx/4tj2agF2Z8spqcg21giSZSBcmwOGH2JBDjVP/ Dj3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p3FH76cr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u10-20020a05620a084a00b006ef131e9c50si8944265qku.439.2022.11.23.07.22.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 23 Nov 2022 07:22:19 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=p3FH76cr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oxrZF-0004pP-4B; Wed, 23 Nov 2022 10:21:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oxrZD-0004or-18 for qemu-devel@nongnu.org; Wed, 23 Nov 2022 10:21:39 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oxrZB-0006Tl-7o for qemu-devel@nongnu.org; Wed, 23 Nov 2022 10:21:38 -0500 Received: by mail-wm1-x336.google.com with SMTP id v124-20020a1cac82000000b003cf7a4ea2caso1680453wme.5 for ; Wed, 23 Nov 2022 07:21:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=t6i2chXybZhHzH7CmCmYDx3Yy0sdjv4ra3ikgYcmUMA=; b=p3FH76crndeXD+XKP0OoU85ergRXB5OSpex59vTnk8TS1KyBjJQ7XICxB/LyOBbJh5 RwCGpVqXbz3ZwhL+KH41+lt3LoBeED6XqOUmIzZNRd6eldnqlwd5fCdl4i021LOMm3eg N5wOFMdxqtN+z3xQn0sD4J0sbC1ht6aqVp7TRydRHMviUDCsUTb/59gq0fewF2Dm6n4T /ZrMGjt8HpL7LCuQHwHO4c8UQWWkufqjeAYYEXQrF7y39nZRBbnY5diTWyuBMBv02N8n MkGhKCW7+Ll/P5eY+BDPOgGiyyUBkCLKOPjQOl35ZthKEPrkzXfqJUzpI6+5y1R2SgGm Rcnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=t6i2chXybZhHzH7CmCmYDx3Yy0sdjv4ra3ikgYcmUMA=; b=J1izaVv9MKPxKPoVTFT1OYoUPLnJAgeHfmJFjuooLUB5DnrEhCcesYhDmHtuWhPwg2 b0KaU9y5y32O+K7ogi4gDyKg8JSM937yQdDYKlWxHWtlWSqBiDo3E/5qs+QM18qGEdTs QTWqBjuRfEPjvETS+VhT84bhoGvuQC1ALpWvczoM27aOdb4CW1xiP7BCVTNb5WGQEL+9 RkRdZIgW/YMKhb09LPCdBzy1hmZc/iudOnjSuLome3FbDE5QaBalcfm+9FeH+T7rvknk sU74aWg9WI8tSVQWLGaoEDUKZVxbYwc5/2MshpvqEfOX1n5tpcquZGat2CSWEmvvfPlg rxzw== X-Gm-Message-State: ANoB5pmZWmpGXCq7kqGnluwo79Uw/Cnqb7c6AKwm+HlEGIp/oeAyav8Z 0Kf5K7HxDh4/CfiSXFhFVzfm5A== X-Received: by 2002:a05:600c:5124:b0:3cf:878c:6555 with SMTP id o36-20020a05600c512400b003cf878c6555mr9808420wms.38.1669216895730; Wed, 23 Nov 2022 07:21:35 -0800 (PST) Received: from zen.linaroharston ([185.81.254.11]) by smtp.gmail.com with ESMTPSA id l13-20020a5d668d000000b00236488f62d6sm16965023wru.79.2022.11.23.07.21.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Nov 2022 07:21:35 -0800 (PST) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 84A071FFB7; Wed, 23 Nov 2022 15:21:34 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: slp@redhat.com, mst@redhat.com, marcandre.lureau@redhat.com, stefanha@redhat.com, mathieu.poirier@linaro.org, viresh.kumar@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= Subject: [PATCH for 7.2-rc3 v1 0/2] virtio fixes Date: Wed, 23 Nov 2022 15:21:32 +0000 Message-Id: <20221123152134.179929-1-alex.bennee@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x336.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Hi, This hopefully fixes the problems with VirtIO migration caused by the previous refactoring of virtio_device_started(). That introduced a different order of checking which didn't give the VM state primacy but wasn't noticed as we don't properly exercise VirtIO device migration and caused issues when dev->started wasn't checked in the core code. The introduction of virtio_device_should_start() split the overloaded function up but the broken order still remained. The series finally fixes that by restoring the original semantics but with the cleaned up functions. I've added more documentation to the various structures involved as well as the functions. There is still some inconsistencies in the VirtIO code between different devices but I think that can be looked at over the 8.0 cycle. Alex Bennée (2): include/hw: attempt to document VirtIO feature variables include/hw: VM state takes precedence in virtio_device_should_start include/hw/virtio/vhost.h | 25 +++++++++++++++++++--- include/hw/virtio/virtio.h | 43 ++++++++++++++++++++++++++++++++------ 2 files changed, 59 insertions(+), 9 deletions(-)