qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 3/6] sysbus: Add user map hints


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 3/6] sysbus: Add user map hints
Date: Wed, 02 Jul 2014 10:26:05 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

Il 02/07/2014 10:24, Alexander Graf ha scritto:

So this suggests your reasoning for side effected _ptr write is just
for validity checking. So another approach could be to add a "check"
function to the _ptr variants (rather than an open coded) setter. This
has the advantage of being consistent with what we already do for
object_property_add_link.

Heh, yes. Unfortunately "realized" is a field in DeviceStruct which we
don't have access to from object.c.

In fact, this is exactly what I wanted to do before this approach. I
introduced an enum that was either

  * read-only
  * read-write
  * read-write-before-realize

and wanted to do all the checking in object.c.

But then I realized that object.c really shouldn't be aware of
DeviceState and threw away the idea.

I think your solution is pretty. However, it's probably time to split qom/object.c and/or include/qom/object.h.

Paolo



reply via email to

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