Re: [PATCH v3 01/16] Introduce probe mode for machine type none

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 02.03.2015 um 13:43 schrieb Michael Mueller:
> QEMU now switches into "probe mode" when the selected machine is "none" and no
> specific accelerator(s) has been requested (i.e.: "-machine none").
> 
> In probe mode a by "<ARCH>_CONFIG" defines predefined list of accelerators run
> their init() methods.
> 
> Signed-off-by: Michael Mueller <mimu@xxxxxxxxxxxxxxxxxx>
> ---
>  accel.c              | 31 +++++++++++++++++++++++++------
>  include/hw/boards.h  |  1 +
>  include/sysemu/kvm.h | 10 ++++++++++
>  kvm-all.c            |  3 +++
>  4 files changed, 39 insertions(+), 6 deletions(-)

Edgar/Peter, isn't Xilinx using -machine none in TCG mode?

> @@ -78,20 +83,30 @@ static int accel_init_machine(AccelClass *acc, MachineState *ms)
>  
>  int configure_accelerator(MachineState *ms)
>  {
> -    const char *p;
> +    const char *p, *name;
>      char buf[10];
>      int ret;
>      bool accel_initialised = false;
>      bool init_failed = false;
>      AccelClass *acc = NULL;
> +    ObjectClass *oc;
> +    bool probe_mode = false;
>  
>      p = qemu_opt_get(qemu_get_machine_opts(), "accel");
>      if (p == NULL) {
> -        /* Use the default "accelerator", tcg */
> -        p = "tcg";
> +        oc = (ObjectClass *) MACHINE_GET_CLASS(current_machine);
> +        name = object_class_get_name(oc);
> +        probe_mode = !strcmp(name, "none" TYPE_MACHINE_SUFFIX);
> +        if (probe_mode) {
> +            /* Use these accelerators in probe mode, tcg should be last */
> +            p = probe_mode_accels;
> +        } else {
> +            /* Use the default "accelerator", tcg */
> +            p = "tcg";
> +        }
>      }

Can't we instead use an explicit ,accel=probe or ,accel=auto?
That would then obsolete the next patch.

Regards,
Andreas

>  
> -    while (!accel_initialised && *p != '\0') {
> +    while ((probe_mode || !accel_initialised) && *p != '\0') {
>          if (*p == ':') {
>              p++;
>          }

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Jennifer Guild, Dilip Upmanyu,
Graham Norton; HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux