From nobody Wed May 14 20:53:35 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1526917084544676.8500319570713; Mon, 21 May 2018 08:38:04 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 761C430D07C9; Mon, 21 May 2018 15:38:02 +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 EE93C611D2; Mon, 21 May 2018 15:38:01 +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 EF8364BB79; Mon, 21 May 2018 15:38:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4LFbZr7024100 for ; Mon, 21 May 2018 11:37:35 -0400 Received: by smtp.corp.redhat.com (Postfix) id 95E9110EE6D6; Mon, 21 May 2018 15:37:35 +0000 (UTC) Received: from icr.brq.redhat.com (unknown [10.43.2.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1D4AA10EE6D5; Mon, 21 May 2018 15:37:34 +0000 (UTC) From: =?UTF-8?q?J=C3=A1n=20Tomko?= To: libvir-list@redhat.com Date: Mon, 21 May 2018 17:37:15 +0200 Message-Id: <073aec3fde5a61694083968a3a7608a51836abd3.1526916651.git.jtomko@redhat.com> In-Reply-To: References: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: stefanha@redhat.com Subject: [libvirt] [PATCH 5/9] qemu: add private data for interfaces 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: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.42]); Mon, 21 May 2018 15:38:03 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Introduce a structure and a class that will be used to store the private data. Signed-off-by: J=C3=A1n Tomko --- src/qemu/qemu_domain.c | 36 ++++++++++++++++++++++++++++++++++++ src/qemu/qemu_domain.h | 9 +++++++++ 2 files changed, 45 insertions(+) diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index d3beee5d87..650909b739 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -1134,6 +1134,41 @@ qemuDomainChrSourcePrivateDispose(void *obj) } =20 =20 +static virClassPtr qemuDomainNetPrivateClass; +static void qemuDomainNetPrivateDispose(void *obj); + +static int +qemuDomainNetPrivateOnceInit(void) +{ + if (!VIR_CLASS_NEW(qemuDomainNetPrivate, virClassForObject())) + return -1; + + return 0; +} + +VIR_ONCE_GLOBAL_INIT(qemuDomainNetPrivate) + +static virObjectPtr +qemuDomainNetPrivateNew(void) +{ + qemuDomainNetPrivatePtr priv; + + if (qemuDomainNetPrivateInitialize() < 0) + return NULL; + + if (!(priv =3D virObjectNew(qemuDomainNetPrivateClass))) + return NULL; + + return (virObjectPtr) priv; +} + + +static void +qemuDomainNetPrivateDispose(void *obj ATTRIBUTE_UNUSED) +{ +} + + /* qemuDomainSecretPlainSetup: * @secinfo: Pointer to secret info * @usageType: The virSecretUsageType @@ -2636,6 +2671,7 @@ virDomainXMLPrivateDataCallbacks virQEMUDriverPrivate= DataCallbacks =3D { .diskNew =3D qemuDomainDiskPrivateNew, .vcpuNew =3D qemuDomainVcpuPrivateNew, .chrSourceNew =3D qemuDomainChrSourcePrivateNew, + .netNew =3D qemuDomainNetPrivateNew, .parse =3D qemuDomainObjPrivateXMLParse, .format =3D qemuDomainObjPrivateXMLFormat, .storageParse =3D qemuStorageSourcePrivateDataParse, diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h index 40d1d095a3..a04ded16ed 100644 --- a/src/qemu/qemu_domain.h +++ b/src/qemu/qemu_domain.h @@ -441,6 +441,15 @@ struct _qemuDomainChrSourcePrivate { }; =20 =20 +typedef struct _qemuDomainNetPrivate qemuDomainNetPrivate; +typedef qemuDomainNetPrivate *qemuDomainNetPrivatePtr; +struct _qemuDomainNetPrivate { + virObject parent; + + virTristateBool maybe; +}; + + typedef enum { QEMU_PROCESS_EVENT_WATCHDOG =3D 0, QEMU_PROCESS_EVENT_GUESTPANIC, --=20 2.16.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list