[libvirt] [PATCH 16/23] Move src/fdstream to src/util/virfdstream

Martin Kletzander mkletzan at redhat.com
Fri Mar 24 19:00:04 UTC 2017


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 <mkletzan at redhat.com>
---
 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 bfaea4afb255..36f70bfb93d2 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 64cb88cfa5a7..2002e6889413 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 2052fb507b70..02db71b0f16e 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 3258c272085d..380af39b0b2a 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 bca9c37d427e..416a7a129c78 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 c5181e5ff6de..25773364f3bd 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1061,16 +1061,6 @@ virStorageVolClass;
 virStreamClass;


-# fdstream.h
-virFDStreamConnectUNIX;
-virFDStreamCreateFile;
-virFDStreamOpen;
-virFDStreamOpenBlockDevice;
-virFDStreamOpenFile;
-virFDStreamOpenPTY;
-virFDStreamSetInternalCloseCb;
-
-
 # libvirt_internal.h
 virConnectSupportsFeature;
 virDomainMigrateBegin3;
@@ -1566,6 +1556,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 6b5b981f18bc..073cfda64302 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 a2c1052c65fe..5dbd5a6c242c 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 4aba981a85c7..b3137954ad80 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -86,7 +86,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 f5711bcf744a..9577f3b258a3 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 287a86276c33..61c5e7eff132 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 38d373ec26c4..7687eb89a0ba 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 18eaf56021dd..866949558bb2 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 f0c0ad35a8be..18e62663ca86 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 3e92577c7985..75b69b611c12 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 <netinet/in.h>
 #include <termios.h>

-#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 2c913ea14093..32a741e2695d 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 96e1ffdc759c..a64d2e89a9bd 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 3f9bfa7a6c38..c88e7ea00751 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 625fd561d3b3..9c7d65bef6cc 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"
-- 
2.12.0




More information about the libvir-list mailing list