From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:58877) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RrGQD-0002t4-4S for qemu-devel@nongnu.org; Sat, 28 Jan 2012 17:06:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RrGQC-0008Ic-1y for qemu-devel@nongnu.org; Sat, 28 Jan 2012 17:06:57 -0500 Received: from mail-iy0-f173.google.com ([209.85.210.173]:59180) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RrGQB-0008IW-ST for qemu-devel@nongnu.org; Sat, 28 Jan 2012 17:06:56 -0500 Received: by iahk25 with SMTP id k25so4574745iah.4 for ; Sat, 28 Jan 2012 14:06:54 -0800 (PST) MIME-Version: 1.0 Date: Sat, 28 Jan 2012 17:06:54 -0500 Message-ID: From: Xin Tong Content-Type: multipart/alternative; boundary=e89a8f6432c2c8472d04b79dd4ea Subject: [Qemu-devel] Proper way to walk through all vpcus List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel --e89a8f6432c2c8472d04b79dd4ea Content-Type: text/plain; charset=ISO-8859-1 What is the proper way to iterate over all vcpus in qemu ? below is what i use in my code. Not sure whether it is the best way, also is a a macro is qemu to do this ? CPUState *curr_cpu = first_cpu; for(; curr_cpu != NULL; curr_cpu = curr_cpu->next_cpu) { ... } Thanks Xin --e89a8f6432c2c8472d04b79dd4ea Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable What is the proper way to iterate over all vcpus in qemu ? below is what i = use in my code. Not sure whether it is the best way, also is a a macro is q= emu to do this ?

=A0=A0=A0=A0=A0 CPUState *curr_cpu =3D first_cpu;=A0=A0=A0=A0=A0=A0 for(; curr_cpu !=3D NULL; curr_cpu =3D curr_cpu->ne= xt_cpu) {
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ...
=A0=A0=A0=A0=A0=A0 }
<= br>Thanks

Xin

--e89a8f6432c2c8472d04b79dd4ea--