From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CC0Ov-0000Bh-9t for qemu-devel@nongnu.org; Mon, 27 Sep 2004 14:39:05 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CC0OT-00007I-IN for qemu-devel@nongnu.org; Mon, 27 Sep 2004 14:39:05 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CC0OT-00007F-FS for qemu-devel@nongnu.org; Mon, 27 Sep 2004 14:38:37 -0400 Received: from [213.146.130.142] (helo=trantor.org.uk) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1CC0Hx-0000yB-Kn for qemu-devel@nongnu.org; Mon, 27 Sep 2004 14:31:54 -0400 Subject: Re: [Qemu-devel] Patch: NE2000 savevm problem solved! From: Gianni Tedesco In-Reply-To: References: Content-Type: text/plain Date: Mon, 27 Sep 2004 19:30:49 +0100 Message-Id: <1096309850.14214.10.camel@sherbert> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Fri, 2004-09-24 at 12:07 +0200, Johannes Schindelin wrote: > With the attached patch, Win98 guest resumes -user-net properly after > loadvm'ming. > > It adds savevm functions for NE2000State and PCIDevice, which I created by > "perl qemu-struct2savevm.pl NE2000State ne2000 < hw/ne2000.c" and > "perl qemu-struct2savevm.pl PCIDevice generic_pci < hw/ne2000.c". > > Two issues remain: > - *Every* PCIDevice is now savevm'ed, because the savevm handler is > registered in pci_register_device. > - the savevm handler is therefore registered with the name passed to > pci_register_device. It would be probably better to prefix that with > "pci_" (note that it only works at the moment because vga registers > a "vga" savevm handler, while the PCI device is registered as "VGA"). > > I am willing to fix those issues when you tell me what solution you > prefer. I'm not sure how well your pci_generic_{load,save} will work. What devices did you test it on? Perhaps it would be a better idea to not make it default, but allow devices to use them if they know they will work. As an aside. I think it's generally a good idea to make the hardware more object oriented in nature. ie. all devices have common methods (ctor, dtor, load, save) and all bussess with (ctor, dtor, add, remove). That would pave the way for having a nice GUI that allows user to configure a machine, and in the future to configure it at run-time with hot-swap. That would also be useful for OS developers to test their hot- swap subsystems. -- // Gianni Tedesco (gianni at scaramanga dot co dot uk) lynx --source www.scaramanga.co.uk/scaramanga.asc | gpg --import 8646BE7D: 6D9F 2287 870E A2C9 8F60 3A3C 91B5 7669 8646 BE7D