From nobody Sat Feb 7 12:19:37 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.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 63.128.21.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=1612886493; cv=none; d=zohomail.com; s=zohoarc; b=hVoSTMCs60km7AZbQyNBQ6TtLkzna6rwRqfrua8Z0AVElnIn5Kh6PpSti9LgvtYOI0xwbZzWEhBCYo2/srApyrRvnjs17f5Cut6gKKi5r0hkOdgPDJG67qi4l46/zNij1MCEMmPxqlW2/DwI2GOP8tKSHFx9VX+Ik0uagbIwmyo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612886493; 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=bfWFxYo0vQtwbrHQmIER6GCXwPWWntOgP3Q82fW8jQE=; b=cLFZLGqHsSiXWszf4o60YK3jGuDkoCJwMMkAoWf909PlJ7E5WZ3YYpeX4+UQ0U0IzbNGWNDUcXXHfsdUAuazYR3X8dwLIPmhBk/HRBcJA+JPHIvAdFw6uvR2PabIVyOhiGT0sDxGCjSXHlKrP94VRADrKL8gxVGQZ1WStvLsZRw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1612886492732869.5449942586887; Tue, 9 Feb 2021 08:01:32 -0800 (PST) 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-120-KpK6eDzgOZSOinVUEdCKNg-1; Tue, 09 Feb 2021 11:01:26 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 45E4785EE9F; Tue, 9 Feb 2021 16:01:19 +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 C525119C78; Tue, 9 Feb 2021 16:01:18 +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 79A0D18095CB; Tue, 9 Feb 2021 16:01:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 119G1G5u010752 for ; Tue, 9 Feb 2021 11:01:16 -0500 Received: by smtp.corp.redhat.com (Postfix) id 0B38760CCD; Tue, 9 Feb 2021 16:01:16 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-115-66.ams2.redhat.com [10.36.115.66]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4EBB960861; Tue, 9 Feb 2021 16:01:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612886489; 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=bfWFxYo0vQtwbrHQmIER6GCXwPWWntOgP3Q82fW8jQE=; b=hNOkTv1+dRDOd1gxsMtOL1BCdFRNwPxOAPD+icHuOj31/ItsfJJ1dNTm3JW2AF+Dapz+zw 82fcipSoDJlfCNszBqeBx7AyI/SZo/dh6rbDP6yqxrOqkD56Or2SZTzNAM+lm1ATdTwNCE Lp6BJf/whEItdgob34q9flKhO8iNZkc= X-MC-Unique: KpK6eDzgOZSOinVUEdCKNg-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH v2 1/6] conf: record deprecation messages against the domain Date: Tue, 9 Feb 2021 16:01:04 +0000 Message-Id: <20210209160109.1229387-2-berrange@redhat.com> In-Reply-To: <20210209160109.1229387-1-berrange@redhat.com> References: <20210209160109.1229387-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 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.84 on 10.5.11.23 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-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) These messages will be stored in the live status XML. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/conf/domain_conf.c | 28 +++++++++++++++++++++++++--- src/conf/domain_conf.h | 4 ++++ src/libvirt_private.syms | 1 + 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 07e6f39256..a873c0ada2 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -1788,6 +1788,15 @@ bool virDomainObjTaint(virDomainObjPtr obj, } =20 =20 +void virDomainObjDeprecation(virDomainObjPtr obj, + const char *msg) +{ + obj->deprecations =3D g_renew(char *, obj->deprecations, + obj->ndeprecations + 1); + obj->deprecations[obj->ndeprecations++] =3D g_strdup(msg); +} + + static void virDomainGraphicsAuthDefClear(virDomainGraphicsAuthDefPtr def) { @@ -21225,7 +21234,8 @@ virDomainObjParseXML(xmlDocPtr xml, int reason =3D 0; void *parseOpaque =3D NULL; g_autofree char *tmp =3D NULL; - g_autofree xmlNodePtr *nodes =3D NULL; + g_autofree xmlNodePtr *taintNodes =3D NULL; + g_autofree xmlNodePtr *depNodes =3D NULL; =20 if (!(obj =3D virDomainObjNew(xmlopt))) return NULL; @@ -21272,10 +21282,10 @@ virDomainObjParseXML(xmlDocPtr xml, } obj->pid =3D (pid_t)val; =20 - if ((n =3D virXPathNodeSet("./taint", ctxt, &nodes)) < 0) + if ((n =3D virXPathNodeSet("./taint", ctxt, &taintNodes)) < 0) goto error; for (i =3D 0; i < n; i++) { - char *str =3D virXMLPropString(nodes[i], "flag"); + char *str =3D virXMLPropString(taintNodes[i], "flag"); if (str) { int flag =3D virDomainTaintTypeFromString(str); if (flag < 0) { @@ -21289,6 +21299,13 @@ virDomainObjParseXML(xmlDocPtr xml, } } =20 + if ((n =3D virXPathNodeSet("./deprecation", ctxt, &depNodes)) < 0) + goto error; + for (i =3D 0; i < n; i++) { + g_autofree char *str =3D virXMLNodeContentString(depNodes[i]); + virDomainObjDeprecation(obj, str); + } + if (xmlopt->privateData.parse && xmlopt->privateData.parse(ctxt, obj, &xmlopt->config) < 0) goto error; @@ -29122,6 +29139,11 @@ virDomainObjFormat(virDomainObjPtr obj, virDomainTaintTypeToString(i)); } =20 + for (i =3D 0; i < obj->ndeprecations; i++) { + virBufferEscapeString(&buf, "%s\n", + obj->deprecations[i]); + } + if (xmlopt->privateData.format && xmlopt->privateData.format(&buf, obj) < 0) return NULL; diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h index 8b1c8643be..ea6370c03d 100644 --- a/src/conf/domain_conf.h +++ b/src/conf/domain_conf.h @@ -2801,6 +2801,8 @@ struct _virDomainObj { void (*privateDataFreeFunc)(void *); =20 int taint; + size_t ndeprecations; + char **deprecations; =20 unsigned long long original_memlock; /* Original RLIMIT_MEMLOCK, zero = if no * restore will be required later= */ @@ -3058,6 +3060,8 @@ void virDomainObjEndAPI(virDomainObjPtr *vm); =20 bool virDomainObjTaint(virDomainObjPtr obj, virDomainTaintFlags taint); +void virDomainObjDeprecation(virDomainObjPtr obj, + const char *msg); =20 void virDomainObjBroadcast(virDomainObjPtr vm); int virDomainObjWait(virDomainObjPtr vm); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 0636b0d8c9..512da526fc 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -547,6 +547,7 @@ virDomainObjAssignDef; virDomainObjBroadcast; virDomainObjCheckActive; virDomainObjCopyPersistentDef; +virDomainObjDeprecation; virDomainObjEndAPI; virDomainObjFormat; virDomainObjGetDefs; --=20 2.29.2