From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3D010C433C1 for ; Mon, 29 Mar 2021 14:49:41 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 938BC6192C for ; Mon, 29 Mar 2021 14:49:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 938BC6192C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:43510 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lQtD1-0002lE-IA for qemu-devel@archiver.kernel.org; Mon, 29 Mar 2021 10:49:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43792) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lQtAg-0001fT-NG for qemu-devel@nongnu.org; Mon, 29 Mar 2021 10:47:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:29907) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lQtAd-0001ml-Pg for qemu-devel@nongnu.org; Mon, 29 Mar 2021 10:47:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617029230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nYmg6gycb7+Bq0MpfcB3k1zUpVuZQf0QYsaK4dFtDnk=; b=I9l83VEmvaEuF4qiNVBvFYwQo2eChsD1K7k/vGw87cEs7SUHxNp34xJ8FMFm2K2zvLjRoI bfSOErrznqIvK9C11MMp03Q0tBlrNAQGTY7mO7kavHWaUrIVaEBzT8I+r5rR0GFSfqgCda 9PNG8et+oYluHKEZnIunBip8AJRY+tU= 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-528-kBRaEBtSOHC3IitmWLWWdg-1; Mon, 29 Mar 2021 10:47:06 -0400 X-MC-Unique: kBRaEBtSOHC3IitmWLWWdg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BBE54108BD07; Mon, 29 Mar 2021 14:47:04 +0000 (UTC) Received: from work-vm (ovpn-114-160.ams2.redhat.com [10.36.114.160]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1ADE75D9D3; Mon, 29 Mar 2021 14:46:56 +0000 (UTC) Date: Mon, 29 Mar 2021 15:46:53 +0100 From: "Dr. David Alan Gilbert" To: Igor Mammedov Subject: Re: Ways to deal with broken machine types Message-ID: References: <20210301195919.9333-1-cheptsov@ispras.ru> <20210322114116-mutt-send-email-mst@kernel.org> <20210323104542-mutt-send-email-mst@kernel.org> <71AD039B-775A-4DF3-B16D-4BC3768A20AC@ispras.ru> <20210323175447.0c57d2a4@redhat.com> <20210326014825.2e58c68f@redhat.com> MIME-Version: 1.0 In-Reply-To: <20210326014825.2e58c68f@redhat.com> User-Agent: Mutt/2.0.6 (2021-03-06) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dgilbert@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=63.128.21.124; envelope-from=dgilbert@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Daniel =?iso-8859-1?Q?P=2E_Berrang=E9?= , "Michael S. Tsirkin" , libvir-list@redhat.com, qemu devel list , Vitaly Cheptsov , Paolo Bonzini , Thomas Lamprecht Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" * Igor Mammedov (imammedo@redhat.com) wrote: > On Tue, 23 Mar 2021 17:40:36 +0000 > Daniel P. Berrangé wrote: > > > On Tue, Mar 23, 2021 at 05:54:47PM +0100, Igor Mammedov wrote: > > > Let me hijack this thread for beyond this case scope. > > > > > > I agree that for this particular bug we've done all we could, but > > > there is broader issue to discuss here. > > > > > > We have machine versions to deal with hw compatibility issues and that covers most of the cases, > > > but occasionally we notice problem well after release(s), > > > so users may be stuck with broken VM and need to manually fix configuration (and/or VM). > > > Figuring out what's wrong and how to fix it is far from trivial. So lets discuss if we > > > can help to ease this pain, yes it will be late for first victims but it's still > > > better than never. > > > > To summarize the problem situation > > > > - We rely on a machine type version to encode a precise guest ABI. > > - Due a bug, we are in a situation where the same machine type > > encodes two distinct guest ABIs due to a mistake introduced > > betwen QEMU N-2 and N-1 > > - We want to fix the bug in QEMU N > > - For incoming migration there is no way to distinguish between > > the ABIs used in N-2 and N-1, to pick the right one > > > > So we're left with an unwinnable problem: > > > > - Not fixing the bug => > > > > a) user migrating N-2 to N-1 have ABI change > > b) user migrating N-2 to N have ABI change > > c) user migrating N-1 to N are fine > > > > No mitigation for (a) or (b) > > > > - Fixing the bug => > > > > a) user migrating N-2 to N-1 have ABI change. > > b) user migrating N-2 to N are fine > > c) user migrating N-1 to N have ABI change > > > > Bad situations (a) and (c) are mitigated by > > backporting fix to N-1-stable too. > > > > Generally we have preferred to fix the bug, because we have > > usually identified them fairly quickly after release, and > > backporting the fix to stable has been sufficient mitigation > > against ill effects. Basically the people left broken are a > > relatively small set out of the total userbase. > > > > The real challenge arises when we are slow to identify the > > problem, such that we have a large number of people impacted. > > > > > > > I'll try to sum up idea Michael suggested (here comes my unorganized brain-dump), > > > > > > 1. We can keep in VM's config QEMU version it was created on > > > and as minimum warn user with a pointer to known issues if version in > > > config mismatches version of actually used QEMU, with a knob to silence > > > it for particular mismatch. > > > > > > When an issue becomes know and resolved we know for sure how and what > > > changed and embed instructions on what options to use for fixing up VM's > > > config to preserve old HW config depending on QEMU version VM was installed on. > > > > > some more ideas: > > > 2. let mgmt layer to keep fixup list and apply them to config if available > > > (user would need to upgrade mgmt or update fixup list somehow) > > > 3. let mgmt layer to pass VM's QEMU version to currently used QEMU, so > > > that QEMU could maintain and apply fixups based on QEMU version + machine type. > > > The user will have to upgrade to newer QEMU to get/use new fixups. > > > > The nice thing about machine type versioning is that we are treating the > > versions as opaque strings which represent a specific ABI, regardless of > > the QEMU version. This means that even if distros backport fixes for bugs > > or even new features, the machine type compatibility check remains a > > simple equality comparsion. > > > > As soon as you introduce the QEMU version though, we have created a > > large matrix for compatibility. This matrix is expanded if a distro > > chooses to backport fixes for any of the machine type bugs to their > > stable streams. This can get particularly expensive when there are > > multiple streams a distro is maintaining. > > > > *IF* the original N-1 qemu has a property that could be queried by > > the mgmt app to identify a machine type bug, then we could potentially > > apply a fixup automatically. > > > > eg query-machines command in QEMU version N could report against > > "pc-i440fx-5.0", that there was a regression fix that has to be > > applied if property "foo" had value "bar". > > > > Now, the mgmt app wants to migrate from QEMU N-2 or N-1 to QEMU N. > > It can query the value of "foo" on the source QEMU with qom-get. > > It now knows whether it has to override this property "foo" when > > spawning QEMU N on the target host. > > > > Of course this doesn't help us if neither N-1 or N-2 QEMU had a > > property that can be queried to identify the bug - ie if the > > property in question was newly introduced in QEMU N to fix the > > bug. > > > > > In my opinion both would lead to explosion of 'possibly needed' properties for each > > > change we introduce in hw/firmware(read ACPI) and very possibly a lot of conditional > > > branches in QEMU code. And I'm afraid it will become hard to maintain QEMU => > > > more bugs in future. > > > Also it will lead to explosion of test matrix for downstreams who care about testing. > > > > > > If we proactively gate changes on properties, we can just update fixup lists in mgmt, > > > without need to update QEMU (aka Insite rules) at a cost of complexity on QMEU side. > > > > > > Alternatively we can be conservative in spawning new properties, that means creating > > > them only when issue is fixed and require users to update QEMU, so that fixups could > > > be applied to VM. > > > > > > Feel free to shoot the messenger down or suggest ways how we can deal with the problem. > > > > The best solution is of course to not have introduced the ABI change in > > the first place. We have lots of testing, but upstream at least, I don't > > think we have anything that is explicitly recording the ABI associated > > with each machine type and validating that it hasn't changed. We rely on > > the developers to follow the coding practices wrt setting machine type > > defaults for back compat, and while we're good, we inevitably screw up > > every now & then. > > > > Downstreams do have some of this ABI testing - several problems like the > > one we have there, have been identified when RHEL downstream QE did > > migration tests and found a change in RHEL machine types, which then > > was traced back to upstream. > > > > I feel like we need some standard tool which can be run inside a VM > > that dumps all the possible ABI relevant information about the virtual > > machine in a nice data format. > > > > We would have to run this for each machine type, and save the > > results to git immediately after release. Then for every change to > > master, we would have to run the test again for every historic > > machine type version and compare to the recorded ABI record. > > Like Michael said we don't know that something is broken until it's > too late and this particular case it's not even broken (strictly speaking > change is correct) and is not even a part of ABI (it's ACPI code, i.e. firmware). > > Problem is in the way virtio drivers enumerate devices, which makes the same > device appear as a new one. We can work around issue on hypervisor side so user > won't loose network connectivity or would be able to boot guest after QEMU upgrade. > > We can suggest user re-installing their Windows (method that fixes almost all Win issues) > or to try to make it pain-less for user in these rare cases, by upgrading to > new QEMU (or fixed stable) which has workaround, so only the first few has to suffer. > > (I think downstreams would even more benefit from this, there were similar problems > there before). > > Yes, It surely will expand test matrix, but it should be limited to specific cases > we implemented fixups for. My suggestion from a long while ago (which no one liked) was to include the source qemu version and then have a quirks list of things to fix up. Dave > > > > Regards, > > Daniel > > -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK