[Top][All Lists]

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

Re: [qemu-s390x] [PATCH v1] s390x/cpu_models: Add "-cpu max" support

From: Eduardo Habkost
Subject: Re: [qemu-s390x] [PATCH v1] s390x/cpu_models: Add "-cpu max" support
Date: Wed, 25 Jul 2018 17:14:38 -0300
User-agent: Mutt/1.9.2 (2017-12-15)

On Wed, Jul 25, 2018 at 07:50:21PM +0200, David Hildenbrand wrote:
> On 25.07.2018 19:09, Eduardo Habkost wrote:
> >> +    if (local_err) {
> >> +        g_assert(kvm_enabled());
> >> +        error_report_err(local_err);
> >> +        /* fallback to unsupported CPU models */
> >> +        return;
> > 
> > What about moving this outside instance_init?
> To which place for example? We at least have to copy the CPU model
> for each and every CPU instance (so we can modify it without side
> effects using properties).

To any code that will look at cpu->model.

You are wrapping an interface that needs to report errors
(kvm_s390_get_host_cpu_model()) behind an interface that is not
able to report errors (object_new()).  There's nothing that
requires you to do that, does it?  You are free to provide an API
that is actually able to report errors, instead of relying on
object_new() only.

But I understand that the QOM/qdev API doesn't make that job
easy.  On x86 we have X86CPU::max_features and
X86CPU::user_features because of that.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]