[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/7 V10] memory, exec: switch file ram allocatio
From: |
He, Junyan |
Subject: |
Re: [Qemu-devel] [PATCH 2/7 V10] memory, exec: switch file ram allocation functions to 'flags' parameters |
Date: |
Wed, 18 Jul 2018 05:34:09 +0000 |
OK, I wil chang all flags to 32bits
It is a little strange that the compiler give no warning when losing precision.
-----Original Message-----
From: Richard Henderson [mailto:address@hidden
Sent: Wednesday, July 18, 2018 12:03 AM
To: address@hidden; address@hidden
Cc: address@hidden; address@hidden; address@hidden; address@hidden;
address@hidden; address@hidden; address@hidden; address@hidden; address@hidden;
Zhang, Yi Z <address@hidden>; He, Junyan <address@hidden>; Haozhong Zhang
<address@hidden>
Subject: Re: [PATCH 2/7 V10] memory, exec: switch file ram allocation functions
to 'flags' parameters
On 07/16/2018 11:32 PM, address@hidden wrote:
> RAMBlock *qemu_ram_alloc_from_fd(ram_addr_t size, MemoryRegion *mr,
> - bool share, int fd,
> + uint64_t ram_flags, int fd,
> Error **errp) {
> RAMBlock *new_block;
> @@ -2280,14 +2280,14 @@ RAMBlock *qemu_ram_alloc_from_fd(ram_addr_t size,
> MemoryRegion *mr,
> new_block->mr = mr;
> new_block->used_length = size;
> new_block->max_length = size;
> - new_block->flags = share ? RAM_SHARED : 0;
> + new_block->flags = ram_flags;
The type of "flags" within RAMBlock is uint32_t.
You should either change the member type in the struct, or change the argument
type in all of these functions.
More likely the latter, since you seem to have just five used bits at the
moment.
r~
- [Qemu-devel] [PATCH 0/7 V10] nvdimm: guarantee persistence of QEMU writes to persistent memory, junyan . he, 2018/07/17
- [Qemu-devel] [PATCH 1/7 V10] memory, exec: Expose all memory block related flags., junyan . he, 2018/07/17
- [Qemu-devel] [PATCH 3/7 V10] configure: add libpmem support, junyan . he, 2018/07/17
- [Qemu-devel] [PATCH 2/7 V10] memory, exec: switch file ram allocation functions to 'flags' parameters, junyan . he, 2018/07/17
- [Qemu-devel] [PATCH 4/7 V10] hostmem-file: add the 'pmem' option, junyan . he, 2018/07/17
- [Qemu-devel] [PATCH 5/7 V10] mem/nvdimm: ensure write persistence to PMEM in label emulation, junyan . he, 2018/07/17
- [Qemu-devel] [PATCH 6/7 V10] migration/ram: Add check and info message to nvdimm post copy., junyan . he, 2018/07/17
- [Qemu-devel] [PATCH 7/7 V10] migration/ram: ensure write persistence on loading all data to PMEM., junyan . he, 2018/07/17