From nobody Fri May 3 02:41:19 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1627389723; cv=none; d=zohomail.com; s=zohoarc; b=jRhzYzv6qZAnLYK2PBcwN1v7rQ84HUKE5G8kyGb7Nie7wuc7qxAhT8kL8DcAs1ypPK5vXshRA3RBHd5wm2P3eHKLEeoNDqsE+EJq58TnsKWie1Ns/1uMgQNUj8oPYGIvBkVT4jQxmTsDS0XDvrToBtJpQYZyt1PdWdOi0CRfgAU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1627389723; h=Content-Type:Content-Transfer-Encoding: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=VO5/YJbtESIC0kJySg/k5CAw07RufaA+c0tuDS0S7ic=; b=J4Am9hlYbQCx4LqIzHeP3HQh0Eic9v96qyBynlXuJFuM3za722ZM2CoxPsAMoXQXd7+44vxKFTLbomMtORqCaUHLL51pxHlHdFT5pZVOpjzuawZrgP87iizGWf6+FHEtROtwJEd/d4+nzPEPKbMn3fM9RYgERubDf8Hmt1xgvJY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1627389723940237.27579945217792; Tue, 27 Jul 2021 05:42: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-127-mdUTUKnMN82tpULIKeEgDw-1; Tue, 27 Jul 2021 08:42:01 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8E011874997; Tue, 27 Jul 2021 12:41:41 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0C32A69CBA; Tue, 27 Jul 2021 12:41:40 +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 32D1E181A2A6; Tue, 27 Jul 2021 12:41:38 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 16RCaBuL019298 for ; Tue, 27 Jul 2021 08:36:11 -0400 Received: by smtp.corp.redhat.com (Postfix) id 65F1119C79; Tue, 27 Jul 2021 12:36:11 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.34.244.239]) by smtp.corp.redhat.com (Postfix) with ESMTP id DFC4419D7C for ; Tue, 27 Jul 2021 12:36:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1627389723; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=VO5/YJbtESIC0kJySg/k5CAw07RufaA+c0tuDS0S7ic=; b=Q82eROq9oIfLq4fs81k6RVssuTD+tkMiG0wwVOVZf1BdZvWFuwDVjMs7syz2pjJGw8lHaR QQF9gFWAXeNRXIEG4AsXgfmh7w2bLhM9OI4OCfhgee/HIo7iFMz+LjDw3DOBYjgw02mJlu /R84FjQPiNz6Lq5WXODBYuqzDHPu+T8= X-MC-Unique: mdUTUKnMN82tpULIKeEgDw-1 From: Kristina Hanicova To: libvir-list@redhat.com Subject: [PATCH v2] qemu: save status xml after generating taint message Date: Tue, 27 Jul 2021 14:36:00 +0200 Message-Id: <09893461d7d0fc833491592aca4037edc0db18c0.1627387627.git.khanicov@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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.11 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: 1627389724965100001 Content-Type: text/plain; charset="utf-8" We didn't always save status xml after generating new taint message which resulted in it being deleted in case of a libvirtd restart. Some taint messages were preserved thanks to saving status xml separately at the end of the calling functions. With this, every taint message is saved, regardless of the calling functions. Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=3D1965589 Signed-off-by: Kristina Hanicova Reviewed-by: J=C3=A1n Tomko --- src/qemu/qemu_domain.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index ce55ac39c1..5e96ea84ff 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -6461,7 +6461,10 @@ void qemuDomainObjTaint(virQEMUDriver *driver, virDomainTaintFlags taint, qemuDomainLogContext *logCtxt) { + g_autoptr(virQEMUDriverConfig) cfg =3D virQEMUDriverGetConfig(driver); + qemuDomainObjTaintMsg(driver, obj, taint, logCtxt, NULL); + ignore_value(virDomainObjSave(obj, driver->xmlopt, cfg->stateDir)); } =20 void qemuDomainObjTaintAndSave(virQEMUDriver *driver, --=20 2.31.1