From nobody Sat Feb 7 11:05:29 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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=1594319826; cv=none; d=zohomail.com; s=zohoarc; b=gQ+qOfB02u94mvUtcaSItKJNMtE1IwezELnXtmfuMk8ZPA995+HSS4MasDuNeun4cRXl1C/QpEovCr6fZEs1tEer6b8bpb87JizOELroeg5Vopwney6Wuku/fQD6QY+HHgWcV6DdiokmIFQExc55j8xV+Y+yCJms+UIm8Cp5SMg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594319826; 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=j9qYoqUK+ALu55ixggpkeM9jMOTdW7e5pYqdxX8F6uY=; b=BKNkMZN92m+e7oyRJOQ3eQVzZsrk2LQU1NI0rkO/qa65mssK9Xk3ee39bc0ET0krQz3w90NGoGwbibvwBQNdg/WOw6kFJhm56ntFNWpbb6+pCOsEGzbpm7yxhSZojcW9A3SUy5dd/Sis5Ap2DPGAUbZ8Ff84TJhIuA7dw9nU0do= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by mx.zohomail.com with SMTPS id 1594319826284335.63973422710103; Thu, 9 Jul 2020 11:37:06 -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-466-ZDhvpJvSOQydrwuWeeBLlw-1; Thu, 09 Jul 2020 14:37:02 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6BB59107B7EF; Thu, 9 Jul 2020 18:36:56 +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 43F8210016DA; Thu, 9 Jul 2020 18:36:56 +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 11E71180043D; Thu, 9 Jul 2020 18:36:56 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 069Ias3p023338 for ; Thu, 9 Jul 2020 14:36:54 -0400 Received: by smtp.corp.redhat.com (Postfix) id D053C60F8D; Thu, 9 Jul 2020 18:36:54 +0000 (UTC) Received: from localhost.localdomain.com (unknown [10.36.110.45]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1EA3A60E1C; Thu, 9 Jul 2020 18:36:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594319824; 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=j9qYoqUK+ALu55ixggpkeM9jMOTdW7e5pYqdxX8F6uY=; b=VHKl0R07pvy6Fk3ekWZcjLL6bwa/b66DpuZKBqhi5sOS5y9AfUjuHxOIWXeIKuBCGrPOGi T/ZBXrehrJejWM/tnPLpIamcMik7YVqFDc4R8BybfN6G7tDNFcsqIJ7SXUQmoeLvP6aMv/ x0rXzwm7EXBCanwNizxl9Y9bTUVOapY= X-MC-Unique: ZDhvpJvSOQydrwuWeeBLlw-1 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Subject: [libvirt PATCH 2/9] remote: split off enums into separate source file Date: Thu, 9 Jul 2020 19:36:39 +0100 Message-Id: <20200709183646.4016586-3-berrange@redhat.com> In-Reply-To: <20200709183646.4016586-1-berrange@redhat.com> References: <20200709183646.4016586-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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.84 on 10.5.11.22 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 1b1be8340d..0ae97f4107 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 653c68472a..880fce6e62 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