Move all the private helpers for parsing and formatting of domain
elements as private static functions in vmx.c, to avoid using them
directly.

Signed-off-by: Pino Toscano <ptosc...@redhat.com>
---
 src/libvirt_vmx.syms | 12 ---------
 src/vmx/vmx.c        | 62 ++++++++++++++++++++++++++++++++------------
 src/vmx/vmx.h        | 44 -------------------------------
 3 files changed, 46 insertions(+), 72 deletions(-)

diff --git a/src/libvirt_vmx.syms b/src/libvirt_vmx.syms
index e673923bd9..9d723c6de4 100644
--- a/src/libvirt_vmx.syms
+++ b/src/libvirt_vmx.syms
@@ -7,19 +7,7 @@ virVMXConvertToUTF8;
 virVMXDomainXMLConfInit;
 virVMXEscapeHex;
 virVMXFormatConfig;
-virVMXFormatDisk;
-virVMXFormatEthernet;
-virVMXFormatFloppy;
-virVMXFormatParallel;
-virVMXFormatSerial;
-virVMXFormatVNC;
 virVMXParseConfig;
-virVMXParseDisk;
-virVMXParseEthernet;
-virVMXParseParallel;
-virVMXParseSCSIController;
-virVMXParseSerial;
-virVMXParseVNC;
 virVMXUnescapeHex;
 
 # Let emacs know we want case-insensitive sorting
diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c
index e0777a9ddd..70f4d78e8a 100644
--- a/src/vmx/vmx.c
+++ b/src/vmx/vmx.c
@@ -521,6 +521,35 @@ VIR_ENUM_IMPL(virVMXControllerModelSCSI,
               "UNUSED virtio-non-transitional",
 );
 
+static int virVMXParseVNC(virConfPtr conf, virDomainGraphicsDefPtr *def);
+static int virVMXParseSCSIController(virConfPtr conf, int controller, bool 
*present,
+                                     int *virtualDev);
+static int virVMXParseDisk(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt,
+                           virConfPtr conf, int device, int busType,
+                           int controllerOrBus, int unit, virDomainDiskDefPtr 
*def,
+                           virDomainDefPtr vmdef);
+static int virVMXParseFileSystem(virConfPtr conf, int number, 
virDomainFSDefPtr *def);
+static int virVMXParseEthernet(virConfPtr conf, int controller, 
virDomainNetDefPtr *def);
+static int virVMXParseSerial(virVMXContext *ctx, virConfPtr conf, int port,
+                             virDomainChrDefPtr *def);
+static int virVMXParseParallel(virVMXContext *ctx, virConfPtr conf, int port,
+                               virDomainChrDefPtr *def);
+static int virVMXParseSVGA(virConfPtr conf, virDomainVideoDefPtr *def);
+
+static int virVMXFormatVNC(virDomainGraphicsDefPtr def, virBufferPtr buffer);
+static int virVMXFormatDisk(virVMXContext *ctx, virDomainDiskDefPtr def,
+                                   virBufferPtr buffer);
+static int virVMXFormatFloppy(virVMXContext *ctx, virDomainDiskDefPtr def,
+                              virBufferPtr buffer, bool floppy_present[2]);
+static int virVMXFormatFileSystem(virDomainFSDefPtr def, int number,
+                                  virBufferPtr buffer);
+static int virVMXFormatEthernet(virDomainNetDefPtr def, int controller,
+                                virBufferPtr buffer, int virtualHW_version);
+static int virVMXFormatSerial(virVMXContext *ctx, virDomainChrDefPtr def,
+                              virBufferPtr buffer);
+static int virVMXFormatParallel(virVMXContext *ctx, virDomainChrDefPtr def,
+                                virBufferPtr buffer);
+static int virVMXFormatSVGA(virDomainVideoDefPtr def, virBufferPtr buffer);
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  * Helpers
@@ -1852,7 +1881,7 @@ virVMXParseConfig(virVMXContext *ctx,
 
 
 
-int
+static int
 virVMXParseVNC(virConfPtr conf, virDomainGraphicsDefPtr *def)
 {
     bool enabled = false;
@@ -1916,7 +1945,7 @@ virVMXParseVNC(virConfPtr conf, virDomainGraphicsDefPtr 
*def)
 
 
 
-int
+static int
 virVMXParseSCSIController(virConfPtr conf, int controller, bool *present,
                           int *virtualDev)
 {
@@ -1986,7 +2015,7 @@ virVMXParseSCSIController(virConfPtr conf, int 
controller, bool *present,
 
 
 
-int
+static int
 virVMXParseDisk(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt, virConfPtr 
conf,
                 int device, int busType, int controllerOrBus, int unit,
                 virDomainDiskDefPtr *def, virDomainDefPtr vmdef)
@@ -2406,7 +2435,8 @@ virVMXParseDisk(virVMXContext *ctx, virDomainXMLOptionPtr 
xmlopt, virConfPtr con
 
 
 
-int virVMXParseFileSystem(virConfPtr conf, int number, virDomainFSDefPtr *def)
+static int
+virVMXParseFileSystem(virConfPtr conf, int number, virDomainFSDefPtr *def)
 {
     int result = -1;
     char prefix[48] = "";
@@ -2493,7 +2523,7 @@ int virVMXParseFileSystem(virConfPtr conf, int number, 
virDomainFSDefPtr *def)
 
 
 
-int
+static int
 virVMXParseEthernet(virConfPtr conf, int controller, virDomainNetDefPtr *def)
 {
     int result = -1;
@@ -2723,7 +2753,7 @@ virVMXParseEthernet(virConfPtr conf, int controller, 
virDomainNetDefPtr *def)
 
 
 
-int
+static int
 virVMXParseSerial(virVMXContext *ctx, virConfPtr conf, int port,
                   virDomainChrDefPtr *def)
 {
@@ -2905,7 +2935,7 @@ virVMXParseSerial(virVMXContext *ctx, virConfPtr conf, 
int port,
 
 
 
-int
+static int
 virVMXParseParallel(virVMXContext *ctx, virConfPtr conf, int port,
                     virDomainChrDefPtr *def)
 {
@@ -3007,7 +3037,7 @@ virVMXParseParallel(virVMXContext *ctx, virConfPtr conf, 
int port,
 
 
 
-int
+static int
 virVMXParseSVGA(virConfPtr conf, virDomainVideoDefPtr *def)
 {
     int result = -1;
@@ -3448,7 +3478,7 @@ virVMXFormatConfig(virVMXContext *ctx, 
virDomainXMLOptionPtr xmlopt, virDomainDe
 
 
 
-int
+static int
 virVMXFormatVNC(virDomainGraphicsDefPtr def, virBufferPtr buffer)
 {
     virDomainGraphicsListenDefPtr glisten;
@@ -3492,7 +3522,7 @@ virVMXFormatVNC(virDomainGraphicsDefPtr def, virBufferPtr 
buffer)
     return 0;
 }
 
-int
+static int
 virVMXFormatDisk(virVMXContext *ctx, virDomainDiskDefPtr def,
                  virBufferPtr buffer)
 {
@@ -3639,7 +3669,7 @@ virVMXFormatDisk(virVMXContext *ctx, virDomainDiskDefPtr 
def,
     return 0;
 }
 
-int
+static int
 virVMXFormatFloppy(virVMXContext *ctx, virDomainDiskDefPtr def,
                    virBufferPtr buffer, bool floppy_present[2])
 {
@@ -3696,7 +3726,7 @@ virVMXFormatFloppy(virVMXContext *ctx, 
virDomainDiskDefPtr def,
 
 
 
-int
+static int
 virVMXFormatFileSystem(virDomainFSDefPtr def, int number, virBufferPtr buffer)
 {
     if (def->type != VIR_DOMAIN_FS_TYPE_MOUNT) {
@@ -3721,7 +3751,7 @@ virVMXFormatFileSystem(virDomainFSDefPtr def, int number, 
virBufferPtr buffer)
 
 
 
-int
+static int
 virVMXFormatEthernet(virDomainNetDefPtr def, int controller,
                      virBufferPtr buffer, int virtualHW_version)
 {
@@ -3877,7 +3907,7 @@ virVMXFormatEthernet(virDomainNetDefPtr def, int 
controller,
 
 
 
-int
+static int
 virVMXFormatSerial(virVMXContext *ctx, virDomainChrDefPtr def,
                    virBufferPtr buffer)
 {
@@ -3983,7 +4013,7 @@ virVMXFormatSerial(virVMXContext *ctx, virDomainChrDefPtr 
def,
 
 
 
-int
+static int
 virVMXFormatParallel(virVMXContext *ctx, virDomainChrDefPtr def,
                      virBufferPtr buffer)
 {
@@ -4035,7 +4065,7 @@ virVMXFormatParallel(virVMXContext *ctx, 
virDomainChrDefPtr def,
 
 
 
-int
+static int
 virVMXFormatSVGA(virDomainVideoDefPtr def, virBufferPtr buffer)
 {
     unsigned long long vram;
diff --git a/src/vmx/vmx.h b/src/vmx/vmx.h
index 7069a50b6e..df5d39157b 100644
--- a/src/vmx/vmx.h
+++ b/src/vmx/vmx.h
@@ -88,28 +88,6 @@ virDomainDefPtr virVMXParseConfig(virVMXContext *ctx,
                                   virCapsPtr caps,
                                   const char *vmx);
 
-int virVMXParseVNC(virConfPtr conf, virDomainGraphicsDefPtr *def);
-
-int virVMXParseSCSIController(virConfPtr conf, int controller, bool *present,
-                              int *virtualDev);
-
-int virVMXParseDisk(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt,
-                    virConfPtr conf, int device, int busType,
-                    int controllerOrBus, int unit, virDomainDiskDefPtr *def,
-                    virDomainDefPtr vmdef);
-
-int virVMXParseFileSystem(virConfPtr conf, int number, virDomainFSDefPtr *def);
-
-int virVMXParseEthernet(virConfPtr conf, int controller, virDomainNetDefPtr 
*def);
-
-int virVMXParseSerial(virVMXContext *ctx, virConfPtr conf, int port,
-                      virDomainChrDefPtr *def);
-
-int virVMXParseParallel(virVMXContext *ctx, virConfPtr conf, int port,
-                        virDomainChrDefPtr *def);
-
-int virVMXParseSVGA(virConfPtr conf, virDomainVideoDefPtr *def);
-
 
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
@@ -118,25 +96,3 @@ int virVMXParseSVGA(virConfPtr conf, virDomainVideoDefPtr 
*def);
 
 char *virVMXFormatConfig(virVMXContext *ctx, virDomainXMLOptionPtr xmlopt,
                          virDomainDefPtr def, int virtualHW_version);
-
-int virVMXFormatVNC(virDomainGraphicsDefPtr def, virBufferPtr buffer);
-
-int virVMXFormatDisk(virVMXContext *ctx, virDomainDiskDefPtr def,
-                     virBufferPtr buffer);
-
-int virVMXFormatFloppy(virVMXContext *ctx, virDomainDiskDefPtr def,
-                       virBufferPtr buffer, bool floppy_present[2]);
-
-int virVMXFormatFileSystem(virDomainFSDefPtr def, int number,
-                           virBufferPtr buffer);
-
-int virVMXFormatEthernet(virDomainNetDefPtr def, int controller,
-                         virBufferPtr buffer, int virtualHW_version);
-
-int virVMXFormatSerial(virVMXContext *ctx, virDomainChrDefPtr def,
-                       virBufferPtr buffer);
-
-int virVMXFormatParallel(virVMXContext *ctx, virDomainChrDefPtr def,
-                         virBufferPtr buffer);
-
-int virVMXFormatSVGA(virDomainVideoDefPtr def, virBufferPtr buffer);
-- 
2.26.2

Reply via email to