qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Evgeny Voevodin <e.voevodin@samsung.com>,
	Marcel Apfelbaum <marcel.a@redhat.com>,
	Igor Mitsyanko <i.mitsyanko@gmail.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Dmitry Solodkiy <d.solodkiy@samsung.com>,
	Maksim Kozlov <m.kozlov@samsung.com>
Subject: [Qemu-devel] [PATCH 2/7] exynos4: Use MachineClass instead of exynos4_machines array
Date: Tue, 18 Aug 2015 12:08:49 -0700	[thread overview]
Message-ID: <1439924934-30491-3-git-send-email-ehabkost@redhat.com> (raw)
In-Reply-To: <1439924934-30491-1-git-send-email-ehabkost@redhat.com>

We don't need a QEMUMachine array to query max_cpus, if we can get the
corresponding MachineClass.

Cc: Peter Maydell <peter.maydell@linaro.org>
Cc: Evgeny Voevodin <e.voevodin@samsung.com>
Cc: Maksim Kozlov <m.kozlov@samsung.com>
Cc: Igor Mitsyanko <i.mitsyanko@gmail.com>
Cc: Dmitry Solodkiy <d.solodkiy@samsung.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 hw/arm/exynos4_boards.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/arm/exynos4_boards.c b/hw/arm/exynos4_boards.c
index 3f88c4a..312a014 100644
--- a/hw/arm/exynos4_boards.c
+++ b/hw/arm/exynos4_boards.c
@@ -97,10 +97,12 @@ static void lan9215_init(uint32_t base, qemu_irq irq)
 static Exynos4210State *exynos4_boards_init_common(MachineState *machine,
                                                    Exynos4BoardType board_type)
 {
+    MachineClass *mc = MACHINE_GET_CLASS(machine);
+
     if (smp_cpus != EXYNOS4210_NCPUS && !qtest_enabled()) {
         fprintf(stderr, "%s board supports only %d CPU cores. Ignoring smp_cpus"
                 " value.\n",
-                exynos4_machines[board_type].name, EXYNOS4210_NCPUS);
+                mc->name, EXYNOS4210_NCPUS);
     }
 
     exynos4_board_binfo.ram_size = exynos4_board_ram_size[board_type];
-- 
2.1.0

  parent reply	other threads:[~2015-08-18 19:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-18 19:08 [Qemu-devel] [PATCH 0/7] machine registration: Use QOM, eliminate QEMUMachine Eduardo Habkost
2015-08-18 19:08 ` [Qemu-devel] [PATCH 1/7] exynos4: Use EXYNOS4210_NCPUS instead of max_cpus on error message Eduardo Habkost
2015-08-18 19:08 ` Eduardo Habkost [this message]
2015-08-18 19:08 ` [Qemu-devel] [PATCH 3/7] exynos4: Declare each QEMUMachine as a separate variable Eduardo Habkost
2015-08-18 19:08 ` [Qemu-devel] [PATCH 4/7] machine: DEFINE_MACHINE macro Eduardo Habkost
2015-08-20 21:14   ` Eduardo Habkost
2015-08-18 19:08 ` [Qemu-devel] [PATCH 5/7] pc: Use DEFINE_MACHINE to implement DEFINE_PC_MACHINE Eduardo Habkost
2015-08-19 23:28   ` Eduardo Habkost
2015-08-18 19:08 ` [Qemu-devel] [PATCH 6/7] [RFC] Use DEFINE_MACHINE to register all machines Eduardo Habkost
2015-08-18 19:54   ` Eduardo Habkost
2015-08-18 20:06   ` Eduardo Habkost
2015-08-18 21:43     ` [Qemu-devel] [PATCH v2 " Eduardo Habkost
2015-08-19  8:25       ` Michael Walle
2015-08-21 22:43         ` Eduardo Habkost
2015-08-18 19:08 ` [Qemu-devel] [PATCH 7/7] machine: Eliminate QEMUMachine and qemu_register_machine() Eduardo Habkost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1439924934-30491-3-git-send-email-ehabkost@redhat.com \
    --to=ehabkost@redhat.com \
    --cc=d.solodkiy@samsung.com \
    --cc=e.voevodin@samsung.com \
    --cc=i.mitsyanko@gmail.com \
    --cc=m.kozlov@samsung.com \
    --cc=marcel.a@redhat.com \
    --cc=mst@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).