From nobody Tue Feb 10 05:44:48 2026 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=1616777343; cv=none; d=zohomail.com; s=zohoarc; b=YAHH9GsdSMhb1H+AhiYtaQDw6QGFsKHmKzTgB+Jc3wWc51Itzj0yP8OJGDvZ7Z6gb3AU9yUg5JxBincuryLWZ7fGoXNAzHow/0q0SOREUExb64jhrPce6eaGuyFsKgPJ7JmkmuGRlHcIlm50RSTELOUSQFh96SpS+P5XIqUqNQw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616777343; h=Content-Type: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=DtRClMRHWFyDk37bunhLojMW1CzKjZDOCVO0vgaXAVo=; b=Jw2q5orbLWxYYiBKEUx5ThmerTv1DXgs0prXInJXhycr+eETMzNusK2J0W4fzfXLI2+Obd42A4QvHvxnv1JfrW7R5otQQsAVxFwctakJEEEIrS3mOlYbvx4XR4cpL67LrYstULbCYCdQxvdp5Vg4l5f7Ylu/qA0yAA5EVSjvrSw= 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) header.from= 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 1616777343239225.31473971353216; Fri, 26 Mar 2021 09:49: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-453-fPWFKj-kMiqFTN-rlY81-w-1; Fri, 26 Mar 2021 12:48:55 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A54161853021; Fri, 26 Mar 2021 16:48:46 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7B4FB89D02; Fri, 26 Mar 2021 16:48:46 +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 081D44A7CA; Fri, 26 Mar 2021 16:48:46 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12QGmavt002963 for ; Fri, 26 Mar 2021 12:48:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id A499C5D72E; Fri, 26 Mar 2021 16:48:36 +0000 (UTC) Received: from himantopus.redhat.com (ovpn-113-51.phx2.redhat.com [10.3.113.51]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6B9305D6DC; Fri, 26 Mar 2021 16:48:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1616777337; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=DtRClMRHWFyDk37bunhLojMW1CzKjZDOCVO0vgaXAVo=; b=DYV1uKGu9onAt/LKR9LJZ73ME4mJ8gPpK6V8Zpk5jumkdqrM961R9tzS50Js5FeOyDAbwA U0EtpjK1eGna5IY1fB89294WjGoG7O4y3XHA0iCJsMqUpywWg8b+4+IREUgXLnVwoGek5w zyEuMDRlOps23WZ8uc0AmWMAM801IRY= X-MC-Unique: fPWFKj-kMiqFTN-rlY81-w-1 From: Jonathon Jongsma To: libvir-list@redhat.com Subject: [libvirt PATCH v6 09/30] nodedev: add persistence to virNodeDeviceObj Date: Fri, 26 Mar 2021 11:48:05 -0500 Message-Id: <20210326164826.1720062-10-jjongsma@redhat.com> In-Reply-To: <20210326164826.1720062-1-jjongsma@redhat.com> References: <20210326164826.1720062-1-jjongsma@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com Cc: eskultet@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.12 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) Content-Type: text/plain; charset="utf-8" Consistent with other objects (e.g. virDomainObj), add a field to indicate whether the node device is persistent or transient. Signed-off-by: Jonathon Jongsma --- src/conf/virnodedeviceobj.c | 16 ++++++++++++++++ src/conf/virnodedeviceobj.h | 6 ++++++ src/libvirt_private.syms | 2 ++ 3 files changed, 24 insertions(+) diff --git a/src/conf/virnodedeviceobj.c b/src/conf/virnodedeviceobj.c index ab663fd5a0..ce84e4d8c1 100644 --- a/src/conf/virnodedeviceobj.c +++ b/src/conf/virnodedeviceobj.c @@ -40,6 +40,7 @@ struct _virNodeDeviceObj { bool skipUpdateCaps; /* whether to skip checking host c= aps, used by testdriver */ bool active; + bool persistent; }; =20 struct _virNodeDeviceObjList { @@ -1003,3 +1004,18 @@ virNodeDeviceObjSetActive(virNodeDeviceObj *obj, { obj->active =3D active; } + + +bool +virNodeDeviceObjIsPersistent(virNodeDeviceObj *obj) +{ + return obj->persistent; +} + + +void +virNodeDeviceObjSetPersistent(virNodeDeviceObj *obj, + bool persistent) +{ + obj->persistent =3D persistent; +} diff --git a/src/conf/virnodedeviceobj.h b/src/conf/virnodedeviceobj.h index e786a70f51..7f682b9dca 100644 --- a/src/conf/virnodedeviceobj.h +++ b/src/conf/virnodedeviceobj.h @@ -128,3 +128,9 @@ virNodeDeviceObjIsActive(virNodeDeviceObj *obj); void virNodeDeviceObjSetActive(virNodeDeviceObj *obj, bool active); +bool +virNodeDeviceObjIsPersistent(virNodeDeviceObj *obj); + +void +virNodeDeviceObjSetPersistent(virNodeDeviceObj *obj, + bool persistent); diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 09957c943b..047314ec19 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1273,6 +1273,7 @@ virNetworkPortDefSaveStatus; virNodeDeviceObjEndAPI; virNodeDeviceObjGetDef; virNodeDeviceObjIsActive; +virNodeDeviceObjIsPersistent; virNodeDeviceObjListAssignDef; virNodeDeviceObjListExport; virNodeDeviceObjListFindByName; @@ -1286,6 +1287,7 @@ virNodeDeviceObjListNew; virNodeDeviceObjListNumOfDevices; virNodeDeviceObjListRemove; virNodeDeviceObjSetActive; +virNodeDeviceObjSetPersistent; =20 =20 # conf/virnwfilterbindingdef.h --=20 2.26.3