[PATCH 03/33] qemu_capabilities.c: use 'MachineIsPowerPC' in DeviceDiskCaps

Daniel Henrique Barboza posted 33 patches 4 years ago
There is a newer version of this series
[PATCH 03/33] qemu_capabilities.c: use 'MachineIsPowerPC' in DeviceDiskCaps
Posted by Daniel Henrique Barboza 4 years ago
Both pSeries and PowerNV machines don't have floppy device support.

qemuDomainMachineIsPSeries() can be turned into static since it's
now unused outside of qemu_domain.c.

Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
 src/qemu/qemu_capabilities.c | 4 ++--
 src/qemu/qemu_domain.c       | 2 +-
 src/qemu/qemu_domain.h       | 2 --
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index ea35948b01..e922309351 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -6075,8 +6075,8 @@ virQEMUCapsFillDomainDeviceDiskCaps(virQEMUCaps *qemuCaps,
                              VIR_DOMAIN_DISK_DEVICE_CDROM,
                              VIR_DOMAIN_DISK_DEVICE_LUN);
 
-    /* PowerPC pseries based VMs do not support floppy device */
-    if (!qemuDomainMachineIsPSeries(machine, qemuCaps->arch)) {
+    /* PowerPC domains do not support floppy device */
+    if (!qemuDomainMachineIsPowerPC(machine, qemuCaps->arch)) {
         VIR_DOMAIN_CAPS_ENUM_SET(disk->diskDevice, VIR_DOMAIN_DISK_DEVICE_FLOPPY);
         VIR_DOMAIN_CAPS_ENUM_SET(disk->bus, VIR_DOMAIN_DISK_BUS_FDC);
     }
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 2accd4f766..bf418c8e80 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -8639,7 +8639,7 @@ qemuDomainMachineIsRISCVVirt(const char *machine,
 
 /* You should normally avoid this function and use
  * qemuDomainIsPSeries() instead. */
-bool
+static bool
 qemuDomainMachineIsPSeries(const char *machine,
                            const virArch arch)
 {
diff --git a/src/qemu/qemu_domain.h b/src/qemu/qemu_domain.h
index d07a279a1b..fe4420bf83 100644
--- a/src/qemu/qemu_domain.h
+++ b/src/qemu/qemu_domain.h
@@ -759,8 +759,6 @@ virDomainChrDef *qemuFindAgentConfig(virDomainDef *def);
  * doesn't have "Machine" in the name instead. */
 bool qemuDomainMachineIsARMVirt(const char *machine,
                                 const virArch arch);
-bool qemuDomainMachineIsPSeries(const char *machine,
-                                const virArch arch);
 bool qemuDomainMachineIsPowerPC(const char *machine,
                                 const virArch arch);
 bool qemuDomainMachineHasBuiltinIDE(const char *machine,
-- 
2.34.1

Re: [PATCH 03/33] qemu_capabilities.c: use 'MachineIsPowerPC' in DeviceDiskCaps
Posted by Peter Krempa 4 years ago
On Thu, Jan 20, 2022 at 10:52:06 -0300, Daniel Henrique Barboza wrote:
> Both pSeries and PowerNV machines don't have floppy device support.
> 
> qemuDomainMachineIsPSeries() can be turned into static since it's
> now unused outside of qemu_domain.c.

Preferably don't bundle two not related changes into one commit.

> 
> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
> ---
>  src/qemu/qemu_capabilities.c | 4 ++--
>  src/qemu/qemu_domain.c       | 2 +-
>  src/qemu/qemu_domain.h       | 2 --
>  3 files changed, 3 insertions(+), 5 deletions(-)

With the commits split:

Reviewed-by: Peter Krempa <pkrempa@redhat.com>

Re: [PATCH 03/33] qemu_capabilities.c: use 'MachineIsPowerPC' in DeviceDiskCaps
Posted by Daniel Henrique Barboza 4 years ago

On 1/21/22 10:44, Peter Krempa wrote:
> On Thu, Jan 20, 2022 at 10:52:06 -0300, Daniel Henrique Barboza wrote:
>> Both pSeries and PowerNV machines don't have floppy device support.
>>
>> qemuDomainMachineIsPSeries() can be turned into static since it's
>> now unused outside of qemu_domain.c.
> 
> Preferably don't bundle two not related changes into one commit.
> 
>>
>> Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
>> ---
>>   src/qemu/qemu_capabilities.c | 4 ++--
>>   src/qemu/qemu_domain.c       | 2 +-
>>   src/qemu/qemu_domain.h       | 2 --
>>   3 files changed, 3 insertions(+), 5 deletions(-)
> 
> With the commits split:
> 
> Reviewed-by: Peter Krempa <pkrempa@redhat.com>

Thanks. I split the commit as suggested.


Daniel

>