Patchwork [qom-cpu,for-1.4,03/14] cpu: Add model resolution support to CPUClass

login
register
mail settings
Submitter Andreas Färber
Date Jan. 26, 2013, 4:55 p.m.
Message ID <51040A71.404@suse.de>
Download mbox | patch
Permalink /patch/215918/
State New
Headers show

Comments

Andreas Färber - Jan. 26, 2013, 4:55 p.m.
Am 23.01.2013 13:07, schrieb Andreas Färber:
> Introduce CPUClass::class_by_name and add a default implementation.
[...]
> diff --git a/include/qom/cpu.h b/include/qom/cpu.h
> index 773caf9..cd0378e 100644
> --- a/include/qom/cpu.h
> +++ b/include/qom/cpu.h
> @@ -49,6 +49,8 @@ typedef struct CPUClass {
>      DeviceClass parent_class;
>      /*< public >*/
>  
> +    ObjectClass *(*class_by_name)(const char *cpu_model);
> +
>      void (*reset)(CPUState *cpu);
>  } CPUClass;
>  

Documentation missing:


Andreas

Patch

diff --git a/include/qom/cpu.h b/include/qom/cpu.h
index cd0378e..8097692 100644
--- a/include/qom/cpu.h
+++ b/include/qom/cpu.h
@@ -40,6 +40,8 @@  typedef struct CPUState CPUState;

 /**
  * CPUClass:
+ * @class_by_name: Callback to map -cpu command line model name to an
+ * instantiatable CPU type.
  * @reset: Callback to reset the #CPUState to its initial state.
  *
  * Represents a CPU family or model.