From nobody Mon May 13 18:55:17 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.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 170.10.129.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=1645456242; cv=none; d=zohomail.com; s=zohoarc; b=Dr0KstK9Ta3BYk1oXGQTJu78DgXGiDrhYcE8ixt22F/LjodoAYMtw/crJEO79T7x/jTfiHb4TTz2ErojZfTYyWAxw4042aVW2jvgtJOOr10k0cD2FZVugG7HTyRFu+1SmebA6XHwy5TXFxsDjRkB2tv1hwCsiwxBkcnNKpRZYX4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645456242; h=Content-Type:Content-Transfer-Encoding:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=yJGrY8KlOlbCpSFypU1EwP7qGbv1kShTqJh79nnLOL4=; b=kjZrKouhvAcZseAEeeZ3AhIXIsgVo420C+tkFbpHYHPCQqUudAwdZFuJSeWz/l0a1WRqr8TSRgS09k4RfsKlZV8MEj9z3V66SBK/p/JY47RbfiIFIy2KiZ7JxaP7xoFyJeUYdF7/km7Tlau5gPveooepeOvRD0eCwgzpuEv+lKU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1645456242043333.99684433302775; Mon, 21 Feb 2022 07:10:42 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-451-mxAabjwaOI6jX0zZZkFfsQ-1; Mon, 21 Feb 2022 10:10:40 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id CD220801AC5; Mon, 21 Feb 2022 15:10:31 +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 B9BD47512F; Mon, 21 Feb 2022 15:10:30 +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 2EC904CA93; Mon, 21 Feb 2022 15:10:28 +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 21LFAR8R025183 for ; Mon, 21 Feb 2022 10:10:27 -0500 Received: by smtp.corp.redhat.com (Postfix) id 92A2382767; Mon, 21 Feb 2022 15:10:27 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.56]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1CBBC7DE38 for ; Mon, 21 Feb 2022 15:10:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1645456242; 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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=yJGrY8KlOlbCpSFypU1EwP7qGbv1kShTqJh79nnLOL4=; b=XA9dHRP0KqSbPSFGLKCb/Ji1FYt2FsGPD45opjcyj2799e9AkBcLBdHEt6FwJhMGg7Hbdc JdmOyKORmSX/FKgoe8lLEPqzsEoCoOQ8wutRZIl5FA7ahX/gOzjlBpjzZWa6+LK4F1kpgq +ekG9t2aYNuPQcEaVfBOX3ASswg/PEo= X-MC-Unique: mxAabjwaOI6jX0zZZkFfsQ-1 From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH] qemu: Move some enums impl to qemu_monitor.c Date: Mon, 21 Feb 2022 16:10:25 +0100 Message-Id: <0ca1f4384a9664e1b22722a0602b166c09a512ce.1645456214.git.mprivozn@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.79 on 10.5.11.15 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) X-ZM-MESSAGEID: 1645456261857100001 Content-Type: text/plain; charset="utf-8" There are some enums that are declared in qemu_monitor.h but implemented in qemu_monitor_json.c. While from compiler and linker POV it doesn't matter, the code is cleaner if an enum is implemented in .c file that corresponds to .h file which declared the enum. Signed-off-by: Michal Privoznik --- src/qemu/qemu_monitor.c | 40 ++++++++++++++++++++++++++++++++++++ src/qemu/qemu_monitor_json.c | 34 ------------------------------ 2 files changed, 40 insertions(+), 34 deletions(-) diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 0ff938a577..8fc2a49abf 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -111,6 +111,38 @@ static int qemuMonitorOnceInit(void) =20 VIR_ONCE_GLOBAL_INIT(qemuMonitor); =20 +VIR_ENUM_IMPL(qemuMonitorJob, + QEMU_MONITOR_JOB_TYPE_LAST, + "", + "commit", + "stream", + "mirror", + "backup", + "create", +); + +VIR_ENUM_IMPL(qemuMonitorJobStatus, + QEMU_MONITOR_JOB_STATUS_LAST, + "", + "created", + "running", + "paused", + "ready", + "standby", + "waiting", + "pending", + "aborting", + "concluded", + "undefined", + "null", +); + +VIR_ENUM_IMPL(qemuMonitorCPUProperty, + QEMU_MONITOR_CPU_PROPERTY_LAST, + "boolean", + "string", + "number", +); =20 VIR_ENUM_IMPL(qemuMonitorMigrationStatus, QEMU_MONITOR_MIGRATION_STATUS_LAST, @@ -4473,6 +4505,14 @@ qemuMonitorTransactionBackup(virJSONValue *actions, } =20 =20 +VIR_ENUM_IMPL(qemuMonitorDirtyRateCalcMode, + QEMU_MONITOR_DIRTYRATE_CALC_MODE_LAST, + "page-sampling", + "dirty-bitmap", + "dirty-ring", +); + + int qemuMonitorStartDirtyRateCalc(qemuMonitor *mon, int seconds, diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c index 345b81cd12..4d339f29b8 100644 --- a/src/qemu/qemu_monitor_json.c +++ b/src/qemu/qemu_monitor_json.c @@ -53,30 +53,6 @@ VIR_LOG_INIT("qemu.qemu_monitor_json"); =20 #define LINE_ENDING "\r\n" =20 -VIR_ENUM_IMPL(qemuMonitorJob, - QEMU_MONITOR_JOB_TYPE_LAST, - "", - "commit", - "stream", - "mirror", - "backup", - "create"); - -VIR_ENUM_IMPL(qemuMonitorJobStatus, - QEMU_MONITOR_JOB_STATUS_LAST, - "", - "created", - "running", - "paused", - "ready", - "standby", - "waiting", - "pending", - "aborting", - "concluded", - "undefined", - "null"); - static void qemuMonitorJSONHandleShutdown(qemuMonitor *mon, virJSONValue *= data); static void qemuMonitorJSONHandleReset(qemuMonitor *mon, virJSONValue *dat= a); static void qemuMonitorJSONHandleStop(qemuMonitor *mon, virJSONValue *data= ); @@ -5347,11 +5323,6 @@ qemuMonitorJSONGetCPUDefinitions(qemuMonitor *mon, } =20 =20 -VIR_ENUM_IMPL(qemuMonitorCPUProperty, - QEMU_MONITOR_CPU_PROPERTY_LAST, - "boolean", "string", "number", -); - static int qemuMonitorJSONParseCPUModelProperty(const char *key, virJSONValue *value, @@ -8740,11 +8711,6 @@ qemuMonitorJSONGetCPUMigratable(qemuMonitor *mon, migratable); } =20 -VIR_ENUM_IMPL(qemuMonitorDirtyRateCalcMode, - QEMU_MONITOR_DIRTYRATE_CALC_MODE_LAST, - "page-sampling", - "dirty-bitmap", - "dirty-ring"); =20 int qemuMonitorJSONStartDirtyRateCalc(qemuMonitor *mon, --=20 2.34.1