All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>, qemu-ppc@nongnu.org
Cc: qemu-devel@nongnu.org, Alexander Graf <agraf@suse.de>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Bharata B Rao <bharata@linux.vnet.ibm.com>
Subject: [Qemu-devel] [PATCH 2/2] vl: Print CPU help after we've registered the CPU accelerators
Date: Tue, 31 Jan 2017 14:11:59 +0100	[thread overview]
Message-ID: <1485868319-16151-3-git-send-email-thuth@redhat.com> (raw)
In-Reply-To: <1485868319-16151-1-git-send-email-thuth@redhat.com>

When running with KVM on POWER, we register some CPU types during
the initialization function of the ppc64 KVM code (which unfortunately
also can not be done via a type_init() like it is done on x86). So to
be able to see these updates in the CPU help text, the code that calls
list_cpus() has to be run after configure_accelerator(). This move should
be fine since the "cpu_model" variable is also never used before the call
to configure_accelerator(), and thus there should not be any unwanted
side effects in the code before configure_accelerator() if the user
started QEMU with "-cpu ?" or "-cpu help".

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 vl.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/vl.c b/vl.c
index 0b72b12..315c5c3 100644
--- a/vl.c
+++ b/vl.c
@@ -4055,11 +4055,6 @@ int main(int argc, char **argv, char **envp)
         qemu_set_hw_version(machine_class->hw_version);
     }
 
-    if (cpu_model && is_help_option(cpu_model)) {
-        list_cpus(stdout, &fprintf, cpu_model);
-        exit(0);
-    }
-
     if (!trace_init_backends()) {
         exit(1);
     }
@@ -4298,6 +4293,11 @@ int main(int argc, char **argv, char **envp)
 
     configure_accelerator(current_machine);
 
+    if (cpu_model && is_help_option(cpu_model)) {
+        list_cpus(stdout, &fprintf, cpu_model);
+        exit(0);
+    }
+
     if (qtest_chrdev) {
         qtest_init(qtest_chrdev, qtest_log, &error_fatal);
     }
-- 
1.8.3.1

  parent reply	other threads:[~2017-01-31 13:12 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-31 13:11 [Qemu-devel] [PATCH 0/2] ppc: Fix problems with duplicated CPU family types Thomas Huth
2017-01-31 13:11 ` [Qemu-devel] [PATCH 1/2] ppc/kvm: Handle the "family" CPU via alias instead of registering new types Thomas Huth
2017-02-01  0:10   ` David Gibson
2017-02-01  7:39     ` Thomas Huth
2017-02-01 22:27       ` David Gibson
2017-01-31 13:11 ` Thomas Huth [this message]
2017-02-01  0:08   ` [Qemu-devel] [PATCH 2/2] vl: Print CPU help after we've registered the CPU accelerators David Gibson
2017-02-02  1:11     ` Paolo Bonzini
2017-03-03 14:58   ` Eduardo Habkost
2017-03-05 23:06     ` David Gibson
2017-03-06 11:47       ` Eduardo Habkost
2017-03-07  3:31         ` David Gibson
2017-03-07 12:02           ` Eduardo Habkost
2017-03-08  2:33             ` David Gibson
2017-03-08 12:08               ` Eduardo Habkost
2017-03-09  1:29                 ` David Gibson
2017-03-07  9:02     ` Thomas Huth
2017-03-07 12:07       ` Eduardo Habkost
2017-03-10 12:40       ` Andrea Bolognani
2017-03-08 14:31     ` Peter Maydell
2017-03-08 14:50       ` Eduardo Habkost
2017-03-08 15:50         ` Thomas Huth

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=1485868319-16151-3-git-send-email-thuth@redhat.com \
    --to=thuth@redhat.com \
    --cc=agraf@suse.de \
    --cc=bharata@linux.vnet.ibm.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.