From nobody Wed Nov 27 18:28:17 2024 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 1541966537068210.18662294512865; Sun, 11 Nov 2018 12:02:17 -0800 (PST) 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 mx1.redhat.com (Postfix) with ESMTPS id E38D2307D913; Sun, 11 Nov 2018 20:02:14 +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 7F78719742; Sun, 11 Nov 2018 20:02:14 +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 092933FCFC; Sun, 11 Nov 2018 20:02:14 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id wABK0lO1023843 for ; Sun, 11 Nov 2018 15:00:47 -0500 Received: by smtp.corp.redhat.com (Postfix) id 68CB35C260; Sun, 11 Nov 2018 20:00:47 +0000 (UTC) Received: from cv1.redhat.com (ovpn-121-41.rdu2.redhat.com [10.10.121.41]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7C80F5C1B4; Sun, 11 Nov 2018 20:00:46 +0000 (UTC) From: Chris Venteicher To: libvir-list@redhat.com Date: Sun, 11 Nov 2018 13:59:27 -0600 Message-Id: <20181111195930.17185-20-cventeic@redhat.com> In-Reply-To: <20181111195930.17185-1-cventeic@redhat.com> References: <20181111195930.17185-1-cventeic@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com Cc: walling@linux.ibm.com, Chris Venteicher , jdenemar@redhat.com, david@redhat.com Subject: [libvirt] [PATCH RFC 19/22] qemu_monitor: Make monitor callbacks optional 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: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Sun, 11 Nov 2018 20:02:15 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Qemu process code for capababilities doesn't use monitor callbacks and defines empty callback functions. Allow NULL to be passed to qemuMonitorOpen for callbacks and remove the empty functions from the QMP process code. Signed-off-by: Chris Venteicher --- src/qemu/qemu_monitor.c | 4 ++-- src/qemu/qemu_process.c | 14 +------------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 7f7013e115..77f4fe7cf7 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -813,12 +813,12 @@ qemuMonitorOpenInternal(virDomainObjPtr vm, { qemuMonitorPtr mon; =20 - if (!cb->eofNotify) { + if (cb && !cb->eofNotify) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("EOF notify callback must be supplied")); return NULL; } - if (!cb->errorNotify) { + if (cb && !cb->errorNotify) { virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("Error notify callback must be supplied")); return NULL; diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index c44e46fc88..d20f832053 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -8066,18 +8066,6 @@ qemuProcessReconnectAll(virQEMUDriverPtr driver) } =20 =20 -static void virQEMUCapsMonitorNotify(qemuMonitorPtr mon ATTRIBUTE_UNUSED, - virDomainObjPtr vm ATTRIBUTE_UNUSED, - void *opaque ATTRIBUTE_UNUSED) -{ -} - -static qemuMonitorCallbacks callbacks =3D { - .eofNotify =3D virQEMUCapsMonitorNotify, - .errorNotify =3D virQEMUCapsMonitorNotify, -}; - - /** * qemuProcessFree: * @proc: Stores Process and Connection State @@ -8270,7 +8258,7 @@ qemuConnectMonitorQmp(qemuProcessPtr proc) bool retry =3D true; bool enableJson =3D true; virQEMUDriverPtr driver =3D NULL; - qemuMonitorCallbacksPtr monCallbacks =3D &callbacks; + qemuMonitorCallbacksPtr monCallbacks =3D NULL; virDomainXMLOptionPtr xmlopt =3D NULL; virDomainChrSourceDef monConfig; =20 --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list