From nobody Mon Apr 29 08:48:10 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 1526997496974796.1695979494905; Tue, 22 May 2018 06:58:16 -0700 (PDT) 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 mx1.redhat.com (Postfix) with ESMTPS id 21772F87AB; Tue, 22 May 2018 13:58:15 +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 0EC8C60470; Tue, 22 May 2018 13:58: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 ADA45180B536; Tue, 22 May 2018 13:58:12 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w4MDwAZI027664 for ; Tue, 22 May 2018 09:58:10 -0400 Received: by smtp.corp.redhat.com (Postfix) id 01146215CDAC; Tue, 22 May 2018 13:58:10 +0000 (UTC) Received: from angien.brq.redhat.com (unknown [10.43.2.136]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7C270215CDA7; Tue, 22 May 2018 13:58:09 +0000 (UTC) From: Peter Krempa To: libvir-list@redhat.com Date: Tue, 22 May 2018 15:57:57 +0200 Message-Id: <0b573e950a41b1b3321b63254a9f9e4c809c6c9c.1526997430.git.pkrempa@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Cc: Peter Krempa Subject: [libvirt] [PATCH] qemu: monitor: Remove diskSecretLookup monitor event 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.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 22 May 2018 13:58:16 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" After the text monitor was deleted this event can't be triggered. Remove it and all the unnecessary code. Signed-off-by: Peter Krempa Reviewed-by: J=EF=BF=BDn Tomko --- This applies on top of the text monitor removal series. I forgot to include it while splitting branches. src/qemu/qemu_monitor.c | 16 ---------------- src/qemu/qemu_monitor.h | 12 ------------ src/qemu/qemu_process.c | 28 ---------------------------- 3 files changed, 56 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index ac1fbddb91..02d2629eb0 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -1287,22 +1287,6 @@ qemuMonitorHMPCommandWithFd(qemuMonitorPtr mon, } while (0) -int -qemuMonitorGetDiskSecret(qemuMonitorPtr mon, - const char *path, - char **secret, - size_t *secretLen) -{ - int ret =3D -1; - *secret =3D NULL; - *secretLen =3D 0; - - QEMU_MONITOR_CALLBACK(mon, ret, diskSecretLookup, mon->vm, - path, secret, secretLen); - return ret; -} - - int qemuMonitorEmitEvent(qemuMonitorPtr mon, const char *event, long long seconds, unsigned int micros, diff --git a/src/qemu/qemu_monitor.h b/src/qemu/qemu_monitor.h index b3aeb83cf0..212d1e3e16 100644 --- a/src/qemu/qemu_monitor.h +++ b/src/qemu/qemu_monitor.h @@ -121,12 +121,6 @@ typedef void (*qemuMonitorEofNotifyCallback)(qemuMonit= orPtr mon, typedef void (*qemuMonitorErrorNotifyCallback)(qemuMonitorPtr mon, virDomainObjPtr vm, void *opaque); -typedef int (*qemuMonitorDiskSecretLookupCallback)(qemuMonitorPtr mon, - virDomainObjPtr vm, - const char *path, - char **secret, - size_t *secretLen, - void *opaque); typedef int (*qemuMonitorDomainEventCallback)(qemuMonitorPtr mon, virDomainObjPtr vm, const char *event, @@ -285,7 +279,6 @@ struct _qemuMonitorCallbacks { qemuMonitorDestroyCallback destroy; qemuMonitorEofNotifyCallback eofNotify; qemuMonitorErrorNotifyCallback errorNotify; - qemuMonitorDiskSecretLookupCallback diskSecretLookup; qemuMonitorDomainEventCallback domainEvent; qemuMonitorDomainShutdownCallback domainShutdown; qemuMonitorDomainResetCallback domainReset; @@ -369,11 +362,6 @@ int qemuMonitorHMPCommandWithFd(qemuMonitorPtr mon, # define qemuMonitorHMPCommand(mon, cmd, reply) \ qemuMonitorHMPCommandWithFd(mon, cmd, -1, reply) -int qemuMonitorGetDiskSecret(qemuMonitorPtr mon, - const char *path, - char **secret, - size_t *secretLen); - int qemuMonitorEmitEvent(qemuMonitorPtr mon, const char *event, long long seconds, unsigned int micros, const char *details); diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index 5b73a61962..2ba432630f 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -436,33 +436,6 @@ qemuProcessGetVolumeQcowPassphrase(virDomainDiskDefPtr= disk, return ret; } -static int -qemuProcessFindVolumeQcowPassphrase(qemuMonitorPtr mon ATTRIBUTE_UNUSED, - virDomainObjPtr vm, - const char *path, - char **secretRet, - size_t *secretLen, - void *opaque ATTRIBUTE_UNUSED) -{ - virDomainDiskDefPtr disk; - int ret =3D -1; - - virObjectLock(vm); - if (!(disk =3D virDomainDiskByName(vm->def, path, true))) { - virReportError(VIR_ERR_INTERNAL_ERROR, - _("no disk found with path %s"), - path); - goto cleanup; - } - - ret =3D qemuProcessGetVolumeQcowPassphrase(disk, secretRet, secretLen); - - cleanup: - virObjectUnlock(vm); - return ret; -} - - static int qemuProcessHandleReset(qemuMonitorPtr mon ATTRIBUTE_UNUSED, virDomainObjPtr vm, @@ -1709,7 +1682,6 @@ qemuProcessHandleDumpCompleted(qemuMonitorPtr mon ATT= RIBUTE_UNUSED, static qemuMonitorCallbacks monitorCallbacks =3D { .eofNotify =3D qemuProcessHandleMonitorEOF, .errorNotify =3D qemuProcessHandleMonitorError, - .diskSecretLookup =3D qemuProcessFindVolumeQcowPassphrase, .domainEvent =3D qemuProcessHandleEvent, .domainShutdown =3D qemuProcessHandleShutdown, .domainStop =3D qemuProcessHandleStop, --=20 2.16.2 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list