[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 16/17] ahci: Recompute cur_cmd on migrate pos
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v3 16/17] ahci: Recompute cur_cmd on migrate post load |
Date: |
Mon, 23 Feb 2015 14:56:10 +0000 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Tue, Feb 10, 2015 at 01:19:28PM -0500, John Snow wrote:
> diff --git a/hw/ide/ahci.c b/hw/ide/ahci.c
> index 56a4867..5a1973f 100644
> --- a/hw/ide/ahci.c
> +++ b/hw/ide/ahci.c
> @@ -1376,6 +1376,11 @@ 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. */
> + assert(ad->busy_slot >= 0 && ad->busy_slot < AHCI_MAX_CMDS);
> + ad->cur_cmd = &((AHCICmdHdr *)ad->lst)[ad->busy_slot];
> }
Assertion failures call abort(3) and therefore cause core dumps, which
is not a suitable way of rejecting invalid inputs.
post_load() functions should return -1 on failure.
Stefan
pgpLWqf2zDuZj.pgp
Description: PGP signature
- [Qemu-devel] [PATCH v3 05/17] ide: pass IDEBus to the restart_cb, (continued)
- [Qemu-devel] [PATCH v3 05/17] ide: pass IDEBus to the restart_cb, John Snow, 2015/02/10
- [Qemu-devel] [PATCH v3 07/17] ide: remove restart_cb callback, John Snow, 2015/02/10
- [Qemu-devel] [PATCH v3 08/17] ide: replace set_unit callback with more IDEBus state, John Snow, 2015/02/10
- [Qemu-devel] [PATCH v3 06/17] ide: move restart callback to common code, John Snow, 2015/02/10
- [Qemu-devel] [PATCH v3 04/17] ide: do not use BMDMA in restart callback, John Snow, 2015/02/10
- [Qemu-devel] [PATCH v3 09/17] ide: place initial state of the current request to IDEBus, John Snow, 2015/02/10
- [Qemu-devel] [PATCH v3 14/17] ahci: Migrate IDEStatus, John Snow, 2015/02/10
- [Qemu-devel] [PATCH v3 01/17] ide: start extracting ide_restart_dma out of bmdma_restart_dma, John Snow, 2015/02/10
- [Qemu-devel] [PATCH v3 10/17] ide: migrate initial request state via IDEBus, John Snow, 2015/02/10
- [Qemu-devel] [PATCH v3 16/17] ahci: Recompute cur_cmd on migrate post load, John Snow, 2015/02/10
- Re: [Qemu-devel] [PATCH v3 16/17] ahci: Recompute cur_cmd on migrate post load,
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH v3 12/17] ide: make more functions static, John Snow, 2015/02/10
- [Qemu-devel] [PATCH v3 13/17] ide: support PIO restart for the ISA controller, John Snow, 2015/02/10
- [Qemu-devel] [PATCH v3 17/17] qtest/ide: Test flush / retry for ISA and PCI, John Snow, 2015/02/10
- [Qemu-devel] [PATCH v3 15/17] ahci: add support for restarting non-queued commands, John Snow, 2015/02/10
- [Qemu-devel] [PATCH v3 11/17] ide: commonize io_buffer_index initialization, John Snow, 2015/02/10