Re: [Qemu-devel] [PATCH 1/1] pc-dimm: Change PCDIMMDevice->node from UINT32 to INT32, and initialize it as -1.

2014-08-18 Thread tangchen
Hi Michael, Paolo Thanks for the advices. Will send a v2 patch soon. Thanks. On 08/19/2014 04:04 AM, Michael S. Tsirkin wrote: On Mon, Aug 18, 2014 at 03:58:33PM +0200, Paolo Bonzini wrote: Il 18/08/2014 15:56, Michael S. Tsirkin ha scritto: +/* Initialize PCDIMMDevice->node to -1 so that ev

Re: [Qemu-devel] [PATCH 1/1] pc-dimm: Change PCDIMMDevice->node from UINT32 to INT32, and initialize it as -1.

2014-08-18 Thread Michael S. Tsirkin
On Mon, Aug 18, 2014 at 03:58:33PM +0200, Paolo Bonzini wrote: > Il 18/08/2014 15:56, Michael S. Tsirkin ha scritto: > > > +/* Initialize PCDIMMDevice->node to -1 so that even if user doesn't > > > specify > > > + * any numa option, PCDIMMDevice->node won't be 0, which indicates node0. > > > + * I

Re: [Qemu-devel] [PATCH 1/1] pc-dimm: Change PCDIMMDevice->node from UINT32 to INT32, and initialize it as -1.

2014-08-18 Thread Paolo Bonzini
Il 18/08/2014 15:56, Michael S. Tsirkin ha scritto: > > +/* Initialize PCDIMMDevice->node to -1 so that even if user doesn't specify > > + * any numa option, PCDIMMDevice->node won't be 0, which indicates node0. > > + * In this case, SRAT won't be created, and guest kernel will fake a node. > > + *

Re: [Qemu-devel] [PATCH 1/1] pc-dimm: Change PCDIMMDevice->node from UINT32 to INT32, and initialize it as -1.

2014-08-18 Thread Michael S. Tsirkin
On Mon, Aug 18, 2014 at 08:12:14PM +0800, Tang Chen wrote: > If user doesn't specify numa options, nb_numa_nodes will be 0. But > PCDIMMDevice->node > is also initialized to 0. As a result, the following check will fail: > > pc_dimm_realize() > { > .. > if (dimm->node >= nb_numa_n

[Qemu-devel] [PATCH 1/1] pc-dimm: Change PCDIMMDevice->node from UINT32 to INT32, and initialize it as -1.

2014-08-18 Thread Tang Chen
If user doesn't specify numa options, nb_numa_nodes will be 0. But PCDIMMDevice->node is also initialized to 0. As a result, the following check will fail: pc_dimm_realize() { .. if (dimm->node >= nb_numa_nodes) { error_setg(errp, "'DIMM property " PC_DIMM_NODE_PRO