From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38605) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WIJF8-0000em-0g for qemu-devel@nongnu.org; Tue, 25 Feb 2014 09:44:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WIJF2-0001Oa-15 for qemu-devel@nongnu.org; Tue, 25 Feb 2014 09:44:21 -0500 Received: from mx1.redhat.com ([209.132.183.28]:26340) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WIJF1-0001OR-Jl for qemu-devel@nongnu.org; Tue, 25 Feb 2014 09:44:15 -0500 Date: Tue, 25 Feb 2014 14:44:06 +0000 From: "Dr. David Alan Gilbert" Message-ID: <20140225144406.GC3656@work-vm> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] Some line of codes in a file that I cant understand List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Atlas Khan Cc: qemu-devel * Atlas Khan (atlaskhan90@gmail.com) wrote: > I am watching i8259.c in \hw folder in QEMU. here is something like this > > > static const VMStateDescription vmstate_pic = { > .name = "i8259", > .version_id = 1, > .minimum_version_id = 1, > .minimum_version_id_old = 1, > .fields = (VMStateField[]) { > VMSTATE_UINT8(last_irr, PicState), > VMSTATE_UINT8(irr, PicState), > VMSTATE_UINT8(imr, PicState), > VMSTATE_UINT8(isr, PicState), > VMSTATE_UINT8(priority_add, PicState), > VMSTATE_UINT8(irq_base, PicSthisate), > VMSTATE_UINT8(read_reg_select, PicState), > VMSTATE_UINT8(poll, PicState), > VMSTATE_UINT8(special_mask, PicState), > VMSTATE_UINT8(init_state, PicState), > VMSTATE_UINT8(auto_eoi, PicState), > VMSTATE_UINT8(rotate_on_auto_eoi, PicState), > VMSTATE_UINT8(special_fully_nested_mode, PicState), > VMSTATE_UINT8(init4, PicState), > VMSTATE_UINT8(single_mode, PicState), > VMSTATE_UINT8(elcr, PicState), > VMSTATE_END_OF_LIST() > } > }; > > here what does this dot shows and what is this VMSTATE_UINT8 function? The . is about assigning into named fields in a structure; it's just neater than the old C way of having to keep all the fields in order. See the def of VMStateDescription in include/migration/vmstate.h The VMSTATE_UINT8 is a macro declaring that there is a byte/uint8 member see ./include/migration/vmstate.h and docs/migration.txt for a bit of a description. Dave -- Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK