[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 8/8] system: Inline machine_containers[] in qemu_create_machin
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v4 8/8] system: Inline machine_containers[] in qemu_create_machine_containers() |
Date: |
Thu, 2 Jan 2025 22:18:00 +0100 |
Only qemu_create_machine_containers() uses the
machine_containers[] array, restrict the scope
to this single user.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Acked-by: Peter Xu <peterx@redhat.com>
---
system/vl.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/system/vl.c b/system/vl.c
index 20e0eaf95ac..0768f93f9f1 100644
--- a/system/vl.c
+++ b/system/vl.c
@@ -2113,18 +2113,16 @@ static void parse_memory_options(void)
loc_pop(&loc);
}
-static const char *const machine_containers[] = {
- "unattached",
- "peripheral",
- "peripheral-anon"
-};
-
static void qemu_create_machine_containers(Object *machine)
{
- int i;
+ static const char *const containers[] = {
+ "unattached",
+ "peripheral",
+ "peripheral-anon",
+ };
- for (i = 0; i < ARRAY_SIZE(machine_containers); i++) {
- object_property_add_new_container(machine, machine_containers[i]);
+ for (unsigned i = 0; i < ARRAY_SIZE(containers); i++) {
+ object_property_add_new_container(machine, containers[i]);
}
}
--
2.47.1
- [PATCH v4 3/8] qdev: Add machine_get_container(), (continued)
- [PATCH v4 3/8] qdev: Add machine_get_container(), Philippe Mathieu-Daudé, 2025/01/02
- [PATCH v4 4/8] qdev: Use machine_get_container(), Philippe Mathieu-Daudé, 2025/01/02
- [PATCH v4 5/8] qom: Add object_get_container(), Philippe Mathieu-Daudé, 2025/01/02
- [PATCH v4 6/8] qom: Use object_get_container(), Philippe Mathieu-Daudé, 2025/01/02
- [PATCH v4 7/8] qom: Remove container_get(), Philippe Mathieu-Daudé, 2025/01/02
- [PATCH v4 8/8] system: Inline machine_containers[] in qemu_create_machine_containers(),
Philippe Mathieu-Daudé <=
- Re: [PATCH v4 0/8] QOM: container_get() removal, Philippe Mathieu-Daudé, 2025/01/09