From nobody Sun Feb 8 09:30:41 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.120 as permitted sender) client-ip=207.211.31.120; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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=1595603721; cv=none; d=zohomail.com; s=zohoarc; b=H4Md0wy99cON4aWDjfFbX5gW/5NzoQsVld1f+lzxqNIYh/2TBt2NOYgSRVtY+iIFgDti8zUPQ17mJdStJop26WZSiOc1M9blpjw8/R2DJc4J0oYWf3cR5psII2ZebeOG4c3WRmlVxagRiHptAr/3kfUDUodj8j/wRZsqh/ogwd8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1595603721; h=Content-Type:Content-Transfer-Encoding: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=dGx5Uea+LB3JIN8IJNUAQAmGI24sXWifbTwMGdH7JGg=; b=SVoRsb0fFgg84YvbVbA+VQryagqXhtGlz+GVx7sD+azxaPO0uToNwlnnksAWg2CJe3qg2dnEmOQBw1k/khK/264IAzAD+fc6DQYWvS/rVR2+CKcrp7wBHxgAkHBm31WKX8ejFxSPNH1Pw2F7xCPLdJkm9nH3ccKO5jkqLo6jXXc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.120 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-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by mx.zohomail.com with SMTPS id 1595603721001112.59230236188876; Fri, 24 Jul 2020 08:15:21 -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-449-umAojlv4OymqtBWmP-V5LQ-1; Fri, 24 Jul 2020 11:15:17 -0400 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 A402D80046E; Fri, 24 Jul 2020 15:15:11 +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 84718726B1; Fri, 24 Jul 2020 15:15:11 +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 469FCA3588; Fri, 24 Jul 2020 15:15:11 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 06OFENU7023120 for ; Fri, 24 Jul 2020 11:14:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id 20EC72DE80; Fri, 24 Jul 2020 15:14:23 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.36.110.43]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5A5892DE7F; Fri, 24 Jul 2020 15:14:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1595603719; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=dGx5Uea+LB3JIN8IJNUAQAmGI24sXWifbTwMGdH7JGg=; b=VN/h0IKESOQgZBW4+2fn7IVkdedwWPWuk3EVd42t7LLX3V5fMAKJfdasYkZGlYtn7Dzy4E h+fqs4jRVxi9Ct6JJf/Qz36l/DvYrSO3err7C145z7TDC/V+2IzmC2eV1qtcOX1ahYVRcU UHe9M/6qeqhQ4xkzQx/X5NvEVVP1cKQ= X-MC-Unique: umAojlv4OymqtBWmP-V5LQ-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH v2 03/10] remote: split off enums into separate source file Date: Fri, 24 Jul 2020 16:14:07 +0100 Message-Id: <20200724151414.3380935-4-berrange@redhat.com> In-Reply-To: <20200724151414.3380935-1-berrange@redhat.com> References: <20200724151414.3380935-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 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 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) The remoteDriverTransport and remoteDriverMode enums are going to be needed by source files beyond the remote driver client. Signed-off-by: Daniel P. Berrang=C3=A9 --- src/remote/Makefile.inc.am | 2 ++ src/remote/remote_driver.c | 41 +----------------------------- src/remote/remote_sockets.c | 39 +++++++++++++++++++++++++++++ src/remote/remote_sockets.h | 50 +++++++++++++++++++++++++++++++++++++ 4 files changed, 92 insertions(+), 40 deletions(-) create mode 100644 src/remote/remote_sockets.c create mode 100644 src/remote/remote_sockets.h diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am index 80f4aad782..2191e5b900 100644 --- a/src/remote/Makefile.inc.am +++ b/src/remote/Makefile.inc.am @@ -13,6 +13,8 @@ REMOTE_DRIVER_GENERATED =3D \ $(NULL) =20 REMOTE_DRIVER_SOURCES =3D \ + remote/remote_sockets.c \ + remote/remote_sockets.h \ remote/remote_driver.c \ remote/remote_driver.h \ $(NULL) diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c index c8f5858bd1..30dea6c1ea 100644 --- a/src/remote/remote_driver.c +++ b/src/remote/remote_driver.c @@ -38,6 +38,7 @@ #include "virbuffer.h" #include "remote_driver.h" #include "remote_protocol.h" +#include "remote_sockets.h" #include "lxc_protocol.h" #include "qemu_protocol.h" #include "viralloc.h" @@ -54,46 +55,6 @@ =20 VIR_LOG_INIT("remote.remote_driver"); =20 -typedef enum { - REMOTE_DRIVER_TRANSPORT_TLS, - REMOTE_DRIVER_TRANSPORT_UNIX, - REMOTE_DRIVER_TRANSPORT_SSH, - REMOTE_DRIVER_TRANSPORT_LIBSSH2, - REMOTE_DRIVER_TRANSPORT_EXT, - REMOTE_DRIVER_TRANSPORT_TCP, - REMOTE_DRIVER_TRANSPORT_LIBSSH, - - REMOTE_DRIVER_TRANSPORT_LAST, -} remoteDriverTransport; - -VIR_ENUM_DECL(remoteDriverTransport); -VIR_ENUM_IMPL(remoteDriverTransport, - REMOTE_DRIVER_TRANSPORT_LAST, - "tls", - "unix", - "ssh", - "libssh2", - "ext", - "tcp", - "libssh"); - -typedef enum { - /* Try to figure out the "best" choice magically */ - REMOTE_DRIVER_MODE_AUTO, - /* Always use the legacy libvirtd */ - REMOTE_DRIVER_MODE_LEGACY, - /* Always use the per-driver virt*d daemons */ - REMOTE_DRIVER_MODE_DIRECT, - - REMOTE_DRIVER_MODE_LAST -} remoteDriverMode; - -VIR_ENUM_DECL(remoteDriverMode); -VIR_ENUM_IMPL(remoteDriverMode, - REMOTE_DRIVER_MODE_LAST, - "auto", - "legacy", - "direct"); =20 #if SIZEOF_LONG < 8 # define HYPER_TO_TYPE(_type, _to, _from) \ diff --git a/src/remote/remote_sockets.c b/src/remote/remote_sockets.c new file mode 100644 index 0000000000..0662cbad14 --- /dev/null +++ b/src/remote/remote_sockets.c @@ -0,0 +1,39 @@ +/* + * remote_sockets.c: helpers for getting remote driver socket paths + * + * Copyright (C) 2007-2019 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * . + */ + +#include + +#include "remote_sockets.h" + +VIR_ENUM_IMPL(remoteDriverTransport, + REMOTE_DRIVER_TRANSPORT_LAST, + "tls", + "unix", + "ssh", + "libssh2", + "ext", + "tcp", + "libssh"); + +VIR_ENUM_IMPL(remoteDriverMode, + REMOTE_DRIVER_MODE_LAST, + "auto", + "legacy", + "direct"); diff --git a/src/remote/remote_sockets.h b/src/remote/remote_sockets.h new file mode 100644 index 0000000000..1d4ae3f9c1 --- /dev/null +++ b/src/remote/remote_sockets.h @@ -0,0 +1,50 @@ +/* + * remote_sockets.h: helpers for getting remote driver socket paths + * + * Copyright (C) 2007-2020 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see + * . + */ + +#pragma once + +#include "virenum.h" + +typedef enum { + REMOTE_DRIVER_TRANSPORT_TLS, + REMOTE_DRIVER_TRANSPORT_UNIX, + REMOTE_DRIVER_TRANSPORT_SSH, + REMOTE_DRIVER_TRANSPORT_LIBSSH2, + REMOTE_DRIVER_TRANSPORT_EXT, + REMOTE_DRIVER_TRANSPORT_TCP, + REMOTE_DRIVER_TRANSPORT_LIBSSH, + + REMOTE_DRIVER_TRANSPORT_LAST, +} remoteDriverTransport; + +VIR_ENUM_DECL(remoteDriverTransport); + +typedef enum { + /* Try to figure out the "best" choice magically */ + REMOTE_DRIVER_MODE_AUTO, + /* Always use the legacy libvirtd */ + REMOTE_DRIVER_MODE_LEGACY, + /* Always use the per-driver virt*d daemons */ + REMOTE_DRIVER_MODE_DIRECT, + + REMOTE_DRIVER_MODE_LAST +} remoteDriverMode; + +VIR_ENUM_DECL(remoteDriverMode); --=20 2.26.2