From bdcb199532ae815310c5fdd7bc4f39397eb09f42 Mon Sep 17 00:00:00 2001 From: Martin Kletzander Date: Tue, 7 Mar 2017 10:34:47 +0100 Subject: [PATCH] Move src/fdstream to src/util/virfdstream There is no reason for it not to be in the utils, all global symbols under that file already have prefix vir* and there is no reason for it to be part of DRIVER_SOURCES because that is just a leftover from older days (pre-driver modules era, I believe). Signed-off-by: Martin Kletzander --- cfg.mk | 2 +- po/POTFILES.in | 2 +- src/Makefile.am | 2 +- src/bhyve/bhyve_driver.c | 2 +- src/conf/virchrdev.c | 2 +- src/libvirt_private.syms | 20 ++++++++++---------- src/libxl/libxl_migration.c | 2 +- src/lxc/lxc_driver.c | 2 +- src/qemu/qemu_driver.c | 2 +- src/qemu/qemu_migration.c | 2 +- src/storage/storage_driver.c | 2 +- src/storage/storage_util.c | 2 +- src/test/test_driver.c | 2 +- src/uml/uml_driver.c | 2 +- src/{fdstream.c => util/virfdstream.c} | 4 ++-- src/{fdstream.h => util/virfdstream.h} | 2 +- src/vbox/vbox_common.c | 2 +- src/xen/xen_driver.c | 2 +- tests/fdstreamtest.c | 2 +- 19 files changed, 29 insertions(+), 29 deletions(-) rename src/{fdstream.c => util/virfdstream.c} (99%) rename src/{fdstream.h => util/virfdstream.h} (97%) diff --git a/cfg.mk b/cfg.mk index bfaea4afb2..36f70bfb93 100644 --- a/cfg.mk +++ b/cfg.mk @@ -1101,7 +1101,7 @@ $(srcdir)/src/admin/admin_client.h: $(srcdir)/src/admin/admin_protocol.x # List all syntax-check exemptions: exclude_file_name_regexp--sc_avoid_strcase = ^tools/vsh\.h$$ -_src1=libvirt-stream|fdstream|qemu/qemu_monitor|util/(vircommand|virfile)|xen/xend_internal|rpc/virnetsocket|lxc/lxc_controller|locking/lock_daemon|logging/log_daemon +_src1=libvirt-stream|qemu/qemu_monitor|util/vir(command|file|fdstream)|xen/xend_internal|rpc/virnetsocket|lxc/lxc_controller|locking/lock_daemon|logging/log_daemon _test1=shunloadtest|virnettlscontexttest|virnettlssessiontest|vircgroupmock exclude_file_name_regexp--sc_avoid_write = \ ^(src/($(_src1))|daemon/libvirtd|tools/virsh-console|tests/($(_test1)))\.c$$ diff --git a/po/POTFILES.in b/po/POTFILES.in index 64cb88cfa5..2002e68894 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -67,7 +67,6 @@ src/esx/esx_util.c src/esx/esx_vi.c src/esx/esx_vi_methods.c src/esx/esx_vi_types.c -src/fdstream.c src/hyperv/hyperv_driver.c src/hyperv/hyperv_util.c src/hyperv/hyperv_wmi.c @@ -206,6 +205,7 @@ src/util/virdnsmasq.c src/util/virerror.c src/util/virerror.h src/util/vireventpoll.c +src/util/virfdstream.c src/util/virfile.c src/util/virfirewall.c src/util/virfirmware.c diff --git a/src/Makefile.am b/src/Makefile.am index 86fb721fc3..efaa724139 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -113,6 +113,7 @@ UTIL_SOURCES = \ util/virerror.c util/virerror.h \ util/virevent.c util/virevent.h \ util/vireventpoll.c util/vireventpoll.h \ + util/virfdstream.c util/virfdstream.h \ util/virfile.c util/virfile.h \ util/virfirewall.c util/virfirewall.h \ util/virfirewallpriv.h \ @@ -218,7 +219,6 @@ DRIVER_SOURCES = \ driver-stream.h \ internal.h \ $(DATATYPES_SOURCES) \ - fdstream.c fdstream.h \ $(NODE_INFO_SOURCES) \ libvirt.c libvirt_internal.h \ libvirt-domain.c \ diff --git a/src/bhyve/bhyve_driver.c b/src/bhyve/bhyve_driver.c index 3258c27208..380af39b0b 100644 --- a/src/bhyve/bhyve_driver.c +++ b/src/bhyve/bhyve_driver.c @@ -37,7 +37,7 @@ #include "domain_audit.h" #include "domain_event.h" #include "snapshot_conf.h" -#include "fdstream.h" +#include "virfdstream.h" #include "storage_conf.h" #include "node_device_conf.h" #include "virdomainobjlist.h" diff --git a/src/conf/virchrdev.c b/src/conf/virchrdev.c index bca9c37d42..416a7a129c 100644 --- a/src/conf/virchrdev.c +++ b/src/conf/virchrdev.c @@ -29,7 +29,7 @@ #include "virchrdev.h" #include "virhash.h" -#include "fdstream.h" +#include "virfdstream.h" #include "internal.h" #include "virthread.h" #include "viralloc.h" diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms index 384888d158..ec6deb8a5d 100644 --- a/src/libvirt_private.syms +++ b/src/libvirt_private.syms @@ -1063,16 +1063,6 @@ virStorageVolClass; virStreamClass; -# fdstream.h -virFDStreamConnectUNIX; -virFDStreamCreateFile; -virFDStreamOpen; -virFDStreamOpenBlockDevice; -virFDStreamOpenFile; -virFDStreamOpenPTY; -virFDStreamSetInternalCloseCb; - - # libvirt_internal.h virConnectSupportsFeature; virDomainMigrateBegin3; @@ -1569,6 +1559,16 @@ virEventPollUpdateHandle; virEventPollUpdateTimeout; +# util/virfdstream.h +virFDStreamConnectUNIX; +virFDStreamCreateFile; +virFDStreamOpen; +virFDStreamOpenBlockDevice; +virFDStreamOpenFile; +virFDStreamOpenPTY; +virFDStreamSetInternalCloseCb; + + # util/virfile.h saferead; safewrite; diff --git a/src/libxl/libxl_migration.c b/src/libxl/libxl_migration.c index 6b5b981f18..073cfda643 100644 --- a/src/libxl/libxl_migration.c +++ b/src/libxl/libxl_migration.c @@ -44,7 +44,7 @@ #include "libxl_migration.h" #include "locking/domain_lock.h" #include "virtypedparam.h" -#include "fdstream.h" +#include "virfdstream.h" #define VIR_FROM_THIS VIR_FROM_LIBXL diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index a2c1052c65..5dbd5a6c24 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -64,7 +64,7 @@ #include "virhook.h" #include "virfile.h" #include "virpidfile.h" -#include "fdstream.h" +#include "virfdstream.h" #include "domain_audit.h" #include "domain_nwfilter.h" #include "nwfilter_conf.h" diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 53c9090726..68044d8c4d 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -87,7 +87,7 @@ #include "virhook.h" #include "virstoragefile.h" #include "virfile.h" -#include "fdstream.h" +#include "virfdstream.h" #include "configmake.h" #include "virthreadpool.h" #include "locking/lock_manager.h" diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index a69e8784ab..3e789a7a7e 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -49,7 +49,7 @@ #include "virfile.h" #include "virnetdevopenvswitch.h" #include "datatypes.h" -#include "fdstream.h" +#include "virfdstream.h" #include "viruuid.h" #include "virtime.h" #include "locking/domain_lock.h" diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index 287a86276c..61c5e7eff1 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -46,7 +46,7 @@ #include "storage_backend.h" #include "virlog.h" #include "virfile.h" -#include "fdstream.h" +#include "virfdstream.h" #include "configmake.h" #include "virstring.h" #include "viraccessapicheck.h" diff --git a/src/storage/storage_util.c b/src/storage/storage_util.c index 38d373ec26..7687eb89a0 100644 --- a/src/storage/storage_util.c +++ b/src/storage/storage_util.c @@ -67,7 +67,7 @@ #include "stat-time.h" #include "virstring.h" #include "virxml.h" -#include "fdstream.h" +#include "virfdstream.h" #define VIR_FROM_THIS VIR_FROM_STORAGE diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 18eaf56021..866949558b 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -47,7 +47,7 @@ #include "domain_event.h" #include "network_event.h" #include "snapshot_conf.h" -#include "fdstream.h" +#include "virfdstream.h" #include "storage_conf.h" #include "virstorageobj.h" #include "storage_event.h" diff --git a/src/uml/uml_driver.c b/src/uml/uml_driver.c index f0c0ad35a8..18e62663ca 100644 --- a/src/uml/uml_driver.c +++ b/src/uml/uml_driver.c @@ -58,7 +58,7 @@ #include "domain_nwfilter.h" #include "nwfilter_conf.h" #include "virfile.h" -#include "fdstream.h" +#include "virfdstream.h" #include "configmake.h" #include "virnetdevtap.h" #include "virnodesuspend.h" diff --git a/src/fdstream.c b/src/util/virfdstream.c similarity index 99% rename from src/fdstream.c rename to src/util/virfdstream.c index 3e92577c79..75b69b611c 100644 --- a/src/fdstream.c +++ b/src/util/virfdstream.c @@ -1,5 +1,5 @@ /* - * fdstream.c: generic streams impl for file descriptors + * virfdstream.c: generic streams impl for file descriptors * * Copyright (C) 2009-2012, 2014 Red Hat, Inc. * @@ -33,7 +33,7 @@ #include #include -#include "fdstream.h" +#include "virfdstream.h" #include "virerror.h" #include "datatypes.h" #include "virlog.h" diff --git a/src/fdstream.h b/src/util/virfdstream.h similarity index 97% rename from src/fdstream.h rename to src/util/virfdstream.h index 2c913ea140..32a741e269 100644 --- a/src/fdstream.h +++ b/src/util/virfdstream.h @@ -1,5 +1,5 @@ /* - * fdstream.h: generic streams impl for file descriptors + * virfdstream.h: generic streams impl for file descriptors * * Copyright (C) 2009-2012 Red Hat, Inc. * diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index 96e1ffdc75..a64d2e89a9 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -37,7 +37,7 @@ #include "virkeycode.h" #include "snapshot_conf.h" #include "vbox_snapshot_conf.h" -#include "fdstream.h" +#include "virfdstream.h" #include "configmake.h" #include "vbox_common.h" diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c index 3f9bfa7a6c..c88e7ea007 100644 --- a/src/xen/xen_driver.c +++ b/src/xen/xen_driver.c @@ -59,7 +59,7 @@ #include "node_device_conf.h" #include "virpci.h" #include "viruuid.h" -#include "fdstream.h" +#include "virfdstream.h" #include "virfile.h" #include "viruri.h" #include "vircommand.h" diff --git a/tests/fdstreamtest.c b/tests/fdstreamtest.c index 625fd561d3..9c7d65bef6 100644 --- a/tests/fdstreamtest.c +++ b/tests/fdstreamtest.c @@ -25,7 +25,7 @@ #include "testutils.h" -#include "fdstream.h" +#include "virfdstream.h" #include "datatypes.h" #include "virerror.h" #include "viralloc.h" -- GitLab