From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 1/2] PCI: Add interfaces to store and load the device saved state Date: Sun, 17 Apr 2011 12:23:50 +0300 Message-ID: <4DAAB1A6.4000308@redhat.com> References: <20110415194220.2838.10750.stgit@s20.home> <20110415195433.2838.96871.stgit@s20.home> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: linux-pci@vger.kernel.org, kvm@vger.kernel.org, jan.kiszka@siemens.com, jbarnes@virtuousgeek.org To: Alex Williamson Return-path: Received: from mx1.redhat.com ([209.132.183.28]:40813 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751727Ab1DQJX7 (ORCPT ); Sun, 17 Apr 2011 05:23:59 -0400 In-Reply-To: <20110415195433.2838.96871.stgit@s20.home> Sender: kvm-owner@vger.kernel.org List-ID: On 04/15/2011 10:54 PM, Alex Williamson wrote: > For KVM device assignment, we'd like to save off the state of a device > prior to passing it to the guest and restore it later. We also want > to allow pci_reset_funciton() to be called while the device is owned > by the guest. This however overwrites and invalidates the struct pci_dev > buffers, so we can't just manually call save and restore. Add generic > interfaces for the saved state to be stored into a buffer and reloaded > back into struct pci_dev at a later time. > > +/** > + * pci_store_saved_state - Store the device saved state into a buffer > + * @dev: - PCI device that we're dealing with > + * > + * Returns an opaque buffer containing the device saved state. > + * NULL if no state or error. > + */ > +void *pci_store_saved_state(struct pci_dev *dev) This is too opaque - no type safety. You can return a struct pci_state *, leaving it undefined in headers files. -- error compiling committee.c: too many arguments to function