From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MQnBq-0005wT-3n for qemu-devel@nongnu.org; Tue, 14 Jul 2009 14:57:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MQnBo-0005vb-B0 for qemu-devel@nongnu.org; Tue, 14 Jul 2009 14:57:21 -0400 Received: from [199.232.76.173] (port=60147 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MQnBo-0005vW-5K for qemu-devel@nongnu.org; Tue, 14 Jul 2009 14:57:20 -0400 Received: from fg-out-1718.google.com ([72.14.220.153]:57036) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MQnBm-0000dv-I7 for qemu-devel@nongnu.org; Tue, 14 Jul 2009 14:57:19 -0400 Received: by fg-out-1718.google.com with SMTP id d23so1292768fga.8 for ; Tue, 14 Jul 2009 11:57:16 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4A5C9EDF.3060705@codemonkey.ws> References: <4A5C3FBB.10306@siemens.com> <4A5C9EDF.3060705@codemonkey.ws> Date: Tue, 14 Jul 2009 21:57:16 +0300 Message-ID: Subject: Re: [Qemu-devel] [PATCH] monitor: Add port write command From: Blue Swirl Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Jan Kiszka , Anthony Liguori , qemu-devel On 7/14/09, Anthony Liguori wrote: > Jan Kiszka wrote: > > > Useful for testing hardware emulations or manipulating its state to > > stress guest drivers. > > > > Signed-off-by: Jan Kiszka > > > > > > Patch looks good. > > Makes me think of an idea I had a while ago. It's a rather radical change > but I think we could target it for 0.12. Today, the vast majority of our > save/restore code looks like: > > save: > // version checks > qemu_put_type(f, &field); > ... > > load: > // version checks > qemu_get_type(f, &field); > ... > // optional depending on version > qemu_get_type(f, &field); > > device_reset(s); > > We could convert this to something this to be largely data drive. For > instance, > > SaveVMFields fields[] = { > { offsetof(DeviceState, field), "field", TYPE, VERSION }, > {}, > }; > > SaveVMDescription desc = { > .fields = fields, > .version = CURRENT_VERSION, > .reset = device_reset, > }; > > What would be really cool about this change is that we could introduce a > new set of commands to manipulate device state. We could save/restore > individual device state and that would allow us to dump device state via the > monitor and to manipulate individual fields of the device state. I think > this could be pretty useful for debugging. > > I'm curious if anyone else is interested in this sort of change. Excellent idea!