[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 14/14] libqos/ahci: create libqos/ahci.c
From: |
Paolo Bonzini |
Subject: |
Re: [Qemu-devel] [PATCH 14/14] libqos/ahci: create libqos/ahci.c |
Date: |
Mon, 19 Jan 2015 18:15:31 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 |
On 13/01/2015 04:34, John Snow wrote:
> +tests/ahci-test$(EXESUF): tests/ahci-test.o $(libqos-pc-obj-y) \
> + tests/libqos/ahci.o
Why not add this to libqos-pc-obj-y or libqos-obj-y?
>
> + * Allocate space in the guest using information in the AHCIQState object.
> + */
> +uint64_t ahci_alloc(AHCIQState *ahci, size_t bytes)
> +{
> + g_assert(ahci);
> + g_assert(ahci->parent);
> + return qmalloc(ahci->parent, bytes);
No need to assert if you'd get a subsequent NULL pointer access.
> +}
> +
> +void ahci_free(AHCIQState *ahci, uint64_t addr)
> +{
> + g_assert(ahci);
> + g_assert(ahci->parent);
> + qfree(ahci->parent, addr);
> +}
Same here.
> + g_assert(ahci->hba_base != 0);
Comparing void * to NULL. Not a problem since I think hba_base should
become an uint32_t anyway.
Paolo
- Re: [Qemu-devel] [PATCH 11/14] libqos/ahci: Functional register helpers, (continued)
- [Qemu-devel] [PATCH 08/14] qtest/ahci: finalize AHCIQState consolidation, John Snow, 2015/01/12
- [Qemu-devel] [PATCH 12/14] qtest/ahci: remove getter/setter macros, John Snow, 2015/01/12
- [Qemu-devel] [PATCH 13/14] qtest/ahci: Bookmark FB and CLB pointers, John Snow, 2015/01/12
- [Qemu-devel] [PATCH 09/14] qtest/ahci: remove pcibus global, John Snow, 2015/01/12
- [Qemu-devel] [PATCH 14/14] libqos/ahci: create libqos/ahci.c, John Snow, 2015/01/12
- Re: [Qemu-devel] [PATCH 14/14] libqos/ahci: create libqos/ahci.c,
Paolo Bonzini <=