[PATCH 7/9] qemu: Make most qemuDomainMachine*() functions static

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ideally we'd make all of them static, but there are a few
cases where we don't have a virDomainDef instance handy and
so they are the only option.

For the few ones we're forced to keep exporting, document
through comments that the alternative is preferred.

Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 src/qemu/qemu_domain.c | 16 +++++++++++-----
 src/qemu/qemu_domain.h | 12 ++----------
 2 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 5820a4b515..8db02f7738 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -9870,7 +9870,7 @@ qemuFindAgentConfig(virDomainDefPtr def)
 }
 
 
-bool
+static bool
 qemuDomainMachineIsQ35(const char *machine,
                        const virArch arch)
 {
@@ -9882,7 +9882,7 @@ qemuDomainMachineIsQ35(const char *machine,
 }
 
 
-bool
+static bool
 qemuDomainMachineIsI440FX(const char *machine,
                           const virArch arch)
 {
@@ -9897,7 +9897,7 @@ qemuDomainMachineIsI440FX(const char *machine,
 }
 
 
-bool
+static bool
 qemuDomainMachineIsS390CCW(const char *machine,
                            const virArch arch)
 {
@@ -9908,6 +9908,8 @@ qemuDomainMachineIsS390CCW(const char *machine,
 }
 
 
+/* You should normally avoid this function and use
+ * qemuDomainIsARMVirt() instead. */
 bool
 qemuDomainMachineIsARMVirt(const char *machine,
                            const virArch arch)
@@ -9925,7 +9927,7 @@ qemuDomainMachineIsARMVirt(const char *machine,
 }
 
 
-bool
+static bool
 qemuDomainMachineIsRISCVVirt(const char *machine,
                              const virArch arch)
 {
@@ -9940,6 +9942,8 @@ qemuDomainMachineIsRISCVVirt(const char *machine,
 }
 
 
+/* You should normally avoid this function and use
+ * qemuDomainIsPSeries() instead. */
 bool
 qemuDomainMachineIsPSeries(const char *machine,
                            const virArch arch)
@@ -9955,6 +9959,8 @@ qemuDomainMachineIsPSeries(const char *machine,
 }
 
 
+/* You should normally avoid this function and use
+ * qemuDomainHasBuiltinIDE() instead. */
 bool
 qemuDomainMachineHasBuiltinIDE(const char *machine,
                                const virArch arch)
@@ -9966,7 +9972,7 @@ qemuDomainMachineHasBuiltinIDE(const char *machine,
 }
 
 
-bool
+static bool
 qemuDomainMachineNeedsFDC(const char *machine,
                           const virArch arch)
 {
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index e98999a026..89f45aeb2c 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -828,22 +828,14 @@ void qemuDomainMemoryDeviceAlignSize(virDomainDefPtr def,
 
 virDomainChrDefPtr qemuFindAgentConfig(virDomainDefPtr def);
 
-bool qemuDomainMachineIsQ35(const char *machine,
-                            const virArch arch);
-bool qemuDomainMachineIsI440FX(const char *machine,
-                               const virArch arch);
-bool qemuDomainMachineIsS390CCW(const char *machine,
-                                const virArch arch);
+/* You should normally avoid these functions and use the variant that
+ * doesn't have "Machine" in the name instead. */
 bool qemuDomainMachineIsARMVirt(const char *machine,
                                 const virArch arch);
-bool qemuDomainMachineIsRISCVVirt(const char *machine,
-                                  const virArch arch);
 bool qemuDomainMachineIsPSeries(const char *machine,
                                 const virArch arch);
 bool qemuDomainMachineHasBuiltinIDE(const char *machine,
                                     const virArch arch);
-bool qemuDomainMachineNeedsFDC(const char *machine,
-                               const virArch arch);
 
 bool qemuDomainIsQ35(const virDomainDef *def);
 bool qemuDomainIsI440FX(const virDomainDef *def);
-- 
2.20.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux