[Libguestfs] [PATCH 1/3] lib: move MAX_PKG_DB_SIZE to inspect-apps

Pino Toscano ptoscano at redhat.com
Fri Nov 30 12:07:47 UTC 2018


It is used only there, so avoid exposing it to all the users of
guestfs-internal.h.

This is just code motion.
---
 lib/guestfs-internal.h | 9 ---------
 lib/inspect-apps.c     | 9 +++++++++
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/lib/guestfs-internal.h b/lib/guestfs-internal.h
index 0ebb639e7..3274dcdf0 100644
--- a/lib/guestfs-internal.h
+++ b/lib/guestfs-internal.h
@@ -122,15 +122,6 @@
  */
 #define APPLIANCE_TIMEOUT (20*60) /* 20 mins */
 
-/* Some limits on what the inspection code will read, for safety. */
-
-/* Maximum RPM or dpkg database we will download to /tmp.  RPM
- * 'Packages' database can get very large: 70 MB is roughly the
- * standard size for a new Fedora install, and after lots of package
- * installation/removal I have seen well over 100 MB databases.
- */
-#define MAX_PKG_DB_SIZE       (300 * 1000 * 1000)
-
 /* Maximum size of Windows explorer.exe.  2.6MB on Windows 7. */
 #define MAX_WINDOWS_EXPLORER_SIZE (4 * 1000 * 1000)
 
diff --git a/lib/inspect-apps.c b/lib/inspect-apps.c
index f0cf16b38..d0bb340da 100644
--- a/lib/inspect-apps.c
+++ b/lib/inspect-apps.c
@@ -45,6 +45,15 @@
 #include "guestfs-internal-actions.h"
 #include "structs-cleanups.h"
 
+/* Some limits on what the inspection code will read, for safety. */
+
+/* Maximum RPM or dpkg database we will download to /tmp.  RPM
+ * 'Packages' database can get very large: 70 MB is roughly the
+ * standard size for a new Fedora install, and after lots of package
+ * installation/removal I have seen well over 100 MB databases.
+ */
+#define MAX_PKG_DB_SIZE       (300 * 1000 * 1000)
+
 #ifdef DB_DUMP
 static struct guestfs_application2_list *list_applications_rpm (guestfs_h *g, const char *root);
 #endif
-- 
2.17.2




More information about the Libguestfs mailing list