[PATCH] cosmetic: remove unused function return value

2021-10-23 Thread Ani Sinha
qemuBuildPMPCIRootHotplugCommandLine() returns 0 unconditionally. There is no
failure scenario at present. So clean up the code by removing integer return
from the function and also remove the failure check conditional from the
function call.
Also fix indentation for the above function call while at it.

Signed-off-by: Ani Sinha 
---
 src/qemu/qemu_command.c | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index d6df50ec73..093d8ae62c 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -3177,9 +3177,9 @@ qemuBuildSkipController(const virDomainControllerDef 
*controller,
 return false;
 }
 
-static int
+static void
 qemuBuildPMPCIRootHotplugCommandLine(virCommand *cmd,
-  const virDomainControllerDef *controller)
+ const virDomainControllerDef *controller)
 {
 if (controller->type == VIR_DOMAIN_CONTROLLER_TYPE_PCI &&
 controller->model == VIR_DOMAIN_CONTROLLER_MODEL_PCI_ROOT &&
@@ -3189,7 +3189,7 @@ qemuBuildPMPCIRootHotplugCommandLine(virCommand *cmd,
 virCommandAddArgFormat(cmd, "PIIX4_PM.acpi-root-pci-hotplug=%s",

virTristateSwitchTypeToString(controller->opts.pciopts.hotplug));
 }
-return 0;
+return;
 }
 
 static int
@@ -3207,8 +3207,7 @@ qemuBuildControllersByTypeCommandLine(virCommand *cmd,
 if (cont->type != type)
 continue;
 
-if (qemuBuildPMPCIRootHotplugCommandLine(cmd, cont))
-continue;
+qemuBuildPMPCIRootHotplugCommandLine(cmd, cont);
 
 if (qemuBuildSkipController(cont, def))
 continue;
-- 
2.25.1



Re: [libvirt PATCH 02/10] Revert "qemuxml2xmltest: Convert all acpi-hotplug control related tests to DO_TEST_CAPS_LATEST"

2021-10-23 Thread Laine Stump

On 10/21/21 1:06 PM, Ján Tomko wrote:

On a Thursday in 2021, Laine Stump wrote:

This reverts commit da896d440c7267e0b4575e4a3f2780bebf3fbfca.

Signed-off-by: Laine Stump 
---
...i-hotplug-bridge-disable.x86_64-latest.xml | 36 -
.../pc-i440fx-acpi-hotplug-bridge-disable.xml |  1 +
...pi-hotplug-bridge-enable.x86_64-latest.xml | 36 -
.../pc-i440fx-acpi-hotplug-bridge-enable.xml  |  1 +
...cpi-root-hotplug-disable.x86_64-latest.xml | 33 
.../pc-i440fx-acpi-root-hotplug-disable.xml   |  1 +
...acpi-root-hotplug-enable.x86_64-latest.xml | 33 
.../pc-i440fx-acpi-root-hotplug-enable.xml    |  1 +
...i-hotplug-bridge-disable.x86_64-latest.xml | 53 ---
.../q35-acpi-hotplug-bridge-disable.xml   |  1 +
...pi-hotplug-bridge-enable.x86_64-latest.xml | 53 ---
.../q35-acpi-hotplug-bridge-enable.xml    |  1 +
tests/qemuxml2xmltest.c   | 24 ++---
13 files changed, 24 insertions(+), 250 deletions(-)
delete mode 100644 
tests/qemuxml2xmloutdata/pc-i440fx-acpi-hotplug-bridge-disable.x86_64-latest.xml 

create mode 12 
tests/qemuxml2xmloutdata/pc-i440fx-acpi-hotplug-bridge-disable.xml
delete mode 100644 
tests/qemuxml2xmloutdata/pc-i440fx-acpi-hotplug-bridge-enable.x86_64-latest.xml 

create mode 12 
tests/qemuxml2xmloutdata/pc-i440fx-acpi-hotplug-bridge-enable.xml
delete mode 100644 
tests/qemuxml2xmloutdata/pc-i440fx-acpi-root-hotplug-disable.x86_64-latest.xml 

create mode 12 
tests/qemuxml2xmloutdata/pc-i440fx-acpi-root-hotplug-disable.xml
delete mode 100644 
tests/qemuxml2xmloutdata/pc-i440fx-acpi-root-hotplug-enable.x86_64-latest.xml 

create mode 12 
tests/qemuxml2xmloutdata/pc-i440fx-acpi-root-hotplug-enable.xml
delete mode 100644 
tests/qemuxml2xmloutdata/q35-acpi-hotplug-bridge-disable.x86_64-latest.xml 

create mode 12 
tests/qemuxml2xmloutdata/q35-acpi-hotplug-bridge-disable.xml
delete mode 100644 
tests/qemuxml2xmloutdata/q35-acpi-hotplug-bridge-enable.x86_64-latest.xml
create mode 12 
tests/qemuxml2xmloutdata/q35-acpi-hotplug-bridge-enable.xml


diff --git a/tests/qemuxml2xmltest.c b/tests/qemuxml2xmltest.c
index b0a1212a54..d6effbdac6 100644
--- a/tests/qemuxml2xmltest.c
+++ b/tests/qemuxml2xmltest.c
@@ -424,12 +424,24 @@ mymain(void)
    DO_TEST_NOCAPS("input-usbtablet");
    DO_TEST_NOCAPS("misc-acpi");
    DO_TEST("misc-disable-s3", QEMU_CAPS_PIIX_DISABLE_S3);
-    DO_TEST_CAPS_LATEST("pc-i440fx-acpi-root-hotplug-disable");
-    DO_TEST_CAPS_LATEST("pc-i440fx-acpi-root-hotplug-enable");
-    DO_TEST_CAPS_LATEST("pc-i440fx-acpi-hotplug-bridge-disable");
-    DO_TEST_CAPS_LATEST("pc-i440fx-acpi-hotplug-bridge-enable");
-    DO_TEST_CAPS_LATEST("q35-acpi-hotplug-bridge-disable");
-    DO_TEST_CAPS_LATEST("q35-acpi-hotplug-bridge-enable");
+    DO_TEST("pc-i440fx-acpi-root-hotplug-disable",
+    QEMU_CAPS_PIIX4_ACPI_ROOT_PCI_HOTPLUG);
+    DO_TEST("pc-i440fx-acpi-root-hotplug-enable",
+    QEMU_CAPS_PIIX4_ACPI_ROOT_PCI_HOTPLUG);


Please only do a partial revert here and leave the i440fx root hotplug
tests using the _LATEST form, since you're only reverting bridge hotplug
tests by the end of the series.


Huh, I thought I caught all of those (maybe I "re-un-re-reverted" it in 
another patch?). Thanks for catching it!


I fixed it, but I'm waiting until Monday to push these.



(The only conflict will be in context in the second-to-last patch.
  Well, and the NEWS addition, because I pushed a patch there in the
  meantime)

Jano


+    DO_TEST("pc-i440fx-acpi-hotplug-bridge-disable",
+    QEMU_CAPS_PIIX4_ACPI_HOTPLUG_BRIDGE);
+    DO_TEST("pc-i440fx-acpi-hotplug-bridge-enable",
+    QEMU_CAPS_PIIX4_ACPI_HOTPLUG_BRIDGE);