qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 16/17] ahci: Recompute cur_cmd on migrate pos


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v2 16/17] ahci: Recompute cur_cmd on migrate post load
Date: Fri, 30 Jan 2015 10:36:02 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0


On 17/12/2014 02:36, John Snow wrote:
> When the AHCI HBA device is migrated, all of the information that
> led to the request being created is stored in the AHCIDevice
> structures, except for pointers into guest data where return
> information needs to be stored.
> 
> The "cur_cmd" field is usually responsible for this.
> 
> To rebuild the cur_cmd pointer post-migration, we can utilize
> the busy_slot index to figure out where the command header
> we are still processing is.
> 
> This allows a machine in a halted state from rerror=stop or
> werror=stop to be migrated and resume operations without issue.
> 
> Signed-off-by: John Snow <address@hidden>

Reviewed-by: Paolo Bonzini <address@hidden>


> ---
>  hw/ide/ahci.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
> index c153228..8078d3e 100644
> --- a/hw/ide/ahci.c
> +++ b/hw/ide/ahci.c
> @@ -1373,6 +1373,10 @@ static int ahci_state_post_load(void *opaque, int 
> version_id)
>           */
>          if (ad->busy_slot == -1) {
>              check_cmd(s, i);
> +        } else {
> +            /* We are in the middle of a command, and may need to access
> +             * the command header in guest memory again. */
> +            ad->cur_cmd = &((AHCICmdHdr *)ad->lst)[ad->busy_slot];
>          }
>      }
>  
> 



reply via email to

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