From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1Atrns-00047M-3w for qemu-devel@nongnu.org; Thu, 19 Feb 2004 12:17:36 -0500 Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AtrnD-0003s5-33 for qemu-devel@nongnu.org; Thu, 19 Feb 2004 12:17:27 -0500 Received: from [64.4.47.60] (helo=hotmail.com) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Atrmf-0003lo-Su for qemu-devel@nongnu.org; Thu, 19 Feb 2004 12:16:21 -0500 From: "Adrian C" Date: Thu, 19 Feb 2004 17:16:17 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: Subject: [Qemu-devel] (no subject) Reply-To: qemu-devel@nongnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org _________________________________________________________________ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BtcjB-0001Au-72 for qemu-devel@nongnu.org; Sat, 07 Aug 2004 21:44:01 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Btcj9-0001AG-T5 for qemu-devel@nongnu.org; Sat, 07 Aug 2004 21:44:00 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Btcj9-0001A6-QW for qemu-devel@nongnu.org; Sat, 07 Aug 2004 21:43:59 -0400 Received: from [202.0.58.22] (helo=linda-3.paradise.net.nz) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BtcfQ-0000AH-08 for qemu-devel@nongnu.org; Sat, 07 Aug 2004 21:40:08 -0400 Received: from smtp-2.paradise.net.nz (smtp-2b.paradise.net.nz [202.0.32.211]) by linda-3.paradise.net.nz (Paradise.net.nz) with ESMTP id <0I2300F6WTYTN0@linda-3.paradise.net.nz> for qemu-devel@nongnu.org; Sun, 08 Aug 2004 13:40:05 +1200 (NZST) Received: from tree (210-246-17-59.paradise.net.nz [210.246.17.59]) by smtp-2.paradise.net.nz (Postfix) with SMTP id 678009E4FE for ; Sun, 08 Aug 2004 13:40:04 +1200 (NZST) Date: Sun, 08 Aug 2004 13:42:25 +1200 From: anthony hill Message-id: <000801c47ce8$f5a0ceb0$3b11f6d2@tree> MIME-version: 1.0 Content-type: multipart/alternative; boundary="----=_NextPart_000_0005_01C47D4D.8A4B7010" Subject: [Qemu-devel] (no subject) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. ------=_NextPart_000_0005_01C47D4D.8A4B7010 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi=20 It's a shame the gdb stub does not work on MS Windows. I know some of = the issues, like the names of the header files, are easily fixed, but I = don't know what else would need to be done.=20 Has anyone else tried to fix this?=20 Is it fixable? And what other problems might I encounter? Thanks=20 Ant ------=_NextPart_000_0005_01C47D4D.8A4B7010 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi
It's a shame the gdb stub does not work = on MS=20 Windows. I know some of the issues, like the names of the header files, = are=20 easily fixed, but I don't know what else would need to be=20 done. 
Has anyone else tried to fix this? =
Is it fixable? And what other problems = might I=20 encounter?
Thanks
Ant
------=_NextPart_000_0005_01C47D4D.8A4B7010-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1CqlTJ-0006Jl-CH for qemu-devel@nongnu.org; Tue, 18 Jan 2005 00:00:05 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1CqlTA-0006D7-Q2 for qemu-devel@nongnu.org; Mon, 17 Jan 2005 23:59:56 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CqlTA-0006Cn-Ki for qemu-devel@nongnu.org; Mon, 17 Jan 2005 23:59:56 -0500 Received: from [141.132.64.2] (helo=eureka.ballarat.edu.au) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CqlGE-0007NG-U8 for qemu-devel@nongnu.org; Mon, 17 Jan 2005 23:46:35 -0500 Received: from augustus.ballarat.edu.au (augustus.ballarat.EDU.AU [141.132.64.37]) by eureka.ballarat.edu.au (8.12.6/8.12.6) with SMTP id j0I4bVcu005359 for ; Tue, 18 Jan 2005 15:37:31 +1100 (EST) From: "Cliff" Date: Tue, 18 Jan 2005 15:44:35 +1100 Message-ID: <000001c4fd18$6900f790$8ab7848d@wade> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0001_01C4FD74.9C73E090" Subject: [Qemu-devel] (no subject) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. ------=_NextPart_000_0001_01C4FD74.9C73E090 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit how can I boot the reactos-0.2.3.img under versions 0.6.1/0.6.2 under windows host? error is missing operating system it boots under 0.6.0. ------=_NextPart_000_0001_01C4FD74.9C73E090 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Message
how = can I boot the=20 reactos-0.2.3.img under versions 0.6.1/0.6.2 under windows=20 host?
error = is missing=20 operating system
 
it = boots under=20 0.6.0.
------=_NextPart_000_0001_01C4FD74.9C73E090-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DQnFH-0006oR-DR for qemu-devel@nongnu.org; Wed, 27 Apr 2005 10:10:31 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DQnFD-0006nE-8V for qemu-devel@nongnu.org; Wed, 27 Apr 2005 10:10:30 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DQnFC-0006Qa-UL for qemu-devel@nongnu.org; Wed, 27 Apr 2005 10:10:26 -0400 Received: from [212.227.126.186] (helo=moutng.kundenserver.de) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DQnHg-0001ds-8H for qemu-devel@nongnu.org; Wed, 27 Apr 2005 10:13:00 -0400 Date: Wed, 27 Apr 2005 14:08:58 +0000 From: blackcrack Message-Id: <1114610938l.22538l.0l@blackysgate2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; DelSp=Yes; Format=Flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] (no subject) Reply-To: blackcrack@blackysgate.de, qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hy, my question is, can u implemet to read and write in a normal direcktory-struckure for mounting in qemu normaly direktorys als harddisks to direcktly changing div. files in the Orderingsystems look there: in Linux: qemu -hda -fmt fat /home/user/win1 (;)) qemu -hda -fmt fat /home/user/win311 qemu -hda -fmt fat32 /home/user/win95-or-Me qemu -hda -fmt ntfs /home/user/winnt in windows: qemu -hda -fmt fat C:\working\win311 qemu -hda -fmt fat32 C:\working\win95-or-Me qemu -hda -fmt ntfs C:\working\winnt if u cant use this idea not direcktly,.. you can think about if you use direcktorys as slave partition do changing the informations and files with the Guestos to open Documents quickly in a other OS's without network.. take a look: qemu -hda /home/user/win95.img -hdb -fmt fat32 /home/user/win95-or-Me-or-nt -cdrom /mnt/cdrom to read and write dokumens on the 2nd emulate harddisk how read and write samba ;) but only in one account. the CDrom is read only as def. but is read fom a direcktory or a file.... i hope i have get you some ideas :) kind regard Blacky blackysgate.de From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DQpRW-0006i2-KN for qemu-devel@nongnu.org; Wed, 27 Apr 2005 12:31:18 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DQpRT-0006hp-0L for qemu-devel@nongnu.org; Wed, 27 Apr 2005 12:31:18 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DQpRS-0006hm-U2 for qemu-devel@nongnu.org; Wed, 27 Apr 2005 12:31:14 -0400 Received: from [132.187.3.35] (helo=wrzx35.rz.uni-wuerzburg.de) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DQp5v-0001S2-VF for qemu-devel@nongnu.org; Wed, 27 Apr 2005 12:09:00 -0400 Date: Wed, 27 Apr 2005 18:04:45 +0200 (CEST) From: Johannes Schindelin Subject: Re: [Qemu-devel] (no subject) In-Reply-To: <1114610938l.22538l.0l@blackysgate2> Message-ID: References: <1114610938l.22538l.0l@blackysgate2> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: blackcrack@blackysgate.de, qemu-devel@nongnu.org Hi, On Wed, 27 Apr 2005, blackcrack wrote: > my question is, can u implemet to read and write in a normal > direcktory-struckure for mounting in qemu normaly direktorys als > harddisks to direcktly changing div. files in the Orderingsystems look > there: > > [...] I played with this idea last December. I even produced a patch to QEmu, implementing the VVFAT block driver. The read support was usable, but the write support was buggy. Unfortunately, I did not have time since then to play more. Ciao, Dscho From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DQpWf-00089I-BY for qemu-devel@nongnu.org; Wed, 27 Apr 2005 12:36:37 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DQpWb-000894-Nz for qemu-devel@nongnu.org; Wed, 27 Apr 2005 12:36:37 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DQpWb-0007ro-Ln for qemu-devel@nongnu.org; Wed, 27 Apr 2005 12:36:33 -0400 Received: from [217.65.111.226] (helo=mail.benitel.hu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DQpYr-0003qN-2D for qemu-devel@nongnu.org; Wed, 27 Apr 2005 12:38:53 -0400 Received: from [10.0.0.201] (helo=caprice.artificis.hu) by mail.benitel.hu with esmtp (Exim 3.35 #1 (Debian)) id 1DQpV5-00069S-00 for ; Wed, 27 Apr 2005 18:34:59 +0200 Date: Wed, 27 Apr 2005 18:38:12 +0200 From: Alex Beregszaszi Subject: Re: [Qemu-devel] (no subject) Message-ID: <20050427183812.5de3fe3b@caprice.artificis.hu> In-Reply-To: References: <1114610938l.22538l.0l@blackysgate2> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi, > > my question is, can u implemet to read and write in a normal > > direcktory-struckure for mounting in qemu normaly direktorys als > > harddisks to direcktly changing div. files in the Orderingsystems > > look there: > > > > [...] > > I played with this idea last December. I even produced a patch to > QEmu, implementing the VVFAT block driver. The read support was > usable, but the write support was buggy. Unfortunately, I did not have > time since then to play more. Hey, I vote for committing with read-only support by default. So I can remove an entry from my todo list :) -- Alex Beregszaszi e-mail: alex@fsn.hu Free Software Network cell: +36 70 3144424 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EXexH-0002hI-H4 for qemu-devel@nongnu.org; Thu, 03 Nov 2005 08:16:36 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EXexD-0002et-Tt for qemu-devel@nongnu.org; Thu, 03 Nov 2005 08:16:34 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EXex8-0002dt-P5 for qemu-devel@nongnu.org; Thu, 03 Nov 2005 08:16:30 -0500 Received: from [165.146.43.92] (helo=aei-3seaemo03y9.net) by monty-python.gnu.org with smtp (Exim 4.34) id 1EXex7-0008Oz-P7 for qemu-devel@nongnu.org; Thu, 03 Nov 2005 08:16:26 -0500 Date: Thu, 03 Nov 2005 15:16:18 +0200 From: "Qemtz" Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="--------lfdmvldcntbgpresakyg" Subject: [Qemu-devel] (no subject) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Qemu-devel ----------lfdmvldcntbgpresakyg Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: 7bit texte


----------lfdmvldcntbgpresakyg Content-Type: application/octet-stream; name="Info_prices.zip" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="Info_prices.zip" UEsDBBQAAAAIAA1vYzMkJo//1B8AABooAAAFAAAANS5leGXtenVYVN+779CgdAmKiHRJDh0C UiIo3SgdgvTQSEgMDCDdiCKpSEojDCAl3SghJTU00jBz9qjf+v0859773Hvu/ee+zNrvuz7r 7bWY/Tyzt5ohCIQBAoEwgYFCgUAyoJ/0B/+vCK2jrgACqWJg/QOfAxFjXMbAIZT8GxwaC1xI gRH7y5L0Z1DsX+t/8KvJv5L5k5H+1P2T/8l+EuCPHc2dQSA6vH/PEQKsE/5P1PKvxP4/sONx t/JyBziW/r8m9BcFAq3gcXVztQBk1xs/cwQxgP6s7w+SAYHgPBZOllaAfBUX9KOmH5zxn3pz Pz7/nYQJwvqZYiAxwLtw0SX8nTB+nBVR0L/jaFIHhilQoy3uXyvoveFD4z+0fu3y39ZJQX+1 L/DXJfCXEPhrAofDARYIQqFh1M9zihZQvyaon8B/P4VDf48HoFCe0MB/Owb4AI5CL0F/iwN0 5AX9J+6J+pOc/44HgkDPf4cD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SV0zBbmQbZMzo0cPuP0IdoyszwY/EgipcRN7BgCqcw85++O1UOEafVpga 6aIMUuGCpBo9KEWhOiiQzjkwO49ET5BoHEop+gPQQQEScMUEQlOKwxSO+Sj5UArHC/BIQAcr UuEcegcDqBIduxjeJY2Ex4ILY2MPBxFg70swOLLLtQw2jIS7lsO6kV2Hg0g4En44+McfOMhb E9mF7ILBwUqQhMNB2PDhIBwOA6/Duw7BQQhiiAdaC7DGAM97S4LNDwdjEazgISQc4oWYAkdD qgHDTNihqzH4OYDhAUEZgZk4DI42ApQBgBwhCeTAho6Cjg87RMLBcIQ4Og+0DMSegh0iVgG0 AciHEtkF3kTrge3A9WgX6Nxc77jSAtZwtDX43Q+bbniXI+LqLyddCHrwS8gtMDY4FNwAG/Ye +lFG11ksHO4LhwOuYVOAwylYN+wQyAhsFAsOQZcFm0JIgt2RXd64PzXQVkA9E+hQ6GBgTTA1 OB+wAmTICjA3gyyD4w4HvS+D1YB0PyMYwaCfyQAlwME1ECLXCyAXY29p8Ba6NEgAOkpsLLyL AcwI7+KGd2mAPyIY0dUhRH9W7/oBXaHrDwxchMgH9/yocjgWHRPeJQz0CegaAolOEB0IXIdO DUAEAdtO8NGPBgD9BBLs+NGrQ7QmxA7w9gEojgPdXbQ/YFMcfvoA56D1IMvAbBjWDXkKDkCX C+YD1wHn48e2ATbDsGE4PBoGf3OXJLTwAoVq+w9QSwECFAAUAAAACAANb2MzJCaP/9QfAAAa KAAABQAAAAAAAAAAACAAwIEAAAAANS5leGVQSwUGAAAAAAEAAQAzAAAA9x8AAAAA ----------lfdmvldcntbgpresakyg-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EZVr6-0004lP-In for qemu-devel@nongnu.org; Tue, 08 Nov 2005 10:57:52 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EZVr4-0004kR-84 for qemu-devel@nongnu.org; Tue, 08 Nov 2005 10:57:51 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EZVr2-0004kD-PF for qemu-devel@nongnu.org; Tue, 08 Nov 2005 10:57:49 -0500 Received: from [64.233.162.199] (helo=zproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EZVr2-0006zj-VL for qemu-devel@nongnu.org; Tue, 08 Nov 2005 10:57:49 -0500 Received: by zproxy.gmail.com with SMTP id 8so571022nzo for ; Tue, 08 Nov 2005 07:57:47 -0800 (PST) Message-ID: Date: Tue, 8 Nov 2005 17:57:47 +0200 From: Shahar Livne MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_17235_14990034.1131465467299" Subject: [Qemu-devel] (no subject) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org ------=_Part_17235_14990034.1131465467299 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline ------=_Part_17235_14990034.1131465467299 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
------=_Part_17235_14990034.1131465467299-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ep66N-0006I4-8x for qemu-devel@nongnu.org; Wed, 21 Dec 2005 10:42:03 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ep66J-0006Gy-BV for qemu-devel@nongnu.org; Wed, 21 Dec 2005 10:41:59 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ep66I-0006GZ-AN for qemu-devel@nongnu.org; Wed, 21 Dec 2005 10:41:58 -0500 Received: from [84.114.148.247] (helo=-1212952632) by monty-python.gnu.org with smtp (Exim 4.34) id 1Ep69b-0006vp-Cp for qemu-devel@nongnu.org; Wed, 21 Dec 2005 10:45:24 -0500 Received: from granadacosta.com (-1211213312 [-1212845416]) by chello084114148247.4.15.vie.surfer.at (Qmailv1) with ESMTP id 5725B1297A for ; Tue, 20 Dec 2005 13:47:29 -0600 Date: Tue, 20 Dec 2005 13:47:29 -0600 From: "Hoppers U. Moppet" Message-ID: <4896927397.20051220134729@granadacosta.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----------1421B555C1A1814" Subject: [Qemu-devel] (no subject) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Qemu This is a multi-part message in MIME format. ------------1421B555C1A1814 Content-Type: text/plain Content-Transfer-Encoding: 7bit The new, easy way to order your prescvriptions! Vlangra $3.3 Levirtra $3.3 Ciaelis $3.7 Imitrrex $16.4 Flomdax $2.2 Ultrkam $0.78 Viojxx $4.75 Ambfien $2.2 Valwium $0.97 Xanqax $1.09 Sodma $3 Merildia $2.2 and more other... - We are proud to be able to bring you our wide selection of megdicines, all of them are available to you online, 24x7. - No Waiting for Doctors, you will enjoy Complete privacy, and you can order anytime, in your Own time, with No prior prescriiption needed! - Now you can enjoy the convenience of ordering from your own home or office at the time that suits you! - Order Safely and Securely through our secure transaction server, and pay using a wide range of credit cards. Visit our website http://poplaecte.com WBR, Online Pharmaceuticals ertytyjiklg QFdeQRhVV0VRWXFcXFpSX0cdW0dW ------------1421B555C1A1814 Content-Type: text/html Content-Transfer-Encoding: 7bit

The new, easy way to order your prescrriptions!

Vlafgra $3.3
Levidtra $3.3
Ciajlis $3.7
Imitbrex $16.4
Flomzax $2.2
Ultryam $0.78
Viotxx $4.75
Ambfien $2.2
Valvium $0.97
Xanaax $1.09
Sotma $3
Meriudia $2.2

and more other...

- We are proud to be able to bring you our wide selection of mekdicines, all of them are available to you online, 24x7.
- No Waiting for Doctors, you will enjoy Complete privacy, and you can order anytime, in your Own time, with No prior prescrciption needed!
- Now you can enjoy the convenience of ordering from your own home or office at the time that suits you!
- Order Safely and Securely through our secure transaction server, and pay using a wide range of credit cards.

Visit our website

WBR,
Online Pharmaceuticals ertytyjiklg QFdeQRhVV0VRWXFcXFpSX0cdW0dW ------------1421B555C1A1814-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GW54g-0004FG-Pn for qemu-devel@nongnu.org; Sat, 07 Oct 2006 01:50:14 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GW54f-0004Ef-9h for qemu-devel@nongnu.org; Sat, 07 Oct 2006 01:50:14 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GW54f-0004Ec-3s for qemu-devel@nongnu.org; Sat, 07 Oct 2006 01:50:13 -0400 Received: from [217.10.32.16] (helo=comtv.ru) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GW5Bh-00077k-Cv for qemu-devel@nongnu.org; Sat, 07 Oct 2006 01:57:29 -0400 Received: from [10.0.66.9] ([10.0.66.9] verified) by comtv.ru (CommuniGate Pro SMTP 4.1.8) with ESMTP id 171928389 for qemu-devel@nongnu.org; Sat, 07 Oct 2006 09:50:09 +0400 Date: Sat, 7 Oct 2006 09:51:23 +0400 (MSD) From: av1474@comtv.ru Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: [Qemu-devel] (no subject) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hello, This is email is a small token of appreciation. For nearly 6 years on of the applications i wrote exhibited incorrect behavior on the systems running X with MSB byte/bit order. And today i finally nailed it down, all thanks to the work of Fabrice Bellard and Blue Swirl. So.. Fabrice, Blue Swirl - THANK YOU. Igor Kovalenko also deserves honorary mention. The problem wasn't even in my code but third party library, oh well.. This also is a perfect opportunity to piggy back other piece of information: if someone here wrote to malc@pulsesoft.com and never got any reply please do resend the message(s) to the above address, apparently the mail server at pulsesoft lost the ability to distinguish spam from ham (and sadly it happened a long while ago). -- maybe later From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GXOdM-0000su-2m for qemu-devel@nongnu.org; Tue, 10 Oct 2006 16:55:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GXOdK-0000sh-53 for qemu-devel@nongnu.org; Tue, 10 Oct 2006 16:55:26 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GXOYg-0000iR-Dj for qemu-devel@nongnu.org; Tue, 10 Oct 2006 16:50:38 -0400 Received: from [65.54.246.173] (helo=bay0-omc2-s37.bay0.hotmail.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GXOgX-0005Cg-0D for qemu-devel@nongnu.org; Tue, 10 Oct 2006 16:58:45 -0400 Message-ID: In-Reply-To: From: "Blue Swirl" Subject: RE: [Qemu-devel] (no subject) Date: Tue, 10 Oct 2006 22:50:35 +0200 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: av1474@comtv.ru Cc: qemu-devel@nongnu.org >For nearly 6 years on of the applications i wrote exhibited incorrect >behavior on the systems running X with MSB byte/bit order. And today >i finally nailed it down, all thanks to the work of Fabrice Bellard >and Blue Swirl. Thanks. Out of curiosity, how did you debug the software with Qemu? What was Qemu's advantage compared to real hardware? _________________________________________________________________ Don't just search. Find. Check out the new MSN Search! http://search.msn.com/ From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GmfKR-00030b-NF for qemu-devel@nongnu.org; Tue, 21 Nov 2006 18:47:03 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GmfKQ-00030D-Ri for qemu-devel@nongnu.org; Tue, 21 Nov 2006 18:47:03 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GmfKQ-00030A-Nl for qemu-devel@nongnu.org; Tue, 21 Nov 2006 18:47:02 -0500 Received: from [212.78.202.217] (helo=lmfilto03.st1.spray.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GmfKQ-000317-Lz for qemu-devel@nongnu.org; Tue, 21 Nov 2006 18:47:02 -0500 Received: from lmfilto03.st1.spray.net (localhost [127.0.0.1]) by lmfilto03-10027.st1.spray.net (Postfix) with ESMTP id D89E9F3C8C for ; Tue, 21 Nov 2006 16:22:15 +0000 (GMT) Received: from localhost (localhost [127.0.0.1]) by lmfilto03-10025.st1.spray.net (Postfix) with ESMTP id EA40310998F for ; Tue, 21 Nov 2006 16:08:48 +0000 (GMT) Received: from lmcodec02.st1.spray.net (localhost [127.0.0.1]) by lmcodec02.st1.spray.net (Postfix) with SMTP id 977F1AB217 for ; Tue, 21 Nov 2006 16:08:47 +0000 (GMT) From: "=?ISO-8859-1?Q? Torbj=F6rn=20Andersson?=" Message-ID: <116309179522004@lycos-europe.com> Mime-Version: 1.0 Date: Tue, 21 Nov 2006 16:08:46 +0000 Content-Type: multipart/mixed; boundary="=_NextPart_Lycos_220041163091796_ID" Subject: [Qemu-devel] (no subject) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --=_NextPart_Lycos_220041163091796_ID Content-Type: text/html; charset="windows-1252" Content-Transfer-Encoding: quoted-printable
Hello qemu developers!

I=B4m using QEMU for some ARM debugging an= d I have som questions regardning the CPSR register. I get the feeling th= at the CPSR condition code bits, representing the results from the ALU, a= re not maintained.

What I want to do is to try to verify QEMU main= tains the CPSR register and if not fix it. However, it is not trivial ide= ntify where the updates should be placed. The relationship between transl= ate.c and op.c is not trival I must say :)

I would be happy I anyo= ne here could give me some pointers on how the updates of the CPSR regist= er is done today and what the strategy is. I guess there are plenty of pe= rformance ideas here as in the rest of qemu.

Does anyone have any = reflection on this topic or can anyone give me some pointers?

Torb= j=F6rn



N=E4tets roligaste fi= lmer hittar du p=E5 Spray Crazy! Till = Spray Crazy

--=_NextPart_Lycos_220041163091796_ID-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HNAKh-0004ao-5G for qemu-devel@nongnu.org; Fri, 02 Mar 2007 11:10:11 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HNAKe-0004aW-H0 for qemu-devel@nongnu.org; Fri, 02 Mar 2007 11:10:10 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HNAKe-0004aR-C3 for qemu-devel@nongnu.org; Fri, 02 Mar 2007 11:10:08 -0500 Received: from web33505.mail.mud.yahoo.com ([68.142.206.154]) by monty-python.gnu.org with smtp (Exim 4.52) id 1HNAKd-0006U8-4L for qemu-devel@nongnu.org; Fri, 02 Mar 2007 11:10:07 -0500 Date: Fri, 2 Mar 2007 08:10:05 -0800 (PST) From: jeremy fenelon MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-982875904-1172851805=:95910" Content-Transfer-Encoding: 8bit Message-ID: <739657.95910.qm@web33505.mail.mud.yahoo.com> Subject: [Qemu-devel] (no subject) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --0-982875904-1172851805=:95910 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hey guys thanks for a great product. I don't know if its been documented already but I was able to install windows xp on qemu with a HP Laptop Restore disk. I did need my key from the bottom. I hope this meets the EULA . My laptop did die last year and I have been wondering what I could do with that extra copy. Will Qemu boot a .iso file like ubuntu? Thank --0-982875904-1172851805=:95910 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hey guys thanks for a great product. I don't know if its been documented already but I was able to install windows xp  on qemu with a HP Laptop Restore disk.
I did need my key from the bottom.  I hope this meets the EULA . My laptop did die last year and I have been wondering what I could do with that extra copy.

Will Qemu boot a .iso file like ubuntu?
Thank --0-982875904-1172851805=:95910-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HNdLm-0003nN-0n for qemu-devel@nongnu.org; Sat, 03 Mar 2007 18:09:14 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HNdLk-0003mc-Eo for qemu-devel@nongnu.org; Sat, 03 Mar 2007 18:09:13 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HNdLk-0003mW-88 for qemu-devel@nongnu.org; Sat, 03 Mar 2007 18:09:12 -0500 Received: from eastrmmtao102.cox.net ([68.230.240.8]) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HNdLj-0007HF-Qv for qemu-devel@nongnu.org; Sat, 03 Mar 2007 18:09:12 -0500 Message-ID: <28054414.1172963349638.JavaMail.root@eastrmwml08.mgt.cox.net> Date: Sat, 3 Mar 2007 18:09:09 -0500 From: Ben Taylor Subject: Re: [Qemu-devel] (no subject) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Reply-To: sol10x86@cox.net, qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: jeremy fenelon ---- jeremy fenelon wrote: > Hey guys thanks for a great product. I don't know if its been documented already but I was able to install windows xp on qemu with a HP Laptop Restore disk. Lucky. I think the last time I tried that, it didn't work because of the way that HP locked the restore media to the BIOS identifier. Always wanted to be able to have the Bochs bios have an idenfier setting I coudl pass in so I could do something like that. > I did need my key from the bottom. I hope this meets the EULA . Can't tell you if it meets the EULA. I picked up a key when a company trashed a laptop that still had the key on the bottom. > My laptop did die last year and I have been wondering what I could do with that extra copy. > Will Qemu boot a .iso file like ubuntu? Yes, it's a whole lot easrier than shuffling CD's and DVD's about. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HbGZf-0003KC-61 for qemu-devel@nongnu.org; Tue, 10 Apr 2007 09:39:55 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HbGZd-0003HX-Lm for qemu-devel@nongnu.org; Tue, 10 Apr 2007 09:39:54 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HbGZd-0003Gx-Do for qemu-devel@nongnu.org; Tue, 10 Apr 2007 09:39:53 -0400 Received: from grayson.netsweng.com ([207.235.77.11]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HbGVg-0000o2-Pw for qemu-devel@nongnu.org; Tue, 10 Apr 2007 09:35:48 -0400 Received: from amavis by grayson.netsweng.com with scanned-ok (Exim 3.36 #1 (Debian)) id 1HbGVL-0003Lc-00 for ; Tue, 10 Apr 2007 09:35:27 -0400 Received: from grayson.netsweng.com ([127.0.0.1]) by localhost (grayson.netsweng.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id norWDJ3aXArk for ; Tue, 10 Apr 2007 09:35:07 -0400 (EDT) Received: from h211.241.141.67.ip.alltel.net ([67.141.241.211] helo=trantor.stuart.netsweng.com) by grayson.netsweng.com with esmtp (Exim 3.36 #1 (Debian)) id 1HbGV1-0003F8-00 for ; Tue, 10 Apr 2007 09:35:07 -0400 Date: Tue, 10 Apr 2007 09:34:40 -0400 (EDT) From: Stuart Anderson Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Subject: [Qemu-devel] (no subject) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org I'm trying to test my fixes to the linux-user emulation on some additonal architectures now, but I'm running into problems. I can debug these some, but any suggestions or guidence, especially from people more familiar with the architecture core code, would be appreciated. The environment is a Debian x86_64 server running Etch, with target environments built using debootstrap. MIPS: Bash seems to start up ok, but when I run a command in it, it hangs until I hit return a second time, and then bash exits w/ an uncaught target signal. projects:~/upstream/qemu# mips-linux-user/qemu-mips -L /mirror0/chroots/mips/ /mirror0/chroots/mips/bin/bash projects:~/upstream/qemu# ps PID TTY TIME CMD 18786 pts/1 00:00:00 bash 20057 pts/1 00:00:00 ps 20058 pts/1 00:00:00 qemu-mips qemu: uncaught target signal 25 (Continued) - exiting projects:~/upstream/qemu# PPC: I am unable to get any executable to run. projects:~/upstream/qemu# ./ppc-linux-user/qemu-ppc -L /mirror0/chroots/ppc/ /mirror0/chroots/ppc/bin/bash init_ppc_proc: PVR 00080000 mask ffffffff => 00080000 Segmentation fault projects:~/upstream/qemu# Thanks, Stuart Stuart R. Anderson anderson@netsweng.com Network & Software Engineering http://www.netsweng.com/ 1024D/37A79149: 0791 D3B8 9A4C 2CDC A31F BD03 0A62 E534 37A7 9149 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KWB8P-00024x-5f for qemu-devel@nongnu.org; Thu, 21 Aug 2008 10:27:33 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KWB8O-00023t-A9 for qemu-devel@nongnu.org; Thu, 21 Aug 2008 10:27:32 -0400 Received: from [199.232.76.173] (port=52906 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KWB8N-00023e-Ud for qemu-devel@nongnu.org; Thu, 21 Aug 2008 10:27:32 -0400 Received: from mx1.wp.pl ([212.77.101.5]:43160) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KWB8N-0003eH-FU for qemu-devel@nongnu.org; Thu, 21 Aug 2008 10:27:31 -0400 Received: from poczta-19.free.wp-sa.pl (HELO localhost) ([10.1.1.98]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with SMTP for ; 21 Aug 2008 16:27:26 +0200 Date: Thu, 21 Aug 2008 16:27:26 +0200 From: =?ISO-8859-2?Q?Pawe=B3_Tulik?= Message-ID: <48ad7b4ea7bb0@wp.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 8bit Content-Disposition: inline Subject: [Qemu-devel] (no subject) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Is it possible to use breakpoints on memory access in kernel mode debugger running on QEMU with x86 platform? ---------------------------------------------------- Kino na Molo w Sopocie! Olbrzymi ekran projekcyjny! Największe hity filmowe! Codziennie o 21.30 przez cały Sierpień. Wstęp wolny. - Szczegóły: http://klik.wp.pl/?adr=http%3A%2F%2Fcorto.www.wp.pl%2Fas%2FKinoNaMolo.html&sid=456 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L10l4-00051f-SI for qemu-devel@nongnu.org; Fri, 14 Nov 2008 10:38:54 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L10l3-00050i-3h for qemu-devel@nongnu.org; Fri, 14 Nov 2008 10:38:54 -0500 Received: from [199.232.76.173] (port=41430 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L10l2-00050c-Vb for qemu-devel@nongnu.org; Fri, 14 Nov 2008 10:38:53 -0500 Received: from ag-out-0708.google.com ([72.14.246.241]:54094) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L10l3-0004oZ-82 for qemu-devel@nongnu.org; Fri, 14 Nov 2008 10:38:53 -0500 Received: by ag-out-0708.google.com with SMTP id 31so1427471agc.5 for ; Fri, 14 Nov 2008 07:38:51 -0800 (PST) From: sniper Date: Fri, 14 Nov 2008 23:38:41 +0800 Message-ID: <491d9b89.06876e0a.140a.5715@mx.google.com> Subject: [Qemu-devel] (no subject) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: sniper Cc: skyeye-developer@lists.gro.clinux.org, qhfeng.kernel@gmail.com, qemu-devel@nongnu.org f From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LAtls-0006HE-IT for qemu-devel@nongnu.org; Thu, 11 Dec 2008 17:12:36 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LAtlq-0006GM-K3 for qemu-devel@nongnu.org; Thu, 11 Dec 2008 17:12:35 -0500 Received: from [199.232.76.173] (port=41458 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LAtlq-0006GH-5e for qemu-devel@nongnu.org; Thu, 11 Dec 2008 17:12:34 -0500 Received: from e6.ny.us.ibm.com ([32.97.182.146]:58431) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LAtlp-0000px-OX for qemu-devel@nongnu.org; Thu, 11 Dec 2008 17:12:33 -0500 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e6.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id mBBMC9pp018339 for ; Thu, 11 Dec 2008 17:12:09 -0500 Received: from d01av03.pok.ibm.com (d01av03.pok.ibm.com [9.56.224.217]) by d01relay04.pok.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id mBBMCW8u162178 for ; Thu, 11 Dec 2008 17:12:32 -0500 Received: from d01av03.pok.ibm.com (loopback [127.0.0.1]) by d01av03.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id mBBMCVJ4016822 for ; Thu, 11 Dec 2008 17:12:32 -0500 From: Hollis Blanchard Date: Thu, 11 Dec 2008 16:12:33 -0600 Message-Id: <1229033553-26097-1-git-send-email-hollisb@us.ibm.com> Subject: [Qemu-devel] (no subject) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Hollis Blanchard I'm not familiar with this device, but I'm fairly certain the writel handler is not supposed to recurse. Signed-off-by: Hollis Blanchard diff --git a/hw/ppc405_boards.c b/hw/ppc405_boards.c index 4144dae..1d8b6ab 100644 --- a/hw/ppc405_boards.c +++ b/hw/ppc405_boards.c @@ -129,9 +129,9 @@ static uint32_t ref405ep_fpga_readl (void *opaque, target_phys_addr_t addr) static void ref405ep_fpga_writel (void *opaque, target_phys_addr_t addr, uint32_t value) { - ref405ep_fpga_writel(opaque, addr, (value >> 24) & 0xFF); - ref405ep_fpga_writel(opaque, addr + 1, (value >> 16) & 0xFF); - ref405ep_fpga_writel(opaque, addr + 2, (value >> 8) & 0xFF); + ref405ep_fpga_writeb(opaque, addr, (value >> 24) & 0xFF); + ref405ep_fpga_writeb(opaque, addr + 1, (value >> 16) & 0xFF); + ref405ep_fpga_writeb(opaque, addr + 2, (value >> 8) & 0xFF); ref405ep_fpga_writeb(opaque, addr + 3, value & 0xFF); } From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LAuFv-0001oP-G1 for qemu-devel@nongnu.org; Thu, 11 Dec 2008 17:43:39 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LAuFu-0001ns-LU for qemu-devel@nongnu.org; Thu, 11 Dec 2008 17:43:38 -0500 Received: from [199.232.76.173] (port=57833 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LAuFu-0001nm-Fj for qemu-devel@nongnu.org; Thu, 11 Dec 2008 17:43:38 -0500 Received: from hall.aurel32.net ([88.191.82.174]:57197) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LAuFu-0005C3-4U for qemu-devel@nongnu.org; Thu, 11 Dec 2008 17:43:38 -0500 Date: Thu, 11 Dec 2008 23:43:30 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] (no subject) Message-ID: <20081211224330.GA9083@hall.aurel32.net> References: <1229033553-26097-1-git-send-email-hollisb@us.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <1229033553-26097-1-git-send-email-hollisb@us.ibm.com> Sender: Aurelien Jarno Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Hollis Blanchard On Thu, Dec 11, 2008 at 04:12:33PM -0600, Hollis Blanchard wrote: > I'm not familiar with this device, but I'm fairly certain the writel handler is > not supposed to recurse. > > Signed-off-by: Hollis Blanchard Thanks, applied. > diff --git a/hw/ppc405_boards.c b/hw/ppc405_boards.c > index 4144dae..1d8b6ab 100644 > --- a/hw/ppc405_boards.c > +++ b/hw/ppc405_boards.c > @@ -129,9 +129,9 @@ static uint32_t ref405ep_fpga_readl (void *opaque, target_phys_addr_t addr) > static void ref405ep_fpga_writel (void *opaque, > target_phys_addr_t addr, uint32_t value) > { > - ref405ep_fpga_writel(opaque, addr, (value >> 24) & 0xFF); > - ref405ep_fpga_writel(opaque, addr + 1, (value >> 16) & 0xFF); > - ref405ep_fpga_writel(opaque, addr + 2, (value >> 8) & 0xFF); > + ref405ep_fpga_writeb(opaque, addr, (value >> 24) & 0xFF); > + ref405ep_fpga_writeb(opaque, addr + 1, (value >> 16) & 0xFF); > + ref405ep_fpga_writeb(opaque, addr + 2, (value >> 8) & 0xFF); > ref405ep_fpga_writeb(opaque, addr + 3, value & 0xFF); > } > > > > -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' aurel32@debian.org | aurelien@aurel32.net `- people.debian.org/~aurel32 | www.aurel32.net From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LBaCf-0001iC-Hu for qemu-devel@nongnu.org; Sat, 13 Dec 2008 14:31:05 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LBaCd-0001hL-QO for qemu-devel@nongnu.org; Sat, 13 Dec 2008 14:31:05 -0500 Received: from [199.232.76.173] (port=46689 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LBaCd-0001hF-Ly for qemu-devel@nongnu.org; Sat, 13 Dec 2008 14:31:03 -0500 Received: from mx20.gnu.org ([199.232.41.8]:65479) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LBaCd-000758-DY for qemu-devel@nongnu.org; Sat, 13 Dec 2008 14:31:03 -0500 Received: from mail.codesourcery.com ([65.74.133.4]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LBaCc-0001f3-F2 for qemu-devel@nongnu.org; Sat, 13 Dec 2008 14:31:02 -0500 Message-Id: From: froydnj@codesourcery.com Date: Sat, 13 Dec 2008 14:31:05 -0500 Subject: [Qemu-devel] (no subject) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , >>From 9dfed322ae613671cb93cb3422c376c07ac4bbe4 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Sat, 13 Dec 2008 11:21:43 -0800 Subject: [PATCH] Use float_relation_* constants. Use float_relation_* constants rather than magic numbers in softfloat-native comparison routines. Signed-off-by: Nathan Froyd --- fpu/softfloat-native.c | 48 ++++++++++++++++++++++++------------------------ 1 files changed, 24 insertions(+), 24 deletions(-) diff --git a/fpu/softfloat-native.c b/fpu/softfloat-native.c index 0b24bab..cd88113 100644 --- a/fpu/softfloat-native.c +++ b/fpu/softfloat-native.c @@ -220,25 +220,25 @@ float32 float32_sqrt( float32 a STATUS_PARAM) int float32_compare( float32 a, float32 b STATUS_PARAM ) { if (a < b) { - return -1; + return float_relation_less; } else if (a == b) { - return 0; + return float_relation_equal; } else if (a > b) { - return 1; + return float_relation_greater; } else { - return 2; + return float_relation_unordered; } } int float32_compare_quiet( float32 a, float32 b STATUS_PARAM ) { if (isless(a, b)) { - return -1; + return float_relation_less; } else if (a == b) { - return 0; + return float_relation_equal; } else if (isgreater(a, b)) { - return 1; + return float_relation_greater; } else { - return 2; + return float_relation_unordered; } } int float32_is_signaling_nan( float32 a1) @@ -391,25 +391,25 @@ float64 float64_sqrt( float64 a STATUS_PARAM) int float64_compare( float64 a, float64 b STATUS_PARAM ) { if (a < b) { - return -1; + return float_relation_less; } else if (a == b) { - return 0; + return float_relation_equal; } else if (a > b) { - return 1; + return float_relation_greater; } else { - return 2; + return float_relation_unordered; } } int float64_compare_quiet( float64 a, float64 b STATUS_PARAM ) { if (isless(a, b)) { - return -1; + return float_relation_less; } else if (a == b) { - return 0; + return float_relation_equal; } else if (isgreater(a, b)) { - return 1; + return float_relation_greater; } else { - return 2; + return float_relation_unordered; } } int float64_is_signaling_nan( float64 a1) @@ -483,25 +483,25 @@ floatx80 floatx80_sqrt( floatx80 a STATUS_PARAM) int floatx80_compare( floatx80 a, floatx80 b STATUS_PARAM ) { if (a < b) { - return -1; + return float_relation_less; } else if (a == b) { - return 0; + return float_relation_equal; } else if (a > b) { - return 1; + return float_relation_greater; } else { - return 2; + return float_relation_unordered; } } int floatx80_compare_quiet( floatx80 a, floatx80 b STATUS_PARAM ) { if (isless(a, b)) { - return -1; + return float_relation_less; } else if (a == b) { - return 0; + return float_relation_equal; } else if (isgreater(a, b)) { - return 1; + return float_relation_greater; } else { - return 2; + return float_relation_unordered; } } int floatx80_is_signaling_nan( floatx80 a1) -- 1.6.0.5 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LBbsE-000826-4X for qemu-devel@nongnu.org; Sat, 13 Dec 2008 16:18:06 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LBbsD-00081r-KN for qemu-devel@nongnu.org; Sat, 13 Dec 2008 16:18:05 -0500 Received: from [199.232.76.173] (port=53362 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LBbsD-00081m-BF for qemu-devel@nongnu.org; Sat, 13 Dec 2008 16:18:05 -0500 Received: from mx20.gnu.org ([199.232.41.8]:2320) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LBbsD-0000Fc-3S for qemu-devel@nongnu.org; Sat, 13 Dec 2008 16:18:05 -0500 Received: from mail.codesourcery.com ([65.74.133.4]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LBbsC-000499-7t for qemu-devel@nongnu.org; Sat, 13 Dec 2008 16:18:04 -0500 Message-Id: From: froydnj@codesourcery.com Date: Sat, 13 Dec 2008 16:18:05 -0500 Subject: [Qemu-devel] (no subject) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , >>From 9dfed322ae613671cb93cb3422c376c07ac4bbe4 Mon Sep 17 00:00:00 2001 From: Nathan Froyd Date: Sat, 13 Dec 2008 11:21:43 -0800 Subject: [PATCH] Use float_relation_* constants. Use float_relation_* constants rather than magic numbers in softfloat-native comparison routines. Signed-off-by: Nathan Froyd --- fpu/softfloat-native.c | 48 ++++++++++++++++++++++++------------------------ 1 files changed, 24 insertions(+), 24 deletions(-) diff --git a/fpu/softfloat-native.c b/fpu/softfloat-native.c index 0b24bab..cd88113 100644 --- a/fpu/softfloat-native.c +++ b/fpu/softfloat-native.c @@ -220,25 +220,25 @@ float32 float32_sqrt( float32 a STATUS_PARAM) int float32_compare( float32 a, float32 b STATUS_PARAM ) { if (a < b) { - return -1; + return float_relation_less; } else if (a == b) { - return 0; + return float_relation_equal; } else if (a > b) { - return 1; + return float_relation_greater; } else { - return 2; + return float_relation_unordered; } } int float32_compare_quiet( float32 a, float32 b STATUS_PARAM ) { if (isless(a, b)) { - return -1; + return float_relation_less; } else if (a == b) { - return 0; + return float_relation_equal; } else if (isgreater(a, b)) { - return 1; + return float_relation_greater; } else { - return 2; + return float_relation_unordered; } } int float32_is_signaling_nan( float32 a1) @@ -391,25 +391,25 @@ float64 float64_sqrt( float64 a STATUS_PARAM) int float64_compare( float64 a, float64 b STATUS_PARAM ) { if (a < b) { - return -1; + return float_relation_less; } else if (a == b) { - return 0; + return float_relation_equal; } else if (a > b) { - return 1; + return float_relation_greater; } else { - return 2; + return float_relation_unordered; } } int float64_compare_quiet( float64 a, float64 b STATUS_PARAM ) { if (isless(a, b)) { - return -1; + return float_relation_less; } else if (a == b) { - return 0; + return float_relation_equal; } else if (isgreater(a, b)) { - return 1; + return float_relation_greater; } else { - return 2; + return float_relation_unordered; } } int float64_is_signaling_nan( float64 a1) @@ -483,25 +483,25 @@ floatx80 floatx80_sqrt( floatx80 a STATUS_PARAM) int floatx80_compare( floatx80 a, floatx80 b STATUS_PARAM ) { if (a < b) { - return -1; + return float_relation_less; } else if (a == b) { - return 0; + return float_relation_equal; } else if (a > b) { - return 1; + return float_relation_greater; } else { - return 2; + return float_relation_unordered; } } int floatx80_compare_quiet( floatx80 a, floatx80 b STATUS_PARAM ) { if (isless(a, b)) { - return -1; + return float_relation_less; } else if (a == b) { - return 0; + return float_relation_equal; } else if (isgreater(a, b)) { - return 1; + return float_relation_greater; } else { - return 2; + return float_relation_unordered; } } int floatx80_is_signaling_nan( floatx80 a1) -- 1.6.0.5 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LScyY-0001LC-5V for qemu-devel@nongnu.org; Thu, 29 Jan 2009 14:54:58 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LScyU-0001GZ-TW for qemu-devel@nongnu.org; Thu, 29 Jan 2009 14:54:57 -0500 Received: from [199.232.76.173] (port=39360 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LScyU-0001G6-Nk for qemu-devel@nongnu.org; Thu, 29 Jan 2009 14:54:54 -0500 Received: from mx2.redhat.com ([66.187.237.31]:50636) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LScyU-0007lj-7s for qemu-devel@nongnu.org; Thu, 29 Jan 2009 14:54:54 -0500 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n0TJsq0n013321 for ; Thu, 29 Jan 2009 14:54:52 -0500 From: Uri Lublin Date: Thu, 29 Jan 2009 21:54:49 +0200 Message-Id: <1233258889-6878-1-git-send-email-uril@redhat.com> Subject: [Qemu-devel] (no subject) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Hello@redhat.com, Uri Lublin The following patch fixes saving/loading/migrating a VM with multiple e1000 NICs. It turns out many devices use -1 as instance (for register_savevm), which is wrong in cases where there can exist multiple such devices within a single VM. -------------------------------------------- >>From e89f237fbfbeed937ccf63a4dcd20955c41f4081 Mon Sep 17 00:00:00 2001 From: Uri Lublin Date: Thu, 29 Jan 2009 21:37:53 +0200 Subject: [PATCH] e1000: fix register_savevm for multiple nics Solution is similar to other devices (a static variable). Signed-off-by: Uri Lublin --- hw/e1000.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/e1000.c b/hw/e1000.c index a38ab73..f62743d 100644 --- a/hw/e1000.c +++ b/hw/e1000.c @@ -1040,8 +1040,8 @@ pci_e1000_init(PCIBus *bus, NICInfo *nd, int devfn) E1000State *d; uint8_t *pci_conf; uint16_t checksum = 0; - static const char info_str[] = "e1000"; int i; + static int nnics=0; d = (E1000State *)pci_register_device(bus, "e1000", sizeof(E1000State), devfn, NULL, NULL); @@ -1092,5 +1092,5 @@ pci_e1000_init(PCIBus *bus, NICInfo *nd, int devfn) qemu_format_nic_info_str(d->vc, d->nd->macaddr); - register_savevm(info_str, -1, 2, nic_save, nic_load, d); + register_savevm("e1000", nnics++, 2, nic_save, nic_load, d); } -- 1.6.0.6 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LSjLv-0002Ns-K6 for qemu-devel@nongnu.org; Thu, 29 Jan 2009 21:43:31 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LSjLv-0002NG-0G for qemu-devel@nongnu.org; Thu, 29 Jan 2009 21:43:31 -0500 Received: from [199.232.76.173] (port=60366 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LSjLu-0002N6-6F for qemu-devel@nongnu.org; Thu, 29 Jan 2009 21:43:30 -0500 Received: from mx20.gnu.org ([199.232.41.8]:1438) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LSjLt-0005qO-LG for qemu-devel@nongnu.org; Thu, 29 Jan 2009 21:43:29 -0500 Received: from mail.codesourcery.com ([65.74.133.4]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LSjLs-0002Oj-He for qemu-devel@nongnu.org; Thu, 29 Jan 2009 21:43:28 -0500 From: Paul Brook Subject: Re: [Qemu-devel] (no subject) Date: Fri, 30 Jan 2009 02:43:22 +0000 References: <1233258889-6878-1-git-send-email-uril@redhat.com> In-Reply-To: <1233258889-6878-1-git-send-email-uril@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200901300243.23382.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Hello@redhat.com, Uri Lublin On Thursday 29 January 2009, Uri Lublin wrote: > The following patch fixes saving/loading/migrating a VM with > multiple e1000 NICs. I don't know what problems you're seeing, but this is definitely not the right way to fix them. > It turns out many devices use -1 as instance (for register_savevm), > which is wrong in cases where there can exist multiple such > devices within a single VM. No it isn't. -1 means automatically assign IDs, and is what everything should be using. The explicit ID argument is a historcal wart. Read the comment above register_savevm. Paul From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LTe7S-0001ut-Gm for qemu-devel@nongnu.org; Sun, 01 Feb 2009 10:20:22 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LTe7O-0001u2-B4 for qemu-devel@nongnu.org; Sun, 01 Feb 2009 10:20:21 -0500 Received: from [199.232.76.173] (port=43464 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LTe7O-0001tz-42 for qemu-devel@nongnu.org; Sun, 01 Feb 2009 10:20:18 -0500 Received: from mx2.redhat.com ([66.187.237.31]:38377) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LTe7N-0000w0-G4 for qemu-devel@nongnu.org; Sun, 01 Feb 2009 10:20:17 -0500 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n11FKGqD031615 for ; Sun, 1 Feb 2009 10:20:16 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n11FKGD4016176 for ; Sun, 1 Feb 2009 10:20:16 -0500 Received: from [10.35.1.187] (dhcp-1-187.tlv.redhat.com [10.35.1.187]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n11FKFsf025312 for ; Sun, 1 Feb 2009 10:20:16 -0500 Message-ID: <4985BDB0.4090803@redhat.com> Date: Sun, 01 Feb 2009 17:20:16 +0200 From: Uri Lublin MIME-Version: 1.0 Subject: Re: [Qemu-devel] (no subject) References: <1233258889-6878-1-git-send-email-uril@redhat.com> <200901300243.23382.paul@codesourcery.com> In-Reply-To: <200901300243.23382.paul@codesourcery.com> Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Paul Brook wrote: > On Thursday 29 January 2009, Uri Lublin wrote: >> The following patch fixes saving/loading/migrating a VM with >> multiple e1000 NICs. > > I don't know what problems you're seeing, but this is definitely not the right > way to fix them. > >> It turns out many devices use -1 as instance (for register_savevm), >> which is wrong in cases where there can exist multiple such >> devices within a single VM. > > No it isn't. -1 means automatically assign IDs, and is what everything should > be using. The explicit ID argument is a historcal wart. Read the comment > above register_savevm. > > Paul > Paul, You are right, I was wrong. This patch is a fix for an older qemu, and is not needed. Thanks for catching that, Uri. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ljg3H-0005Vf-4I for qemu-devel@nongnu.org; Tue, 17 Mar 2009 16:38:19 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ljg3B-0005Td-V1 for qemu-devel@nongnu.org; Tue, 17 Mar 2009 16:38:18 -0400 Received: from [199.232.76.173] (port=57184 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ljg3B-0005TX-QI for qemu-devel@nongnu.org; Tue, 17 Mar 2009 16:38:13 -0400 Received: from mx1.redhat.com ([66.187.233.31]:44836) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ljg3B-0003xf-D4 for qemu-devel@nongnu.org; Tue, 17 Mar 2009 16:38:13 -0400 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n2HKcCbc018826 for ; Tue, 17 Mar 2009 16:38:12 -0400 Received: from localhost.localdomain (dhcp-1-187.tlv.redhat.com [10.35.1.187]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n2HKcCs6013060 for ; Tue, 17 Mar 2009 16:38:13 -0400 From: Uri Lublin Date: Tue, 17 Mar 2009 22:37:57 +0200 Message-Id: <1237322291-11279-1-git-send-email-uril@redhat.com> Subject: [Qemu-devel] (no subject) Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org In this patchset there are three main features: 1. Introduce Qcow2 extensions. 2. Keep backing file format such that no probing is needed. 3. Keep track of highest-allocated-offset and report it upon a user request. 4. Add an open-flag to distinguish between a leaf image and a backing file (base image). Also keep the open-flags so we can later use them to close and reopen images. 1. Qcow2 extensions are build of magic (id) len (in bytes) and data. They reside between the end of the header and the backing filename (if exists). Unknown extensions are ignored (assumed to be added by a newer version) Based on a work done by Shahar Frank. 2. By keeping the backing file format we: a. Provide a way to know the backing file format without probing it (setting the format at creation time). b. Enable using qcow2 format over host block devices. (only if the user specifically asks for it, by providing the format at creation time). I've added bdrv_create2 and drv->bdrv_create2 (implemented only by block-qcow2 currently) to pass the backing-format to create. Also fixes a security flaw found by Daniel P. Berrange on [1] which summarizes: "Autoprobing: just say no." [1] http://lists.gnu.org/archive/html/qemu-devel/2008-12/msg01083.html 3. One of the main usage for highest-allocated-offset is to know and act upon a case of end-of-storage-space. Instead of waiting for -ENOSPACE (which now may cause the VM to stop), one can define a threshold and extend the diskspace allocated for the image. This info is also good for management systems, so they can report the user disk space status. 4. With bdrv_close and reopen capability we can possibly: a. Open backing files with read-only permission, and reopen with RW if needed. b. Reopen on destination side after migration before starting to run This solves a case where the source changes the disk (especially meta-data) while migration is in process. c. Check open-flags to keep track of highest-allocated-offset for only leaf images. Changes from v5: Patchset includes newly introduced qcow2 extensions. Usage of such qcow2 extensions for keeping both backing format and highest-allocated-offset. No scanning of qcow2 images upon open. Not yet support for num-free. Added bdrv_close_all + calling it at end of main. Support highest_alloc only for leaf images. Uri Lublin (14): Introducing qcow2 extensions block: support known backing format for image create and open block-qcow2: keep backing file format in a qcow2 extension qemu-img: adding a "-F base_fmt" option to "qemu-img create -b" block-qcow2: keep highest allocated offset block-qcow2: export highest-alloc through BlockDriverInfo and get_info() block: info blockstats: show highest_allocated if exists Add a bdrv_close_all() and call it at the end of main() block-qcow2: keep highest alloc offset in a qcow2 extension qemu-img: info: show highest_alloc if exists qcow2: qcow_read_extensions: make "advance offset over extension" common block: pass BDRV_BACKING flag to open of a backing file block: keep flags an image was opened with block-qcow2: do not keep track of highest-alloc for backing files From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MM7KQ-0002q2-5d for qemu-devel@nongnu.org; Wed, 01 Jul 2009 17:26:54 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MM7KL-0002pm-Jw for qemu-devel@nongnu.org; Wed, 01 Jul 2009 17:26:53 -0400 Received: from [199.232.76.173] (port=45307 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MM7KL-0002pj-IA for qemu-devel@nongnu.org; Wed, 01 Jul 2009 17:26:49 -0400 Received: from mail-ew0-f211.google.com ([209.85.219.211]:41815) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MM7KL-00051f-2x for qemu-devel@nongnu.org; Wed, 01 Jul 2009 17:26:49 -0400 Received: by ewy7 with SMTP id 7so1373698ewy.34 for ; Wed, 01 Jul 2009 14:26:48 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v624) Content-Transfer-Encoding: 7bit Message-Id: <022d1985d24fe91131187e956dec0e38@gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed From: G 3 Date: Wed, 1 Jul 2009 17:26:43 -0400 Subject: [Qemu-devel] (no subject) List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org > Stefan Weil wrote: > > strnlen is a GNU extension which is missing in mingw32 > and perhaps other build environments. > > > So we should avoid it and replace it by standard functions. > > > Signed-off-by: Stefan Weil > --- > block.c | 7 ++++++- > 1 files changed, 6 insertions(+), 1 deletions(-) > > > diff --git a/block.c b/block.c > index c66c031..79b3313 100644 > --- a/block.c > +++ b/block.c > @@ -225,9 +225,14 @@ static BlockDriver *find_protocol(const char > *filename) > { > BlockDriver *drv1; > char protocol[128]; > - int len = strnlen(filename, 127)+1; > + int len; > const char *p; > + len = strlen(filename) + 1; > + if (len > sizeof(protocol)) { > + len = sizeof(protocol); > + } > + > #ifdef _WIN32 > if (is_windows_drive(filename) || > is_windows_drive_prefix(filename)) > > > Or something like this? > #ifdef __MINGW32__ > size_t strnlen (const char *string, size_t maxlen) > { > const char *end = memchr (string, '\0', maxlen); > return end ? (size_t) (end - string) : maxlen; > }; > #endif block.c doesn't compile on Mac OS 10.3. I second the notion of removing strnlen. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N42RF-00005a-71 for qemu-devel@nongnu.org; Fri, 30 Oct 2009 21:07:29 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N42RD-0008UE-Ie for qemu-devel@nongnu.org; Fri, 30 Oct 2009 21:07:28 -0400 Received: from [199.232.76.173] (port=53994 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N42RD-0008U0-FE for qemu-devel@nongnu.org; Fri, 30 Oct 2009 21:07:27 -0400 Received: from c-98-219-191-51.hsd1.pa.comcast.net ([98.219.191.51]:42836 helo=mcmullan-linux) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N42RC-0006Gn-PF for qemu-devel@nongnu.org; Fri, 30 Oct 2009 21:07:27 -0400 Message-Id: <20091031010724.DAC4E3C662@mcmullan-linux> Date: Fri, 30 Oct 2009 21:07:24 -0400 (EDT) From: jmcmullan@netronome.com (Jason McMullan) Subject: [Qemu-devel] (no subject) List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org >>From cc0481503722124f085d785637aeea9ea51fab9b Mon Sep 17 00:00:00 2001 From: Jason S. McMullan Date: Wed, 28 Oct 2009 00:56:00 -0400 Subject: [PATCH] hw/sd: Support SDHC size cards Signed-off-by: Jason S. McMullan --- hw/sd.c | 153 ++++++++++++++++++++++++++++++++++++++------------------------- 1 files changed, 93 insertions(+), 60 deletions(-) diff --git a/hw/sd.c b/hw/sd.c index 9888547..4d306af 100644 --- a/hw/sd.c +++ b/hw/sd.c @@ -81,7 +81,7 @@ struct SDState { uint32_t vhs; int wp_switch; int *wp_groups; - uint32_t size; + uint64_t size; int blk_len; uint32_t erase_start; uint32_t erase_end; @@ -92,7 +92,7 @@ struct SDState { int spi; int current_cmd; int blk_written; - uint32_t data_start; + uint64_t data_start; uint32_t data_offset; uint8_t data[512]; qemu_irq readonly_cb; @@ -249,37 +249,59 @@ static const uint8_t sd_csd_rw_mask[16] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfc, 0xfe, }; -static void sd_set_csd(SDState *sd, uint32_t size) +static void sd_set_csd(SDState *sd, uint64_t size) { uint32_t csize = (size >> (CMULT_SHIFT + HWBLOCK_SHIFT)) - 1; uint32_t sectsize = (1 << (SECTOR_SHIFT + 1)) - 1; uint32_t wpsize = (1 << (WPGROUP_SHIFT + 1)) - 1; - sd->csd[0] = 0x00; /* CSD structure */ - sd->csd[1] = 0x26; /* Data read access-time-1 */ - sd->csd[2] = 0x00; /* Data read access-time-2 */ - sd->csd[3] = 0x5a; /* Max. data transfer rate */ - sd->csd[4] = 0x5f; /* Card Command Classes */ - sd->csd[5] = 0x50 | /* Max. read data block length */ - HWBLOCK_SHIFT; - sd->csd[6] = 0xe0 | /* Partial block for read allowed */ - ((csize >> 10) & 0x03); - sd->csd[7] = 0x00 | /* Device size */ - ((csize >> 2) & 0xff); - sd->csd[8] = 0x3f | /* Max. read current */ - ((csize << 6) & 0xc0); - sd->csd[9] = 0xfc | /* Max. write current */ - ((CMULT_SHIFT - 2) >> 1); - sd->csd[10] = 0x40 | /* Erase sector size */ - (((CMULT_SHIFT - 2) << 7) & 0x80) | (sectsize >> 1); - sd->csd[11] = 0x00 | /* Write protect group size */ - ((sectsize << 7) & 0x80) | wpsize; - sd->csd[12] = 0x90 | /* Write speed factor */ - (HWBLOCK_SHIFT >> 2); - sd->csd[13] = 0x20 | /* Max. write data block length */ - ((HWBLOCK_SHIFT << 6) & 0xc0); - sd->csd[14] = 0x00; /* File format group */ - sd->csd[15] = (sd_crc7(sd->csd, 15) << 1) | 1; + if (size <= 0x40000000) { + sd->csd[0] = 0x00; /* CSD structure */ + sd->csd[1] = 0x26; /* Data read access-time-1 */ + sd->csd[2] = 0x00; /* Data read access-time-2 */ + sd->csd[3] = 0x5a; /* Max. data transfer rate */ + sd->csd[4] = 0x5f; /* Card Command Classes */ + sd->csd[5] = 0x50 | /* Max. read data block length */ + HWBLOCK_SHIFT; + sd->csd[6] = 0xe0 | /* Partial block for read allowed */ + ((csize >> 10) & 0x03); + sd->csd[7] = 0x00 | /* Device size */ + ((csize >> 2) & 0xff); + sd->csd[8] = 0x3f | /* Max. read current */ + ((csize << 6) & 0xc0); + sd->csd[9] = 0xfc | /* Max. write current */ + ((CMULT_SHIFT - 2) >> 1); + sd->csd[10] = 0x40 | /* Erase sector size */ + (((CMULT_SHIFT - 2) << 7) & 0x80) | (sectsize >> 1); + sd->csd[11] = 0x00 | /* Write protect group size */ + ((sectsize << 7) & 0x80) | wpsize; + sd->csd[12] = 0x90 | /* Write speed factor */ + (HWBLOCK_SHIFT >> 2); + sd->csd[13] = 0x20 | /* Max. write data block length */ + ((HWBLOCK_SHIFT << 6) & 0xc0); + sd->csd[14] = 0x00; /* File format group */ + sd->csd[15] = (sd_crc7(sd->csd, 15) << 1) | 1; + } else { + size /= 512 * 1024; + size -= 1; + sd->csd[0] = 0x40; + sd->csd[1] = 0x0e; + sd->csd[2] = 0x00; + sd->csd[3] = 0x32; + sd->csd[4] = 0x5b; + sd->csd[5] = 0x59; + sd->csd[6] = 0x00; + sd->csd[7] = (size >> 16) & 0xff; + sd->csd[8] = (size >> 8) & 0xff; + sd->csd[9] = (size & 0xff); + sd->csd[10] = 0x7f; + sd->csd[11] = 0x80; + sd->csd[12] = 0x0a; + sd->csd[13] = 0x40; + sd->csd[14] = 0x00; + sd->csd[15] = 0x00; + sd->ocr |= (1 << 30); + } } static void sd_set_rca(SDState *sd) @@ -362,7 +384,7 @@ static void sd_response_r7_make(SDState *sd, uint8_t *response) static void sd_reset(SDState *sd, BlockDriverState *bdrv) { - uint32_t size; + uint64_t size; uint64_t sect; if (bdrv) { @@ -372,10 +394,7 @@ static void sd_reset(SDState *sd, BlockDriverState *bdrv) } sect <<= 9; - if (sect > 0x40000000) - size = 0x40000000; /* 1 gig */ - else - size = sect + 1; + size = sect + 1; sect = (size >> (HWBLOCK_SHIFT + SECTOR_SHIFT + WPGROUP_SHIFT)) + 1; @@ -460,7 +479,7 @@ static void sd_erase(SDState *sd) sd->card_status |= WP_ERASE_SKIP; } -static uint32_t sd_wpbits(SDState *sd, uint32_t addr) +static uint32_t sd_wpbits(SDState *sd, uint64_t addr) { uint32_t i, wpnum; uint32_t ret = 0; @@ -583,7 +602,14 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, SDRequest req) { uint32_t rca = 0x0000; + uint64_t addr; + if (sd->ocr & (1 << 30)) { + addr = (uint64_t)req.arg << 9; + } else { + addr = req.arg; + } + if (sd_cmd_type[req.cmd] == sd_ac || sd_cmd_type[req.cmd] == sd_adtc) rca = req.arg >> 16; @@ -735,7 +761,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, break; sd->state = sd_sendingdata_state; memcpy(sd->data, sd->csd, 16); - sd->data_start = req.arg; + sd->data_start = addr; sd->data_offset = 0; return sd_r1; @@ -757,7 +783,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, break; sd->state = sd_sendingdata_state; memcpy(sd->data, sd->cid, 16); - sd->data_start = req.arg; + sd->data_start = addr; sd->data_offset = 0; return sd_r1; @@ -850,7 +876,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, switch (sd->state) { case sd_transfer_state: sd->state = sd_sendingdata_state; - sd->data_start = req.arg; + sd->data_start = addr; sd->data_offset = 0; if (sd->data_start + sd->blk_len > sd->size) @@ -866,7 +892,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, switch (sd->state) { case sd_transfer_state: sd->state = sd_sendingdata_state; - sd->data_start = req.arg; + sd->data_start = addr; sd->data_offset = 0; if (sd->data_start + sd->blk_len > sd->size) @@ -888,7 +914,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, if (sd->spi) break; sd->state = sd_receivingdata_state; - sd->data_start = req.arg; + sd->data_start = addr; sd->data_offset = 0; sd->blk_written = 0; @@ -914,7 +940,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, if (sd->spi) break; sd->state = sd_receivingdata_state; - sd->data_start = req.arg; + sd->data_start = addr; sd->data_offset = 0; sd->blk_written = 0; @@ -965,13 +991,13 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, case 28: /* CMD28: SET_WRITE_PROT */ switch (sd->state) { case sd_transfer_state: - if (req.arg >= sd->size) { + if (addr >= sd->size) { sd->card_status = ADDRESS_ERROR; return sd_r1b; } sd->state = sd_programming_state; - sd->wp_groups[req.arg >> (HWBLOCK_SHIFT + + sd->wp_groups[addr >> (HWBLOCK_SHIFT + SECTOR_SHIFT + WPGROUP_SHIFT)] = 1; /* Bzzzzzzztt .... Operation complete. */ sd->state = sd_transfer_state; @@ -985,13 +1011,13 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, case 29: /* CMD29: CLR_WRITE_PROT */ switch (sd->state) { case sd_transfer_state: - if (req.arg >= sd->size) { + if (addr >= sd->size) { sd->card_status = ADDRESS_ERROR; return sd_r1b; } sd->state = sd_programming_state; - sd->wp_groups[req.arg >> (HWBLOCK_SHIFT + + sd->wp_groups[addr >> (HWBLOCK_SHIFT + SECTOR_SHIFT + WPGROUP_SHIFT)] = 0; /* Bzzzzzzztt .... Operation complete. */ sd->state = sd_transfer_state; @@ -1007,7 +1033,7 @@ static sd_rsp_type_t sd_normal_command(SDState *sd, case sd_transfer_state: sd->state = sd_sendingdata_state; *(uint32_t *) sd->data = sd_wpbits(sd, req.arg); - sd->data_start = req.arg; + sd->data_start = addr; sd->data_offset = 0; return sd_r1b; @@ -1322,11 +1348,11 @@ int sd_do_command(SDState *sd, SDRequest *req, return rsplen; } -/* No real need for 64 bit addresses here */ -static void sd_blk_read(SDState *sd, uint32_t addr, uint32_t len) +static void sd_blk_read(SDState *sd, uint64_t addr, uint32_t len) { - uint32_t end = addr + len; + uint64_t end = addr + len; + DPRINTF("sd_blk_read: addr = 0x%08llx, len = %d\n", (unsigned long long)addr, len); if (!sd->bdrv || bdrv_read(sd->bdrv, addr >> 9, sd->buf, 1) == -1) { fprintf(stderr, "sd_blk_read: read error on host side\n"); return; @@ -1344,9 +1370,9 @@ static void sd_blk_read(SDState *sd, uint32_t addr, uint32_t len) memcpy(sd->data, sd->buf + (addr & 511), len); } -static void sd_blk_write(SDState *sd, uint32_t addr, uint32_t len) +static void sd_blk_write(SDState *sd, uint64_t addr, uint32_t len) { - uint32_t end = addr + len; + uint64_t end = addr + len; if ((addr & 511) || len < 512) if (!sd->bdrv || bdrv_read(sd->bdrv, addr >> 9, sd->buf, 1) == -1) { @@ -1505,6 +1531,7 @@ uint8_t sd_read_data(SDState *sd) { /* TODO: Append CRCs */ uint8_t ret; + int io_len; if (!sd->bdrv || !bdrv_is_inserted(sd->bdrv) || !sd->enable) return 0x00; @@ -1517,6 +1544,12 @@ uint8_t sd_read_data(SDState *sd) if (sd->card_status & (ADDRESS_ERROR | WP_VIOLATION)) return 0x00; + if (sd->ocr & (1 << 30)) { + io_len = 512; + } else { + io_len = sd->blk_len; + } + switch (sd->current_cmd) { case 6: /* CMD6: SWITCH_FUNCTION */ ret = sd->data[sd->data_offset ++]; @@ -1535,13 +1568,13 @@ uint8_t sd_read_data(SDState *sd) case 11: /* CMD11: READ_DAT_UNTIL_STOP */ if (sd->data_offset == 0) - BLK_READ_BLOCK(sd->data_start, sd->blk_len); + BLK_READ_BLOCK(sd->data_start, io_len); ret = sd->data[sd->data_offset ++]; - if (sd->data_offset >= sd->blk_len) { - sd->data_start += sd->blk_len; + if (sd->data_offset >= io_len) { + sd->data_start += io_len; sd->data_offset = 0; - if (sd->data_start + sd->blk_len > sd->size) { + if (sd->data_start + io_len > sd->size) { sd->card_status |= ADDRESS_ERROR; break; } @@ -1557,22 +1590,22 @@ uint8_t sd_read_data(SDState *sd) case 17: /* CMD17: READ_SINGLE_BLOCK */ if (sd->data_offset == 0) - BLK_READ_BLOCK(sd->data_start, sd->blk_len); + BLK_READ_BLOCK(sd->data_start, io_len); ret = sd->data[sd->data_offset ++]; - if (sd->data_offset >= sd->blk_len) + if (sd->data_offset >= io_len) sd->state = sd_transfer_state; break; case 18: /* CMD18: READ_MULTIPLE_BLOCK */ if (sd->data_offset == 0) - BLK_READ_BLOCK(sd->data_start, sd->blk_len); + BLK_READ_BLOCK(sd->data_start, io_len); ret = sd->data[sd->data_offset ++]; - if (sd->data_offset >= sd->blk_len) { - sd->data_start += sd->blk_len; + if (sd->data_offset >= io_len) { + sd->data_start += io_len; sd->data_offset = 0; - if (sd->data_start + sd->blk_len > sd->size) { + if (sd->data_start + io_len > sd->size) { sd->card_status |= ADDRESS_ERROR; break; } -- 1.6.3.3 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NfH5t-0004Vx-46 for qemu-devel@nongnu.org; Wed, 10 Feb 2010 13:15:21 -0500 Received: from [199.232.76.173] (port=47170 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NfH5s-0004Vm-QJ for qemu-devel@nongnu.org; Wed, 10 Feb 2010 13:15:20 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from <429bp9d02@sneakemail.com>) id 1NfH5q-0007fg-W3 for qemu-devel@nongnu.org; Wed, 10 Feb 2010 13:15:20 -0500 Received: from sneak2.sneakemail.com ([38.113.6.65]:47923) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from <429bp9d02@sneakemail.com>) id 1NfH5q-0007fO-8m for qemu-devel@nongnu.org; Wed, 10 Feb 2010 13:15:18 -0500 Date: Wed, 10 Feb 2010 13:15:20 -0500 (EST) From: "Stephen Isard" <429bp9d02@sneakemail.com> Message-ID: <20982-1265825713-396848@sneakemail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII Subject: [Qemu-devel] (no subject) List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hello, I hope you will excuse a naive question here. I'm not getting any response on the users' lists. I'm wondering whether shutting down a guest machine with the quit command in the monitor can corrupt the snapshots saved with savevm. As I understand it, quit will have an effect on the virtual guest similar to pulling the plug on a physical machine, so could leave it in a funny state. Since the snapshots appear to be stored on the guest's hard disk, it seems conceivable (in my state of ignorance) that they could be put at risk. Is that in fact possible? Thanks for your attention. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=35999 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OEHmx-0000VC-9Z for qemu-devel@nongnu.org; Tue, 18 May 2010 04:06:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OEHDS-0007xV-FS for qemu-devel@nongnu.org; Tue, 18 May 2010 03:30:47 -0400 Received: from iksaif.net ([88.191.73.63]:38551) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OEHDM-0007vN-97 for qemu-devel@nongnu.org; Tue, 18 May 2010 03:27:49 -0400 Received: from localhost.localdomain (localhost [127.0.0.1]) (Authenticated sender: corentincj@iksaif.net) by iksaif.net (Postfix) with ESMTPA id 5EFA7C90011 for ; Tue, 18 May 2010 09:31:22 +0200 (CEST) From: Corentin Chary Date: Tue, 18 May 2010 09:31:11 +0200 Message-Id: <1274167881-6966-1-git-send-email-corentincj@iksaif.net> Subject: [Qemu-devel] (no subject) List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org >>From 42415cc70a087e9a280667eddbeb2af1029c96a0 Mon Sep 17 00:00:00 2001 From: Corentin Chary Date: Tue, 18 May 2010 09:23:48 +0200 Subject: [PATCH 00/10] vnc encodings Cc: Anthony Liguori , Alexander Graf , Adam Litke Hi, I this series you'll find zlib fixes and a new tight encoding. Tight implementation is inspired (stolen ?) from libvncserver/tightvnc/tigervnc, but rewritten to match QEMU VNC implementation and coding style. Tight encoding still lacks gradient and jpeg, but some results [1] [2] show that it performs better than zlib and hextile. Thanks, [1] http://xf.iksaif.net/blog/index.php?post/2010/05/11/GsoC-2010-QEMU%3A-First-%28dumb%29-tight-benchmarks [2] http://xf.iksaif.net/blog/index.php?post/2010/05/18/QEMU%3A-some-charts-on-tight-zlib-and-hextile Corentin Chary (10): vnc: refactor set_encodings vnc: really call zlib if we want zlib vnc: only use a single zlib stream vnc: adjust compression zstream level vnc: add basic tight support vnc: add support for tight fill encoding vnc: don't clear zlib stream on set_encoding vnc: remove memory leaks in zlib and tight encoding vnc: tight: add palette encoding vnc: update copyrights for vnc-encoding-tight.c Makefile | 2 + Makefile.objs | 1 + vnc-encoding-hextile.c | 5 +- vnc-encoding-tight.c | 945 ++++++++++++++++++++++++++++++++++++++++++++++++ vnc-encoding-tight.h | 200 ++++++++++ vnc-encoding-zlib.c | 43 ++- vnc.c | 79 +++-- vnc.h | 24 +- 8 files changed, 1246 insertions(+), 53 deletions(-) create mode 100644 vnc-encoding-tight.c create mode 100644 vnc-encoding-tight.h From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=34594 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P9J2s-0001ZB-Dx for qemu-devel@nongnu.org; Fri, 22 Oct 2010 10:56:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P9J2q-00009y-RJ for qemu-devel@nongnu.org; Fri, 22 Oct 2010 10:56:38 -0400 Received: from mtagate5.de.ibm.com ([195.212.17.165]:53812) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P9J2q-00008n-JZ for qemu-devel@nongnu.org; Fri, 22 Oct 2010 10:56:36 -0400 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate5.de.ibm.com (8.13.1/8.13.1) with ESMTP id o9MEuTW3002574 for ; Fri, 22 Oct 2010 14:56:29 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o9MEuTZm4042954 for ; Fri, 22 Oct 2010 16:56:29 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id o9MEuTSH017704 for ; Fri, 22 Oct 2010 16:56:29 +0200 From: Stefan Hajnoczi Date: Fri, 22 Oct 2010 15:56:18 +0100 Message-Id: <1287759383-14114-1-git-send-email-stefanha@linux.vnet.ibm.com> Subject: [Qemu-devel] (no subject) List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Anthony Liguori , Christoph Hellwig , Stefan Hajnoczi , Avi Kivity QEMU Enhanced Disk format is a disk image format that forgoes features found in qcow2 in favor of better levels of performance and data integrity. Due to its simpler on-disk layout, it is possible to safely perform metadata updates more efficiently. Installations, suspend-to-disk, and other allocation-heavy I/O workloads will see increased performance due to fewer I/Os and syncs. Workloads that do not cause new clusters to be allocated will perform similar to raw images due to in-memory metadata caching. The format supports sparse disk images. It does not rely on the host filesystem holes feature, making it a good choice for sparse disk images that need to be transferred over channels where holes are not supported. Backing files are supported so only deltas against a base image can be stored. The base image may be smaller than the image file. The file format is extensible so that additional features can be added later with graceful compatibility handling. A specification for the file format is included in this patchset. Internal snapshots are not supported. This eliminates the need for additional metadata to track copy-on-write clusters. Compression and encryption are not supported. They add complexity and can be implemented at other layers in the stack (i.e. inside the guest or on the host). Encryption has been identified as a potential future extension and the file format allows for this. Signed-off-by: Anthony Liguori Signed-off-by: Stefan Hajnoczi --- This code is also available from git: http://repo.or.cz/w/qemu/stefanha.git/shortlog/refs/heads/qed-v3 I have preserved distinct commits against v2 for easier reviewing here: http://repo.or.cz/w/qemu/stefanha.git/shortlog/refs/heads/qed-v3-presquash v3: * Flush before L2 update when a backing file is used * Use QED_F_BACKING_FORMAT_NO_PROBE instead of backing_fmt header field * Allow non-cluster sized images * Implement autoclear feature bits * Implement backing image smaller size - reads from backing image should zero beyond EOF * Preserve errno in qed_find_cluster_cb() - don't dumb down to QED_CLUSTER_ERROR * Use ffs() instead of get_bits_from_size() * Remove l2_cache argument to qed_unref_l2_cache_entry * Eliminate L2TableAllocFunc function pointer * Split qed_aio_write in-place and allocating code path to make code clearer * Document how L2 cache is used * Document qed_find_cluster() * Update QED specification * Fix COPYING.LIB LGPL license file references * Add copyright header to qed-check.c * Avoid the bytes_to_str()/cvtstr()/sztostr() dependency until Jes' strtosz() goes in v2: * Add QED format specification to documentation * Use __builtin_ctzl() for get_bits_from_size() * Fine-grained table locking to allow concurrent allocating write requests * Fix qemu_free() instead of qemu_vfree() in qed_unref_l2_cache_entry() * Comment clean-ups From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=43413 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PGM0a-0004oF-K6 for qemu-devel@nongnu.org; Wed, 10 Nov 2010 20:31:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PGM0Z-0006q0-52 for qemu-devel@nongnu.org; Wed, 10 Nov 2010 20:31:24 -0500 Received: from e9.ny.us.ibm.com ([32.97.182.139]:45570) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PGM0Y-0006pT-TI for qemu-devel@nongnu.org; Wed, 10 Nov 2010 20:31:23 -0500 Received: from d01relay07.pok.ibm.com (d01relay07.pok.ibm.com [9.56.227.147]) by e9.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id oAB19u76022247 for ; Wed, 10 Nov 2010 20:09:56 -0500 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay07.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id oAB1VJvm2347156 for ; Wed, 10 Nov 2010 20:31:19 -0500 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id oAB1VIU5026389 for ; Wed, 10 Nov 2010 20:31:19 -0500 From: Michael Roth Date: Wed, 10 Nov 2010 19:30:55 -0600 Message-Id: <1289439066-23387-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] (no subject) List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: agl@linux.vnet.ibm.com, abeekhof@redhat.com, mdroth@linux.vnet.ibm.com, aliguori@linux.vnet.ibm.com, ryanh@us.ibm.com, amit.shah@redhat.com >>From Michael Roth # This line is ignored. From: Michael Roth Subject: [RFC][PATCH v3 00/11] virtagent: host/guest RPC communication agent In-Reply-To: This set of patches is meant to be applied on top of the recently submitted Virtproxy v2 patchset. It can also be obtained at: git://repo.or.cz/qemu/mdroth.git virtproxy_v2 OVERVIEW: There are a wide range of use cases motivating the need for a guest agent of some sort to extend the functionality/usability/control offered by QEMU. Some examples include graceful guest shutdown/reboot and notifications thereof, copy/paste syncing between host/guest, guest statistics gathering, file access, etc. Ideally these would all be served by a single, easilly extensible agent that can be deployed in a wide range of guests. Virtagent is an XMLRPC server integrated into the Virtproxy guest daemon and aimed at providing this type of functionality. CHANGES IN V3: - Integrated virtagent invocation into virtproxy chardev. Usage examples below. - Consolidated RPC server/client setup into a pair of init routines - Fixed buffer overflow in agent_viewfile() and various memory leaks CHANGES IN V2: - All RPC communication is now done using asynchronous/non-blocking read/write handlers - Previously fork()'d RPC server loop is now integrated into qemu-vp/virtproxy i/o loop - Cleanups/suggestions from previous RFC DESIGN: There are actually 2 RPC servers: 1) a server in the guest integrated into qemu-vp, the Virtproxy guest daemon, which handles RPC requests from QEMU 2) a server in the host, integrated into the virtproxy chardev, to handle RPC requests sent by the guest agent (mainly for handling asynchronous events reported by the agent). At the Virtagent level, communication is done via standard RPCs (HTTP between host and guest). Virtproxy transparently handles transport over a network or isa/virtio serial channel, allowing the agent to be deployed on older guests which may not support virtio-serial. Currently there are only 2 RPCs implemented for the guest server (getfile and getdmesg), and 0 for the host. Additional RPCs can be added fairly easily, but are dependent on feedback from here and elsewhere. ping/status, shutdown, and reboot are likely candidates (although the latter 2 will likely require asynchronous notifications to the host RPC server to implement reliably). EXAMPLE USAGE: The commandline options are a little convoluted right now; this will addressed in later revisions. - Configure guest agent to talk to host via virtio-serial # start guest with virtio-serial/virtproxy/virtagent. for example (RHEL6rc1): qemu \ -chardev virtproxy,id=test0,virtagent=on \ -device virtio-serial \ -device virtserialport,chardev=test0,name=virtagent0 \ -monitor stdio ... # in the guest: ./qemu-vp -c virtserial-open:/dev/virtio-ports/virtagent0:- -g ... # monitor commands (qemu) agent_viewdmesg [139311.710326] wlan0: deauthenticating from 00:30:bd:f7:12:d5 by local choice (reason=3) [139323.469857] wlan0: deauthenticating from 00:21:29:cd:41:ee by local choice (reason=3) ... [257683.375646] wlan0: authenticated [257683.375684] wlan0: associate with AP 00:30:bd:f7:12:d5 (try 1) [257683.377932] wlan0: RX AssocResp from 00:30:bd:f7:12:d5 (capab=0x411 status=0 aid=4) [257683.377940] wlan0: associated (qemu) agent_viewfile /proc/meminfo MemTotal: 3985488 kB MemFree: 400524 kB Buffers: 220556 kB Cached: 2073160 kB SwapCached: 0 kB ... Hugepagesize: 2048 kB DirectMap4k: 8896 kB DirectMap2M: 4110336 kB KNOWN ISSUES/PLANS: - the client socket that qemu connects to send RPCs is a hardcoded filepath. This is unacceptable as the socket is channel/process specific and things will break when multiple guests are started. - capability negotiation will be needed to handle version/architecture differences. - proper channel negotiation is needed to avoid hung monitors and such when a guest reboots or the guest agent is stopped for whatever reason. additionally, a timeout may need to be imposed on the amount of time the http read handler can block the monitor. - additional host-to-guest RPCs as well as asynchronous notifications via guest-to-host RPCs for events such as shutdown/reboot/agent up/agent down From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=55926 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PGqAB-0007JP-U7 for qemu-devel@nongnu.org; Fri, 12 Nov 2010 04:43:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PGqAA-0008Dm-W3 for qemu-devel@nongnu.org; Fri, 12 Nov 2010 04:43:19 -0500 Received: from mtagate4.uk.ibm.com ([194.196.100.164]:56040) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PGqAA-0008DJ-Ou for qemu-devel@nongnu.org; Fri, 12 Nov 2010 04:43:18 -0500 Received: from d06nrmr1806.portsmouth.uk.ibm.com (d06nrmr1806.portsmouth.uk.ibm.com [9.149.39.193]) by mtagate4.uk.ibm.com (8.13.1/8.13.1) with ESMTP id oAC9hF5C009333 for ; Fri, 12 Nov 2010 09:43:15 GMT Received: from d06av06.portsmouth.uk.ibm.com (d06av06.portsmouth.uk.ibm.com [9.149.37.217]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id oAC9h6Lu2666586 for ; Fri, 12 Nov 2010 09:43:16 GMT Received: from d06av06.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av06.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id oAC9h453024228 for ; Fri, 12 Nov 2010 02:43:04 -0700 From: Stefan Hajnoczi Date: Fri, 12 Nov 2010 09:43:02 +0000 Message-Id: <1289554983-22748-1-git-send-email-stefanha@linux.vnet.ibm.com> Subject: [Qemu-devel] (no subject) List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Nigel Horne From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=32861 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PMNmM-0001ce-KV for qemu-devel@nongnu.org; Sat, 27 Nov 2010 11:37:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PMNmL-0004Cl-IY for qemu-devel@nongnu.org; Sat, 27 Nov 2010 11:37:38 -0500 Received: from web39305.mail.mud.yahoo.com ([66.94.238.172]:40881) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1PMNmL-0004CC-6E for qemu-devel@nongnu.org; Sat, 27 Nov 2010 11:37:37 -0500 Message-ID: <684502.36639.qm@web39305.mail.mud.yahoo.com> Date: Sat, 27 Nov 2010 08:37:35 -0800 (PST) From: Joao Francisco Medeiros Neto MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1971899604-1290875855=:36639" Subject: [Qemu-devel] (no subject) List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: rosso@joinville.udesc.br, mateus@consistem.com.br, anderson.jsul@addmakler.com.br, atendimento@atelierdoperfume.com.br, qemu-devel@nongnu.org, di-kazinha@hotmail.com, falecom@tagsoft.com.br, reservas@hotelmirante.com, deptopessoal@avecont.com.br --0-1971899604-1290875855=:36639 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable http://www.tk-motorsport.at/thunder.php=0A=0A=0A --0-1971899604-1290875855=:36639 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
http://www.tk-motorsport.at/thunder.php

=0A=0A=0A=0A   --0-1971899604-1290875855=:36639-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=60749 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PMiEz-00060l-CL for qemu-devel@nongnu.org; Sun, 28 Nov 2010 09:28:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PMiEx-0003wk-LF for qemu-devel@nongnu.org; Sun, 28 Nov 2010 09:28:33 -0500 Received: from web39306.mail.mud.yahoo.com ([66.94.238.173]:42502) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1PMiEx-0003wV-C2 for qemu-devel@nongnu.org; Sun, 28 Nov 2010 09:28:31 -0500 Message-ID: <488462.52164.qm@web39306.mail.mud.yahoo.com> Date: Sun, 28 Nov 2010 06:28:30 -0800 (PST) From: Joao Francisco Medeiros Neto MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-355323152-1290954510=:52164" Subject: [Qemu-devel] (no subject) List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: marcos.gabinete@jaraguadosul.com.br, reservas@hotelmirante.com, jtramontina@brturbo.com, arcelino.sacani@c21ii.com.br, qemu-devel@nongnu.org, mateus@consistem.com.br, fausto.obras@jaraguadosul.com.br, victor@sejaonline.com.br, marcioc@libertyseguros.com.br --0-355323152-1290954510=:52164 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable http://aigipe.it/index99.php=0A=0A=0A --0-355323152-1290954510=:52164 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
http://aigipe.it/index99.php

=0A=0A=0A=0A   --0-355323152-1290954510=:52164-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=37087 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PODmo-0006iO-7A for qemu-devel@nongnu.org; Thu, 02 Dec 2010 13:21:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PODmn-0006kN-8S for qemu-devel@nongnu.org; Thu, 02 Dec 2010 13:21:42 -0500 Received: from web39305.mail.mud.yahoo.com ([66.94.238.172]:37237) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1PODmm-0006jp-RU for qemu-devel@nongnu.org; Thu, 02 Dec 2010 13:21:41 -0500 Message-ID: <706569.29022.qm@web39305.mail.mud.yahoo.com> Date: Thu, 2 Dec 2010 10:21:38 -0800 (PST) From: Joao Francisco Medeiros Neto MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1953266305-1291314098=:29022" Subject: [Qemu-devel] (no subject) List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: debian-sc@listas.cipsga.org.br, eraldo@weg.com.br, rosso@joinville.udesc.br, contabfiscal@avecont.com.br, qemu-devel@nongnu.org, guluxlist@unerj.br, alexandre@joinville.udesc.br, vendas@starblueinformatica.com, fmartins@sefaz.sc.gov.br --0-1953266305-1291314098=:29022 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable http://cuzzucoli.it/index000.php=0A=0A=0A --0-1953266305-1291314098=:29022 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
http://cuzzucoli.it/index000.php

=0A=0A=0A=0A   --0-1953266305-1291314098=:29022-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=35198 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PPKGy-0001yT-Kf for qemu-devel@nongnu.org; Sun, 05 Dec 2010 14:29:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PPKGw-0004uv-Rc for qemu-devel@nongnu.org; Sun, 05 Dec 2010 14:29:24 -0500 Received: from web39301.mail.mud.yahoo.com ([66.94.238.168]:46775) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1PPKGw-0004uf-MC for qemu-devel@nongnu.org; Sun, 05 Dec 2010 14:29:22 -0500 Message-ID: <287990.22060.qm@web39301.mail.mud.yahoo.com> Date: Sun, 5 Dec 2010 11:29:20 -0800 (PST) From: Joao Francisco Medeiros Neto MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1641606462-1291577360=:22060" Subject: [Qemu-devel] (no subject) List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, marcioc@libertyseguros.com.br, nessa.star@yahoo.com.br, debian-sc@listas.cipsga.org.br, cecilia.prefeita@jaraguadosul.com.br, atendimento@lelic.com.br, fausto.obras@jaraguadosul.com.br, hotmailalexandre@hotmail.com, contabfiscal@avecont.com.br --0-1641606462-1291577360=:22060 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable http://www.folhadeitapetininga.com.br/index0005.php=0A=0A=0A --0-1641606462-1291577360=:22060 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
http://www.folhadeitapetininga.com.br/ind= ex0005.php

=0A=0A=0A=0A   --0-1641606462-1291577360=:22060-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=55174 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PPP7H-0004Ks-MQ for qemu-devel@nongnu.org; Sun, 05 Dec 2010 19:39:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PPP7G-0001vZ-N1 for qemu-devel@nongnu.org; Sun, 05 Dec 2010 19:39:43 -0500 Received: from web39305.mail.mud.yahoo.com ([66.94.238.172]:23565) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1PPP7G-0001vV-Bg for qemu-devel@nongnu.org; Sun, 05 Dec 2010 19:39:42 -0500 Message-ID: <192848.46485.qm@web39305.mail.mud.yahoo.com> Date: Sun, 5 Dec 2010 16:39:40 -0800 (PST) From: Joao Francisco Medeiros Neto MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1983467865-1291595980=:46485" Subject: [Qemu-devel] (no subject) List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, marcelo@avecont.com.br, luiz@mertens.eng.br, victor@sejaonline.com.br, atendimento@lelic.com.br, posto.obras@jaraguadosul.com.br, online@atelierdoperfume.com.br, marcio.obras@jaraguadosul.com.br, computeranazias@hotmail.com --0-1983467865-1291595980=:46485 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable http://serwis.avx.pl/index0005.php=0A=0A=0A --0-1983467865-1291595980=:46485 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
http://serwis.avx.pl/index0005.php
<= /td>

=0A=0A=0A=0A   --0-1983467865-1291595980=:46485-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=36923 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PS3QS-0002kZ-Aa for qemu-devel@nongnu.org; Mon, 13 Dec 2010 03:06:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PS3QR-0001ly-1T for qemu-devel@nongnu.org; Mon, 13 Dec 2010 03:06:28 -0500 Received: from mail-gy0-f173.google.com ([209.85.160.173]:40208) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PS3QQ-0001lm-VK for qemu-devel@nongnu.org; Mon, 13 Dec 2010 03:06:27 -0500 Received: by gye5 with SMTP id 5so3143480gye.4 for ; Mon, 13 Dec 2010 00:06:26 -0800 (PST) From: Ronnie Sahlberg Date: Mon, 13 Dec 2010 19:05:49 +1100 Message-Id: <1292227550-6338-1-git-send-email-ronniesahlberg@gmail.com> Subject: [Qemu-devel] (no subject) List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Please find a new block driver that IF libiscsi is present on the system will link with this userspace client library and make qemu able to access iscsi devices directly without exposing them to the host. The library used is multiplatform and available from git://github.com/sahlberg/libiscsi.git From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=37002 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PS3Qh-0002s4-M7 for qemu-devel@nongnu.org; Mon, 13 Dec 2010 03:06:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PS3Qe-0001ny-AG for qemu-devel@nongnu.org; Mon, 13 Dec 2010 03:06:43 -0500 Received: from mail-yx0-f173.google.com ([209.85.213.173]:51082) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PS3Qe-0001nu-0e for qemu-devel@nongnu.org; Mon, 13 Dec 2010 03:06:40 -0500 Received: by yxl31 with SMTP id 31so3430900yxl.4 for ; Mon, 13 Dec 2010 00:06:39 -0800 (PST) From: Ronnie Sahlberg Date: Mon, 13 Dec 2010 19:05:50 +1100 Message-Id: <1292227550-6338-2-git-send-email-ronniesahlberg@gmail.com> In-Reply-To: <1292227550-6338-1-git-send-email-ronniesahlberg@gmail.com> References: <1292227550-6338-1-git-send-email-ronniesahlberg@gmail.com> Subject: [Qemu-devel] [PATCH] libiscsi List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Ronnie Sahlberg This patch adds a new block driver : block.iscsi.c This driver interfaces with the multiplatform posix library for iscsi initiator/client access to iscsi devices hosted at git://github.com/sahlberg/libiscsi.git The patch adds the driver to interface with the iscsi library. It also updated the configure script to * by default, probe is libiscsi is available and if so, build qemu against libiscsi. * --enable-libiscsi Force a build against libiscsi. If libiscsi is not available the build will fail. * --disable-libiscsi Do not link against libiscsi, even if it is available. When linked with libiscsi, qemu gains support to access iscsi resources such as disks and cdrom directly, without having to make the devices visible to the host. You can specify devices using a iscsi url of the form : iscsi://[:/ Example: -drive file=iscsi://10.1.1.1:3260/iqn.ronnie.test/1 -cdrom iscsi://10.1.1.1:3260/iqn.ronnie.test/2 Signed-off-by: Ronnie Sahlberg --- Makefile.objs | 2 +- block/iscsi.c | 528 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ configure | 29 +++ 3 files changed, 558 insertions(+), 1 deletions(-) create mode 100644 block/iscsi.c diff --git a/Makefile.objs b/Makefile.objs index cebb945..81731c5 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -22,7 +22,7 @@ block-nested-y += raw.o cow.o qcow.o vdi.o vmdk.o cloop.o dmg.o bochs.o vpc.o vv block-nested-y += qcow2.o qcow2-refcount.o qcow2-cluster.o qcow2-snapshot.o block-nested-y += parallels.o nbd.o blkdebug.o sheepdog.o blkverify.o block-nested-$(CONFIG_WIN32) += raw-win32.o -block-nested-$(CONFIG_POSIX) += raw-posix.o +block-nested-$(CONFIG_POSIX) += raw-posix.o iscsi.o block-nested-$(CONFIG_CURL) += curl.o block-obj-y += $(addprefix block/, $(block-nested-y)) diff --git a/block/iscsi.c b/block/iscsi.c new file mode 100644 index 0000000..fba5ee6 --- /dev/null +++ b/block/iscsi.c @@ -0,0 +1,528 @@ +/* + * QEMU Block driver for iSCSI images + * + * Copyright (c) 2010 Ronnie Sahlberg + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "config-host.h" +#ifdef CONFIG_LIBISCSI + +#include +#include "sysemu.h" +#include "qemu-common.h" +#include "qemu-error.h" +#include "block_int.h" + +#include +#include + + +typedef struct ISCSILUN { + struct iscsi_context *iscsi; + int lun; + int block_size; + unsigned long num_blocks; +} ISCSILUN; + +typedef struct ISCSIAIOCB { + BlockDriverAIOCB common; + QEMUIOVector *qiov; + QEMUBH *bh; + ISCSILUN *iscsilun; + int canceled; + int status; + size_t read_size; +} ISCSIAIOCB; + +struct iscsi_task { + ISCSILUN *iscsilun; + int status; + int complete; +}; + +static int +iscsi_is_inserted(BlockDriverState *bs) +{ + ISCSILUN *iscsilun = bs->opaque; + struct iscsi_context *iscsi = iscsilun->iscsi; + + return iscsi_is_logged_in(iscsi); +} + + +static void +iscsi_aio_cancel(BlockDriverAIOCB *blockacb) +{ + ISCSIAIOCB *acb = (ISCSIAIOCB *)blockacb; + + acb->status = -EIO; + acb->common.cb(acb->common.opaque, acb->status); + acb->canceled = 1; +} + +static AIOPool iscsi_aio_pool = { + .aiocb_size = sizeof(ISCSIAIOCB), + .cancel = iscsi_aio_cancel, +}; + + +static void iscsi_process_read(void *arg); +static void iscsi_process_write(void *arg); + +static void +iscsi_set_events(ISCSILUN *iscsilun) +{ + struct iscsi_context *iscsi = iscsilun->iscsi; + + qemu_aio_set_fd_handler(iscsi_get_fd(iscsi), iscsi_process_read, + (iscsi_which_events(iscsi)&POLLOUT) + ?iscsi_process_write:NULL, + NULL, NULL, iscsilun); +} + +static void +iscsi_process_read(void *arg) +{ + ISCSILUN *iscsilun = arg; + struct iscsi_context *iscsi = iscsilun->iscsi; + + iscsi_service(iscsi, POLLIN); + iscsi_set_events(iscsilun); +} + +static void +iscsi_process_write(void *arg) +{ + ISCSILUN *iscsilun = arg; + struct iscsi_context *iscsi = iscsilun->iscsi; + + iscsi_service(iscsi, POLLOUT); + iscsi_set_events(iscsilun); +} + + +static int +iscsi_schedule_bh(QEMUBHFunc *cb, ISCSIAIOCB *acb) +{ + acb->bh = qemu_bh_new(cb, acb); + if (!acb->bh) { + error_report("oom: could not create iscsi bh"); + return -EIO; + } + + qemu_bh_schedule(acb->bh); + return 0; +} + +static void +iscsi_readv_writev_bh_cb(void *p) +{ + ISCSIAIOCB *acb = p; + + acb->common.cb(acb->common.opaque, acb->status); + qemu_aio_release(acb); +} + +static void +iscsi_aio_write10_cb(struct iscsi_context *iscsi, int status, + void *command_data, void *private_data) +{ + ISCSIAIOCB *acb = private_data; + + if (acb->canceled != 0) { + qemu_aio_release(acb); + return; + } + + acb->status = 0; + if (status < 0) { + error_report("Failed to write10 data to iSCSI lun. %s", + iscsi_get_error(iscsi)); + acb->status = -EIO; + } + + iscsi_schedule_bh(iscsi_readv_writev_bh_cb, acb); +} + +static BlockDriverAIOCB * +iscsi_aio_writev(BlockDriverState *bs, int64_t sector_num, + QEMUIOVector *qiov, int nb_sectors, + BlockDriverCompletionFunc *cb, + void *opaque) +{ + ISCSILUN *iscsilun = bs->opaque; + struct iscsi_context *iscsi = iscsilun->iscsi; + ISCSIAIOCB *acb; + size_t size; + unsigned char *buf; + + acb = qemu_aio_get(&iscsi_aio_pool, bs, cb, opaque); + if (!acb) { + return NULL; + } + + acb->iscsilun = iscsilun; + acb->qiov = qiov; + + acb->canceled = 0; + + /* XXX we should pass the iovec to write10 to avoid the extra copy */ + /* this will allow us to get rid of 'buf' completely */ + size = nb_sectors * BDRV_SECTOR_SIZE; + buf = qemu_malloc(size); + qemu_iovec_to_buffer(acb->qiov, buf); + if (iscsi_write10_async(iscsi, iscsilun->lun, buf, size, + sector_num * BDRV_SECTOR_SIZE + / iscsilun->block_size, + 0, 0, iscsilun->block_size, + iscsi_aio_write10_cb, acb) != 0) { + error_report("iSCSI: Failed to send write10 command. %s", + iscsi_get_error(iscsi)); + qemu_free(buf); + qemu_aio_release(acb); + return NULL; + } + qemu_free(buf); + iscsi_set_events(iscsilun); + + return &acb->common; +} + +static void +iscsi_aio_read10_cb(struct iscsi_context *iscsi, int status, + void *command_data, void *private_data) +{ + ISCSIAIOCB *acb = private_data; + struct scsi_task *scsi = command_data; + + if (acb->canceled != 0) { + qemu_aio_release(acb); + return; + } + + acb->status = 0; + if (status < 0) { + error_report("Failed to read10 data from iSCSI lun. %s", + iscsi_get_error(iscsi)); + acb->status = -EIO; + } else { + qemu_iovec_from_buffer(acb->qiov, scsi->datain.data, acb->read_size); + } + + iscsi_schedule_bh(iscsi_readv_writev_bh_cb, acb); +} + +static BlockDriverAIOCB * +iscsi_aio_readv(BlockDriverState *bs, int64_t sector_num, + QEMUIOVector *qiov, int nb_sectors, + BlockDriverCompletionFunc *cb, + void *opaque) +{ + ISCSILUN *iscsilun = bs->opaque; + struct iscsi_context *iscsi = iscsilun->iscsi; + ISCSIAIOCB *acb; + size_t qemu_read_size, lun_read_size; + + qemu_read_size = BDRV_SECTOR_SIZE * (size_t)nb_sectors; + lun_read_size = (qemu_read_size + iscsilun->block_size - 1) + / iscsilun->block_size * iscsilun->block_size; + + acb = qemu_aio_get(&iscsi_aio_pool, bs, cb, opaque); + if (!acb) { + return NULL; + } + + acb->iscsilun = iscsilun; + acb->qiov = qiov; + + acb->canceled = 0; + acb->read_size = qemu_read_size; + + if (iscsi_read10_async(iscsi, iscsilun->lun, + sector_num * BDRV_SECTOR_SIZE + / iscsilun->block_size, + lun_read_size, iscsilun->block_size, + iscsi_aio_read10_cb, acb) != 0) { + error_report("iSCSI: Failed to send read10 command. %s", + iscsi_get_error(iscsi)); + qemu_aio_release(acb); + return NULL; + } + iscsi_set_events(iscsilun); + + return &acb->common; +} + + +static void synccache10_cb(struct iscsi_context *iscsi, int status, + void *command_data, void *private_data) +{ + struct iscsi_task *task = private_data; + + task->status = status; + task->complete = 1; +} + +static int +iscsi_flush(BlockDriverState *bs) +{ + ISCSILUN *iscsilun = bs->opaque; + struct iscsi_context *iscsi = iscsilun->iscsi; + struct iscsi_task task; + + task.iscsilun = iscsilun; + task.status = 0; + task.complete = 0; + + if (iscsi_synchronizecache10_async(iscsi, iscsilun->lun, + 0, 0, 0, 0, + synccache10_cb, + &task) != 0) { + error_report("iSCSI: Failed to send SYNCHRONIZECACHE10. %s", + iscsi_get_error(iscsi)); + return -1; + } + + async_context_push(); + while (!task.complete) { + iscsi_set_events(iscsilun); + qemu_aio_wait(); + } + async_context_pop(); + if (task.status != 0) { + error_report("iSCSI: Failed to send SYNCHRONIZECACHE10: %s", + iscsi_get_error(iscsi)); + return -EIO; + } + + return 0; +} + +static int64_t +iscsi_getlength(BlockDriverState *bs) +{ + ISCSILUN *iscsilun = bs->opaque; + int64_t len; + + len = iscsilun->num_blocks; + len *= iscsilun->block_size; + + return len; +} + +static void +iscsi_readcapacity10_cb(struct iscsi_context *iscsi, int status, + void *command_data, void *private_data) +{ + struct iscsi_task *task = private_data; + struct scsi_readcapacity10 *rc10; + struct scsi_task *scsi = command_data; + + if (status != 0) { + error_report("iSCSI: Failed to read capacity of iSCSI lun. %s", + iscsi_get_error(iscsi)); + task->status = 1; + task->complete = 1; + return; + } + + rc10 = scsi_datain_unmarshall(scsi); + if (rc10 == NULL) { + error_report("iSCSI: Failed to unmarshall readcapacity10 data."); + task->status = 1; + task->complete = 1; + return; + } + + task->iscsilun->block_size = rc10->block_size; + task->iscsilun->num_blocks = rc10->lba; + + task->status = 0; + task->complete = 1; +} + + +static void +iscsi_connect_cb(struct iscsi_context *iscsi, int status, void *command_data, + void *private_data) +{ + struct iscsi_task *task = private_data; + + if (status != 0) { + task->status = 1; + task->complete = 1; + return; + } + + if (iscsi_readcapacity10_async(iscsi, task->iscsilun->lun, 0, 0, + iscsi_readcapacity10_cb, private_data) + != 0) { + error_report("iSCSI: failed to send readcapacity command."); + task->status = 1; + task->complete = 1; + } +} + +/* + * We support iscsi url's on the form + * iscsi://[:]// + */ +static int iscsi_open(BlockDriverState *bs, const char *filename, int flags) +{ + ISCSILUN *iscsilun = bs->opaque; + struct iscsi_context *iscsi = NULL; + struct iscsi_task task; + char *ptr, *host, *target, *url; + char *tmp; + int ret, lun; + + bzero(iscsilun, sizeof(ISCSILUN)); + + url = qemu_strdup(filename); + + if (strncmp(url, "iscsi://", 8)) { + error_report("iSCSI: url does not start with 'iscsi://'"); + ret = -EINVAL; + goto failed; + } + + host = url + 8; + + ptr = index(host, '/'); + if (ptr == NULL) { + error_report("iSCSI: host is not '/' terminated."); + ret = -EINVAL; + goto failed; + } + + *ptr++ = 0; + target = ptr; + + ptr = index(target, '/'); + if (ptr == NULL) { + error_report("iSCSI: host/target is not '/' terminated."); + ret = -EINVAL; + goto failed; + } + + *ptr++ = 0; + + lun = strtol(ptr, &tmp, 10); + if (*tmp) { + error_report("iSCSI: Invalid LUN specified."); + ret = -EINVAL; + goto failed; + } + + /* Should really append the KVM name after the ':' here */ + iscsi = iscsi_create_context("iqn.2008-11.org.linux-kvm:"); + if (iscsi == NULL) { + error_report("iSCSI: Failed to create iSCSI context."); + ret = -ENOMEM; + goto failed; + } + + if (iscsi_set_targetname(iscsi, target)) { + error_report("iSCSI: Failed to set target name."); + ret = -ENOMEM; + goto failed; + } + + if (iscsi_set_session_type(iscsi, ISCSI_SESSION_NORMAL) != 0) { + error_report("iSCSI: Failed to set session type to normal."); + ret = -ENOMEM; + goto failed; + } + + iscsi_set_header_digest(iscsi, ISCSI_HEADER_DIGEST_NONE_CRC32C); + + task.iscsilun = iscsilun; + task.status = 0; + task.complete = 0; + + iscsilun->iscsi = iscsi; + iscsilun->lun = lun; + + if (iscsi_full_connect_async(iscsi, host, lun, iscsi_connect_cb, &task) + != 0) { + error_report("iSCSI: Failed to start async connect."); + ret = -ENOMEM; + goto failed; + } + async_context_push(); + while (!task.complete) { + iscsi_set_events(iscsilun); + qemu_aio_wait(); + } + async_context_pop(); + if (task.status != 0) { + error_report("iSCSI: Failed to connect to LUN : %s", + iscsi_get_error(iscsi)); + ret = -EINVAL; + goto failed; + } + + return 0; + +failed: + qemu_free(url); + if (iscsi != NULL) { + iscsi_destroy_context(iscsi); + } + bzero(iscsilun, sizeof(ISCSILUN)); + return ret; +} + +static void iscsi_close(BlockDriverState *bs) +{ + ISCSILUN *iscsilun = bs->opaque; + struct iscsi_context *iscsi = iscsilun->iscsi; + + qemu_aio_set_fd_handler(iscsi_get_fd(iscsi), NULL, NULL, NULL, NULL, NULL); + iscsi_destroy_context(iscsi); + bzero(iscsilun, sizeof(ISCSILUN)); +} + +static BlockDriver bdrv_iscsi = { + .format_name = "iscsi", + .protocol_name = "iscsi", + + .instance_size = sizeof(ISCSILUN), + .bdrv_file_open = iscsi_open, + .bdrv_close = iscsi_close, + .bdrv_flush = iscsi_flush, + + .bdrv_getlength = iscsi_getlength, + + .bdrv_aio_readv = iscsi_aio_readv, + .bdrv_aio_writev = iscsi_aio_writev, + + .bdrv_is_inserted = iscsi_is_inserted, +}; + +static void iscsi_block_init(void) +{ + bdrv_register(&bdrv_iscsi); +} + +block_init(iscsi_block_init); + +#endif diff --git a/configure b/configure index 2917874..93864ca 100755 --- a/configure +++ b/configure @@ -332,6 +332,7 @@ zero_malloc="" trace_backend="nop" trace_file="trace" spice="" +libiscsi="" # OS specific if check_define __linux__ ; then @@ -648,6 +649,10 @@ for opt do ;; --enable-spice) spice="yes" ;; + --disable-libiscsi) libiscsi="no" + ;; + --enable-libiscsi) libiscsi="yes" + ;; --enable-profiler) profiler="yes" ;; --enable-cocoa) @@ -934,6 +939,8 @@ echo " --trace-file=NAME Full PATH,NAME of file to store traces" echo " Default:trace-" echo " --disable-spice disable spice" echo " --enable-spice enable spice" +echo " --disable-libiscsi disable iscsi support" +echo " --enable-libiscsi enable iscsi support" echo "" echo "NOTE: The object files are built at the place where configure is launched" exit 1 @@ -2123,6 +2130,23 @@ EOF fi fi +# libiscsi probe +if test "$libiscsi" != "no" ; then + cat > $TMPC << EOF +#include +int main(void) { iscsi_create_context(""); return 0; } +EOF + if compile_prog "-Werror" "-liscsi" ; then + libiscsi="yes" + LIBS="$LIBS -liscsi" + else + if test "$libiscsi" = "yes" ; then + feature_not_found "libiscsi" + fi + libiscsi="no" + fi +fi + ########################################## ########################################## @@ -2354,6 +2378,7 @@ echo "vhost-net support $vhost_net" echo "Trace backend $trace_backend" echo "Trace output file $trace_file-" echo "spice support $spice" +echo "libiscsi support $libiscsi" if test $sdl_too_old = "yes"; then echo "-> Your SDL version is too old - please upgrade to have SDL support" @@ -2617,6 +2642,10 @@ if test "$spice" = "yes" ; then echo "CONFIG_SPICE=y" >> $config_host_mak fi +if test "$libiscsi" = "yes" ; then + echo "CONFIG_LIBISCSI=y" >> $config_host_mak +fi + # XXX: suppress that if [ "$bsd" = "yes" ] ; then echo "CONFIG_BSD=y" >> $config_host_mak -- 1.7.3.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=48643 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PSFJd-0001Oa-Mn for qemu-devel@nongnu.org; Mon, 13 Dec 2010 15:48:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PSFJZ-0006yO-4h for qemu-devel@nongnu.org; Mon, 13 Dec 2010 15:48:10 -0500 Received: from mail-pw0-f45.google.com ([209.85.160.45]:37727) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PSFJY-0006yH-Om for qemu-devel@nongnu.org; Mon, 13 Dec 2010 15:48:09 -0500 Received: by pwj6 with SMTP id 6so1388328pwj.4 for ; Mon, 13 Dec 2010 12:48:07 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1292227550-6338-2-git-send-email-ronniesahlberg@gmail.com> References: <1292227550-6338-1-git-send-email-ronniesahlberg@gmail.com> <1292227550-6338-2-git-send-email-ronniesahlberg@gmail.com> From: Blue Swirl Date: Mon, 13 Dec 2010 20:47:47 +0000 Message-ID: Subject: Re: [Qemu-devel] [PATCH] libiscsi Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ronnie Sahlberg Cc: qemu-devel@nongnu.org On Mon, Dec 13, 2010 at 8:05 AM, Ronnie Sahlberg wrote: > This patch adds a new block driver : block.iscsi.c > This driver interfaces with the multiplatform posix library > for iscsi initiator/client access to iscsi devices hosted at > git://github.com/sahlberg/libiscsi.git > > The patch adds the driver to interface with the iscsi library. > It also updated the configure script to > * by default, probe is libiscsi is available and if so, build > =C2=A0qemu against libiscsi. > * --enable-libiscsi > =C2=A0Force a build against libiscsi. If libiscsi is not available > =C2=A0the build will fail. > * --disable-libiscsi > =C2=A0Do not link against libiscsi, even if it is available. > > When linked with libiscsi, qemu gains support to access iscsi resources > such as disks and cdrom directly, without having to make the devices visi= ble > to the host. > > You can specify devices using a iscsi url of the form : > iscsi://[:/ > > Example: > -drive file=3Discsi://10.1.1.1:3260/iqn.ronnie.test/1 > > -cdrom iscsi://10.1.1.1:3260/iqn.ronnie.test/2 > > Signed-off-by: Ronnie Sahlberg > --- > =C2=A0Makefile.objs | =C2=A0 =C2=A02 +- > =C2=A0block/iscsi.c | =C2=A0528 +++++++++++++++++++++++++++++++++++++++++= ++++++++++++++++ > =C2=A0configure =C2=A0 =C2=A0 | =C2=A0 29 +++ > =C2=A03 files changed, 558 insertions(+), 1 deletions(-) > =C2=A0create mode 100644 block/iscsi.c > > diff --git a/Makefile.objs b/Makefile.objs > index cebb945..81731c5 100644 > --- a/Makefile.objs > +++ b/Makefile.objs > @@ -22,7 +22,7 @@ block-nested-y +=3D raw.o cow.o qcow.o vdi.o vmdk.o clo= op.o dmg.o bochs.o vpc.o vv > =C2=A0block-nested-y +=3D qcow2.o qcow2-refcount.o qcow2-cluster.o qcow2-= snapshot.o > =C2=A0block-nested-y +=3D parallels.o nbd.o blkdebug.o sheepdog.o blkveri= fy.o > =C2=A0block-nested-$(CONFIG_WIN32) +=3D raw-win32.o > -block-nested-$(CONFIG_POSIX) +=3D raw-posix.o > +block-nested-$(CONFIG_POSIX) +=3D raw-posix.o iscsi.o Please use CONFIG_ISCSI... > =C2=A0block-nested-$(CONFIG_CURL) +=3D curl.o > > =C2=A0block-obj-y +=3D =C2=A0$(addprefix block/, $(block-nested-y)) > diff --git a/block/iscsi.c b/block/iscsi.c > new file mode 100644 > index 0000000..fba5ee6 > --- /dev/null > +++ b/block/iscsi.c > @@ -0,0 +1,528 @@ > +/* > + * QEMU Block driver for iSCSI images > + * > + * Copyright (c) 2010 Ronnie Sahlberg > + * > + * Permission is hereby granted, free of charge, to any person obtaining= a copy > + * of this software and associated documentation files (the "Software"),= to deal > + * in the Software without restriction, including without limitation the= rights > + * to use, copy, modify, merge, publish, distribute, sublicense, and/or = sell > + * copies of the Software, and to permit persons to whom the Software is > + * furnished to do so, subject to the following conditions: > + * > + * The above copyright notice and this permission notice shall be includ= ed in > + * all copies or substantial portions of the Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRE= SS OR > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILI= TY, > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHA= LL > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR = OTHER > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISI= NG FROM, > + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALING= S IN > + * THE SOFTWARE. > + */ > + > +#include "config-host.h" > +#ifdef CONFIG_LIBISCSI ... then this is not needed. > + > +#include > +#include "sysemu.h" > +#include "qemu-common.h" > +#include "qemu-error.h" > +#include "block_int.h" > + > +#include > +#include > + > + > +typedef struct ISCSILUN { > + =C2=A0 =C2=A0struct iscsi_context *iscsi; > + =C2=A0 =C2=A0int lun; > + =C2=A0 =C2=A0int block_size; > + =C2=A0 =C2=A0unsigned long num_blocks; > +} ISCSILUN; > + > +typedef struct ISCSIAIOCB { > + =C2=A0 =C2=A0BlockDriverAIOCB common; > + =C2=A0 =C2=A0QEMUIOVector *qiov; > + =C2=A0 =C2=A0QEMUBH *bh; > + =C2=A0 =C2=A0ISCSILUN *iscsilun; > + =C2=A0 =C2=A0int canceled; > + =C2=A0 =C2=A0int status; > + =C2=A0 =C2=A0size_t read_size; > +} ISCSIAIOCB; > + > +struct iscsi_task { > + =C2=A0 =C2=A0ISCSILUN *iscsilun; > + =C2=A0 =C2=A0int status; > + =C2=A0 =C2=A0int complete; > +}; Please see CODING_STYLE for struct naming and use of typedefs. > + > +static int > +iscsi_is_inserted(BlockDriverState *bs) > +{ > + =C2=A0 =C2=A0ISCSILUN *iscsilun =3D bs->opaque; > + =C2=A0 =C2=A0struct iscsi_context *iscsi =3D iscsilun->iscsi; > + > + =C2=A0 =C2=A0return iscsi_is_logged_in(iscsi); > +} > + > + > +static void > +iscsi_aio_cancel(BlockDriverAIOCB *blockacb) > +{ > + =C2=A0 =C2=A0ISCSIAIOCB *acb =3D (ISCSIAIOCB *)blockacb; > + > + =C2=A0 =C2=A0acb->status =3D -EIO; > + =C2=A0 =C2=A0acb->common.cb(acb->common.opaque, acb->status); > + =C2=A0 =C2=A0acb->canceled =3D 1; > +} > + > +static AIOPool iscsi_aio_pool =3D { > + =C2=A0 =C2=A0.aiocb_size =C2=A0 =C2=A0 =C2=A0 =C2=A0 =3D sizeof(ISCSIAI= OCB), > + =C2=A0 =C2=A0.cancel =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =3D iscs= i_aio_cancel, > +}; > + > + > +static void iscsi_process_read(void *arg); > +static void iscsi_process_write(void *arg); > + > +static void > +iscsi_set_events(ISCSILUN *iscsilun) > +{ > + =C2=A0 =C2=A0struct iscsi_context *iscsi =3D iscsilun->iscsi; > + > + =C2=A0 =C2=A0qemu_aio_set_fd_handler(iscsi_get_fd(iscsi), iscsi_process= _read, > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 (iscsi_which_events(iscsi)&POLLOUT) Please insert space around operators. > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 ?iscsi_process_write:NULL, Also around ?:. > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 NULL, NULL, iscsilun); > +} > + > +static void > +iscsi_process_read(void *arg) > +{ > + =C2=A0 =C2=A0ISCSILUN *iscsilun =3D arg; > + =C2=A0 =C2=A0struct iscsi_context *iscsi =3D iscsilun->iscsi; > + > + =C2=A0 =C2=A0iscsi_service(iscsi, POLLIN); > + =C2=A0 =C2=A0iscsi_set_events(iscsilun); > +} > + > +static void > +iscsi_process_write(void *arg) > +{ > + =C2=A0 =C2=A0ISCSILUN *iscsilun =3D arg; > + =C2=A0 =C2=A0struct iscsi_context *iscsi =3D iscsilun->iscsi; > + > + =C2=A0 =C2=A0iscsi_service(iscsi, POLLOUT); > + =C2=A0 =C2=A0iscsi_set_events(iscsilun); > +} > + > + > +static int > +iscsi_schedule_bh(QEMUBHFunc *cb, ISCSIAIOCB *acb) > +{ > + =C2=A0 =C2=A0acb->bh =3D qemu_bh_new(cb, acb); > + =C2=A0 =C2=A0if (!acb->bh) { > + =C2=A0 =C2=A0 =C2=A0 error_report("oom: could not create iscsi bh"); > + =C2=A0 =C2=A0 =C2=A0 return -EIO; > + =C2=A0 =C2=A0} > + > + =C2=A0 =C2=A0qemu_bh_schedule(acb->bh); > + =C2=A0 =C2=A0return 0; > +} > + > +static void > +iscsi_readv_writev_bh_cb(void *p) > +{ > + =C2=A0 =C2=A0ISCSIAIOCB *acb =3D p; > + > + =C2=A0 =C2=A0acb->common.cb(acb->common.opaque, acb->status); > + =C2=A0 =C2=A0qemu_aio_release(acb); > +} > + > +static void > +iscsi_aio_write10_cb(struct iscsi_context *iscsi, int status, > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0vo= id *command_data, void *private_data) > +{ > + =C2=A0 =C2=A0ISCSIAIOCB *acb =3D private_data; > + > + =C2=A0 =C2=A0if (acb->canceled !=3D 0) { > + =C2=A0 =C2=A0 =C2=A0 qemu_aio_release(acb); > + =C2=A0 =C2=A0 =C2=A0 return; > + =C2=A0 =C2=A0} > + > + =C2=A0 =C2=A0acb->status =3D 0; > + =C2=A0 =C2=A0if (status < 0) { > + =C2=A0 =C2=A0 =C2=A0 error_report("Failed to write10 data to iSCSI lun.= %s", > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0is= csi_get_error(iscsi)); > + =C2=A0 =C2=A0 =C2=A0 acb->status =3D -EIO; > + =C2=A0 =C2=A0} > + > + =C2=A0 =C2=A0iscsi_schedule_bh(iscsi_readv_writev_bh_cb, acb); > +} > + > +static BlockDriverAIOCB * > +iscsi_aio_writev(BlockDriverState *bs, int64_t sector_num, > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0QEMUIOVector *qi= ov, int nb_sectors, > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0BlockDriverCompl= etionFunc *cb, > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0void *opaque) > +{ > + =C2=A0 =C2=A0ISCSILUN *iscsilun =3D bs->opaque; > + =C2=A0 =C2=A0struct iscsi_context *iscsi =3D iscsilun->iscsi; > + =C2=A0 =C2=A0ISCSIAIOCB *acb; > + =C2=A0 =C2=A0size_t size; > + =C2=A0 =C2=A0unsigned char *buf; Why unsigned? Maybe uint8_t or plain char instead? > + > + =C2=A0 =C2=A0acb =3D qemu_aio_get(&iscsi_aio_pool, bs, cb, opaque); > + =C2=A0 =C2=A0if (!acb) { > + =C2=A0 =C2=A0 =C2=A0 return NULL; > + =C2=A0 =C2=A0} > + > + =C2=A0 =C2=A0acb->iscsilun =3D iscsilun; > + =C2=A0 =C2=A0acb->qiov =C2=A0 =C2=A0 =3D qiov; > + > + =C2=A0 =C2=A0acb->canceled =C2=A0 =3D 0; > + > + =C2=A0 =C2=A0/* XXX we should pass the iovec to write10 to avoid the ex= tra copy */ > + =C2=A0 =C2=A0/* this will allow us to get rid of 'buf' completely */ > + =C2=A0 =C2=A0size =3D nb_sectors * BDRV_SECTOR_SIZE; > + =C2=A0 =C2=A0buf =3D qemu_malloc(size); > + =C2=A0 =C2=A0qemu_iovec_to_buffer(acb->qiov, buf); > + =C2=A0 =C2=A0if (iscsi_write10_async(iscsi, iscsilun->lun, buf, size, > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 sector_num * BDRV_SECTOR_SIZE > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 / iscsilun->block_size, > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 0, 0, iscsilun->block_size, > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 iscsi_aio_write10_cb, acb) !=3D 0) { When the function call is this long, perhaps it would be more readable to assign a temporary variable with the result and use that in if expression. The expression sector_num * BDRV_SECTOR_SIZE / iscsilun->block_size is used often, refactoring this to a function could make the code a bit clearer. > + =C2=A0 =C2=A0 =C2=A0 error_report("iSCSI: Failed to send write10 comman= d. %s", > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0is= csi_get_error(iscsi)); > + =C2=A0 =C2=A0 =C2=A0 qemu_free(buf); > + =C2=A0 =C2=A0 =C2=A0 qemu_aio_release(acb); > + =C2=A0 =C2=A0 =C2=A0 return NULL; > + =C2=A0 =C2=A0} > + =C2=A0 =C2=A0qemu_free(buf); > + =C2=A0 =C2=A0iscsi_set_events(iscsilun); > + > + =C2=A0 =C2=A0return &acb->common; > +} > + > +static void > +iscsi_aio_read10_cb(struct iscsi_context *iscsi, int status, > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 void *co= mmand_data, void *private_data) > +{ > + =C2=A0 =C2=A0ISCSIAIOCB *acb =3D private_data; > + =C2=A0 =C2=A0struct scsi_task *scsi =3D command_data; > + > + =C2=A0 =C2=A0if (acb->canceled !=3D 0) { > + =C2=A0 =C2=A0 =C2=A0 qemu_aio_release(acb); > + =C2=A0 =C2=A0 =C2=A0 return; > + =C2=A0 =C2=A0} > + > + =C2=A0 =C2=A0acb->status =3D 0; > + =C2=A0 =C2=A0if (status < 0) { > + =C2=A0 =C2=A0 =C2=A0 error_report("Failed to read10 data from iSCSI lun= . %s", > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0is= csi_get_error(iscsi)); > + =C2=A0 =C2=A0 =C2=A0 acb->status =3D -EIO; > + =C2=A0 =C2=A0} else { > + =C2=A0 =C2=A0 =C2=A0 qemu_iovec_from_buffer(acb->qiov, scsi->datain.dat= a, acb->read_size); > + =C2=A0 =C2=A0} > + > + =C2=A0 =C2=A0iscsi_schedule_bh(iscsi_readv_writev_bh_cb, acb); > +} > + > +static BlockDriverAIOCB * > +iscsi_aio_readv(BlockDriverState *bs, int64_t sector_num, > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 QEMUIOVector *qiov, in= t nb_sectors, > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 BlockDriverCompletionF= unc *cb, > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 void *opaque) > +{ > + =C2=A0 =C2=A0ISCSILUN *iscsilun =3D bs->opaque; > + =C2=A0 =C2=A0struct iscsi_context *iscsi =3D iscsilun->iscsi; > + =C2=A0 =C2=A0ISCSIAIOCB *acb; > + =C2=A0 =C2=A0size_t qemu_read_size, lun_read_size; > + > + =C2=A0 =C2=A0qemu_read_size =3D BDRV_SECTOR_SIZE * (size_t)nb_sectors; > + =C2=A0 =C2=A0lun_read_size =C2=A0=3D (qemu_read_size + iscsilun->block_= size - 1) > + =C2=A0 =C2=A0 =C2=A0/ iscsilun->block_size * iscsilun->block_size; > + > + =C2=A0 =C2=A0acb =3D qemu_aio_get(&iscsi_aio_pool, bs, cb, opaque); > + =C2=A0 =C2=A0if (!acb) { > + =C2=A0 =C2=A0 =C2=A0 return NULL; > + =C2=A0 =C2=A0} > + > + =C2=A0 =C2=A0acb->iscsilun =3D iscsilun; > + =C2=A0 =C2=A0acb->qiov =C2=A0 =C2=A0 =3D qiov; > + > + =C2=A0 =C2=A0acb->canceled =C2=A0 =3D 0; > + =C2=A0 =C2=A0acb->read_size =C2=A0=3D qemu_read_size; > + > + =C2=A0 =C2=A0if (iscsi_read10_async(iscsi, iscsilun->lun, > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0sector_num * BDRV_SECTOR_SIZE > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0/ iscsilun->block_size, > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0lun_read_size, iscsilun->block_size, > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0iscsi_aio_read10_cb, acb) !=3D 0) { > + =C2=A0 =C2=A0 =C2=A0 error_report("iSCSI: Failed to send read10 command= . %s", > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0is= csi_get_error(iscsi)); > + =C2=A0 =C2=A0 =C2=A0 qemu_aio_release(acb); > + =C2=A0 =C2=A0 =C2=A0 return NULL; > + =C2=A0 =C2=A0} > + =C2=A0 =C2=A0iscsi_set_events(iscsilun); > + > + =C2=A0 =C2=A0return &acb->common; > +} > + > + > +static void synccache10_cb(struct iscsi_context *iscsi, int status, > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0void *command_data, void *private_data) Usually 'opaque' is used instead of 'private_data'. > +{ > + =C2=A0 =C2=A0struct iscsi_task *task =3D private_data; > + > + =C2=A0 =C2=A0task->status =C2=A0 =3D status; > + =C2=A0 =C2=A0task->complete =3D 1; > +} > + > +static int > +iscsi_flush(BlockDriverState *bs) > +{ > + =C2=A0 =C2=A0ISCSILUN *iscsilun =3D bs->opaque; > + =C2=A0 =C2=A0struct iscsi_context *iscsi =3D iscsilun->iscsi; > + =C2=A0 =C2=A0struct iscsi_task task; > + > + =C2=A0 =C2=A0task.iscsilun =3D iscsilun; > + =C2=A0 =C2=A0task.status =3D 0; > + =C2=A0 =C2=A0task.complete =3D 0; > + > + =C2=A0 =C2=A0if (iscsi_synchronizecache10_async(iscsi, iscsilun->lun, > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00, 0, 0, 0, > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0synccache10_c= b, > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&task) !=3D 0= ) { > + =C2=A0 =C2=A0 =C2=A0 error_report("iSCSI: Failed to send SYNCHRONIZECAC= HE10. %s", > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0is= csi_get_error(iscsi)); > + =C2=A0 =C2=A0 =C2=A0 =C2=A0return -1; > + =C2=A0 =C2=A0} > + > + =C2=A0 =C2=A0async_context_push(); > + =C2=A0 =C2=A0while (!task.complete) { > + =C2=A0 =C2=A0 =C2=A0 iscsi_set_events(iscsilun); > + =C2=A0 =C2=A0 =C2=A0 qemu_aio_wait(); > + =C2=A0 =C2=A0} > + =C2=A0 =C2=A0async_context_pop(); > + =C2=A0 =C2=A0if (task.status !=3D 0) { > + =C2=A0 =C2=A0 =C2=A0 error_report("iSCSI: Failed to send SYNCHRONIZECAC= HE10: %s", > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0is= csi_get_error(iscsi)); > + =C2=A0 =C2=A0 =C2=A0 return -EIO; > + =C2=A0 =C2=A0} > + > + =C2=A0 =C2=A0return 0; > +} > + > +static int64_t > +iscsi_getlength(BlockDriverState *bs) > +{ > + =C2=A0 =C2=A0ISCSILUN *iscsilun =3D bs->opaque; > + =C2=A0 =C2=A0int64_t len; > + > + =C2=A0 =C2=A0len =C2=A0=3D iscsilun->num_blocks; > + =C2=A0 =C2=A0len *=3D iscsilun->block_size; > + > + =C2=A0 =C2=A0return len; > +} > + > +static void > +iscsi_readcapacity10_cb(struct iscsi_context *iscsi, int status, > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 void *command_data, void *private_data) > +{ > + =C2=A0 =C2=A0struct iscsi_task *task =3D private_data; > + =C2=A0 =C2=A0struct scsi_readcapacity10 *rc10; > + =C2=A0 =C2=A0struct scsi_task *scsi =3D command_data; > + > + =C2=A0 =C2=A0if (status !=3D 0) { > + =C2=A0 =C2=A0 =C2=A0 error_report("iSCSI: Failed to read capacity of iS= CSI lun. %s", > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0is= csi_get_error(iscsi)); > + =C2=A0 =C2=A0 =C2=A0 task->status =C2=A0 =3D 1; > + =C2=A0 =C2=A0 =C2=A0 task->complete =3D 1; > + =C2=A0 =C2=A0 =C2=A0 return; > + =C2=A0 =C2=A0} > + > + =C2=A0 =C2=A0rc10 =3D scsi_datain_unmarshall(scsi); > + =C2=A0 =C2=A0if (rc10 =3D=3D NULL) { > + =C2=A0 =C2=A0 =C2=A0 error_report("iSCSI: Failed to unmarshall readcapa= city10 data."); > + =C2=A0 =C2=A0 =C2=A0 task->status =C2=A0 =3D 1; > + =C2=A0 =C2=A0 =C2=A0 task->complete =3D 1; > + =C2=A0 =C2=A0 =C2=A0 return; > + =C2=A0 =C2=A0} > + > + =C2=A0 =C2=A0task->iscsilun->block_size =3D rc10->block_size; > + =C2=A0 =C2=A0task->iscsilun->num_blocks =3D rc10->lba; > + > + =C2=A0 =C2=A0task->status =C2=A0 =3D 0; > + =C2=A0 =C2=A0task->complete =3D 1; > +} > + > + > +static void > +iscsi_connect_cb(struct iscsi_context *iscsi, int status, void *command_= data, > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0void *private_da= ta) > +{ > + =C2=A0 =C2=A0struct iscsi_task *task =3D private_data; > + > + =C2=A0 =C2=A0if (status !=3D 0) { > + =C2=A0 =C2=A0 =C2=A0 task->status =C2=A0 =3D 1; > + =C2=A0 =C2=A0 =C2=A0 task->complete =3D 1; > + =C2=A0 =C2=A0 =C2=A0 return; > + =C2=A0 =C2=A0} > + > + =C2=A0 =C2=A0if (iscsi_readcapacity10_async(iscsi, task->iscsilun->lun,= 0, 0, > + =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0iscsi_readcapacity10_cb, pr= ivate_data) > + =C2=A0 =C2=A0 =C2=A0 !=3D 0) { > + =C2=A0 =C2=A0 =C2=A0 error_report("iSCSI: failed to send readcapacity c= ommand."); > + =C2=A0 =C2=A0 =C2=A0 task->status =C2=A0 =3D 1; > + =C2=A0 =C2=A0 =C2=A0 task->complete =3D 1; > + =C2=A0 =C2=A0} > +} > + > +/* > + * We support iscsi url's on the form > + * iscsi://[:]// > + */ > +static int iscsi_open(BlockDriverState *bs, const char *filename, int fl= ags) > +{ > + =C2=A0 =C2=A0ISCSILUN *iscsilun =3D bs->opaque; > + =C2=A0 =C2=A0struct iscsi_context *iscsi =3D NULL; > + =C2=A0 =C2=A0struct iscsi_task task; > + =C2=A0 =C2=A0char *ptr, *host, *target, *url; > + =C2=A0 =C2=A0char *tmp; > + =C2=A0 =C2=A0int ret, lun; > + > + =C2=A0 =C2=A0bzero(iscsilun, sizeof(ISCSILUN)); memset() > + > + =C2=A0 =C2=A0url =3D qemu_strdup(filename); > + > + =C2=A0 =C2=A0if (strncmp(url, "iscsi://", 8)) { > + =C2=A0 =C2=A0 =C2=A0 error_report("iSCSI: url does not start with 'iscs= i://'"); > + =C2=A0 =C2=A0 =C2=A0 ret =3D -EINVAL; > + =C2=A0 =C2=A0 =C2=A0 goto failed; > + =C2=A0 =C2=A0} > + > + =C2=A0 =C2=A0host =3D url + 8; > + > + =C2=A0 =C2=A0ptr =3D index(host, '/'); strchr() From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=39457 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PUm8z-0007po-Tu for qemu-devel@nongnu.org; Mon, 20 Dec 2010 15:15:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PUm8x-0002Fo-CO for qemu-devel@nongnu.org; Mon, 20 Dec 2010 15:15:41 -0500 Received: from mail-qy0-f180.google.com ([209.85.216.180]:40581) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PUm8x-0002FW-0m for qemu-devel@nongnu.org; Mon, 20 Dec 2010 15:15:39 -0500 Received: by qyk29 with SMTP id 29so3346316qyk.4 for ; Mon, 20 Dec 2010 12:15:37 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <1292227550-6338-1-git-send-email-ronniesahlberg@gmail.com> <1292227550-6338-2-git-send-email-ronniesahlberg@gmail.com> Date: Tue, 21 Dec 2010 07:15:37 +1100 Message-ID: Subject: Re: [Qemu-devel] [PATCH] libiscsi From: ronnie sahlberg Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel@nongnu.org Thanks. I have implemented all of your suggestions and will submit version 2 of the patch shortly. regards ronnie sahlberg On Tue, Dec 14, 2010 at 7:47 AM, Blue Swirl wrote: > On Mon, Dec 13, 2010 at 8:05 AM, Ronnie Sahlberg > wrote: >> This patch adds a new block driver : block.iscsi.c >> This driver interfaces with the multiplatform posix library >> for iscsi initiator/client access to iscsi devices hosted at >> git://github.com/sahlberg/libiscsi.git >> >> The patch adds the driver to interface with the iscsi library. >> It also updated the configure script to >> * by default, probe is libiscsi is available and if so, build >> =A0qemu against libiscsi. >> * --enable-libiscsi >> =A0Force a build against libiscsi. If libiscsi is not available >> =A0the build will fail. >> * --disable-libiscsi >> =A0Do not link against libiscsi, even if it is available. >> >> When linked with libiscsi, qemu gains support to access iscsi resources >> such as disks and cdrom directly, without having to make the devices vis= ible >> to the host. >> >> You can specify devices using a iscsi url of the form : >> iscsi://[:/ >> >> Example: >> -drive file=3Discsi://10.1.1.1:3260/iqn.ronnie.test/1 >> >> -cdrom iscsi://10.1.1.1:3260/iqn.ronnie.test/2 >> >> Signed-off-by: Ronnie Sahlberg >> --- >> =A0Makefile.objs | =A0 =A02 +- >> =A0block/iscsi.c | =A0528 ++++++++++++++++++++++++++++++++++++++++++++++= +++++++++++ >> =A0configure =A0 =A0 | =A0 29 +++ >> =A03 files changed, 558 insertions(+), 1 deletions(-) >> =A0create mode 100644 block/iscsi.c >> >> diff --git a/Makefile.objs b/Makefile.objs >> index cebb945..81731c5 100644 >> --- a/Makefile.objs >> +++ b/Makefile.objs >> @@ -22,7 +22,7 @@ block-nested-y +=3D raw.o cow.o qcow.o vdi.o vmdk.o cl= oop.o dmg.o bochs.o vpc.o vv >> =A0block-nested-y +=3D qcow2.o qcow2-refcount.o qcow2-cluster.o qcow2-sn= apshot.o >> =A0block-nested-y +=3D parallels.o nbd.o blkdebug.o sheepdog.o blkverify= .o >> =A0block-nested-$(CONFIG_WIN32) +=3D raw-win32.o >> -block-nested-$(CONFIG_POSIX) +=3D raw-posix.o >> +block-nested-$(CONFIG_POSIX) +=3D raw-posix.o iscsi.o > > Please use CONFIG_ISCSI... > >> =A0block-nested-$(CONFIG_CURL) +=3D curl.o >> >> =A0block-obj-y +=3D =A0$(addprefix block/, $(block-nested-y)) >> diff --git a/block/iscsi.c b/block/iscsi.c >> new file mode 100644 >> index 0000000..fba5ee6 >> --- /dev/null >> +++ b/block/iscsi.c >> @@ -0,0 +1,528 @@ >> +/* >> + * QEMU Block driver for iSCSI images >> + * >> + * Copyright (c) 2010 Ronnie Sahlberg >> + * >> + * Permission is hereby granted, free of charge, to any person obtainin= g a copy >> + * of this software and associated documentation files (the "Software")= , to deal >> + * in the Software without restriction, including without limitation th= e rights >> + * to use, copy, modify, merge, publish, distribute, sublicense, and/or= sell >> + * copies of the Software, and to permit persons to whom the Software i= s >> + * furnished to do so, subject to the following conditions: >> + * >> + * The above copyright notice and this permission notice shall be inclu= ded in >> + * all copies or substantial portions of the Software. >> + * >> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPR= ESS OR >> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL= ITY, >> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SH= ALL >> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR= OTHER >> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARIS= ING FROM, >> + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALIN= GS IN >> + * THE SOFTWARE. >> + */ >> + >> +#include "config-host.h" >> +#ifdef CONFIG_LIBISCSI > > ... then this is not needed. > >> + >> +#include >> +#include "sysemu.h" >> +#include "qemu-common.h" >> +#include "qemu-error.h" >> +#include "block_int.h" >> + >> +#include >> +#include >> + >> + >> +typedef struct ISCSILUN { >> + =A0 =A0struct iscsi_context *iscsi; >> + =A0 =A0int lun; >> + =A0 =A0int block_size; >> + =A0 =A0unsigned long num_blocks; >> +} ISCSILUN; >> + >> +typedef struct ISCSIAIOCB { >> + =A0 =A0BlockDriverAIOCB common; >> + =A0 =A0QEMUIOVector *qiov; >> + =A0 =A0QEMUBH *bh; >> + =A0 =A0ISCSILUN *iscsilun; >> + =A0 =A0int canceled; >> + =A0 =A0int status; >> + =A0 =A0size_t read_size; >> +} ISCSIAIOCB; >> + >> +struct iscsi_task { >> + =A0 =A0ISCSILUN *iscsilun; >> + =A0 =A0int status; >> + =A0 =A0int complete; >> +}; > > Please see CODING_STYLE for struct naming and use of typedefs. > >> + >> +static int >> +iscsi_is_inserted(BlockDriverState *bs) >> +{ >> + =A0 =A0ISCSILUN *iscsilun =3D bs->opaque; >> + =A0 =A0struct iscsi_context *iscsi =3D iscsilun->iscsi; >> + >> + =A0 =A0return iscsi_is_logged_in(iscsi); >> +} >> + >> + >> +static void >> +iscsi_aio_cancel(BlockDriverAIOCB *blockacb) >> +{ >> + =A0 =A0ISCSIAIOCB *acb =3D (ISCSIAIOCB *)blockacb; >> + >> + =A0 =A0acb->status =3D -EIO; >> + =A0 =A0acb->common.cb(acb->common.opaque, acb->status); >> + =A0 =A0acb->canceled =3D 1; >> +} >> + >> +static AIOPool iscsi_aio_pool =3D { >> + =A0 =A0.aiocb_size =A0 =A0 =A0 =A0 =3D sizeof(ISCSIAIOCB), >> + =A0 =A0.cancel =A0 =A0 =A0 =A0 =A0 =A0 =3D iscsi_aio_cancel, >> +}; >> + >> + >> +static void iscsi_process_read(void *arg); >> +static void iscsi_process_write(void *arg); >> + >> +static void >> +iscsi_set_events(ISCSILUN *iscsilun) >> +{ >> + =A0 =A0struct iscsi_context *iscsi =3D iscsilun->iscsi; >> + >> + =A0 =A0qemu_aio_set_fd_handler(iscsi_get_fd(iscsi), iscsi_process_read= , >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (iscsi_which_event= s(iscsi)&POLLOUT) > > Please insert space around operators. > >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 ?iscsi_process_wri= te:NULL, > > Also around ?:. > >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 NULL, NULL, iscsil= un); >> +} >> + >> +static void >> +iscsi_process_read(void *arg) >> +{ >> + =A0 =A0ISCSILUN *iscsilun =3D arg; >> + =A0 =A0struct iscsi_context *iscsi =3D iscsilun->iscsi; >> + >> + =A0 =A0iscsi_service(iscsi, POLLIN); >> + =A0 =A0iscsi_set_events(iscsilun); >> +} >> + >> +static void >> +iscsi_process_write(void *arg) >> +{ >> + =A0 =A0ISCSILUN *iscsilun =3D arg; >> + =A0 =A0struct iscsi_context *iscsi =3D iscsilun->iscsi; >> + >> + =A0 =A0iscsi_service(iscsi, POLLOUT); >> + =A0 =A0iscsi_set_events(iscsilun); >> +} >> + >> + >> +static int >> +iscsi_schedule_bh(QEMUBHFunc *cb, ISCSIAIOCB *acb) >> +{ >> + =A0 =A0acb->bh =3D qemu_bh_new(cb, acb); >> + =A0 =A0if (!acb->bh) { >> + =A0 =A0 =A0 error_report("oom: could not create iscsi bh"); >> + =A0 =A0 =A0 return -EIO; >> + =A0 =A0} >> + >> + =A0 =A0qemu_bh_schedule(acb->bh); >> + =A0 =A0return 0; >> +} >> + >> +static void >> +iscsi_readv_writev_bh_cb(void *p) >> +{ >> + =A0 =A0ISCSIAIOCB *acb =3D p; >> + >> + =A0 =A0acb->common.cb(acb->common.opaque, acb->status); >> + =A0 =A0qemu_aio_release(acb); >> +} >> + >> +static void >> +iscsi_aio_write10_cb(struct iscsi_context *iscsi, int status, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0void *command_data, void *priva= te_data) >> +{ >> + =A0 =A0ISCSIAIOCB *acb =3D private_data; >> + >> + =A0 =A0if (acb->canceled !=3D 0) { >> + =A0 =A0 =A0 qemu_aio_release(acb); >> + =A0 =A0 =A0 return; >> + =A0 =A0} >> + >> + =A0 =A0acb->status =3D 0; >> + =A0 =A0if (status < 0) { >> + =A0 =A0 =A0 error_report("Failed to write10 data to iSCSI lun. %s", >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0iscsi_get_error(iscsi)); >> + =A0 =A0 =A0 acb->status =3D -EIO; >> + =A0 =A0} >> + >> + =A0 =A0iscsi_schedule_bh(iscsi_readv_writev_bh_cb, acb); >> +} >> + >> +static BlockDriverAIOCB * >> +iscsi_aio_writev(BlockDriverState *bs, int64_t sector_num, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0QEMUIOVector *qiov, int nb_sectors, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0BlockDriverCompletionFunc *cb, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0void *opaque) >> +{ >> + =A0 =A0ISCSILUN *iscsilun =3D bs->opaque; >> + =A0 =A0struct iscsi_context *iscsi =3D iscsilun->iscsi; >> + =A0 =A0ISCSIAIOCB *acb; >> + =A0 =A0size_t size; >> + =A0 =A0unsigned char *buf; > > Why unsigned? Maybe uint8_t or plain char instead? > >> + >> + =A0 =A0acb =3D qemu_aio_get(&iscsi_aio_pool, bs, cb, opaque); >> + =A0 =A0if (!acb) { >> + =A0 =A0 =A0 return NULL; >> + =A0 =A0} >> + >> + =A0 =A0acb->iscsilun =3D iscsilun; >> + =A0 =A0acb->qiov =A0 =A0 =3D qiov; >> + >> + =A0 =A0acb->canceled =A0 =3D 0; >> + >> + =A0 =A0/* XXX we should pass the iovec to write10 to avoid the extra c= opy */ >> + =A0 =A0/* this will allow us to get rid of 'buf' completely */ >> + =A0 =A0size =3D nb_sectors * BDRV_SECTOR_SIZE; >> + =A0 =A0buf =3D qemu_malloc(size); >> + =A0 =A0qemu_iovec_to_buffer(acb->qiov, buf); >> + =A0 =A0if (iscsi_write10_async(iscsi, iscsilun->lun, buf, size, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 sector_num * BDRV_= SECTOR_SIZE >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 / iscsilun->block_= size, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 0, 0, iscsilun->bl= ock_size, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 iscsi_aio_write10_= cb, acb) !=3D 0) { > > When the function call is this long, perhaps it would be more readable > to assign a temporary variable with the result and use that in if > expression. > > The expression sector_num * BDRV_SECTOR_SIZE / iscsilun->block_size is > used often, refactoring this to a function could make the code a bit > clearer. > >> + =A0 =A0 =A0 error_report("iSCSI: Failed to send write10 command. %s", >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0iscsi_get_error(iscsi)); >> + =A0 =A0 =A0 qemu_free(buf); >> + =A0 =A0 =A0 qemu_aio_release(acb); >> + =A0 =A0 =A0 return NULL; >> + =A0 =A0} >> + =A0 =A0qemu_free(buf); >> + =A0 =A0iscsi_set_events(iscsilun); >> + >> + =A0 =A0return &acb->common; >> +} >> + >> +static void >> +iscsi_aio_read10_cb(struct iscsi_context *iscsi, int status, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 void *command_data, void *private_= data) >> +{ >> + =A0 =A0ISCSIAIOCB *acb =3D private_data; >> + =A0 =A0struct scsi_task *scsi =3D command_data; >> + >> + =A0 =A0if (acb->canceled !=3D 0) { >> + =A0 =A0 =A0 qemu_aio_release(acb); >> + =A0 =A0 =A0 return; >> + =A0 =A0} >> + >> + =A0 =A0acb->status =3D 0; >> + =A0 =A0if (status < 0) { >> + =A0 =A0 =A0 error_report("Failed to read10 data from iSCSI lun. %s", >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0iscsi_get_error(iscsi)); >> + =A0 =A0 =A0 acb->status =3D -EIO; >> + =A0 =A0} else { >> + =A0 =A0 =A0 qemu_iovec_from_buffer(acb->qiov, scsi->datain.data, acb->= read_size); >> + =A0 =A0} >> + >> + =A0 =A0iscsi_schedule_bh(iscsi_readv_writev_bh_cb, acb); >> +} >> + >> +static BlockDriverAIOCB * >> +iscsi_aio_readv(BlockDriverState *bs, int64_t sector_num, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 QEMUIOVector *qiov, int nb_sectors, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 BlockDriverCompletionFunc *cb, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 void *opaque) >> +{ >> + =A0 =A0ISCSILUN *iscsilun =3D bs->opaque; >> + =A0 =A0struct iscsi_context *iscsi =3D iscsilun->iscsi; >> + =A0 =A0ISCSIAIOCB *acb; >> + =A0 =A0size_t qemu_read_size, lun_read_size; >> + >> + =A0 =A0qemu_read_size =3D BDRV_SECTOR_SIZE * (size_t)nb_sectors; >> + =A0 =A0lun_read_size =A0=3D (qemu_read_size + iscsilun->block_size - 1= ) >> + =A0 =A0 =A0/ iscsilun->block_size * iscsilun->block_size; >> + >> + =A0 =A0acb =3D qemu_aio_get(&iscsi_aio_pool, bs, cb, opaque); >> + =A0 =A0if (!acb) { >> + =A0 =A0 =A0 return NULL; >> + =A0 =A0} >> + >> + =A0 =A0acb->iscsilun =3D iscsilun; >> + =A0 =A0acb->qiov =A0 =A0 =3D qiov; >> + >> + =A0 =A0acb->canceled =A0 =3D 0; >> + =A0 =A0acb->read_size =A0=3D qemu_read_size; >> + >> + =A0 =A0if (iscsi_read10_async(iscsi, iscsilun->lun, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0sector_num * BDRV_S= ECTOR_SIZE >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0/ iscsilun->block_s= ize, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0lun_read_size, iscs= ilun->block_size, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0iscsi_aio_read10_cb= , acb) !=3D 0) { >> + =A0 =A0 =A0 error_report("iSCSI: Failed to send read10 command. %s", >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0iscsi_get_error(iscsi)); >> + =A0 =A0 =A0 qemu_aio_release(acb); >> + =A0 =A0 =A0 return NULL; >> + =A0 =A0} >> + =A0 =A0iscsi_set_events(iscsilun); >> + >> + =A0 =A0return &acb->common; >> +} >> + >> + >> +static void synccache10_cb(struct iscsi_context *iscsi, int status, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0void *command_data,= void *private_data) > > Usually 'opaque' is used instead of 'private_data'. > >> +{ >> + =A0 =A0struct iscsi_task *task =3D private_data; >> + >> + =A0 =A0task->status =A0 =3D status; >> + =A0 =A0task->complete =3D 1; >> +} >> + >> +static int >> +iscsi_flush(BlockDriverState *bs) >> +{ >> + =A0 =A0ISCSILUN *iscsilun =3D bs->opaque; >> + =A0 =A0struct iscsi_context *iscsi =3D iscsilun->iscsi; >> + =A0 =A0struct iscsi_task task; >> + >> + =A0 =A0task.iscsilun =3D iscsilun; >> + =A0 =A0task.status =3D 0; >> + =A0 =A0task.complete =3D 0; >> + >> + =A0 =A0if (iscsi_synchronizecache10_async(iscsi, iscsilun->lun, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A00, 0, 0, 0, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0synccache10_cb, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0&task) !=3D 0) { >> + =A0 =A0 =A0 error_report("iSCSI: Failed to send SYNCHRONIZECACHE10. %s= ", >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0iscsi_get_error(iscsi)); >> + =A0 =A0 =A0 =A0return -1; >> + =A0 =A0} >> + >> + =A0 =A0async_context_push(); >> + =A0 =A0while (!task.complete) { >> + =A0 =A0 =A0 iscsi_set_events(iscsilun); >> + =A0 =A0 =A0 qemu_aio_wait(); >> + =A0 =A0} >> + =A0 =A0async_context_pop(); >> + =A0 =A0if (task.status !=3D 0) { >> + =A0 =A0 =A0 error_report("iSCSI: Failed to send SYNCHRONIZECACHE10: %s= ", >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0iscsi_get_error(iscsi)); >> + =A0 =A0 =A0 return -EIO; >> + =A0 =A0} >> + >> + =A0 =A0return 0; >> +} >> + >> +static int64_t >> +iscsi_getlength(BlockDriverState *bs) >> +{ >> + =A0 =A0ISCSILUN *iscsilun =3D bs->opaque; >> + =A0 =A0int64_t len; >> + >> + =A0 =A0len =A0=3D iscsilun->num_blocks; >> + =A0 =A0len *=3D iscsilun->block_size; >> + >> + =A0 =A0return len; >> +} >> + >> +static void >> +iscsi_readcapacity10_cb(struct iscsi_context *iscsi, int status, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 void *command_data, void *= private_data) >> +{ >> + =A0 =A0struct iscsi_task *task =3D private_data; >> + =A0 =A0struct scsi_readcapacity10 *rc10; >> + =A0 =A0struct scsi_task *scsi =3D command_data; >> + >> + =A0 =A0if (status !=3D 0) { >> + =A0 =A0 =A0 error_report("iSCSI: Failed to read capacity of iSCSI lun.= %s", >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0iscsi_get_error(iscsi)); >> + =A0 =A0 =A0 task->status =A0 =3D 1; >> + =A0 =A0 =A0 task->complete =3D 1; >> + =A0 =A0 =A0 return; >> + =A0 =A0} >> + >> + =A0 =A0rc10 =3D scsi_datain_unmarshall(scsi); >> + =A0 =A0if (rc10 =3D=3D NULL) { >> + =A0 =A0 =A0 error_report("iSCSI: Failed to unmarshall readcapacity10 d= ata."); >> + =A0 =A0 =A0 task->status =A0 =3D 1; >> + =A0 =A0 =A0 task->complete =3D 1; >> + =A0 =A0 =A0 return; >> + =A0 =A0} >> + >> + =A0 =A0task->iscsilun->block_size =3D rc10->block_size; >> + =A0 =A0task->iscsilun->num_blocks =3D rc10->lba; >> + >> + =A0 =A0task->status =A0 =3D 0; >> + =A0 =A0task->complete =3D 1; >> +} >> + >> + >> +static void >> +iscsi_connect_cb(struct iscsi_context *iscsi, int status, void *command= _data, >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0void *private_data) >> +{ >> + =A0 =A0struct iscsi_task *task =3D private_data; >> + >> + =A0 =A0if (status !=3D 0) { >> + =A0 =A0 =A0 task->status =A0 =3D 1; >> + =A0 =A0 =A0 task->complete =3D 1; >> + =A0 =A0 =A0 return; >> + =A0 =A0} >> + >> + =A0 =A0if (iscsi_readcapacity10_async(iscsi, task->iscsilun->lun, 0, 0= , >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0isc= si_readcapacity10_cb, private_data) >> + =A0 =A0 =A0 !=3D 0) { >> + =A0 =A0 =A0 error_report("iSCSI: failed to send readcapacity command."= ); >> + =A0 =A0 =A0 task->status =A0 =3D 1; >> + =A0 =A0 =A0 task->complete =3D 1; >> + =A0 =A0} >> +} >> + >> +/* >> + * We support iscsi url's on the form >> + * iscsi://[:]// >> + */ >> +static int iscsi_open(BlockDriverState *bs, const char *filename, int f= lags) >> +{ >> + =A0 =A0ISCSILUN *iscsilun =3D bs->opaque; >> + =A0 =A0struct iscsi_context *iscsi =3D NULL; >> + =A0 =A0struct iscsi_task task; >> + =A0 =A0char *ptr, *host, *target, *url; >> + =A0 =A0char *tmp; >> + =A0 =A0int ret, lun; >> + >> + =A0 =A0bzero(iscsilun, sizeof(ISCSILUN)); > > memset() > >> + >> + =A0 =A0url =3D qemu_strdup(filename); >> + >> + =A0 =A0if (strncmp(url, "iscsi://", 8)) { >> + =A0 =A0 =A0 error_report("iSCSI: url does not start with 'iscsi://'"); >> + =A0 =A0 =A0 ret =3D -EINVAL; >> + =A0 =A0 =A0 goto failed; >> + =A0 =A0} >> + >> + =A0 =A0host =3D url + 8; >> + >> + =A0 =A0ptr =3D index(host, '/'); > > strchr() > From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=41095 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pa8cH-00027e-OQ for qemu-devel@nongnu.org; Tue, 04 Jan 2011 10:16:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pa8cG-0004vD-UW for qemu-devel@nongnu.org; Tue, 04 Jan 2011 10:16:05 -0500 Received: from hall.aurel32.net ([88.191.126.93]:37443) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pa8cG-0004ub-PZ for qemu-devel@nongnu.org; Tue, 04 Jan 2011 10:16:04 -0500 Received: from [2001:470:d4ed:0:5e26:aff:fe2b:6f5b] (helo=volta.aurel32.net) by hall.aurel32.net with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1Pa8c7-0004NP-QX for qemu-devel@nongnu.org; Tue, 04 Jan 2011 16:15:55 +0100 Received: from aurel32 by volta.aurel32.net with local (Exim 4.72) (envelope-from ) id 1Pa8c5-0002Fl-Px for qemu-devel@nongnu.org; Tue, 04 Jan 2011 16:15:53 +0100 From: Aurelien Jarno Date: Tue, 4 Jan 2011 16:15:42 +0100 Message-Id: <1294154150-7528-1-git-send-email-aurelien@aurel32.net> Subject: [Qemu-devel] (no subject) List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This patch series start by a cleanup to remove dead HPPA code and fix a few inconsistencies. The following patch implement implement correct NaN propagation rules for MIPS and PowerPC, following commit 3 54f211b1a49a7387929e22d6e63849fcba48f8a. Changes from v1: - Add "softfloat: use bits32 instead of uint32" (missing in previous series) - Add "softfloat: rename *IsNaN variables to *IsQuietNaN" as suggested by Peter Maydell. - Update "softfloat: fix float{32,64}_maybe_silence_nan() for MIPS" and "softfloat: add float{x80,128}_maybe_silence_nan()" to issue a compile error on SNAN_BIT_IS_ONE targets other than MIPS. - Update "softfloat: use float{32,64,x80,128}_maybe_silence_nan()" to correctly compute aIsLargerSignificand. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=37519 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pa9Oq-000120-GX for qemu-devel@nongnu.org; Tue, 04 Jan 2011 11:06:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pa9Op-0003Cg-5m for qemu-devel@nongnu.org; Tue, 04 Jan 2011 11:06:16 -0500 Received: from mail-qy0-f173.google.com ([209.85.216.173]:39390) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pa9Op-0003Ca-2u for qemu-devel@nongnu.org; Tue, 04 Jan 2011 11:06:15 -0500 Received: by qyk1 with SMTP id 1so16521547qyk.4 for ; Tue, 04 Jan 2011 08:06:14 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <1294154150-7528-1-git-send-email-aurelien@aurel32.net> References: <1294154150-7528-1-git-send-email-aurelien@aurel32.net> Date: Tue, 4 Jan 2011 16:06:13 +0000 Message-ID: Subject: Re: [Qemu-devel] (no subject) From: Peter Maydell Content-Type: text/plain; charset=UTF-8 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aurelien Jarno Cc: qemu-devel@nongnu.org On 4 January 2011 15:15, Aurelien Jarno wrote: > This patch series start by a cleanup to remove dead HPPA code and fix a > few inconsistencies. The following patch implement implement correct > NaN propagation rules for MIPS and PowerPC, following commit 3 > 54f211b1a49a7387929e22d6e63849fcba48f8a. I haven't given a Reviewed-by: for the MIPS and PPC patches in this series (4,7,8) since I don't know either arch well enough to say whether the behaviour is right, but they look OK. -- PMM From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=51581 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pa9Up-0004uY-73 for qemu-devel@nongnu.org; Tue, 04 Jan 2011 11:12:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pa9Uf-0005mg-Eu for qemu-devel@nongnu.org; Tue, 04 Jan 2011 11:12:27 -0500 Received: from hall.aurel32.net ([88.191.126.93]:33722) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pa9Uf-0005mI-AT for qemu-devel@nongnu.org; Tue, 04 Jan 2011 11:12:17 -0500 Date: Tue, 4 Jan 2011 17:12:16 +0100 From: Aurelien Jarno Subject: Re: [Qemu-devel] (no subject) Message-ID: <20110104161216.GB3615@hall.aurel32.net> References: <1294154150-7528-1-git-send-email-aurelien@aurel32.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: Sender: Aurelien Jarno List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel@nongnu.org On Tue, Jan 04, 2011 at 04:06:13PM +0000, Peter Maydell wrote: > On 4 January 2011 15:15, Aurelien Jarno wrote: > > This patch series start by a cleanup to remove dead HPPA code and fix a > > few inconsistencies. The following patch implement implement correct > > NaN propagation rules for MIPS and PowerPC, following commit 3 > > 54f211b1a49a7387929e22d6e63849fcba48f8a. > > I haven't given a Reviewed-by: for the MIPS and PPC patches in > this series (4,7,8) since I don't know either arch well enough to say > whether the behaviour is right, but they look OK. > Ok, thanks for the review. -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=36014 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pq1MP-0008EU-83 for qemu-devel@nongnu.org; Thu, 17 Feb 2011 05:45:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pq1MN-0002z1-6r for qemu-devel@nongnu.org; Thu, 17 Feb 2011 05:45:19 -0500 Received: from web63208.mail.re1.yahoo.com ([69.147.97.18]:23266) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Pq1MN-0002yw-4G for qemu-devel@nongnu.org; Thu, 17 Feb 2011 05:45:19 -0500 Message-ID: <873343.70876.qm@web63208.mail.re1.yahoo.com> Date: Thu, 17 Feb 2011 02:45:17 -0800 (PST) From: maheen butt MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-301210219-1297939517=:70876" Subject: [Qemu-devel] (no subject) List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --0-301210219-1297939517=:70876 Content-Type: text/plain; charset=us-ascii hi I'm running MIPS user mode emulation with qemu. Whenever a memory reference instruction comes from MIPS ELF how this address is translated to host virtual address? or is there any mapping function which is used? my host machine is x86 Regards --0-301210219-1297939517=:70876 Content-Type: text/html; charset=us-ascii
hi
I'm running MIPS user mode emulation with qemu. Whenever a memory reference instruction comes from MIPS ELF how this address is translated to host virtual address? or is there any mapping function which is used? my host machine is x86

Regards

--0-301210219-1297939517=:70876-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=40310 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PCVv9-0001Qv-Fl for qemu-devel@nongnu.org; Sun, 31 Oct 2010 07:17:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PCVv8-0005As-AS for qemu-devel@nongnu.org; Sun, 31 Oct 2010 07:17:55 -0400 Received: from server.zamzit.com ([205.234.174.101]:50326) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PCVv8-0005Ab-6L for qemu-devel@nongnu.org; Sun, 31 Oct 2010 07:17:54 -0400 Received: from 93-96-44-77.zone4.bethere.co.uk ([93.96.44.77]) by server.zamzit.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1PCVv6-0001tc-HP for qemu-devel@nongnu.org; Sun, 31 Oct 2010 11:17:53 +0000 MIME-Version: 1.0 From: "Zamzit" Content-Type: multipart/alternative; boundary="----=_NextPart_001_1291_5E9E50F8.1D9A1715" Message-ID: <28362065790082795316672@RISH-PC> Subject: [Qemu-devel] (no subject) Reply-To: promo1@zamzit.com List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Date: Sun, 31 Oct 2010 11:17:57 -0000 To: qemu-devel@nongnu.org ------=_NextPart_001_1291_5E9E50F8.1D9A1715 Content-Type: text/plain; charset="windows-1252http-equivContent-Type" Content-Transfer-Encoding: quoted-printable ZAMZIT.com - buy it, sell it, Zamzit! =20 Dear friend, We would like to invite you to join the all new auction site taking the web= by storm. If you have tried ebay and you are fed up of paying the extortio= nate end of auction fees, like millions of other members, than check out ht= tp://www.zamzit.com/ - we only charge a small listing fee and no end of auc= tion fees, you keep all of your profit. If you register for free today you can take advantage of our promotional of= fer, you will receive a =A315/$25 credit on your account which you can use = to start selling your items. Act today as this will only be available for a= limited time, click on the link below. https://www.zamzit.com/login.php We hope to see you at Zamzit.com soon. =20 Kindest Regards, The Zamzit Team =20 www.zamzit.com =20 To help stop Zamzit emails being seen as spam, please add us to your addres= s book! Copyright =A9 2010 Zamzit Ltd. All rights reserved. Designated trademarks and brand are property of their respective owners. The Zamzit logo is a trademarks of Zamzit Ltd. To view our Terms and Conditions and Privacy Policy please visit our websit= e. Place of Reg: England & Wales. Reg No: 6038207. VAT Reg No: GB 902 2175 65 var googlead =3D "<\/script>\n\ \n\ <\/script>\n\ "; if (location.href.inde= xOf('http:') =3D=3D 0) { document.write(googlead); } =20 ------=_NextPart_001_1291_5E9E50F8.1D9A1715 Content-Type: text/html; charset="windows-1252http-equivContent-Type" Content-Transfer-Encoding: quoted-printable

3D"The
   ZAMZIT.com - buy it, se= ll it, Zamzit!
 

Dear friend,

We would like to invit= e you to join the all new auction site taking the web by storm. If you have=  tried ebay and you are fed up of paying the extortionate end of aucti= on fees, like millions of other members, than check out http://www.zamzit.com/ - we only charge a small listing= fee and no end of auction fees, you keep all of your profit.

If you register for free today you can tak= e advantage of our promotional offer, you will receive a =A315/$25 credit o= n your account which you can use to start selling your items. Act today as = this will only be available for a limited time, click on the link below.

https://www.zamzit.com/login.php

We hope to see you at Zamzit.com soon.
 


Kindest Regards,


The Zamzit Team

&nbs= p;
www.zamzit.com  


To help stop Zamzit emails being s= een as spam, please add us to your address book!


Copyright =A9 2010 Zamzit Ltd. All= rights reserved.
Designated trademarks and brand are property of their = respective owners.
The Zamzit logo is a trademarks of Zamzit Ltd.
To= view our Terms and Conditions and Privacy Policy please visit our website.=
Place of Reg: England & Wales. Reg No: 6038207. VAT Reg No: GB 902 = 2175 65

------=_NextPart_001_1291_5E9E50F8.1D9A1715-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=36985 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PwthK-0006YV-98 for qemu-devel@nongnu.org; Tue, 08 Mar 2011 04:59:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PwthJ-00076K-2m for qemu-devel@nongnu.org; Tue, 08 Mar 2011 04:59:22 -0500 Received: from mtagate6.uk.ibm.com ([194.196.100.166]:49486) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PwthI-00075u-L5 for qemu-devel@nongnu.org; Tue, 08 Mar 2011 04:59:20 -0500 Received: from d06nrmr1707.portsmouth.uk.ibm.com (d06nrmr1707.portsmouth.uk.ibm.com [9.149.39.225]) by mtagate6.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p289xIMQ021222 for ; Tue, 8 Mar 2011 09:59:18 GMT Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by d06nrmr1707.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p289xVU91658884 for ; Tue, 8 Mar 2011 09:59:32 GMT Received: from d06av07.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p289xHIf018904 for ; Tue, 8 Mar 2011 02:59:17 -0700 From: Stefan Hajnoczi Date: Tue, 8 Mar 2011 09:59:00 +0000 Message-Id: <1299578340-7757-1-git-send-email-stefanha@linux.vnet.ibm.com> Subject: [Qemu-devel] (no subject) List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Anthony Liguori [PULL] trace: Thread-safe simpletrace and additional trace events The following 3 tracing commits were sent to qemu-devel. I have made them available for convenient pulling into qemu.git/master. The following changes since commit 07bf23a77131668ef8db37e08d508b117655ce86: MAINTAINERS: add LatticeMico32 maintainer (2011-03-07 13:42:58 +0100) are available in the git repository at: git://repo.or.cz/qemu/stefanha.git tracing Stefan Hajnoczi (3): simpletrace: Thread-safe tracing trace: Trace bdrv_aio_flush() trace: Trace posix-aio-compat.c completion and cancellation block.c | 2 + docs/tracing.txt | 5 - posix-aio-compat.c | 5 + scripts/simpletrace.py | 3 +- simpletrace.c | 309 ++++++++++++++++++++++++++++++++---------------- simpletrace.h | 8 ++ trace-events | 3 + vl.c | 16 +-- 8 files changed, 229 insertions(+), 122 deletions(-) Thanks, Stefan From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:43292) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRH0h-0000Ek-5U for qemu-devel@nongnu.org; Tue, 31 May 2011 00:56:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QRH0c-0007b5-VL for qemu-devel@nongnu.org; Tue, 31 May 2011 00:56:55 -0400 Received: from mail-vw0-f45.google.com ([209.85.212.45]:49505) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QRH0c-0007b0-RJ for qemu-devel@nongnu.org; Tue, 31 May 2011 00:56:50 -0400 Received: by vws17 with SMTP id 17so3438949vws.4 for ; Mon, 30 May 2011 21:56:50 -0700 (PDT) MIME-Version: 1.0 Date: Tue, 31 May 2011 05:56:43 +0100 Message-ID: From: coolman coolx Content-Type: text/plain; charset=ISO-8859-1 Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: pers-zuksf-1655815864@craigslist.org, pers-zwg24-1680121866@craigslist.org, poleche@maseno.ac.ke, postmaster@unimedmanaus.com.br, qemu-devel@nongnu.org, jnmintlrahul@gmail.com, thedaedlus@gmail.com, richlouise@yahoo.cn, meggle@merotech.de http://newportnewswaterworks.co.cc/n0ow1 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:52598) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QVaiO-0001b6-PX for qemu-devel@nongnu.org; Sat, 11 Jun 2011 22:47:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QVaiN-0000CQ-Im for qemu-devel@nongnu.org; Sat, 11 Jun 2011 22:47:52 -0400 Received: from mail-pz0-f45.google.com ([209.85.210.45]:57174) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QVaiN-0000CM-Ce for qemu-devel@nongnu.org; Sat, 11 Jun 2011 22:47:51 -0400 Received: by pzk30 with SMTP id 30so1787223pzk.4 for ; Sat, 11 Jun 2011 19:47:49 -0700 (PDT) From: Ronnie Sahlberg Date: Sun, 12 Jun 2011 12:47:24 +1000 Message-Id: <1307846845-25892-1-git-send-email-ronniesahlberg@gmail.com> Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, stefanha@linux.vnet.ibm.com, hch@lst.de Please find attached a patch to add built-in support for iSCSI into QEMU. Please review and/or apply this patch. This is the latest version of this patch and I think I have addressed all previous concerns and suggestions. Using built-in iSCSI support has many advantages for certain use cases : * if you have very many iSCSI devices it may be impractical to expose all LUNs to the underlying host. * the devices become private to the guest and are not visible to the host. This automatically avoids polluting the page-cache on the host. * security, the devices are private to the guest, which prevents other guests or the host itself from accessing the devices. * security, it allows non-root users a secure way to get private and password protected access to the device by using CHAP authentication. * migration, many other virtualization systems provide built-in iscsi clients like this. Also providing this as feature in QEMU may make it easier for such users to migrate over to QEMU/KVM. * easier to maintain. For users with very many QEMU instances I think having guest-private iscsi targets and LUNs may be easier to manage than 'huge set of files in /dev/scsi/*' * easier to maintain, when copying a QEMU instance from one host to another, this offers a more self-contained solution where the QEMU command line itself cotnains all required storage configuration, instead of also having to coordinate this move with setting up and tearing down open-iscsi logins on the underlying hosts. The patch has been tested by installing and running several distributions such as RHEL6 and Ubuntu on devices, both system disk as well as the installer CDROM as being iscsi devices. This testing has also been performed by running full QEMU under valgrind. Performance is comparable to using open-iscsi devices. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:55954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qoclz-0007cG-95 for qemu-devel@nongnu.org; Wed, 03 Aug 2011 10:50:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qocly-0007gU-IU for qemu-devel@nongnu.org; Wed, 03 Aug 2011 10:50:15 -0400 Received: from isrv.corpit.ru ([86.62.121.231]:51356) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qocly-0007fs-Ca for qemu-devel@nongnu.org; Wed, 03 Aug 2011 10:50:14 -0400 From: Michael Tokarev Date: Wed, 3 Aug 2011 18:50:11 +0400 Message-Id: <1312383011-9401-1-git-send-email-mjt@msgid.tls.msk.ru> Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Luiz Capitulino Cc: Jan Kiszka , Michael Tokarev , qemu-devel@nongnu.org From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:47854) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3qbe-0003r4-Fy for qemu-devel@nongnu.org; Wed, 14 Sep 2011 10:38:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R3qbd-0003BJ-Ql for qemu-devel@nongnu.org; Wed, 14 Sep 2011 10:38:30 -0400 Received: from mail-wy0-f173.google.com ([74.125.82.173]:47902) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3qbd-0003Aw-MP for qemu-devel@nongnu.org; Wed, 14 Sep 2011 10:38:29 -0400 Received: by wyf22 with SMTP id 22so1764959wyf.4 for ; Wed, 14 Sep 2011 07:38:27 -0700 (PDT) MIME-Version: 1.0 Date: Wed, 14 Sep 2011 22:38:27 +0800 Message-ID: From: =?GB2312?B?zfXTwLKp?= Content-Type: multipart/alternative; boundary=0016e65512da94470f04ace7b6d3 Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --0016e65512da94470f04ace7b6d3 Content-Type: text/plain; charset=ISO-8859-1 ds --0016e65512da94470f04ace7b6d3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable ds=A0 --0016e65512da94470f04ace7b6d3-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:41331) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R9Jtx-0005LF-N5 for qemu-devel@nongnu.org; Thu, 29 Sep 2011 12:56:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R9Jtw-0004YB-JP for qemu-devel@nongnu.org; Thu, 29 Sep 2011 12:56:01 -0400 Received: from nm11.bullet.mail.ukl.yahoo.com ([217.146.183.185]:22032) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1R9Jtw-0004XZ-BD for qemu-devel@nongnu.org; Thu, 29 Sep 2011 12:56:00 -0400 Received: by qyc1 with SMTP id 1so1081456qyc.4 for ; Thu, 29 Sep 2011 09:55:53 -0700 (PDT) MIME-Version: 1.0 From: Ottavio Date: Thu, 29 Sep 2011 17:55:33 +0100 Message-ID: Content-Type: text/plain; charset=ISO-8859-1 Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-users@yahoogroups.com I wonder if it is possible to compile a newer version of qemu with (the defunct) kqemu on Windows (XP)? The winkvm project doesn't seem to be usable yet. -- Ottavio From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49930) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIHii-0007P7-G1 for qemu-devel@nongnu.org; Mon, 24 Oct 2011 06:25:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RIHig-0001fe-Gz for qemu-devel@nongnu.org; Mon, 24 Oct 2011 06:25:28 -0400 Received: from mail-wy0-f173.google.com ([74.125.82.173]:52549) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIHig-0001fF-8L for qemu-devel@nongnu.org; Mon, 24 Oct 2011 06:25:26 -0400 Received: by wyh15 with SMTP id 15so6803170wyh.4 for ; Mon, 24 Oct 2011 03:25:24 -0700 (PDT) MIME-Version: 1.0 Date: Mon, 24 Oct 2011 18:25:23 +0800 Message-ID: From: =?GB2312?B?zfXTwLKp?= Content-Type: multipart/alternative; boundary=0016e65b581638f25b04b008d74d Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --0016e65b581638f25b04b008d74d Content-Type: text/plain; charset=ISO-8859-1 ff --0016e65b581638f25b04b008d74d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable ff=A0 --0016e65b581638f25b04b008d74d-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:48696) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIReP-0001py-QY for qemu-devel@nongnu.org; Mon, 24 Oct 2011 17:01:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RIReO-0001FR-KP for qemu-devel@nongnu.org; Mon, 24 Oct 2011 17:01:41 -0400 Received: from mail-ww0-f53.google.com ([74.125.82.53]:50477) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIReO-0001FN-6d for qemu-devel@nongnu.org; Mon, 24 Oct 2011 17:01:40 -0400 Received: by wwi36 with SMTP id 36so8739277wwi.10 for ; Mon, 24 Oct 2011 14:01:38 -0700 (PDT) From: =?UTF-8?q?Beno=C3=AEt=20Canet?= Date: Mon, 24 Oct 2011 23:03:25 +0200 Message-Id: <1319490221-5854-1-git-send-email-benoit.canet@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org These patches apply against akivity memory/master. They convert syborg to memory API and various arm related component to VMState. Omap boards where not modified because Linaro is currently refactoring them. Xscale was left apart too. This version fix coding style issues. >>From Benoît Canet # This line is ignored. From: Benoît Canet Subject: In-Reply-To: From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:34284) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROywS-0003mR-EE for qemu-devel@nongnu.org; Fri, 11 Nov 2011 16:47:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ROywR-0003UJ-FY for qemu-devel@nongnu.org; Fri, 11 Nov 2011 16:47:20 -0500 Received: from mail-yx0-f173.google.com ([209.85.213.173]:44080) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ROywR-0003Ts-D0 for qemu-devel@nongnu.org; Fri, 11 Nov 2011 16:47:19 -0500 Received: by yenr8 with SMTP id r8so4147578yen.4 for ; Fri, 11 Nov 2011 13:47:18 -0800 (PST) From: Ronnie Sahlberg Date: Sat, 12 Nov 2011 08:46:45 +1100 Message-Id: <1321048006-16451-1-git-send-email-ronniesahlberg@gmail.com> Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com List, Please find a patch that adds a new section for iSCSI to qemu-doc. This section provides much more verbose description of iSCSI and its use than the manpage and also includes a short description on how to set up a simple iSCSI target on loopback and then accessing it from QEMU. The example on how to set up iSCSI Target uses the STGT iscsi target, so the example would only work on a subset of linux/bsd systems. I recognize also that this might be controversion, since why show how to configure "xyz unrelated package" in QEMU documentation. My intention here is to provide a howto that describes how to quickly get iSCSI target up and running and to get QEMU to use it. As a quick howto for people that are not familiar with iSCSI but still want to test it out quickly. Learning how to set up iSCSI target can often be somewhat complex and daunting and could otherwise act as huge treshold for people that would just want to get iSCSI running and experiment with QMEU, but would otherwise not want to spend a lot of time learning about the target side of iscsi. I think having examples like this is useful but see that it could be seen as controversial. Feel free to remove that part of the patch if you think this does not belong in the qemu docs. regards ronnie sahlberg From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:58789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYckI-0002HP-Md for qemu-devel@nongnu.org; Thu, 08 Dec 2011 07:06:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RYckE-0006RB-Ez for qemu-devel@nongnu.org; Thu, 08 Dec 2011 07:06:38 -0500 Received: from mail-yx0-f173.google.com ([209.85.213.173]:60733) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RYckE-0006Qy-CU for qemu-devel@nongnu.org; Thu, 08 Dec 2011 07:06:34 -0500 Received: by yenm6 with SMTP id m6so1770330yen.4 for ; Thu, 08 Dec 2011 04:06:33 -0800 (PST) MIME-Version: 1.0 Date: Thu, 8 Dec 2011 20:06:33 +0800 Message-ID: From: wong Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: 9cipdtcc5@freewebemail.com, akuster@kama-aina.net, cczzaf@hotmail.com, cupy_001@163.com, dizhidizhi@678910.com, leiwang@rst.ricoh.com, sunix.kernel@gmail.com, qemu-devel@nongnu.org, support@digg.com ...I suppose you won=EF=BF=BDt find the place more interesting than this si= te! http://www.spassvoegel-woellstein.de/page.december.php?uvpage=3D16t5 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49430) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaIS1-0002hd-7V for qemu-devel@nongnu.org; Mon, 12 Dec 2011 21:50:41 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RaIS0-0007W6-9G for qemu-devel@nongnu.org; Mon, 12 Dec 2011 21:50:41 -0500 Received: from mail-vx0-f173.google.com ([209.85.220.173]:61794) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaIS0-0007Vz-71 for qemu-devel@nongnu.org; Mon, 12 Dec 2011 21:50:40 -0500 Received: by vcbfl11 with SMTP id fl11so4602947vcb.4 for ; Mon, 12 Dec 2011 18:50:39 -0800 (PST) MIME-Version: 1.0 Date: Mon, 12 Dec 2011 20:50:39 -0600 Message-ID: From: Erik Lotspeich Content-Type: text/plain; charset=UTF-8 Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi, I posted this on qemu-discuss and didn't receive any replies; sorry for posting it twice. I have OpenSUSE 12.1 and I have a 64-bit Windows 7 VM that recognizes the emulated ICH6 sound (HDA audio device). Although Windows recognizes this sound device just fine, there is no sound from the Windows 7 VM. Sound works fine in KDE and from all other applications on the Linux side. I would appreciate any ideas or help? Thanks! Regards, Erik From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:38982) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaOD2-0003Kh-AF for qemu-devel@nongnu.org; Tue, 13 Dec 2011 03:59:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RaOD0-0003J3-Us for qemu-devel@nongnu.org; Tue, 13 Dec 2011 03:59:36 -0500 Received: from mail-ee0-f45.google.com ([74.125.83.45]:52815) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaOD0-0003Ha-QI for qemu-devel@nongnu.org; Tue, 13 Dec 2011 03:59:34 -0500 Received: by eekb45 with SMTP id b45so2274726eek.4 for ; Tue, 13 Dec 2011 00:59:33 -0800 (PST) Date: Tue, 13 Dec 2011 08:06:06 +0000 From: Stefan Hajnoczi Message-ID: <20111213080606.GD6815@stefanha-thinkpad.localdomain> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Erik Lotspeich Cc: qemu-devel@nongnu.org On Mon, Dec 12, 2011 at 08:50:39PM -0600, Erik Lotspeich wrote: > Hi, > > I posted this on qemu-discuss and didn't receive any replies; sorry > for posting it twice. > > I have OpenSUSE 12.1 and I have a 64-bit Windows 7 VM that recognizes > the emulated ICH6 sound (HDA audio device). Although Windows > recognizes this sound device just fine, there is no sound from the > Windows 7 VM. Sound works fine in KDE and from all other applications > on the Linux side. I would appreciate any ideas or help? Please post your QEMU command-line (you can find it with "ps aux | grep qemu"). If you are running through libvirt/virsh/virt-manager there may be permission requirements since the guest can be set to run as an unprivileged user without access to audio devices. That's just a guess but worth looking into. Stefan From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49071) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaRt4-0004uI-1E for qemu-devel@nongnu.org; Tue, 13 Dec 2011 07:55:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RaRt2-0008GW-IG for qemu-devel@nongnu.org; Tue, 13 Dec 2011 07:55:13 -0500 Received: from mail-gx0-f173.google.com ([209.85.161.173]:42159) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaRt2-0008GS-C9 for qemu-devel@nongnu.org; Tue, 13 Dec 2011 07:55:12 -0500 Received: by ggnk1 with SMTP id k1so7623823ggn.4 for ; Tue, 13 Dec 2011 04:55:11 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <20111213080606.GD6815@stefanha-thinkpad.localdomain> References: <20111213080606.GD6815@stefanha-thinkpad.localdomain> Date: Tue, 13 Dec 2011 06:55:11 -0600 Message-ID: From: Erik Lotspeich Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org On Tue, Dec 13, 2011 at 2:06 AM, Stefan Hajnoczi wrote= : > Please post your QEMU command-line (you can find it with "ps aux | grep > qemu"). > > If you are running through libvirt/virsh/virt-manager there may be > permission requirements since the guest can be set to run as an > unprivileged user without access to audio devices. =C2=A0 That's just a g= uess > but worth looking into. Here's my qemu command line: qemu 5294 19.6 25.7 2444808 2101252 ? Sl 06:47 1:00 /usr/bin/qemu-kvm -S -M pc-0.14 -enable-kvm -m 2048 -smp 2,sockets=3D2,cores=3D1,threads=3D1 -name windowsvistax64-2 -uuid 9e05602e-6c56-ccdb-a8d6-551cf434a3f8 -nodefconfig -nodefaults -chardev socket,id=3Dcharmonitor,path=3D/var/lib/libvirt/qemu/windowsvistax64-2.moni= tor,server,nowait -mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol -rtc base=3Dlocaltim= e -no-hpet -no-shutdown -drive file=3D/var/lib/libvirt/images/win7.raw,if=3Dnone,id=3Ddrive-ide0-0-0,forma= t=3Draw -device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-0= ,bootindex=3D2 -netdev tap,fd=3D22,id=3Dhostnet0 -device rtl8139,netdev=3Dhostnet0,id=3Dnet0,mac=3D52:54:00:98:e5:52,bus=3Dpci.0,mul= tifunction=3Don,addr=3D0x3.0x0 -netdev tap,fd=3D23,id=3Dhostnet1 -device rtl8139,netdev=3Dhostnet1,id=3Dnet1,mac=3D52:54:00:71:a0:18,bus=3Dpci.0,mul= tifunction=3Don,addr=3D0x5.0x0 -usb -device usb-tablet,id=3Dinput0 -vnc 127.0.0.1:0 -vga cirrus -device intel-hda,id=3Dsound0,bus=3Dpci.0,multifunction=3Don,addr=3D0x6.0x0 -device hda-duplex,id=3Dsound0-codec0,bus=3Dsound0.0,cad=3D0 -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,multifunction=3Don,addr=3D0x4.= 0x0 I am running with virt-manager as root -- OpenSUSE 12.1 prompts me for the root password if I start virt-manager as a regular user. Normally, though, I just run it su'ed to root from a terminal window. Thanks, Erik From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:32896) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaTmy-00025Q-Ct for qemu-devel@nongnu.org; Tue, 13 Dec 2011 09:57:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RaTmx-0008EA-Ae for qemu-devel@nongnu.org; Tue, 13 Dec 2011 09:57:04 -0500 Received: from mail-ww0-f53.google.com ([74.125.82.53]:50755) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaTmx-0008Dx-13 for qemu-devel@nongnu.org; Tue, 13 Dec 2011 09:57:03 -0500 Received: by wgbds1 with SMTP id ds1so12840329wgb.10 for ; Tue, 13 Dec 2011 06:57:01 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <20111213080606.GD6815@stefanha-thinkpad.localdomain> Date: Tue, 13 Dec 2011 14:57:01 +0000 Message-ID: From: Stefan Hajnoczi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Erik Lotspeich Cc: qemu-devel@nongnu.org On Tue, Dec 13, 2011 at 12:55 PM, Erik Lotspeich wrote: > On Tue, Dec 13, 2011 at 2:06 AM, Stefan Hajnoczi wro= te: >> Please post your QEMU command-line (you can find it with "ps aux | grep >> qemu"). >> >> If you are running through libvirt/virsh/virt-manager there may be >> permission requirements since the guest can be set to run as an >> unprivileged user without access to audio devices. =A0 That's just a gue= ss >> but worth looking into. > > Here's my qemu command line: > > qemu =A0 =A0 =A05294 19.6 25.7 2444808 2101252 ? =A0 =A0 Sl =A0 06:47 =A0= 1:00 ^^ Libvirt is running the qemu-kvm process as user 'qemu'. Does that user have the necessary groups (e.g. 'audio')? On my system the unprivileged user is called 'libvirt-qemu' and here's what I get: $ id libvirt-qemuuid=3D105(libvirt-qemu) gid=3D112(kvm) groups=3D112(kvm) You may need to add 'qemu' to group 'audio' or whatever is necessary to let it access ALSA devices or talk to a sound daemon. Stefan From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:60362) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaUBQ-0000NP-A8 for qemu-devel@nongnu.org; Tue, 13 Dec 2011 10:22:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RaUBJ-0005EG-Td for qemu-devel@nongnu.org; Tue, 13 Dec 2011 10:22:20 -0500 Received: from mail-gx0-f173.google.com ([209.85.161.173]:61349) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaUBJ-0005EA-Pv for qemu-devel@nongnu.org; Tue, 13 Dec 2011 10:22:13 -0500 Received: by ggnk1 with SMTP id k1so7804780ggn.4 for ; Tue, 13 Dec 2011 07:22:13 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <20111213080606.GD6815@stefanha-thinkpad.localdomain> Date: Tue, 13 Dec 2011 09:22:13 -0600 Message-ID: From: Erik Lotspeich Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi Cc: qemu-devel@nongnu.org Thank you - I overlooked the obvious. Regards, Erik On Tue, Dec 13, 2011 at 8:57 AM, Stefan Hajnoczi wrote= : > On Tue, Dec 13, 2011 at 12:55 PM, Erik Lotspeich > wrote: >> On Tue, Dec 13, 2011 at 2:06 AM, Stefan Hajnoczi wr= ote: >>> Please post your QEMU command-line (you can find it with "ps aux | grep >>> qemu"). >>> >>> If you are running through libvirt/virsh/virt-manager there may be >>> permission requirements since the guest can be set to run as an >>> unprivileged user without access to audio devices. =C2=A0 That's just a= guess >>> but worth looking into. >> >> Here's my qemu command line: >> >> qemu =C2=A0 =C2=A0 =C2=A05294 19.6 25.7 2444808 2101252 ? =C2=A0 =C2=A0 = Sl =C2=A0 06:47 =C2=A0 1:00 > =C2=A0^^ > Libvirt is running the qemu-kvm process as user 'qemu'. =C2=A0Does that > user have the necessary groups (e.g. 'audio')? > > On my system the unprivileged user is called 'libvirt-qemu' and here's > what I get: > > $ id libvirt-qemuuid=3D105(libvirt-qemu) gid=3D112(kvm) groups=3D112(kvm) > > You may need to add 'qemu' to group 'audio' or whatever is necessary > to let it access ALSA devices or talk to a sound daemon. > Stefan From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:37874) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaUiq-0000Rn-IL for qemu-devel@nongnu.org; Tue, 13 Dec 2011 10:56:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RaUik-0004dk-Fo for qemu-devel@nongnu.org; Tue, 13 Dec 2011 10:56:52 -0500 Received: from lo.gmane.org ([80.91.229.12]:33283) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RaUik-0004dW-AP for qemu-devel@nongnu.org; Tue, 13 Dec 2011 10:56:46 -0500 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RaUie-0005Hw-Aj for qemu-devel@nongnu.org; Tue, 13 Dec 2011 16:56:40 +0100 Received: from 93-34-178-147.ip50.fastwebnet.it ([93.34.178.147]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 13 Dec 2011 16:56:40 +0100 Received: from pbonzini by 93-34-178-147.ip50.fastwebnet.it with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 13 Dec 2011 16:56:40 +0100 From: Paolo Bonzini Date: Tue, 13 Dec 2011 16:56:27 +0100 Message-ID: References: <20111213080606.GD6815@stefanha-thinkpad.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit In-Reply-To: Subject: Re: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On 12/13/2011 04:22 PM, Erik Lotspeich wrote: > Thank you - I overlooked the obvious. Actually it may be a distro bug, I suggest you report it there. Paolo From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:42159) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgNQp-0001lR-Cz for qemu-devel@nongnu.org; Thu, 29 Dec 2011 16:22:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RgNQo-0001eD-SF for qemu-devel@nongnu.org; Thu, 29 Dec 2011 16:22:35 -0500 Received: from vms173011pub.verizon.net ([206.46.173.11]:48659) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RgNQo-0001e3-P0 for qemu-devel@nongnu.org; Thu, 29 Dec 2011 16:22:34 -0500 Received: from [108.107.215.63] ([unknown] [108.107.215.63]) by vms173011.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0LWZ001LRI172310@vms173011.mailsrvcs.net> for qemu-devel@nongnu.org; Thu, 29 Dec 2011 15:22:20 -0600 (CST) Date: Thu, 29 Dec 2011 16:17:35 -0500 Message-id: From: Fred Oliveira MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: base64 Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:60992) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S2iwp-0007kB-Ow for qemu-devel@nongnu.org; Wed, 29 Feb 2012 07:48:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S2iwI-0006zi-5E for qemu-devel@nongnu.org; Wed, 29 Feb 2012 07:47:59 -0500 Received: from na3sys010aog101.obsmtp.com ([74.125.245.70]:46888) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1S2iwH-0006z2-CY for qemu-devel@nongnu.org; Wed, 29 Feb 2012 07:47:26 -0500 Received: by mail-wi0-f174.google.com with SMTP id hm11so3420925wib.5 for ; Wed, 29 Feb 2012 04:47:21 -0800 (PST) MIME-Version: 1.0 From: Dmitry Fleytman Date: Wed, 29 Feb 2012 14:43:53 +0200 Message-Id: <1330519433-20536-1-git-send-email-dmitry.fleytman@ravellosystems.com> Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Anthony Liguori , Alex Fishman , "Michael S. Tsirkin" , yvugenfi@redhat.com, Izik Eidus , Yan Vugenfirer , Dmitry Fleytman >>From ac51c01697ee2dc2ff2cb8c24346054ae0e3e32a Mon Sep 17 00:00:00 2001 From: Dmitry Fleytman Date: Sun, 26 Feb 2012 18:39:07 +0200 Subject: [PATCH v2] VMXNET3 paravirtual NIC device implementation Implementation of VMWare VMXNET3 paravirtual NIC device. Supports of all the device features including offload capabilties, VLANs and etc. The device is tested on different OSes: Fedora 15 Ubuntu 10.4 Centos 6.2 Windows 2008R2 Windows 2008 64bit Windows 2008 32bit Windows 2003 64bit Windows 2003 32bit Currently live migration is not supported. Signed-off-by: Dmitry Fleytman Signed-off-by: Yan Vugenfirer --- qemu/Makefile.objs | 1 + qemu/default-configs/pci.mak | 1 + qemu/hw/pci.c | 2 + qemu/hw/pci.h | 1 + qemu/hw/virtio-net.h | 13 +- qemu/hw/vmware_utils.h | 131 +++ qemu/hw/vmxnet3.c | 2559 ++++++++++++++++++++++++++++++++++++++++++ qemu/hw/vmxnet3.h | 727 ++++++++++++ qemu/hw/vmxnet3_debug.h | 104 ++ qemu/hw/vmxnet_utils.c | 172 +++ qemu/hw/vmxnet_utils.h | 242 ++++ qemu/net.c | 2 +- qemu/net/checksum.h | 7 + 13 files changed, 3955 insertions(+), 7 deletions(-) create mode 100644 qemu/hw/vmware_utils.h create mode 100644 qemu/hw/vmxnet3.c create mode 100644 qemu/hw/vmxnet3.h create mode 100644 qemu/hw/vmxnet3_debug.h create mode 100644 qemu/hw/vmxnet_utils.c create mode 100644 qemu/hw/vmxnet_utils.h diff --git a/qemu/Makefile.objs b/qemu/Makefile.objs index 808de6a..3f846a6 100644 --- a/qemu/Makefile.objs +++ b/qemu/Makefile.objs @@ -264,6 +264,7 @@ hw-obj-$(CONFIG_PCNET_PCI) += pcnet-pci.o hw-obj-$(CONFIG_PCNET_COMMON) += pcnet.o hw-obj-$(CONFIG_E1000_PCI) += e1000.o hw-obj-$(CONFIG_RTL8139_PCI) += rtl8139.o +hw-obj-$(CONFIG_VMXNET3_PCI) += vmxnet3.o vmxnet_utils.o hw-obj-$(CONFIG_SMC91C111) += smc91c111.o hw-obj-$(CONFIG_LAN9118) += lan9118.o diff --git a/qemu/default-configs/pci.mak b/qemu/default-configs/pci.mak index 21e4ccf..f8e6ee1 100644 --- a/qemu/default-configs/pci.mak +++ b/qemu/default-configs/pci.mak @@ -13,6 +13,7 @@ CONFIG_PCNET_COMMON=y CONFIG_LSI_SCSI_PCI=y CONFIG_RTL8139_PCI=y CONFIG_E1000_PCI=y +CONFIG_VMXNET3_PCI=y CONFIG_IDE_CORE=y CONFIG_IDE_QDEV=y CONFIG_IDE_PCI=y diff --git a/qemu/hw/pci.c b/qemu/hw/pci.c index bf046bf..f0fb1ee 100644 --- a/qemu/hw/pci.c +++ b/qemu/hw/pci.c @@ -1350,6 +1350,7 @@ static const char * const pci_nic_models[] = { "e1000", "pcnet", "virtio", + "vmxnet3", NULL }; @@ -1362,6 +1363,7 @@ static const char * const pci_nic_names[] = { "e1000", "pcnet", "virtio-net-pci", + "vmxnet3", NULL }; diff --git a/qemu/hw/pci.h b/qemu/hw/pci.h index 4f19fdb..fee8250 100644 --- a/qemu/hw/pci.h +++ b/qemu/hw/pci.h @@ -60,6 +60,7 @@ #define PCI_DEVICE_ID_VMWARE_NET 0x0720 #define PCI_DEVICE_ID_VMWARE_SCSI 0x0730 #define PCI_DEVICE_ID_VMWARE_IDE 0x1729 +#define PCI_DEVICE_ID_VMWARE_VMXNET3 0x07B0 /* Intel (0x8086) */ #define PCI_DEVICE_ID_INTEL_82551IT 0x1209 diff --git a/qemu/hw/virtio-net.h b/qemu/hw/virtio-net.h index 4468741..fa3c17b 100644 --- a/qemu/hw/virtio-net.h +++ b/qemu/hw/virtio-net.h @@ -78,13 +78,14 @@ struct virtio_net_config * specify GSO or CSUM features, you can simply ignore the header. */ struct virtio_net_hdr { -#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset +#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 /* Use csum_start, csum_offset */ +#define VIRTIO_NET_HDR_F_DATA_VALID 2 /* Csum is valid */ uint8_t flags; -#define VIRTIO_NET_HDR_GSO_NONE 0 // Not a GSO frame -#define VIRTIO_NET_HDR_GSO_TCPV4 1 // GSO frame, IPv4 TCP (TSO) -#define VIRTIO_NET_HDR_GSO_UDP 3 // GSO frame, IPv4 UDP (UFO) -#define VIRTIO_NET_HDR_GSO_TCPV6 4 // GSO frame, IPv6 TCP -#define VIRTIO_NET_HDR_GSO_ECN 0x80 // TCP has ECN set +#define VIRTIO_NET_HDR_GSO_NONE 0 /* Not a GSO frame */ +#define VIRTIO_NET_HDR_GSO_TCPV4 1 /* GSO frame, IPv4 TCP (TSO) */ +#define VIRTIO_NET_HDR_GSO_UDP 3 /* GSO frame, IPv4 UDP (UFO) */ +#define VIRTIO_NET_HDR_GSO_TCPV6 4 /* GSO frame, IPv6 TCP */ +#define VIRTIO_NET_HDR_GSO_ECN 0x80 /* TCP has ECN set */ uint8_t gso_type; uint16_t hdr_len; uint16_t gso_size; diff --git a/qemu/hw/vmware_utils.h b/qemu/hw/vmware_utils.h new file mode 100644 index 0000000..304bb48 --- /dev/null +++ b/qemu/hw/vmware_utils.h @@ -0,0 +1,131 @@ +/* + * QEMU VMWARE paravirtual devices - auxiliary code + * + * Copyright (c) 2012 Ravello Systems LTD (http://ravellosystems.com) + * + * Developed by Daynix Computing LTD (http://www.daynix.com) + * + * Authors: + * Dmitry Fleytman + * Yan Vugenfirer + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + * + */ + +/* Shared memory access functions with byte swap support */ +static inline void +vmw_shmem_read(target_phys_addr_t addr, void *buf, int len) +{ + DSHPRINTF("SHMEM r: %" PRIx64 ", len: %d to %p", + (uint64_t) addr, len, buf); + cpu_physical_memory_read(addr, buf, len); +} + +static inline void +vmw_shmem_write(target_phys_addr_t addr, void *buf, int len) +{ + DSHPRINTF("SHMEM w: %" PRIx64 ", len: %d to %p", + (uint64_t) addr, len, buf); + cpu_physical_memory_write(addr, buf, len); +} + +static inline void +vmw_shmem_rw(target_phys_addr_t addr, void *buf, int len, int is_write) +{ + DSHPRINTF("SHMEM r/w: %" PRIx64 ", len: %d (to %p), is write: %d", + (uint64_t) addr, len, buf, is_write); + + cpu_physical_memory_rw(addr, buf, len, is_write); +} + +static inline void +vmw_shmem_set(target_phys_addr_t addr, uint8 val, int len) +{ + int i; + DSHPRINTF("SHMEM set: %" PRIx64 ", len: %d (value 0x%X)", + (uint64_t) addr, len, val); + + for (i = 0; i < len; i++) { + cpu_physical_memory_write(addr + i, &val, 1); + } +} + +static inline uint32_t +vmw_shmem_ld8(target_phys_addr_t addr) +{ + uint8_t res = ldub_phys(addr); + DSHPRINTF("SHMEM load8: %" PRIx64 " (value 0x%X)", + (uint64_t) addr, res); + return res; +} + +static inline void +vmw_shmem_st8(target_phys_addr_t addr, uint8_t value) +{ + DSHPRINTF("SHMEM store8: %" PRIx64 " (value 0x%X)", + (uint64_t) addr, value); + stb_phys(addr, value); +} + +static inline uint32_t +vmw_shmem_ld16(target_phys_addr_t addr) +{ + uint16_t res = lduw_le_phys(addr); + DSHPRINTF("SHMEM load16: %" PRIx64 " (value 0x%X)", + (uint64_t) addr, res); + return res; +} + +static inline void +vmw_shmem_st16(target_phys_addr_t addr, uint16_t value) +{ + DSHPRINTF("SHMEM store16: %" PRIx64 " (value 0x%X)", + (uint64_t) addr, value); + stw_le_phys(addr, value); +} + +static inline uint32_t +vmw_shmem_ld32(target_phys_addr_t addr) +{ + uint32_t res = ldl_le_phys(addr); + DSHPRINTF("SHMEM load32: %" PRIx64 " (value 0x%X)", + (uint64_t) addr, res); + return res; +} + +static inline void +vmw_shmem_st32(target_phys_addr_t addr, uint32_t value) +{ + DSHPRINTF("SHMEM store32: %" PRIx64 " (value 0x%X)", + (uint64_t) addr, value); + stl_le_phys(addr, value); +} + +static inline uint64_t +vmw_shmem_ld64(target_phys_addr_t addr) +{ + uint64_t res = ldq_le_phys(addr); + DSHPRINTF("SHMEM load64: %" PRIx64 " (value %" PRIx64 ")", + (uint64_t) addr, res); + return res; +} + +static inline void +vmw_shmem_st64(target_phys_addr_t addr, uint64_t value) +{ + DSHPRINTF("SHMEM store64: %" PRIx64 " (value %" PRIx64 ")", + (uint64_t) addr, value); + stq_le_phys(addr, value); +} + +/* MACROS for simplification of operations on array-style registers */ +#define IS_MULTIREG_ADDR(addr, base, cnt, regsize) \ + (((addr) >= (base)) && ((addr) < (base) + (cnt) * (regsize))) + +#define MULTIREG_IDX_BY_ADDR(addr, base, regsize) \ + (((addr) - (base)) / (regsize)) + +/* Bitfields */ +#define FLAG_IS_SET(field, flag) (((field) & (flag)) == (flag)) diff --git a/qemu/hw/vmxnet3.c b/qemu/hw/vmxnet3.c new file mode 100644 index 0000000..112d3b9 --- /dev/null +++ b/qemu/hw/vmxnet3.c @@ -0,0 +1,2559 @@ +/* + * QEMU VMWARE VMXNET3 paravirtual NIC + * + * Copyright (c) 2012 Ravello Systems LTD (http://ravellosystems.com) + * + * Developed by Daynix Computing LTD (http://www.daynix.com) + * + * Authors: + * Dmitry Fleytman + * Yan Vugenfirer + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + * + */ + +#define VMXNET3_ENABLE_MSIX +#define VMXNET3_ENABLE_MSI + +/* Define this constant to non-zero to enable IP4 */ +/* fragmentation feature */ + +/* #define VMXNET_MAX_IP_PLOAD_LEN ETH_MAX_IP_PLOAD_LEN */ +#define VMXNET3_MAX_IP_PLOAD_LEN 0 + +#include "hw.h" +#include "pci.h" +#include "net.h" +#include "virtio-net.h" +#include "net/tap.h" +#include "sysemu.h" +#include "iov.h" +#include "bswap.h" +#ifdef VMXNET3_ENABLE_MSIX +#include "msix.h" +#endif +#ifdef VMXNET3_ENABLE_MSI +#include "msi.h" +#endif + +#include "vmxnet3_debug.h" +#include "vmxnet3.h" +#include "vmware_utils.h" +#include "vmxnet_utils.h" + +#define PCI_DEVICE_ID_VMWARE_VMXNET3_REVISION 0x1 +#define VMXNET3_MSIX_BAR_SIZE 0x2000 + +#define VMXNET3_BAR0_IDX (0) +#define VMXNET3_BAR1_IDX (1) +#define VMXNET3_MSIX_BAR_IDX (2) + +/* Link speed in Mbps should be shifted by 16 */ +#define VMXNET3_LINK_SPEED (1000 << 16) + +/* Link status: 1 - up, 0 - down. */ +#define VMXNET3_LINK_STATUS_UP 0x1 + +/* Least significant bit should be set for revision and version */ +#define VMXNET3_DEVICE_VERSION 0x1 +#define VMXNET3_DEVICE_REVISION 0x1 + +/* Macros for rings descriptors access */ +#define VMXNET3_READ_TX_QUEUE_DESCR8(dpa, field) \ + (vmw_shmem_ld8(dpa + offsetof(struct Vmxnet3_TxQueueDesc, field))) + +#define VMXNET3_WRITE_TX_QUEUE_DESCR8(dpa, field, value) \ + (vmw_shmem_st8(dpa + offsetof(struct Vmxnet3_TxQueueDesc, field, value))) + +#define VMXNET3_READ_TX_QUEUE_DESCR32(dpa, field) \ + (vmw_shmem_ld32(dpa + offsetof(struct Vmxnet3_TxQueueDesc, field))) + +#define VMXNET3_WRITE_TX_QUEUE_DESCR32(dpa, field, value) \ + (vmw_shmem_st32(dpa + offsetof(struct Vmxnet3_TxQueueDesc, field), value)) + +#define VMXNET3_READ_TX_QUEUE_DESCR64(dpa, field) \ + (vmw_shmem_ld64(dpa + offsetof(struct Vmxnet3_TxQueueDesc, field))) + +#define VMXNET3_WRITE_TX_QUEUE_DESCR64(dpa, field, value) \ + (vmw_shmem_st64(dpa + offsetof(struct Vmxnet3_TxQueueDesc, field), value)) + +#define VMXNET3_READ_RX_QUEUE_DESCR64(dpa, field) \ + (vmw_shmem_ld64(dpa + offsetof(struct Vmxnet3_RxQueueDesc, field))) + +#define VMXNET3_READ_RX_QUEUE_DESCR32(dpa, field) \ + (vmw_shmem_ld32(dpa + offsetof(struct Vmxnet3_RxQueueDesc, field))) + +#define VMXNET3_WRITE_RX_QUEUE_DESCR64(dpa, field, value) \ + (vmw_shmem_st64(dpa + offsetof(struct Vmxnet3_RxQueueDesc, field), value)) + +#define VMXNET3_WRITE_RX_QUEUE_DESCR8(dpa, field, value) \ + (vmw_shmem_st8(dpa + offsetof(struct Vmxnet3_RxQueueDesc, field), value)) + +/* Macros for guest driver shared area access */ +#define VMXNET3_READ_DRV_SHARED64(shpa, field) \ + (vmw_shmem_ld64(shpa + offsetof(struct Vmxnet3_DriverShared, field))) + +#define VMXNET3_READ_DRV_SHARED32(shpa, field) \ + (vmw_shmem_ld32(shpa + offsetof(struct Vmxnet3_DriverShared, field))) + +#define VMXNET3_WRITE_DRV_SHARED32(shpa, field, val) \ + (vmw_shmem_st32(shpa + offsetof(struct Vmxnet3_DriverShared, field), val)) + +#define VMXNET3_READ_DRV_SHARED16(shpa, field) \ + (vmw_shmem_ld16(shpa + offsetof(struct Vmxnet3_DriverShared, field))) + +#define VMXNET3_READ_DRV_SHARED8(shpa, field) \ + (vmw_shmem_ld8(shpa + offsetof(struct Vmxnet3_DriverShared, field))) + +#define VMXNET3_READ_DRV_SHARED(shpa, field, b, l) \ + (vmw_shmem_read(shpa + offsetof(struct Vmxnet3_DriverShared, field), b, l)) + +/* TX/RX packets abstractions */ +typedef struct Vmxnet3_TxPktMdata { + uint32_t offload_mode; + uint32_t cso_or_gso_size; + uint32_t hdr_length; + eth_pkt_types_e packet_type; +} Vmxnet3_TxPktMdata; + +typedef struct _Vmxnet3_RxPktMdata { + uint32_t tot_len; + uint16_t vlan_tag; + bool vlan_stripped; + bool vhdr_valid; + eth_pkt_types_e packet_type; +} Vmxnet3_RxPktMdata; + +#define VMXNET3_TXPKT_REBUILT_HDR_LEN (1024) + +typedef struct _Vmxnet3_TxPkt { + Vmxnet3_TxPktMdata mdata; + struct virtio_net_hdr virt_hdr; + bool has_virt_hdr; + + struct iovec *vec; + + uint8_t __l2_hdr[ETH_MAX_L2_HDR_LEN]; + uint8_t __l3_hdr[ETH_MAX_L3_HDR_LEN]; + + uint32_t payload_len; + uint32_t max_payload_len; + + uint32_t payload_frags; + uint32_t max_payload_frags; + + struct { + uint32_t offset; + bool more_frags; + bool orig_more_frags; + } fragmentation; +} Vmxnet3_TxPkt; + +#define VMXNET3_TXPKT_VHDR_FRAG (0) +#define VMXNET3_TXPKT_L2HDR_FRAG (1) +#define VMXNET3_TXPKT_L3HDR_FRAG (2) +#define VMXNET3_TXPKT_PL_START_FRAG (3) + +#define vmxnet3_txpkt_get_mdata(p) (&((p)->mdata)) +#define vmxnet3_txpkt_get_vhdr(p) (&((p)->virt_hdr)) + +#define vmxnet3_txpkt_get_l2hdr(p) \ + ((p)->vec[VMXNET3_TXPKT_L2HDR_FRAG].iov_base) +#define vmxnet3_txpkt_get_l2hdr_len(p) \ + ((p)->vec[VMXNET3_TXPKT_L2HDR_FRAG].iov_len) +#define vmxnet3_txpkt_set_l2hdr_len(p, l) \ + ((p)->vec[VMXNET3_TXPKT_L2HDR_FRAG].iov_len = l) +#define vmxnet3_txpkt_get_l3hdr(p) \ + ((p)->vec[VMXNET3_TXPKT_L3HDR_FRAG].iov_base) +#define vmxnet3_txpkt_get_l3hdr_len(p) \ + ((p)->vec[VMXNET3_TXPKT_L3HDR_FRAG].iov_len) +#define vmxnet3_txpkt_set_l3hdr_len(p, l) \ + ((p)->vec[VMXNET3_TXPKT_L3HDR_FRAG].iov_len = l) +#define vmxnet3_txpkt_get_payload_len(p) \ + ((p)->payload_len) + +#define vmxnet3_txpkt_set_more_frags(p, mf) \ + ((p)->fragmentation.more_frags = mf) +#define vmxnet3_txpkt_get_more_frags(p) \ + ((p)->fragmentation.more_frags | \ + (p)->fragmentation.orig_more_frags) +#define vmxnet3_txpkt_set_frag_off(p, off) \ + ((p)->fragmentation.offset = off) +#define vmxnet3_txpkt_get_frag_off(p) \ + ((p)->fragmentation.offset) +#define vmxnet3_txpkt_advance_frag_off(p, off) \ + ((p)->fragmentation.offset += off) + +static inline size_t +vmxnet3_txpkt_get_total_len(const Vmxnet3_TxPkt *p) +{ + return vmxnet3_txpkt_get_l2hdr_len(p) + + vmxnet3_txpkt_get_l3hdr_len(p) + + vmxnet3_txpkt_get_payload_len(p); +} + +static inline struct iovec* +vmxnet3_txpkt_get_payload_frag(Vmxnet3_TxPkt *p, uint32_t num) +{ + assert(num < p->max_payload_frags); + return &p->vec[num + VMXNET3_TXPKT_PL_START_FRAG]; +} + +static inline void +vmxnet3_txpkt_set_num_pl_frags(Vmxnet3_TxPkt *p, uint32_t num) +{ + assert(num <= p->max_payload_frags); + p->payload_frags = num; +} + +static inline void +vmxnet3_txpkt_reset_payload(Vmxnet3_TxPkt *p) +{ + p->payload_len = 0; +} + +static void vmxnet3_txpkt_reset(Vmxnet3_TxPkt *p) +{ + memset(&p->mdata, 0, sizeof(p->mdata)); + vmxnet3_txpkt_set_num_pl_frags(p, 0); + vmxnet3_txpkt_reset_payload(p); + vmxnet3_txpkt_set_more_frags(p, 0); + vmxnet3_txpkt_set_frag_off(p, 0); + p->max_payload_len = 0; + + if (NULL != p->vec) { + p->vec[VMXNET3_TXPKT_L2HDR_FRAG].iov_len = 0; + p->vec[VMXNET3_TXPKT_L3HDR_FRAG].iov_len = 0; + } +} + +static bool +vmxnet3_txpkt_prealloc(Vmxnet3_TxPkt *p, uint32_t max_frags, bool has_virt_hdr) +{ + if (NULL != p->vec) { + g_free(p->vec); + } + + p->vec = + g_malloc(sizeof(*p->vec) * (max_frags + VMXNET3_TXPKT_PL_START_FRAG)); + if (NULL == p->vec) { + return false; + } + + p->max_payload_frags = max_frags; + p->has_virt_hdr = has_virt_hdr; + p->vec[VMXNET3_TXPKT_VHDR_FRAG].iov_base = &p->virt_hdr; + p->vec[VMXNET3_TXPKT_VHDR_FRAG].iov_len = + p->has_virt_hdr ? sizeof(p->virt_hdr) : 0; + p->vec[VMXNET3_TXPKT_L2HDR_FRAG].iov_base = &p->__l2_hdr; + p->vec[VMXNET3_TXPKT_L3HDR_FRAG].iov_base = &p->__l3_hdr; + vmxnet3_txpkt_reset(p); + return true; +} + +static void vmxnet3_txpkt_init(Vmxnet3_TxPkt *p) +{ + p->vec = NULL; +} + +static void vmxnet3_txpkt_cleanup(Vmxnet3_TxPkt *p) +{ + g_free(p->vec); +} + +static void vmxnet3_txpkt_unmap(Vmxnet3_TxPkt *p, bool is_write) +{ + int i; + + for (i = VMXNET3_TXPKT_PL_START_FRAG; + i < p->payload_frags + VMXNET3_TXPKT_PL_START_FRAG; i++) { + cpu_physical_memory_unmap(p->vec[i].iov_base, p->vec[i].iov_len, + is_write, p->vec[i].iov_len); + } +} + +static void* +vmxnet3_txpkt_map(Vmxnet3_TxPkt *p, uint32_t *mapped_fragments, bool is_write) +{ + int i; + + for (i = VMXNET3_TXPKT_PL_START_FRAG; + i < p->payload_frags + VMXNET3_TXPKT_PL_START_FRAG; i++) { + target_phys_addr_t mapped_len = p->vec[i].iov_len; + size_t orig_len = p->vec[i].iov_len; + p->vec[i].iov_base = + cpu_physical_memory_map((uint64_t) p->vec[i].iov_base, + &mapped_len, is_write); + p->vec[i].iov_len = mapped_len; + + if ((NULL == p->vec[i].iov_base) || (orig_len != mapped_len)) { + p->payload_frags = i + !!p->vec[i].iov_base; + vmxnet3_txpkt_unmap(p, is_write); + return NULL; + } + } + + *mapped_fragments = VMXNET3_TXPKT_PL_START_FRAG + p->payload_frags; + return p->vec; +} + +static inline void +vmxnet3_txpkt_dump(Vmxnet3_TxPkt *p) +{ +#ifdef DEBUG_VMXNET3_PACKETS + Vmxnet3_TxPktMdata *m = vmxnet3_txpkt_get_mdata(p); +#endif + + DPKPRINTF("TXPKT MDATA: om: %d, cso/gso_size: %d, hdr_len: %d, " + "pkt_type: 0x%X, l2hdr_len: %lu l3hdr_len: %lu, payload_len: %u", + m->offload_mode, m->cso_or_gso_size, + m->hdr_length, m->packet_type, + vmxnet3_txpkt_get_l2hdr_len(p), + vmxnet3_txpkt_get_l3hdr_len(p), + vmxnet3_txpkt_get_payload_len(p)); +}; + +/* RX packet may contain up to 2 fragments - rebuilt eth header */ +/* in case of VLAN tag stripping */ +/* and payload received from QEMU - in any case */ +#define VMXNET3_MAX_RX_PACKET_FRAGMENTS (2) + +typedef struct _Vmxnet3_RxPkt { + Vmxnet3_RxPktMdata mdata; + struct virtio_net_hdr virt_hdr; + struct eth_header eth_hdr; + struct iovec vec[VMXNET3_MAX_RX_PACKET_FRAGMENTS]; + uint16 vec_len; +} Vmxnet3_RxPkt; + +#define vmxnet3_rxpkt_get_mdata(p) (&((p)->mdata)) +#define vmxnet3_rxpkt_get_ehdr(p) (&((p)->eth_hdr)) +#define vmxnet3_rxpkt_get_vhdr(p) (&((p)->virt_hdr)) +#define vmxnet3_rxpkt_get_frag(p, n) (&((p)->vec[(n)])) +#define vmxnet3_rxpkt_set_num_frags(p, n) ((p)->vec_len = (n)) +#define vmxnet3_rxpkt_get_num_frags(p) ((p)->vec_len) + +static inline void vmxnet3_rxpkt_attach_ehdr(Vmxnet3_RxPkt *p) +{ + vmxnet3_rxpkt_get_frag(p, 0)->iov_base = &p->eth_hdr; + vmxnet3_rxpkt_get_frag(p, 0)->iov_len = sizeof(p->eth_hdr); +} + +static inline void vmxnet3_rxpkt_reset(Vmxnet3_RxPkt *p) +{ + memset(&p->mdata, 0, sizeof(p->mdata)); + memset(&p->virt_hdr, 0, sizeof(p->virt_hdr)); + vmxnet3_rxpkt_set_num_frags(p, 0); +} + +static void vmxnet3_rxpkt_init(Vmxnet3_RxPkt *p) +{ + vmxnet3_rxpkt_reset(p); +} + +static inline void +vmxnet3_rxpkt_dump(Vmxnet3_RxPkt *p) +{ +#ifdef DEBUG_VMXNET3_PACKETS + Vmxnet3_RxPktMdata *m = vmxnet3_rxpkt_get_mdata(p); +#endif + + DPKPRINTF("RXPKT MDATA: tot_len: %d, pkt_type: 0x%X, " + "vlan_stripped: %d, vlan_tag: %d, vhdr_valid: %d", + m->tot_len, m->packet_type, + m->vlan_stripped, m->vlan_tag, m->vhdr_valid); +}; + +/* Cyclic ring abstraction */ +typedef struct _Vmxnet3_Ring { + target_phys_addr_t pa; + size_t size; + size_t cell_size; + size_t next; + uint8_t gen; +} Vmxnet3_Ring; + +static inline void vmxnet3_ring_init(Vmxnet3_Ring *ring, + target_phys_addr_t pa, + size_t size, + size_t cell_size, + bool zero_region) +{ + ring->pa = pa; + ring->size = size; + ring->cell_size = cell_size; + ring->gen = VMXNET3_INIT_GEN; + ring->next = 0; + + if (zero_region) { + vmw_shmem_set(pa, 0, size*cell_size); + } +} + +#define vmxnet3_ring_dump(macro, ring_name, ridx, r) \ + macro("%s#%d: base %" PRIx64 " size %lu cell_size %lu gen %d next %lu", \ + (ring_name), (ridx), (uint64_t) (r)->pa, \ + (r)->size, (r)->cell_size, (r)->gen, (r)->next) + +static inline void vmxnet3_ring_inc(Vmxnet3_Ring *ring) +{ + if (++ring->next >= ring->size) { + ring->next = 0; + ring->gen ^= 1; + } +} + +static inline void vmxnet3_ring_dec(Vmxnet3_Ring *ring) +{ + if (0 == ring->next--) { + ring->next = ring->size - 1; + ring->gen ^= 1; + } +} + +static inline target_phys_addr_t vmxnet3_ring_curr_cell_pa(Vmxnet3_Ring *ring) +{ + return ring->pa + ring->next * ring->cell_size; +} + +static inline void vmxnet3_ring_read_curr_cell(Vmxnet3_Ring *ring, void *buff) +{ + vmw_shmem_read(vmxnet3_ring_curr_cell_pa(ring), buff, ring->cell_size); +} + +static inline void vmxnet3_ring_write_curr_cell(Vmxnet3_Ring *ring, void *buff) +{ + vmw_shmem_write(vmxnet3_ring_curr_cell_pa(ring), buff, ring->cell_size); +} + +static inline size_t vmxnet3_ring_curr_cell_idx(Vmxnet3_Ring *ring) +{ + return ring->next; +} + +static inline uint8_t vmxnet3_ring_curr_gen(Vmxnet3_Ring *ring) +{ + return ring->gen; +} + +/* Debug trace-related functions */ +static inline void +vmxnet3_dump_tx_descr(struct Vmxnet3_TxDesc *descr) +{ + DPKPRINTF("TX DESCR: " + "addr %" PRIx64 ", len: %d, gen: %d, rsvd: %d, " + "dtype: %d, ext1: %d, msscof: %d, hlen: %d, om: %d, " + "eop: %d, cq: %d, ext2: %d, ti: %d, tci: %d", + le64_to_cpu(descr->addr), descr->len, descr->gen, descr->rsvd, + descr->dtype, descr->ext1, descr->msscof, descr->hlen, descr->om, + descr->eop, descr->cq, descr->ext2, descr->ti, descr->tci); +} + +static inline void +vmxnet3_dump_virt_hdr(struct virtio_net_hdr *vhdr) +{ + DPKPRINTF("VHDR: flags 0x%x, gso_type: 0x%x, hdr_len: %d, gso_size: %d, " + "csum_start: %d, csum_offset: %d", + vhdr->flags, vhdr->gso_type, vhdr->hdr_len, vhdr->gso_size, + vhdr->csum_start, vhdr->csum_offset); +} + +static inline void +vmxnet3_dump_rx_descr(struct Vmxnet3_RxDesc *descr) +{ + DPKPRINTF("RX DESCR: addr %" PRIx64 ", len: %d, gen: %d, rsvd: %d, " + "dtype: %d, ext1: %d, btype: %d", + le64_to_cpu(descr->addr), descr->len, descr->gen, + descr->rsvd, descr->dtype, descr->ext1, descr->btype); +} + +/* Device state and helper functions */ +#define VMXNET3_RX_RINGS_PER_QUEUE (2) + +typedef struct _VMXNET3_State { + PCIDevice dev; + NICState *nic; + NICConf conf; + MemoryRegion bar0; + MemoryRegion bar1; + MemoryRegion msix_bar; + +#ifdef VMXNET3_ENABLE_MSIX + /* Whether MSI-X support was installed successfully */ + uint8_t msix_used; +#endif +#ifdef VMXNET3_ENABLE_MSI + /* Whether MSI support was installed successfully */ + uint8_t msi_used; +#endif + + target_phys_addr_t drv_shmem; + target_phys_addr_t temp_shared_guest_driver_memory; + + uint8_t txq_num; + struct { + Vmxnet3_Ring tx_ring; + Vmxnet3_Ring comp_ring; + + uint8_t intr_idx; + target_phys_addr_t tx_stats_pa; + struct UPT1_TxStats txq_stats; + } txq_descr[VMXNET3_DEVICE_MAX_TX_QUEUES]; + + /* This boolean tells whether RX packet being indicated has to */ + /* be split into head and body chunks from different RX rings */ + bool rx_packets_compound; + + bool rx_vlan_stripping; + bool lro_supported; + + uint8_t rxq_num; + struct { + Vmxnet3_Ring rx_ring[VMXNET3_RX_RINGS_PER_QUEUE]; + Vmxnet3_Ring comp_ring; + uint8_t intr_idx; + target_phys_addr_t rx_stats_pa; + struct UPT1_RxStats rxq_stats; + } rxq_descr[VMXNET3_DEVICE_MAX_RX_QUEUES]; + + /* Network MTU */ + uint32_t mtu; + + /* Maximum number of fragments for indicated TX packets */ + uint32_t max_tx_frags; + + /* Maximum number of fragments for indicated RX packets */ + uint16_t max_rx_frags; + + /* Index for events interrupt */ + uint8_t event_int_idx; + + /* Whether automatic interrupts masking enabled */ + uint8_t auto_int_masking; + + bool peer_has_vhdr; + + /* TX packets to QEMU interface */ + Vmxnet3_TxPkt curr_txpkt; + size_t curr_txpkt_pl_frags; + bool curr_txpkt_skip; + bool curr_txpkt_header_processed; + + uint32_t device_active; + uint32_t last_command; + + uint32_t link_status_and_speed; + + struct { + bool is_masked; + bool is_pending; + bool is_asserted; + } interrupt_states[VMXNET3_MAX_INTRS]; + + uint32_t temp_mac; /* To store the low part first */ + + MACAddr perm_mac; + uint32_t vlan_table[VMXNET3_VFT_SIZE]; + uint32_t rx_mode; + MACAddr *mcast_list; + uint16_t mcast_list_len; +} VMXNET3_State; + +/* Interrupt management */ + +/* This function returns sign whether interrupt line is in asserted state */ +/* This depends on the type of interrupt used. For INTX interrupt line will */ +/* be asserted until explicit deassertion, for MSI(X) interrupt line will */ +/* be deasserted automatically due to notifiction symantics of the MSI(X) */ +/* interrupts */ +static bool _vmxnet3_assert_interrupt_line(VMXNET3_State *s, uint32_t int_idx) +{ +#ifdef VMXNET3_ENABLE_MSIX + if (s->msix_used && msix_enabled(&s->dev)) { + DIRPRINTF("Sending MSI-X notification for vector %u", int_idx); + msix_notify(&s->dev, int_idx); + return false; + } +#endif +#ifdef VMXNET3_ENABLE_MSI + if (s->msi_used && msi_enabled(&s->dev)) { + DIRPRINTF("Sending MSI notification for vector %u", int_idx); + msi_notify(&s->dev, int_idx); + return false; + } +#endif + + DIRPRINTF("Asserting line for interrupt %u", int_idx); + qemu_set_irq(s->dev.irq[int_idx], 1); + return true; +} + +static void _vmxnet3_deassert_interrupt_line(VMXNET3_State *s, int lidx) +{ +#ifdef VMXNET3_ENABLE_MSIX + /* This function should never be called for MSI(X) interrupts */ + /* because deassertion never required for message interrupts */ + assert(!s->msix_used || !msix_enabled(&s->dev)); +#endif +#ifdef VMXNET3_ENABLE_MSI + /* This function should never be called for MSI(X) interrupts */ + /* because deassertion never required for message interrupts */ + assert(!s->msi_used || !msi_enabled(&s->dev)); +#endif + + DIRPRINTF("Deasserting line for interrupt %u", lidx); + qemu_set_irq(s->dev.irq[lidx], 0); +} + +static void vmxnet3_update_interrupt_line_state(VMXNET3_State *s, int lidx) +{ + if (!s->interrupt_states[lidx].is_pending && + s->interrupt_states[lidx].is_asserted) { + DIRPRINTF("New interrupt line state for index %d is DOWN", lidx); + _vmxnet3_deassert_interrupt_line(s, lidx); + s->interrupt_states[lidx].is_asserted = false; + return; + } + + if (s->interrupt_states[lidx].is_pending && + !s->interrupt_states[lidx].is_masked && + !s->interrupt_states[lidx].is_asserted) { + DIRPRINTF("New interrupt line state for index %d is UP", lidx); + s->interrupt_states[lidx].is_asserted = + _vmxnet3_assert_interrupt_line(s, lidx); + s->interrupt_states[lidx].is_pending = false; + return; + } +} + +static void vmxnet3_trigger_interrupt(VMXNET3_State *s, int lidx) +{ + s->interrupt_states[lidx].is_pending = true; + vmxnet3_update_interrupt_line_state(s, lidx); + +#ifdef VMXNET3_ENABLE_MSIX + if (s->msix_used && msix_enabled(&s->dev) && s->auto_int_masking) { + goto do_automask; + } +#endif + +#ifdef VMXNET3_ENABLE_MSI + if (s->msi_used && msi_enabled(&s->dev) && s->auto_int_masking) { + goto do_automask; + } +#endif + + return; + +do_automask: + s->interrupt_states[lidx].is_masked = true; + vmxnet3_update_interrupt_line_state(s, lidx); +} + +static bool vmxnet3_interrupt_asserted(VMXNET3_State *s, int lidx) +{ + return s->interrupt_states[lidx].is_asserted; +} + +static void vmxnet3_clear_interrupt(VMXNET3_State *s, int int_idx) +{ + s->interrupt_states[int_idx].is_pending = false; + if (s->auto_int_masking) { + s->interrupt_states[int_idx].is_masked = true; + } + vmxnet3_update_interrupt_line_state(s, int_idx); +} + +static void +vmxnet3_on_interrupt_mask_changed(VMXNET3_State *s, int lidx, bool is_masked) +{ + s->interrupt_states[lidx].is_masked = is_masked; + vmxnet3_update_interrupt_line_state(s, lidx); +} + +static bool vmxnet3_verify_driver_magic(target_phys_addr_t dshmem) +{ + return (VMXNET3_REV1_MAGIC == VMXNET3_READ_DRV_SHARED32(dshmem, magic)); +} + +#define _GET_BYTE(x, byte_num) (((x) >> (byte_num)*8) & 0xFF) +#define _MAKE_BYTE(byte_num, val) (((uint32_t)((val) & 0xFF)) << (byte_num)*8) + +static void vmxnet3_set_variable_mac(VMXNET3_State *s, uint32_t h, uint32_t l) +{ + s->conf.macaddr.a[0] = _GET_BYTE(l, 0); + s->conf.macaddr.a[1] = _GET_BYTE(l, 1); + s->conf.macaddr.a[2] = _GET_BYTE(l, 2); + s->conf.macaddr.a[3] = _GET_BYTE(l, 3); + s->conf.macaddr.a[4] = _GET_BYTE(h, 0); + s->conf.macaddr.a[5] = _GET_BYTE(h, 1); + + DCFPRINTF("Variable MAC: " MAC_FMT, MAC_ARG(s->conf.macaddr.a)); + + qemu_format_nic_info_str(&s->nic->nc, s->conf.macaddr.a); +} + +static uint64_t vmxnet3_get_mac_low(MACAddr *addr) +{ + return _MAKE_BYTE(0, addr->a[0]) | + _MAKE_BYTE(1, addr->a[1]) | + _MAKE_BYTE(2, addr->a[2]) | + _MAKE_BYTE(3, addr->a[3]); +} + +static uint64_t vmxnet3_get_mac_high(MACAddr *addr) +{ + return _MAKE_BYTE(0, addr->a[4]) | + _MAKE_BYTE(1, addr->a[5]); +} + +static void +vmxnet3_inc_tx_consumption_counter(VMXNET3_State *s, int qidx) +{ + vmxnet3_ring_inc(&s->txq_descr[qidx].tx_ring); +} + +static inline void +vmxnet3_inc_rx_consumption_counter(VMXNET3_State *s, int qidx, int ridx) +{ + vmxnet3_ring_inc(&s->rxq_descr[qidx].rx_ring[ridx]); +} + +static inline void +vmxnet3_inc_tx_completion_counter(VMXNET3_State *s, int qidx) +{ + vmxnet3_ring_inc(&s->txq_descr[qidx].comp_ring); +} + +static void +vmxnet3_inc_rx_completion_counter(VMXNET3_State *s, int qidx) +{ + vmxnet3_ring_inc(&s->rxq_descr[qidx].comp_ring); +} + +static void +vmxnet3_dec_rx_completion_counter(VMXNET3_State *s, int qidx) +{ + vmxnet3_ring_dec(&s->rxq_descr[qidx].comp_ring); +} + +static inline void vmxnet3_flush_shmem_changes(void) +{ + /* Flush shared memory changes */ + /* Needed before transferring comntrol to guest */ + smp_wmb(); +} + +static void vmxnet3_complete_packet(VMXNET3_State *s, int qidx, uint32 tx_ridx) +{ + struct Vmxnet3_TxCompDesc txcq_descr; + + vmxnet3_ring_dump(DRIPRINTF, "TXC", qidx, &s->txq_descr[qidx].comp_ring); + + txcq_descr.txdIdx = tx_ridx; + txcq_descr.gen = vmxnet3_ring_curr_gen(&s->txq_descr[qidx].comp_ring); + + vmxnet3_ring_write_curr_cell(&s->txq_descr[qidx].comp_ring, &txcq_descr); + vmxnet3_inc_tx_completion_counter(s, qidx); + + vmxnet3_flush_shmem_changes(); + vmxnet3_trigger_interrupt(s, s->txq_descr[qidx].intr_idx); +} + +static bool +vmxnet3_setup_tx_offloads(Vmxnet3_TxPkt *pkt) +{ + Vmxnet3_TxPktMdata *mdata = vmxnet3_txpkt_get_mdata(pkt); + struct virtio_net_hdr *vhdr = vmxnet3_txpkt_get_vhdr(pkt); + bool res = true; + + vhdr->hdr_len = mdata->hdr_length; + + switch (mdata->offload_mode) { + case VMXNET3_OM_NONE: + vhdr->flags = 0; + vhdr->gso_type = VIRTIO_NET_HDR_GSO_NONE; + vhdr->gso_size = 0; + break; + + case VMXNET3_OM_CSUM: { + DPKPRINTF("L4 CSO requested data_offset: %d, csoff: %d", + mdata->hdr_length, mdata->cso_or_gso_size); + vhdr->flags = VIRTIO_NET_HDR_F_NEEDS_CSUM; + vhdr->gso_type = VIRTIO_NET_HDR_GSO_NONE; + vhdr->gso_size = 0; + vhdr->csum_start = mdata->hdr_length; + vhdr->csum_offset = mdata->cso_or_gso_size - mdata->hdr_length; + } + break; + + case VMXNET3_OM_TSO: { + uint8_t *l2hdr = vmxnet3_txpkt_get_l2hdr(pkt); + size_t l2hdr_len = vmxnet3_txpkt_get_l2hdr_len(pkt); + uint8_t *l3hdr = vmxnet3_txpkt_get_l3hdr(pkt); + size_t l3hdr_len = vmxnet3_txpkt_get_l3hdr_len(pkt); + uint16_t l3_proto = eth_get_l3_proto(l2hdr, l2hdr_len); + size_t payload_len = vmxnet3_txpkt_get_payload_len(pkt); + + vhdr->gso_type = eth_get_gso_type(l3_proto, l3hdr); + vhdr->gso_size = mdata->cso_or_gso_size; + res = eth_setup_tx_offloads(l3hdr, l3hdr_len, l2hdr_len, + payload_len, vhdr, + vmxnet3_txpkt_get_more_frags(pkt), + vmxnet3_txpkt_get_frag_off(pkt)); + DPKPRINTF("GSO offload type %d requested.", vhdr->gso_type); + } + break; + + default: + assert(false); + } + + return res; +} + +static size_t +vmxnet3_txpkt_adopt_headers(Vmxnet3_TxPkt *pkt, + size_t data_len, + target_phys_addr_t data_pa, + bool needs_tso) +{ + /* Copy L2 header */ + uint8_t *l2hdr = vmxnet3_txpkt_get_l2hdr(pkt); + uint8_t *l3hdr = vmxnet3_txpkt_get_l3hdr(pkt); + size_t l2hdr_len = 0; + size_t l3hdr_len = 0; + + assert(data_len >= ETH_MAX_L2_HDR_LEN); + cpu_physical_memory_read(data_pa, l2hdr, ETH_MAX_L2_HDR_LEN); + l2hdr_len = eth_get_l2_hdr_length(l2hdr); + vmxnet3_txpkt_set_l2hdr_len(pkt, l2hdr_len); + + /* If packet requires offload - copy L3 header */ + if (needs_tso) { + switch (eth_get_l3_proto(l2hdr, l2hdr_len)) { + case ETH_P_IP: { + target_phys_addr_t ip_opt_pa; + struct ip_header *iphdr = (struct ip_header *) l3hdr; + assert(data_len >= l2hdr_len + sizeof(struct ip_header)); + cpu_physical_memory_read(data_pa + l2hdr_len, + l3hdr, sizeof(struct ip_header)); + l3hdr_len = IP_HDR_GET_LEN(l3hdr); + ip_opt_pa = data_pa + l2hdr_len + sizeof(struct ip_header); + cpu_physical_memory_read(ip_opt_pa, + l3hdr + sizeof(struct ip_header), + l3hdr_len - sizeof(struct ip_header)); + pkt->max_payload_len = + IP_FRAG_ALIGN_SIZE(VMXNET3_MAX_IP_PLOAD_LEN); + pkt->fragmentation.orig_more_frags = + FLAG_IS_SET(be16_to_cpu(iphdr->ip_off), IP_MF); + } + break; + + case ETH_P_IPV6: { + target_phys_addr_t l3hdr_pa = data_pa + l2hdr_len; + l3hdr_len = sizeof(struct ip6_header); + assert(data_len >= l2hdr_len + l3hdr_len); + cpu_physical_memory_read(l3hdr_pa, l3hdr, l3hdr_len); + pkt->max_payload_len = 0; + } + break; + + default: { + l3hdr_len = 0; + pkt->max_payload_len = 0; + } + break; + } + } + + vmxnet3_txpkt_set_l3hdr_len(pkt, l3hdr_len); + + /* Return amount of data adopted */ + return l2hdr_len + l3hdr_len; +} + +static void +vmxnet3_tx_retrieve_metadata(Vmxnet3_TxPkt *pkt, + const struct Vmxnet3_TxDesc *txd) +{ + struct eth_header *ehdr = + (struct eth_header *) vmxnet3_txpkt_get_l2hdr(pkt); + + Vmxnet3_TxPktMdata *mdata = vmxnet3_txpkt_get_mdata(pkt); + mdata->offload_mode = txd->om; + mdata->cso_or_gso_size = txd->msscof; + mdata->hdr_length = txd->hlen; + mdata->packet_type = get_eth_packet_type(ehdr); + + if (txd->ti) { + eth_setup_vlan_headers(ehdr, txd->tci); + } +} + +static size_t +vmxnet3_txpkt_adopt_data_fragment(Vmxnet3_TxPkt *pkt, + target_phys_addr_t data_pa, + size_t data_len, + uint32_t fragment_num) +{ + struct iovec *v = vmxnet3_txpkt_get_payload_frag(pkt, fragment_num); + size_t bytes_to_adopt = data_len; + + if ((0 != pkt->max_payload_len) && + (pkt->payload_len + data_len > pkt->max_payload_len)) { + bytes_to_adopt = pkt->max_payload_len - pkt->payload_len; + } + + v->iov_base = (void *) (uint64_t) data_pa; + v->iov_len = bytes_to_adopt; + pkt->payload_len += bytes_to_adopt; + return bytes_to_adopt; +} + +typedef enum { + VMXNET3_SUCCEEDED = 0xBEEFBEEF, + VMXNET3_OUT_OF_BUF, + VMXNET3_PKT_ERROR +} Vmxnet3_PktStatus; + +static void +vmxnet3_on_tx_done_update_stats(VMXNET3_State *s, + Vmxnet3_TxPkt *pkt, + int qidx, + Vmxnet3_PktStatus status) +{ + Vmxnet3_TxPktMdata *mdata = vmxnet3_txpkt_get_mdata(&s->curr_txpkt); + size_t tot_len = vmxnet3_txpkt_get_total_len(pkt); + struct UPT1_TxStats *stats = &s->txq_descr[qidx].txq_stats; + + switch (status) { + case VMXNET3_SUCCEEDED: { + switch (mdata->packet_type) { + case VMXNET3_PKT_BCAST: + stats->bcastPktsTxOK++; + stats->bcastBytesTxOK += tot_len; + break; + case VMXNET3_PKT_MCAST: + stats->mcastPktsTxOK++; + stats->mcastBytesTxOK += tot_len; + break; + case VMXNET3_PKT_UCAST: + stats->ucastPktsTxOK++; + stats->ucastBytesTxOK += tot_len; + break; + default: + assert(false); + } + + if (VMXNET3_OM_TSO == mdata->offload_mode) { + /* According to VMWARE headers this statistic is a number */ + /* of packets after segmentation but since we don't have */ + /* this information in QEMU model, the best we can do is to */ + /* provide number of non-segmented packets */ + stats->TSOPktsTxOK++; + stats->TSOBytesTxOK += tot_len; + } + } + break; + + case VMXNET3_PKT_ERROR: { + stats->pktsTxDiscard++; + } + break; + + case VMXNET3_OUT_OF_BUF: { + stats->pktsTxError++; + } + break; + + default: + assert(false); + } +} + +static void +vmxnet3_on_rx_done_update_stats(VMXNET3_State *s, + Vmxnet3_RxPkt *pkt, + int qidx, + Vmxnet3_PktStatus status) +{ + Vmxnet3_RxPktMdata *mdata = vmxnet3_rxpkt_get_mdata(pkt); + struct UPT1_RxStats *stats = &s->rxq_descr[qidx].rxq_stats; + + switch (status) { + case VMXNET3_OUT_OF_BUF: + stats->pktsRxOutOfBuf++; + break; + + case VMXNET3_PKT_ERROR: + stats->pktsRxError++; + break; + + case VMXNET3_SUCCEEDED: + switch (mdata->packet_type) { + case VMXNET3_PKT_BCAST: + stats->bcastPktsRxOK++; + stats->bcastBytesRxOK += mdata->tot_len; + break; + case VMXNET3_PKT_MCAST: + stats->mcastPktsRxOK++; + stats->mcastBytesRxOK += mdata->tot_len; + break; + case VMXNET3_PKT_UCAST: + stats->ucastPktsRxOK++; + stats->ucastBytesRxOK += mdata->tot_len; + break; + default: + assert(false); + } + + if (mdata->tot_len > s->mtu) { + stats->LROPktsRxOK++; + stats->LROBytesRxOK += mdata->tot_len; + } + break; + + default: + assert(false); + } +} + +static inline bool +vmxnet3_pop_next_tx_descr(VMXNET3_State *s, + int qidx, + struct Vmxnet3_TxDesc *txd, + uint32_t *descr_idx) +{ + Vmxnet3_Ring *ring = &s->txq_descr[qidx].tx_ring; + + vmxnet3_ring_read_curr_cell(ring, txd); + if (txd->gen == vmxnet3_ring_curr_gen(ring)) { + vmxnet3_ring_dump(DRIPRINTF, "TX", qidx, ring); + *descr_idx = vmxnet3_ring_curr_cell_idx(ring); + vmxnet3_inc_tx_consumption_counter(s, qidx); + return true; + } + + return false; +} + +static bool +vmxnet3_send_packet(VMXNET3_State *s, Vmxnet3_TxPkt *pkt, uint32_t qidx) +{ + uint32_t mapped_fragments; + void *mapped = vmxnet3_txpkt_map(&s->curr_txpkt, &mapped_fragments, false); + if (NULL != mapped) { + bool res; + if (vmxnet3_setup_tx_offloads(pkt)) { + vmxnet3_dump_virt_hdr(vmxnet3_txpkt_get_vhdr(pkt)); + vmxnet3_txpkt_dump(pkt); + qemu_sendv_packet(&s->nic->nc, mapped, mapped_fragments); + vmxnet3_on_tx_done_update_stats(s, pkt, qidx, VMXNET3_SUCCEEDED); + res = true; + } else { + vmxnet3_on_tx_done_update_stats(s, pkt, qidx, VMXNET3_PKT_ERROR); + res = false; + } + vmxnet3_txpkt_unmap(pkt, false); + return res; + } else { + vmxnet3_on_tx_done_update_stats(s, &s->curr_txpkt, + qidx, VMXNET3_OUT_OF_BUF); + return false; + } +} + +static void vmxnet3_process_tx_queue(VMXNET3_State *s, int qidx) +{ + struct Vmxnet3_TxDesc txd; + uint32_t txd_idx; + uint32_t data_len; + target_phys_addr_t data_pa; + size_t bytes_adopted; + + for (;;) { + if (!vmxnet3_pop_next_tx_descr(s, qidx, &txd, &txd_idx)) { + break; + } + + vmxnet3_dump_tx_descr(&txd); + + if (!s->curr_txpkt_skip) { + data_len = (txd.len > 0) ? txd.len : VMXNET3_MAX_TX_BUF_SIZE; + data_pa = le64_to_cpu(txd.addr); + + if (!s->curr_txpkt_header_processed) { + bool needs_tso = (VMXNET3_OM_TSO == txd.om); + bytes_adopted = vmxnet3_txpkt_adopt_headers(&s->curr_txpkt, + data_len, + data_pa, + needs_tso); + vmxnet3_tx_retrieve_metadata(&s->curr_txpkt, &txd); + data_pa += bytes_adopted; + data_len -= bytes_adopted; + s->curr_txpkt_header_processed = true; + } + + do { + if (0 != data_len) { + int frag_num = s->curr_txpkt_pl_frags++; + bytes_adopted = + vmxnet3_txpkt_adopt_data_fragment(&s->curr_txpkt, + data_pa, + data_len, + frag_num); + data_pa += bytes_adopted; + data_len -= bytes_adopted; + } + + if ((0 != data_len) || txd.eop) { + size_t frag_off; + + vmxnet3_txpkt_set_num_pl_frags(&s->curr_txpkt, + s->curr_txpkt_pl_frags); + + vmxnet3_txpkt_set_more_frags(&s->curr_txpkt, + (0 != data_len)); + + s->curr_txpkt_skip = + !vmxnet3_send_packet(s, &s->curr_txpkt, qidx); + + frag_off = vmxnet3_txpkt_get_payload_len(&s->curr_txpkt) / + IP_FRAG_UNIT_SIZE; + + vmxnet3_txpkt_advance_frag_off(&s->curr_txpkt, frag_off); + + vmxnet3_txpkt_reset_payload(&s->curr_txpkt); + s->curr_txpkt_pl_frags = 0; + } + } while (0 != data_len); + } + + if (txd.eop) { + vmxnet3_complete_packet(s, qidx, txd_idx); + vmxnet3_txpkt_reset(&s->curr_txpkt); + s->curr_txpkt_skip = false; + s->curr_txpkt_header_processed = false; + } + } +} + +static inline void +vmxnet3_read_next_rx_descr(VMXNET3_State *s, int qidx, int ridx, + struct Vmxnet3_RxDesc *dbuf, uint32_t *didx) +{ + Vmxnet3_Ring *ring = &s->rxq_descr[qidx].rx_ring[ridx]; + *didx = vmxnet3_ring_curr_cell_idx(ring); + vmxnet3_ring_read_curr_cell(ring, dbuf); +} + +static inline uint8_t +vmxnet3_get_rx_ring_gen(VMXNET3_State *s, int qidx, int ridx) +{ + return s->rxq_descr[qidx].rx_ring[ridx].gen; +} + +static inline target_phys_addr_t +vmxnet3_pop_rxc_descr(VMXNET3_State *s, int qidx, uint32_t *descr_gen) +{ + uint8_t ring_gen; + struct Vmxnet3_RxCompDesc rxcd; + + target_phys_addr_t daddr = + vmxnet3_ring_curr_cell_pa(&s->rxq_descr[qidx].comp_ring); + + cpu_physical_memory_read(daddr, &rxcd, sizeof(struct Vmxnet3_RxCompDesc)); + ring_gen = vmxnet3_ring_curr_gen(&s->rxq_descr[qidx].comp_ring); + + if (rxcd.gen != ring_gen) { + *descr_gen = ring_gen; + vmxnet3_inc_rx_completion_counter(s, qidx); + return daddr; + } + + return 0; +} + +static inline void +vmxnet3_revert_rxc_descr(VMXNET3_State *s, int qidx) +{ + vmxnet3_dec_rx_completion_counter(s, qidx); +} + +#define RXQ_IDX (0) +#define RX_HEAD_BODY_RING (0) +#define RX_BODY_ONLY_RING (1) + +static bool +vmxnet3_get_next_head_rx_descr(VMXNET3_State *s, + struct Vmxnet3_RxDesc *descr_buf, + uint32_t *descr_idx, + uint32_t *ridx) +{ + for (;;) { + uint32_t ring_gen; + vmxnet3_read_next_rx_descr(s, RXQ_IDX, RX_HEAD_BODY_RING, + descr_buf, descr_idx); + + /* If no more free descriptors - return */ + ring_gen = vmxnet3_get_rx_ring_gen(s, RXQ_IDX, RX_HEAD_BODY_RING); + if (descr_buf->gen != ring_gen) { + return false; + } + + /* Mark current descriptor as used/skipped */ + vmxnet3_inc_rx_consumption_counter(s, RXQ_IDX, RX_HEAD_BODY_RING); + + /* If this is what we are looking for - return */ + if (VMXNET3_RXD_BTYPE_HEAD == descr_buf->btype) { + *ridx = RX_HEAD_BODY_RING; + return true; + } + } +} + +static bool +vmxnet3_get_next_body_rx_descr(VMXNET3_State *s, + struct Vmxnet3_RxDesc *dbuf, + uint32_t *didx, + uint32_t *ridx) +{ + vmxnet3_read_next_rx_descr(s, RXQ_IDX, RX_HEAD_BODY_RING, dbuf, didx); + + /* Try to find corresponding descriptor in head/body ring */ + if ((dbuf->gen == vmxnet3_get_rx_ring_gen(s, RXQ_IDX, RX_HEAD_BODY_RING)) && + (VMXNET3_RXD_BTYPE_BODY == dbuf->btype)) { + vmxnet3_inc_rx_consumption_counter(s, RXQ_IDX, RX_HEAD_BODY_RING); + *ridx = RX_HEAD_BODY_RING; + return true; + } + + /* If there is no free descriptors on head/body ring or next free */ + /* descriptor is a head descriptor switch to body only ring */ + vmxnet3_read_next_rx_descr(s, RXQ_IDX, RX_BODY_ONLY_RING, dbuf, didx); + + /* If no more free descriptors - return */ + if (dbuf->gen == vmxnet3_get_rx_ring_gen(s, RXQ_IDX, RX_BODY_ONLY_RING)) { + assert(VMXNET3_RXD_BTYPE_BODY == dbuf->btype); + *ridx = RX_BODY_ONLY_RING; + vmxnet3_inc_rx_consumption_counter(s, RXQ_IDX, RX_BODY_ONLY_RING); + return true; + } + + return false; +} + +static inline bool +vmxnet3_get_next_rx_descr(VMXNET3_State *s, bool is_head, + struct Vmxnet3_RxDesc *descr_buf, + uint32_t *descr_idx, + uint32_t *ridx) +{ + if (is_head || !s->rx_packets_compound) { + return vmxnet3_get_next_head_rx_descr(s, descr_buf, descr_idx, ridx); + } else { + return vmxnet3_get_next_body_rx_descr(s, descr_buf, descr_idx, ridx); + } +} + +static void +vmxnet3_rx_put_metadata_to_descr(Vmxnet3_RxPkt *pkt, + struct Vmxnet3_RxCompDesc *rxcd) +{ + int csum_correct, is_gso; + bool isip4, isip6, istcp, isudp; + uint8_t headers[ETH_MAX_L2_HDR_LEN + ETH_MAX_L3_HDR_LEN]; + Vmxnet3_RxPktMdata *mdata = vmxnet3_rxpkt_get_mdata(pkt); + struct virtio_net_hdr *vhdr; + uint8_t offload_type; + + if (mdata->vlan_stripped) { + rxcd->ts = 1; + rxcd->tci = mdata->vlan_tag; + } + + if (!mdata->vhdr_valid) { + goto nocsum; + } + + vhdr = vmxnet3_rxpkt_get_vhdr(pkt); + /* Checksum is valid when lower level tell so or when lower level */ + /* requires checksum offload telling that packet produced/bridged */ + /* locally and did travel over network after last checksum calculation */ + /* or production */ + csum_correct = FLAG_IS_SET(vhdr->flags, VIRTIO_NET_HDR_F_DATA_VALID) || + FLAG_IS_SET(vhdr->flags, VIRTIO_NET_HDR_F_NEEDS_CSUM); + + offload_type = vhdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN; + is_gso = (offload_type != VIRTIO_NET_HDR_GSO_NONE) ? 1 : 0; + + if (!csum_correct && !is_gso) { + goto nocsum; + } + + /* Make linear copy of L2-L3 headers and parse it */ + iov_to_buf(vmxnet3_rxpkt_get_frag(pkt, 0), + vmxnet3_rxpkt_get_num_frags(pkt), + headers, 0, MIN(sizeof(headers), mdata->tot_len)); + + eth_get_protocols(headers, MIN(sizeof(headers), mdata->tot_len), + &isip4, &isip6, &isudp, &istcp); + if ((!istcp && !isudp) || (!isip4 && !isip6)) { + goto nocsum; + } + + rxcd->cnc = 0; + rxcd->v4 = isip4 ? 1 : 0; + rxcd->v6 = isip6 ? 1 : 0; + rxcd->tcp = istcp ? 1 : 0; + rxcd->udp = isudp ? 1 : 0; + rxcd->fcs = rxcd->tuc = rxcd->ipc = 1; + return; + +nocsum: + rxcd->cnc = 1; + return; +} + +static void +vmxnet3_physical_memory_writev(const struct iovec *iov, + size_t start_iov_off, + target_phys_addr_t target_addr, + size_t bytes_to_copy) +{ + size_t curr_off = 0; + size_t copied = 0; + + while (bytes_to_copy) { + if (start_iov_off < (curr_off + iov->iov_len)) { + size_t chunk_len = + MIN((curr_off + iov->iov_len) - start_iov_off, bytes_to_copy); + + cpu_physical_memory_write(target_addr + copied, + iov->iov_base + start_iov_off - curr_off, + chunk_len); + + copied += chunk_len; + start_iov_off += chunk_len; + curr_off = start_iov_off; + bytes_to_copy -= chunk_len; + } else { + curr_off += iov->iov_len; + } + iov++; + } +} + +static bool +vmxnet3_indicate_packet(VMXNET3_State *s, Vmxnet3_RxPkt *pkt) +{ + struct Vmxnet3_RxDesc rxd; + bool is_head = true; + uint32_t rxd_idx; + uint32_t rx_ridx; + + struct Vmxnet3_RxCompDesc rxcd; + uint32_t new_rxcd_gen = VMXNET3_INIT_GEN; + target_phys_addr_t new_rxcd_pa = 0; + target_phys_addr_t ready_rxcd_pa = 0; + struct iovec *data = vmxnet3_rxpkt_get_frag(pkt, 0); + Vmxnet3_RxPktMdata *mdata = vmxnet3_rxpkt_get_mdata(pkt); + size_t bytes_copied = 0; + size_t bytes_left = mdata->tot_len; + uint16_t num_frags = 0; + + vmxnet3_rxpkt_dump(pkt); + + while ((num_frags < s->max_rx_frags) && + (bytes_left > 0) && + (new_rxcd_pa = vmxnet3_pop_rxc_descr(s, RXQ_IDX, &new_rxcd_gen)) && + vmxnet3_get_next_rx_descr(s, is_head, &rxd, &rxd_idx, &rx_ridx)) { + size_t chunk_size = MIN(bytes_left, rxd.len); + vmxnet3_physical_memory_writev(data, bytes_copied, + le64_to_cpu(rxd.addr), chunk_size); + bytes_copied += chunk_size; + bytes_left -= chunk_size; + + vmxnet3_dump_rx_descr(&rxd); + + if (0 != ready_rxcd_pa) { + cpu_physical_memory_write(ready_rxcd_pa, &rxcd, sizeof(rxcd)); + } + + memset(&rxcd, 0, sizeof(struct Vmxnet3_RxCompDesc)); + rxcd.rxdIdx = rxd_idx; + rxcd.len = chunk_size; + rxcd.sop = is_head; + rxcd.gen = new_rxcd_gen; + rxcd.rqID = RXQ_IDX + rx_ridx*s->rxq_num; + + if (0 == bytes_left) { + vmxnet3_rx_put_metadata_to_descr(pkt, &rxcd); + } + + DRIPRINTF("RX Completion descriptor: rxRing: %lu rxIdx %lu len %lu " + "sop %d csum_correct %lu", + (unsigned long) rx_ridx, + (unsigned long) rxcd.rxdIdx, + (unsigned long) rxcd.len, + (int) rxcd.sop, + (unsigned long) rxcd.tuc); + + is_head = false; + ready_rxcd_pa = new_rxcd_pa; + new_rxcd_pa = 0; + } + + if (0 != ready_rxcd_pa) { + rxcd.eop = 1; + rxcd.err = (0 != bytes_left); + cpu_physical_memory_write(ready_rxcd_pa, &rxcd, sizeof(rxcd)); + vmxnet3_flush_shmem_changes(); + } + + if (0 != new_rxcd_pa) { + vmxnet3_revert_rxc_descr(s, RXQ_IDX); + } + + vmxnet3_trigger_interrupt(s, s->rxq_descr[RXQ_IDX].intr_idx); + + if (bytes_left == 0) { + vmxnet3_on_rx_done_update_stats(s, pkt, RXQ_IDX, VMXNET3_SUCCEEDED); + return true; + } else if (num_frags == s->max_rx_frags) { + vmxnet3_on_rx_done_update_stats(s, pkt, RXQ_IDX, VMXNET3_PKT_ERROR); + return false; + } else { + vmxnet3_on_rx_done_update_stats(s, pkt, RXQ_IDX, VMXNET3_OUT_OF_BUF); + return false; + } +} + +static void +vmxnet3_io_bar0_write(void *opaque, target_phys_addr_t addr, + uint64_t val, unsigned size) +{ + VMXNET3_State *s = opaque; + + if (IS_MULTIREG_ADDR(addr, VMXNET3_REG_TXPROD, + VMXNET3_DEVICE_MAX_TX_QUEUES, VMXNET3_REG_ALIGN)) { + int tx_queue_idx = + MULTIREG_IDX_BY_ADDR(addr, VMXNET3_REG_TXPROD, VMXNET3_REG_ALIGN); + assert(tx_queue_idx <= s->txq_num); + vmxnet3_process_tx_queue(s, tx_queue_idx); + return; + } + +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wtype-limits" + if (IS_MULTIREG_ADDR(addr, VMXNET3_REG_IMR, + VMXNET3_MAX_INTRS, VMXNET3_REG_ALIGN)) { + int l = MULTIREG_IDX_BY_ADDR(addr, VMXNET3_REG_IMR, VMXNET3_REG_ALIGN); + + DCBPRINTF("Interrupt mask for line %d written: 0x%" PRIx64, l, val); + + vmxnet3_on_interrupt_mask_changed(s, l, val); + return; + } +#pragma GCC diagnostic pop + + if (IS_MULTIREG_ADDR(addr, VMXNET3_REG_RXPROD, + VMXNET3_DEVICE_MAX_RX_QUEUES, VMXNET3_REG_ALIGN) || + IS_MULTIREG_ADDR(addr, VMXNET3_REG_RXPROD2, + VMXNET3_DEVICE_MAX_RX_QUEUES, VMXNET3_REG_ALIGN)) { + return; + } + + DWRPRINTF("BAR0 unknown write [%" PRIx64 "] = %" PRIx64 ", size %d", + (uint64_t) addr, val, size); +} + +static uint64_t +vmxnet3_io_bar0_read(void *opaque, target_phys_addr_t addr, unsigned size) +{ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wtype-limits" + if (IS_MULTIREG_ADDR(addr, VMXNET3_REG_IMR, + VMXNET3_MAX_INTRS, VMXNET3_REG_ALIGN)) { + assert(false); + } +#pragma GCC diagnostic pop + + DCBPRINTF("BAR0 unknown read [%" PRIx64 "], size %d", + (uint64_t) addr, size); + return 0; +} + +static void vmxnet3_reset(VMXNET3_State *s) +{ + DCBPRINTF("Resetting vmxnet3..."); + + vmxnet3_txpkt_reset(&s->curr_txpkt); + s->curr_txpkt_pl_frags = 0; + s->curr_txpkt_skip = false; + s->curr_txpkt_header_processed = false; +} + +static void vmxnet3_deactivate_device(VMXNET3_State *s) +{ + DCBPRINTF("Deactivating vmxnet3..."); + s->device_active = false; +} + +static void vmxnet3_update_rx_mode(VMXNET3_State *s) +{ + s->rx_mode = VMXNET3_READ_DRV_SHARED32(s->drv_shmem, + devRead.rxFilterConf.rxMode); + DCFPRINTF("RX mode: 0x%08X", s->rx_mode); +} + +static void vmxnet3_update_vlan_filters(VMXNET3_State *s) +{ + int i; + + /* Copy configuration from shared memory */ + VMXNET3_READ_DRV_SHARED(s->drv_shmem, + devRead.rxFilterConf.vfTable, + s->vlan_table, + sizeof(s->vlan_table)); + + /* Invert byte order when needed */ + for (i = 0; i < ARRAY_SIZE(s->vlan_table); i++) { + s->vlan_table[i] = le32_to_cpu(s->vlan_table[i]); + } + + /* Dump configuration for debugging purposes */ + DCFPRINTF("Configured VLANs:"); + for (i = 0; i < sizeof(s->vlan_table) * 8; i++) { + if (VMXNET3_VFTABLE_ENTRY_IS_SET(s->vlan_table, i)) { + DCFPRINTF("\tVLAN %d is present", i); + } + } +} + +static void vmxnet3_update_mcast_filters(VMXNET3_State *s) +{ + uint16_t list_bytes = + VMXNET3_READ_DRV_SHARED16(s->drv_shmem, + devRead.rxFilterConf.mfTableLen); + + s->mcast_list_len = list_bytes / sizeof(s->mcast_list[0]); + + s->mcast_list = g_realloc(s->mcast_list, list_bytes); + if (NULL == s->mcast_list) { + if (0 == s->mcast_list_len) { + DCFPRINTF("Current multicast list is empty"); + } else { + DERPRINTF("Failed to allocate multicast list of %d elements", + s->mcast_list_len); + } + s->mcast_list_len = 0; + } else { + int i; + target_phys_addr_t mcast_list_pa = + VMXNET3_READ_DRV_SHARED64(s->drv_shmem, + devRead.rxFilterConf.mfTablePA); + + cpu_physical_memory_read(mcast_list_pa, s->mcast_list, list_bytes); + DCFPRINTF("Current multicast list len is %d:", s->mcast_list_len); + for (i = 0; i < s->mcast_list_len; i++) { + DCFPRINTF("\t" MAC_FMT, MAC_ARG(s->mcast_list[i].a)); + } + } +} + +static void vmxnet3_setup_rx_filtering(VMXNET3_State *s) +{ + vmxnet3_update_rx_mode(s); + vmxnet3_update_vlan_filters(s); + vmxnet3_update_mcast_filters(s); +} + +static uint32_t vmxnet3_get_interrupt_config(VMXNET3_State *s) +{ + uint32_t interrupt_mode = VMXNET3_IT_AUTO | (VMXNET3_IMM_AUTO << 2); + DCFPRINTF("Interrupt config is 0x%X", interrupt_mode); + return interrupt_mode; +} + +static void vmxnet3_fill_stats(VMXNET3_State *s) +{ + int i; + for (i = 0; i < s->txq_num; i++) { + cpu_physical_memory_write(s->txq_descr[i].tx_stats_pa, + &s->txq_descr[i].txq_stats, + sizeof(s->txq_descr[i].txq_stats)); + } + + for (i = 0; i < s->rxq_num; i++) { + cpu_physical_memory_write(s->rxq_descr[i].rx_stats_pa, + &s->rxq_descr[i].rxq_stats, + sizeof(s->rxq_descr[i].rxq_stats)); + } +} + +static void vmxnet3_adjust_by_guest_type(VMXNET3_State *s) +{ + struct Vmxnet3_GOSInfo gos; + + VMXNET3_READ_DRV_SHARED(s->drv_shmem, devRead.misc.driverInfo.gos, + &gos, sizeof(gos)); + s->rx_packets_compound = + (VMXNET3_GOS_TYPE_WIN == gos.gosType) ? false : true; + + DCFPRINTF("Guest type specifics: RXCOMPOUND: %d", s->rx_packets_compound); +} + +static void +vmxnet3_dump_conf_descr(const char *name, + struct Vmxnet3_VariableLenConfDesc *pm_descr) +{ + DCFPRINTF("%s descriptor dump: Version %u, Length %u", + name, pm_descr->confVer, pm_descr->confLen); + +}; + +static void vmxnet3_update_pm_state(VMXNET3_State *s) +{ + struct Vmxnet3_VariableLenConfDesc pm_descr; + + pm_descr.confLen = + VMXNET3_READ_DRV_SHARED32(s->drv_shmem, devRead.pmConfDesc.confLen); + pm_descr.confVer = + VMXNET3_READ_DRV_SHARED32(s->drv_shmem, devRead.pmConfDesc.confVer); + pm_descr.confPA = + VMXNET3_READ_DRV_SHARED64(s->drv_shmem, devRead.pmConfDesc.confPA); + + vmxnet3_dump_conf_descr("PM State", &pm_descr); +} + +static void vmxnet3_update_features(VMXNET3_State *s) +{ + uint32_t guest_features; + int rxcsum_offload_supported; + + guest_features = VMXNET3_READ_DRV_SHARED32(s->drv_shmem, + devRead.misc.uptFeatures); + + rxcsum_offload_supported = FLAG_IS_SET(guest_features, UPT1_F_RXCSUM); + s->rx_vlan_stripping = FLAG_IS_SET(guest_features, UPT1_F_RXVLAN); + s->lro_supported = FLAG_IS_SET(guest_features, UPT1_F_LRO); + + DCFPRINTF("Features configuration: LRO: %d, RXCSUM: %d, VLANSTRIP: %d", + s->lro_supported, rxcsum_offload_supported, + s->rx_vlan_stripping); + + tap_set_offload(s->nic->nc.peer, + rxcsum_offload_supported, + s->lro_supported, + s->lro_supported, + 0, + 0); +} + +static void vmxnet3_activate_device(VMXNET3_State *s) +{ + int i; + static const uint32_t VMXNET3_DEF_TX_THRESHOLD = 1; + target_phys_addr_t qdescr_table_pa; + uint64_t pa; + uint32_t size; + + /* Verify configuration consistency */ + if (!vmxnet3_verify_driver_magic(s->drv_shmem)) { + DERPRINTF("Device configuration received from driver is invalid"); + return; + } + + vmxnet3_adjust_by_guest_type(s); + vmxnet3_update_features(s); + vmxnet3_update_pm_state(s); + vmxnet3_setup_rx_filtering(s); + /* Cache fields from shared memory */ + s->mtu = VMXNET3_READ_DRV_SHARED32(s->drv_shmem, devRead.misc.mtu); + DCFPRINTF("MTU is %u", s->mtu); + + s->max_rx_frags = + VMXNET3_READ_DRV_SHARED16(s->drv_shmem, devRead.misc.maxNumRxSG); + + DCFPRINTF("Max RX fragments is %u", s->max_rx_frags); + + s->event_int_idx = + VMXNET3_READ_DRV_SHARED8(s->drv_shmem, devRead.intrConf.eventIntrIdx); + DCFPRINTF("Events interrupt line is %u", s->event_int_idx); + + s->auto_int_masking = + VMXNET3_READ_DRV_SHARED8(s->drv_shmem, devRead.intrConf.autoMask); + DCFPRINTF("Automatic interrupt masking is %d", (int)s->auto_int_masking); + + s->txq_num = + VMXNET3_READ_DRV_SHARED8(s->drv_shmem, devRead.misc.numTxQueues); + s->rxq_num = + VMXNET3_READ_DRV_SHARED8(s->drv_shmem, devRead.misc.numRxQueues); + + DCFPRINTF("Number of TX/RX queues %u/%u", s->txq_num, s->rxq_num); + assert(s->txq_num <= VMXNET3_DEVICE_MAX_TX_QUEUES); + + qdescr_table_pa = + VMXNET3_READ_DRV_SHARED64(s->drv_shmem, devRead.misc.queueDescPA); + DCFPRINTF("TX queues descriptors table is at 0x%" PRIx64, + (uint64_t) qdescr_table_pa); + + /* Worst-case scenario is a packet that holds all TX rings space so */ + /* we calculate total size of all TX rings for max TX fragments number */ + s->max_tx_frags = 0; + + /* TX queues */ + for (i = 0; i < s->txq_num; i++) { + target_phys_addr_t qdescr_pa = + qdescr_table_pa + i*sizeof(struct Vmxnet3_TxQueueDesc); + + /* Read interrupt number for this TX queue */ + s->txq_descr[i].intr_idx = + VMXNET3_READ_TX_QUEUE_DESCR8(qdescr_pa, conf.intrIdx); + + DCFPRINTF("TX Queue %d interrupt: %d", i, s->txq_descr[i].intr_idx); + + /* Read rings memory locations for TX queues */ + pa = VMXNET3_READ_TX_QUEUE_DESCR64(qdescr_pa, conf.txRingBasePA); + size = VMXNET3_READ_TX_QUEUE_DESCR32(qdescr_pa, conf.txRingSize); + + vmxnet3_ring_init(&s->txq_descr[i].tx_ring, pa, size, + sizeof(struct Vmxnet3_TxDesc), false); + vmxnet3_ring_dump(DCFPRINTF, "TX", i, &s->txq_descr[i].tx_ring); + + s->max_tx_frags += size; + + /* TXC ring */ + pa = VMXNET3_READ_TX_QUEUE_DESCR64(qdescr_pa, conf.compRingBasePA); + size = VMXNET3_READ_TX_QUEUE_DESCR32(qdescr_pa, conf.compRingSize); + vmxnet3_ring_init(&s->txq_descr[i].comp_ring, pa, size, + sizeof(struct Vmxnet3_TxCompDesc), true); + vmxnet3_ring_dump(DCFPRINTF, "TXC", i, &s->txq_descr[i].comp_ring); + + s->txq_descr[i].tx_stats_pa = + qdescr_pa + offsetof(struct Vmxnet3_TxQueueDesc, stats); + + memset(&s->txq_descr[i].txq_stats, 0, + sizeof(s->txq_descr[i].txq_stats)); + + /* Fill device-managed parameters for queues */ + VMXNET3_WRITE_TX_QUEUE_DESCR32(qdescr_pa, + ctrl.txThreshold, + VMXNET3_DEF_TX_THRESHOLD); + } + + /* Preallocate TX packet wrapper */ + DCFPRINTF("Max TX fragments is %u", s->max_tx_frags); + if (!vmxnet3_txpkt_prealloc(&s->curr_txpkt, s->max_tx_frags, + s->peer_has_vhdr)) { + hw_error("TX rings configuration problem"); + } + + /* Read rings memory locations for RX queues */ + for (i = 0; i < s->rxq_num; i++) { + int j; + target_phys_addr_t qd_pa = + qdescr_table_pa + s->txq_num*sizeof(struct Vmxnet3_TxQueueDesc) + + i*sizeof(struct Vmxnet3_RxQueueDesc); + + /* Read interrupt number for this RX queue */ + s->rxq_descr[i].intr_idx = + VMXNET3_READ_TX_QUEUE_DESCR8(qd_pa, conf.intrIdx); + + DCFPRINTF("RX Queue %d interrupt: %d", i, s->rxq_descr[i].intr_idx); + + /* Read rings memory locations */ + for (j = 0; j < VMXNET3_RX_RINGS_PER_QUEUE; j++) { + /* RX rings */ + pa = VMXNET3_READ_RX_QUEUE_DESCR64(qd_pa, conf.rxRingBasePA[j]); + size = VMXNET3_READ_RX_QUEUE_DESCR32(qd_pa, conf.rxRingSize[j]); + vmxnet3_ring_init(&s->rxq_descr[i].rx_ring[j], pa, size, + sizeof(struct Vmxnet3_RxDesc), false); + DCFPRINTF("RX queue %d:%d: Base: %" PRIx64 ", Size: %d", + i, j, pa, size); + } + + /* RXC ring */ + pa = VMXNET3_READ_RX_QUEUE_DESCR64(qd_pa, conf.compRingBasePA); + size = VMXNET3_READ_RX_QUEUE_DESCR32(qd_pa, conf.compRingSize); + vmxnet3_ring_init(&s->rxq_descr[i].comp_ring, pa, size, + sizeof(struct Vmxnet3_RxCompDesc), true); + DCFPRINTF("RXC queue %d: Base: %" PRIx64 ", Size: %d", i, pa, size); + + s->rxq_descr[i].rx_stats_pa = + qd_pa + offsetof(struct Vmxnet3_RxQueueDesc, stats); + memset(&s->rxq_descr[i].rxq_stats, 0, + sizeof(s->rxq_descr[i].rxq_stats)); + } + + vmxnet3_flush_shmem_changes(); + s->device_active = true; +} + +static void vmxnet3_handle_command(VMXNET3_State *s, uint64_t cmd) +{ + s->last_command = cmd; + + switch (cmd) { + case VMXNET3_CMD_GET_PERM_MAC_HI: + DCBPRINTF("Set: Get upper part of permanent MAC"); + break; + + case VMXNET3_CMD_GET_PERM_MAC_LO: + DCBPRINTF("Set: Get lower part of permanent MAC"); + break; + + case VMXNET3_CMD_GET_STATS: + DCBPRINTF("Set: Get device statistics"); + vmxnet3_fill_stats(s); + break; + + case VMXNET3_CMD_ACTIVATE_DEV: + DCBPRINTF("Set: Activating vmxnet3 device"); + vmxnet3_activate_device(s); + break; + + case VMXNET3_CMD_UPDATE_RX_MODE: + DCBPRINTF("Set: Update rx mode"); + vmxnet3_update_rx_mode(s); + break; + + case VMXNET3_CMD_UPDATE_VLAN_FILTERS: + DCBPRINTF("Set: Update VLAN filters"); + vmxnet3_update_vlan_filters(s); + break; + + case VMXNET3_CMD_UPDATE_MAC_FILTERS: + DCBPRINTF("Set: Update MAC filters"); + vmxnet3_update_mcast_filters(s); + break; + + case VMXNET3_CMD_UPDATE_FEATURE: + DCBPRINTF("Set: Update features"); + vmxnet3_update_features(s); + break; + + case VMXNET3_CMD_UPDATE_PMCFG: + DCBPRINTF("Set: Update power management config"); + vmxnet3_update_pm_state(s); + break; + + case VMXNET3_CMD_GET_LINK: + DCBPRINTF("Set: Get link"); + break; + + case VMXNET3_CMD_RESET_DEV: + DCBPRINTF("Set: Reset device"); + vmxnet3_reset(s); + break; + + case VMXNET3_CMD_QUIESCE_DEV: + DCBPRINTF("Set: VMXNET3_CMD_QUIESCE_DEV - pause the device"); + vmxnet3_deactivate_device(s); + break; + + case VMXNET3_CMD_GET_CONF_INTR: + DCBPRINTF("Set: VMXNET3_CMD_GET_CONF_INTR - interrupt configuration"); + break; + + default: + DCBPRINTF("Received unknown command: %" PRIx64, cmd); + break; + } +} + +static uint64_t vmxnet3_get_command_status(VMXNET3_State *s) +{ + uint64_t ret; + + switch (s->last_command) { + case VMXNET3_CMD_ACTIVATE_DEV: + ret = (s->device_active) ? 0 : -1; + DCFPRINTF("Device active: %" PRIx64, ret); + break; + + case VMXNET3_CMD_GET_LINK: + ret = s->link_status_and_speed; + DCFPRINTF("Link and speed: %" PRIx64, ret); + break; + + case VMXNET3_CMD_GET_PERM_MAC_LO: + ret = vmxnet3_get_mac_low(&s->perm_mac); + break; + + case VMXNET3_CMD_GET_PERM_MAC_HI: + ret = vmxnet3_get_mac_high(&s->perm_mac); + break; + + case VMXNET3_CMD_GET_CONF_INTR: + ret = vmxnet3_get_interrupt_config(s); + break; + + default: + DWRPRINTF("Received request for unknown command: %x", s->last_command); + ret = -1; + break; + } + + return ret; +} + +static void vmxnet3_set_events(VMXNET3_State *s, uint32_t val) +{ + uint32_t events; + + DCBPRINTF("Setting events: 0x%x", val); + events = VMXNET3_READ_DRV_SHARED32(s->drv_shmem, ecr) | val; + VMXNET3_WRITE_DRV_SHARED32(s->drv_shmem, ecr, events); +} + +static void vmxnet3_ack_events(VMXNET3_State *s, uint32_t val) +{ + uint32_t events; + + DCBPRINTF("Clearing events: 0x%x", val); + events = VMXNET3_READ_DRV_SHARED32(s->drv_shmem, ecr) & ~val; + VMXNET3_WRITE_DRV_SHARED32(s->drv_shmem, ecr, events); +} + +static void +vmxnet3_io_bar1_write(void *opaque, + target_phys_addr_t addr, + uint64_t val, + unsigned size) +{ + VMXNET3_State *s = opaque; + + switch (addr) { + /* Vmxnet3 Revision Report Selection */ + case VMXNET3_REG_VRRS: + DCBPRINTF("Write BAR1 [VMXNET3_REG_VRRS] = %" PRIx64 ", size %d", + val, size); + break; + + /* UPT Version Report Selection */ + case VMXNET3_REG_UVRS: + DCBPRINTF("Write BAR1 [VMXNET3_REG_UVRS] = %" PRIx64 ", size %d", + val, size); + break; + + /* Driver Shared Address Low */ + case VMXNET3_REG_DSAL: + DCBPRINTF("Write BAR1 [VMXNET3_REG_DSAL] = %" PRIx64 ", size %d", + val, size); + /* Guest driver will first write the low part of the shared */ + /* memory address. We save it to temp variable and set the */ + /* shared address only after we get the high part */ + if (0 == val) { + s->device_active = false; + } + s->temp_shared_guest_driver_memory = val; + s->drv_shmem = 0; + break; + + /* Driver Shared Address High */ + case VMXNET3_REG_DSAH: + DCBPRINTF("Write BAR1 [VMXNET3_REG_DSAH] = %" PRIx64 ", size %d", + val, size); + /* Set the shared memory between guest driver and device. */ + /* We already should have low address part. */ + s->drv_shmem = s->temp_shared_guest_driver_memory | (val << 32); + break; + + /* Command */ + case VMXNET3_REG_CMD: + DCBPRINTF("Write BAR1 [VMXNET3_REG_CMD] = %" PRIx64 ", size %d", + val, size); + vmxnet3_handle_command(s, val); + break; + + /* MAC Address Low */ + case VMXNET3_REG_MACL: + DCBPRINTF("Write BAR1 [VMXNET3_REG_MACL] = %" PRIx64 ", size %d", + val, size); + s->temp_mac = val; + break; + + /* MAC Address High */ + case VMXNET3_REG_MACH: + DCBPRINTF("Write BAR1 [VMXNET3_REG_MACH] = %" PRIx64 ", size %d", + val, size); + vmxnet3_set_variable_mac(s, val, s->temp_mac); + break; + + /* Interrupt Cause Register */ + case VMXNET3_REG_ICR: + DCBPRINTF("Write BAR1 [VMXNET3_REG_ICR] = %" PRIx64 ", size %d", + val, size); + assert(false); + break; + + /* Event Cause Register */ + case VMXNET3_REG_ECR: + DCBPRINTF("Write BAR1 [VMXNET3_REG_ECR] = %" PRIx64 ", size %d", + val, size); + vmxnet3_ack_events(s, val); + break; + + default: + DCBPRINTF("Unknown Write to BAR1 [%" PRIx64 "] = %" PRIx64 ", size %d", + (uint64_t) addr, val, size); + break; + } +} + +static uint64_t +vmxnet3_io_bar1_read(void *opaque, target_phys_addr_t addr, unsigned size) +{ + VMXNET3_State *s = opaque; + uint64_t ret = 0; + + switch (addr) { + /* Vmxnet3 Revision Report Selection */ + case VMXNET3_REG_VRRS: + DCBPRINTF("Read BAR1 [VMXNET3_REG_VRRS], size %d", size); + ret = VMXNET3_DEVICE_REVISION; + break; + + /* UPT Version Report Selection */ + case VMXNET3_REG_UVRS: + DCBPRINTF("Read BAR1 [VMXNET3_REG_UVRS], size %d", size); + ret = VMXNET3_DEVICE_VERSION; + break; + + /* Command */ + case VMXNET3_REG_CMD: + DCBPRINTF("Read BAR1 [VMXNET3_REG_CMD], size %d", size); + ret = vmxnet3_get_command_status(s); + break; + + /* MAC Address Low */ + case VMXNET3_REG_MACL: + DCBPRINTF("Read BAR1 [VMXNET3_REG_MACL], size %d", size); + ret = vmxnet3_get_mac_low(&s->conf.macaddr); + break; + + /* MAC Address High */ + case VMXNET3_REG_MACH: + DCBPRINTF("Read BAR1 [VMXNET3_REG_MACH], size %d", size); + ret = vmxnet3_get_mac_high(&s->conf.macaddr); + break; + + /* Interrupt Cause Register */ + /* Used for legacy interrupts only so interrupt index always 0 */ + case VMXNET3_REG_ICR: + DCBPRINTF("Read BAR1 [VMXNET3_REG_ICR], size %d", size); + if (vmxnet3_interrupt_asserted(s, 0)) { + vmxnet3_clear_interrupt(s, 0); + ret = true; + } else { + ret = false; + } + break; + + default: + DCBPRINTF("Unknow read BAR1[%" PRIx64 "], %d bytes", + (uint64_t) addr, size); + break; + } + + return ret; +} + +static int +vmxnet3_can_receive(VLANClientState *nc) +{ + VMXNET3_State *s = DO_UPCAST(NICState, nc, nc)->opaque; + return s->device_active && + FLAG_IS_SET(s->link_status_and_speed, VMXNET3_LINK_STATUS_UP); +} + +static inline bool +vmxnet3_is_registered_vlan(VMXNET3_State *s, const void *data) +{ + uint16_t vlan_tag = eth_get_pkt_vlan_tag(data) & VLAN_VID_MASK; + + if (IS_SPECIAL_VLAN_ID(vlan_tag)) { + return true; + } + + return VMXNET3_VFTABLE_ENTRY_IS_SET(s->vlan_table, vlan_tag); +} + +static bool +vmxnet3_is_allowed_mcast_group(VMXNET3_State *s, const uint8_t *group_mac) +{ + int i; + for (i = 0; i < s->mcast_list_len; i++) { + if (memcmp(group_mac, s->mcast_list[i].a, sizeof(s->mcast_list[i]))) { + return true; + } + } + return false; +} + +static bool +vmxnet3_rx_filter_may_indicate(VMXNET3_State *s, const void *data, + size_t size, eth_pkt_types_e packet_type) +{ + struct eth_header *ehdr = PKT_GET_ETH_HDR(data); + + if (FLAG_IS_SET(s->rx_mode, VMXNET3_RXM_PROMISC)) { + return true; + } + + switch (packet_type) { + case VMXNET3_PKT_UCAST: + if (!FLAG_IS_SET(s->rx_mode, VMXNET3_RXM_UCAST)) { + return false; + } + if (memcmp(s->conf.macaddr.a, ehdr->h_dest, ETH_ALEN)) { + return false; + } + break; + + case VMXNET3_PKT_BCAST: + if (!FLAG_IS_SET(s->rx_mode, VMXNET3_RXM_BCAST)) { + return false; + } + break; + + case VMXNET3_PKT_MCAST: + if (FLAG_IS_SET(s->rx_mode, VMXNET3_RXM_ALL_MULTI)) { + return true; + } + if (!FLAG_IS_SET(s->rx_mode, VMXNET3_RXM_MCAST)) { + return false; + } + if (!vmxnet3_is_allowed_mcast_group(s, ehdr->h_dest)) { + return false; + } + break; + + default: + assert(false); + } + + return vmxnet3_is_registered_vlan(s, data); +} + +static void +vmxnet3_rxpkt_attach_data(VMXNET3_State *s, Vmxnet3_RxPkt *pkt, + const void *data, size_t len) +{ + uint16_t vtag = 0; + uint16_t ploff; + Vmxnet3_RxPktMdata *mdata = vmxnet3_rxpkt_get_mdata(pkt); + + if (s->rx_vlan_stripping) { + mdata->vlan_stripped = + eth_strip_vlan(&data, vmxnet3_rxpkt_get_ehdr(pkt), &ploff, &vtag); + } else { + mdata->vlan_stripped = false; + } + + if (mdata->vlan_stripped) { + vmxnet3_rxpkt_attach_ehdr(pkt); + vmxnet3_rxpkt_get_frag(pkt, 1)->iov_base = (uint8_t *) data + ploff; + vmxnet3_rxpkt_get_frag(pkt, 1)->iov_len = len - ploff; + vmxnet3_rxpkt_set_num_frags(pkt, 2); + mdata->tot_len = len - ploff + sizeof(struct eth_header); + } else { + vmxnet3_rxpkt_get_frag(pkt, 0)->iov_base = (void *) data; + vmxnet3_rxpkt_get_frag(pkt, 0)->iov_len = len; + vmxnet3_rxpkt_set_num_frags(pkt, 1); + mdata->tot_len = len; + } + + mdata->vlan_tag = vtag; +} + +static ssize_t +vmxnet3_receive(VLANClientState *nc, const uint8_t *buf, size_t size) +{ + VMXNET3_State *s = DO_UPCAST(NICState, nc, nc)->opaque; + Vmxnet3_RxPkt pkt; + size_t bytes_indicated; + Vmxnet3_RxPktMdata *mdata; + + if (!vmxnet3_can_receive(&s->nic->nc)) { + DPKPRINTF("Cannot receive now"); + return -1; + } + + vmxnet3_rxpkt_init(&pkt); + mdata = vmxnet3_rxpkt_get_mdata(&pkt); + + if (s->peer_has_vhdr) { + buf += sizeof(struct virtio_net_hdr); + size -= sizeof(struct virtio_net_hdr); + *vmxnet3_rxpkt_get_vhdr(&pkt) = *(const struct virtio_net_hdr *) buf; + mdata->vhdr_valid = true; + } else { + mdata->vhdr_valid = false; + } + + mdata->packet_type = get_eth_packet_type(PKT_GET_ETH_HDR(buf)); + + if (vmxnet3_rx_filter_may_indicate(s, buf, size, mdata->packet_type)) { + vmxnet3_rxpkt_attach_data(s, &pkt, buf, size); + bytes_indicated = vmxnet3_indicate_packet(s, &pkt) ? size : -1; + if (bytes_indicated < size) { + DPKPRINTF("RX: %lu of %lu bytes indicated", bytes_indicated, size); + } + } else { + DPKPRINTF("Packet dropped by RX filter"); + bytes_indicated = size; + } + + assert(size > 0); + assert(bytes_indicated != 0); + return bytes_indicated; +} + +static void vmxnet3_cleanup(VLANClientState *nc) +{ + VMXNET3_State *s = DO_UPCAST(NICState, nc, nc)->opaque; + s->nic = NULL; +} + +static void vmxnet3_set_link_status(VLANClientState *nc) +{ + VMXNET3_State *s = DO_UPCAST(NICState, nc, nc)->opaque; + + if (nc->link_down) { + s->link_status_and_speed &= ~VMXNET3_LINK_STATUS_UP; + } else { + s->link_status_and_speed |= VMXNET3_LINK_STATUS_UP; + } + + vmxnet3_set_events(s, VMXNET3_ECR_LINK); + vmxnet3_trigger_interrupt(s, s->event_int_idx); +} + +static NetClientInfo net_vmxnet3_info = { + .type = NET_CLIENT_TYPE_NIC, + .size = sizeof(NICState), + .can_receive = vmxnet3_can_receive, + .receive = vmxnet3_receive, + .cleanup = vmxnet3_cleanup, + .link_status_changed = vmxnet3_set_link_status, +}; + +static bool vmxnet3_peer_has_vnet_hdr(VMXNET3_State *s) +{ + VLANClientState *peer = s->nic->nc.peer; + + if ((NULL != peer) && + (NET_CLIENT_TYPE_TAP == peer->info->type) && + tap_has_vnet_hdr(peer)) { + return true; + } + + DWRPRINTF("Peer has no virtio extension. Task offloads will not work."); + return false; +} + +static void vmxnet3_net_uninit(VMXNET3_State *s) +{ + if (NULL != s->mcast_list) { + g_free(s->mcast_list); + } + + vmxnet3_txpkt_cleanup(&s->curr_txpkt); +} + +static void vmxnet3_net_init(VMXNET3_State *s) +{ + DCBPRINTF("vmxnet3_net_init called..."); + + vmxnet3_txpkt_init(&s->curr_txpkt); + + qemu_macaddr_default_if_unset(&s->conf.macaddr); + + /* Windows guest will query the address that was set on init */ + memcpy(&s->perm_mac.a, &s->conf.macaddr.a, sizeof(s->perm_mac.a)); + + s->mcast_list = NULL; + s->mcast_list_len = 0; + + s->link_status_and_speed = VMXNET3_LINK_SPEED | VMXNET3_LINK_STATUS_UP; + + DCFPRINTF("Permanent MAC: " MAC_FMT, MAC_ARG(s->perm_mac.a)); + + s->nic = qemu_new_nic(&net_vmxnet3_info, &s->conf, + object_get_typename(OBJECT(s)), + s->dev.qdev.id, s); + + s->peer_has_vhdr = vmxnet3_peer_has_vnet_hdr(s); + s->curr_txpkt_pl_frags = 0; + s->curr_txpkt_skip = false; + s->curr_txpkt_header_processed = false; + + if (s->peer_has_vhdr) { + tap_set_vnet_hdr_len(s->nic->nc.peer, sizeof(struct virtio_net_hdr)); + tap_using_vnet_hdr(s->nic->nc.peer, 1); + } + + qemu_format_nic_info_str(&s->nic->nc, s->conf.macaddr.a); +} + +#ifdef VMXNET3_ENABLE_MSIX + +static void +vmxnet3_unuse_msix_vectors(VMXNET3_State *s, int num_vectors) +{ + int i; + for (i = 0; i < num_vectors; i++) { + msix_vector_unuse(&s->dev, i); + } +} + +static bool +vmxnet3_use_msix_vectors(VMXNET3_State *s, int num_vectors) +{ + int i; + for (i = 0; i < num_vectors; i++) { + int res = msix_vector_use(&s->dev, i); + if (0 > res) { + DWRPRINTF("Failed to use MSI-X vector %d, error %d", i, res); + vmxnet3_unuse_msix_vectors(s, i); + return false; + } + } + return true; +} + +static bool +vmxnet3_init_msix(VMXNET3_State *s) +{ + int res = msix_init(&s->dev, VMXNET3_MAX_INTRS, + &s->msix_bar, VMXNET3_MSIX_BAR_IDX, 0); + if (0 > res) { + DWRPRINTF("Failed to initialize MSI-X, error %d", res); + s->msix_used = false; + } else { + if (!vmxnet3_use_msix_vectors(s, VMXNET3_MAX_INTRS)) { + DWRPRINTF("Failed to use MSI-X vectors, error %d", res); + msix_uninit(&s->dev, &s->msix_bar); + s->msix_used = false; + } else { + s->msix_used = true; + } + } + return s->msix_used; +} + +static void +vmxnet3_cleanup_msix(VMXNET3_State *s) +{ + if (s->msix_used) { + msix_vector_unuse(&s->dev, VMXNET3_MAX_INTRS); + msix_uninit(&s->dev, &s->msix_bar); + } +} +#endif + +#ifdef VMXNET3_ENABLE_MSI + +static bool +vmxnet3_init_msi(VMXNET3_State *s) +{ +#define VMXNET3_MSI_NUM_VECTORS (1) +#define VMXNET3_MSI_OFFSET (0x50) +#define VMXNET3_USE_64BIT (true) +#define VMXNET3_PER_VECTOR_MASK (false) + + int res; + res = msi_init(&s->dev, VMXNET3_MSI_OFFSET, VMXNET3_MSI_NUM_VECTORS, + VMXNET3_USE_64BIT, VMXNET3_PER_VECTOR_MASK); + if (0 > res) { + DWRPRINTF("Failed to initialize MSI, error %d", res); + s->msi_used = false; + } else { + s->msi_used = true; + } + + return s->msi_used; +} + +static void +vmxnet3_cleanup_msi(VMXNET3_State *s) +{ + if (s->msi_used) { + msi_uninit(&s->dev); + } +} +#endif + +static int vmxnet3_pci_init(PCIDevice *dev) +{ + static const MemoryRegionOps b0_ops = { + .read = vmxnet3_io_bar0_read, + .write = vmxnet3_io_bar0_write, + .endianness = DEVICE_LITTLE_ENDIAN, + .impl = { + .min_access_size = 4, + .max_access_size = 4, + }, + }; + + static const MemoryRegionOps b1_ops = { + .read = vmxnet3_io_bar1_read, + .write = vmxnet3_io_bar1_write, + .endianness = DEVICE_LITTLE_ENDIAN, + .impl = { + .min_access_size = 4, + .max_access_size = 4, + }, + }; + + VMXNET3_State *s = DO_UPCAST(VMXNET3_State, dev, dev); + int i; + + DCBPRINTF("Starting init..."); + + memory_region_init_io(&s->bar0, &b0_ops, s, + "vmxnet3-b0", VMXNET3_PT_REG_SIZE); + pci_register_bar(&s->dev, VMXNET3_BAR0_IDX, + PCI_BASE_ADDRESS_SPACE_MEMORY, &s->bar0); + + memory_region_init_io(&s->bar1, &b1_ops, s, + "vmxnet3-b1", VMXNET3_VD_REG_SIZE); + pci_register_bar(&s->dev, VMXNET3_BAR1_IDX, + PCI_BASE_ADDRESS_SPACE_MEMORY, &s->bar1); + + memory_region_init(&s->msix_bar, "vmxnet3-msix-bar", + VMXNET3_MSIX_BAR_SIZE); + pci_register_bar(&s->dev, VMXNET3_MSIX_BAR_IDX, + PCI_BASE_ADDRESS_SPACE_MEMORY, &s->msix_bar); + + for (i = 0; i < ARRAY_SIZE(s->interrupt_states); i++) { + s->interrupt_states[i].is_asserted = false; + s->interrupt_states[i].is_pending = false; + s->interrupt_states[i].is_masked = true; + } + + /* Interrupt pin A */ + s->dev.config[PCI_INTERRUPT_PIN] = 0x01; + +#ifdef VMXNET3_ENABLE_MSIX + if (!vmxnet3_init_msix(s)) { + hw_error("Failed to initialize MSI-X, configuration is inconsistent."); + } +#endif + +#ifdef VMXNET3_ENABLE_MSI + if (!vmxnet3_init_msi(s)) { + hw_error("Failed to initialize MSI, configuration is inconsistent."); + } +#endif + + vmxnet3_net_init(s); + add_boot_device_path(s->conf.bootindex, &dev->qdev, "/ethernet-phy@0"); + + return 0; +} + + +static int vmxnet3_pci_uninit(PCIDevice *dev) +{ + VMXNET3_State *s = DO_UPCAST(VMXNET3_State, dev, dev); + + DCBPRINTF("Starting uninit..."); + + vmxnet3_net_uninit(s); + +#ifdef VMXNET3_ENABLE_MSIX + vmxnet3_cleanup_msix(s); +#endif + +#ifdef VMXNET3_ENABLE_MSI + vmxnet3_cleanup_msi(s); +#endif + + memory_region_destroy(&s->bar0); + memory_region_destroy(&s->bar1); + memory_region_destroy(&s->msix_bar); + + return 0; +} + +static void vmxnet3_qdev_reset(DeviceState *dev) +{ + VMXNET3_State *s = DO_UPCAST(VMXNET3_State, dev.qdev, dev); + DCBPRINTF("Starting QDEV reset..."); + vmxnet3_reset(s); +} + +static const VMStateDescription vmstate_vmxnet3 = { + .name = "vmxnet3", + .version_id = 1, + .minimum_version_id = 1, + .minimum_version_id_old = 1, + .fields = (VMStateField[]) { + VMSTATE_PCI_DEVICE(dev, VMXNET3_State), + VMSTATE_END_OF_LIST() + } +}; + +#if defined(VMXNET3_ENABLE_MSI) || defined(VMXNET3_ENABLE_MSIX) +static void +vmxnet3_write_config(PCIDevice *pci, uint32_t addr, uint32_t val, int len) +{ + pci_default_write_config(pci, addr, val, len); +#if defined(VMXNET3_ENABLE_MSIX) + msix_write_config(pci, addr, val, len); +#endif +#if defined(VMXNET3_ENABLE_MSI) + msi_write_config(pci, addr, val, len); +#endif +} +#endif + +static Property vmxnet3_properties[] = { + DEFINE_NIC_PROPERTIES(VMXNET3_State, conf), + DEFINE_PROP_END_OF_LIST(), +}; + +static void vmxnet3_class_init(ObjectClass *class, void *data) +{ + DeviceClass *dc = DEVICE_CLASS(class); + PCIDeviceClass *c = PCI_DEVICE_CLASS(class); + + c->init = vmxnet3_pci_init; + c->exit = vmxnet3_pci_uninit; + c->romfile = "pxe-e1000.rom"; + c->vendor_id = PCI_VENDOR_ID_VMWARE; + c->device_id = PCI_DEVICE_ID_VMWARE_VMXNET3; + c->revision = PCI_DEVICE_ID_VMWARE_VMXNET3_REVISION; + c->class_id = PCI_CLASS_NETWORK_ETHERNET; + c->subsystem_vendor_id = PCI_VENDOR_ID_VMWARE; + c->subsystem_id = PCI_DEVICE_ID_VMWARE_VMXNET3; +#if defined(VMXNET3_ENABLE_MSI) || defined(VMXNET3_ENABLE_MSIX) + c->config_write = vmxnet3_write_config, +#endif + dc->desc = "VMWare Paravirtualized Ethernet v3"; + dc->reset = vmxnet3_qdev_reset; + dc->vmsd = &vmstate_vmxnet3; + dc->props = vmxnet3_properties; +} + +static TypeInfo vmxnet3_info = { + .name = "vmxnet3", + .parent = TYPE_PCI_DEVICE, + .instance_size = sizeof(VMXNET3_State), + .class_init = vmxnet3_class_init, +}; + +static void vmxnet3_register_types(void) +{ + DCBPRINTF("vmxnet3_register_types called..."); + type_register_static(&vmxnet3_info); +} + +type_init(vmxnet3_register_types) diff --git a/qemu/hw/vmxnet3.h b/qemu/hw/vmxnet3.h new file mode 100644 index 0000000..6ec3fd5 --- /dev/null +++ b/qemu/hw/vmxnet3.h @@ -0,0 +1,727 @@ +/* + * QEMU VMWARE VMXNET3 paravirtual NIC + * + * Copyright (c) 2012 Ravello Systems LTD (http://ravellosystems.com) + * + * Developed by Daynix Computing LTD (http://www.daynix.com) + * + * Authors: + * Dmitry Fleytman + * Yan Vugenfirer + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + * + */ + +#ifndef _QEMU_VMXNET3_H +#define _QEMU_VMXNET3_H + +#define VMXNET3_DEVICE_MAX_TX_QUEUES 8 +#define VMXNET3_DEVICE_MAX_RX_QUEUES 8 /* Keep this value as a power of 2 */ + +/* Defines needed to integrate VMWARE headers */ +#define u64 uint64_t +#define u32 uint32_t +#define u16 uint16_t +#define u8 uint8_t +#define __le16 uint16_t +#define __le32 uint32_t +#define __le64 uint64_t +#define __packed QEMU_PACKED + +#if defined(HOST_WORDS_BIGENDIAN) +#define const_cpu_to_le64(x) bswap_64(x) +#define __BIG_ENDIAN_BITFIELD +#else +#define const_cpu_to_le64(x) (x) +#endif + +/* Following is an interface definition for */ +/* VMXNET3 device as provided by VMWARE */ +/* Original file and copyright is available */ +/* in Linux kernel v3.2.8 at */ +/* drivers/net/vmxnet3/vmxnet3_defs.h */ + +struct UPT1_TxStats { + u64 TSOPktsTxOK; /* TSO pkts post-segmentation */ + u64 TSOBytesTxOK; + u64 ucastPktsTxOK; + u64 ucastBytesTxOK; + u64 mcastPktsTxOK; + u64 mcastBytesTxOK; + u64 bcastPktsTxOK; + u64 bcastBytesTxOK; + u64 pktsTxError; + u64 pktsTxDiscard; +}; + +struct UPT1_RxStats { + u64 LROPktsRxOK; /* LRO pkts */ + u64 LROBytesRxOK; /* bytes from LRO pkts */ + /* the following counters are for pkts from the wire, i.e., pre-LRO */ + u64 ucastPktsRxOK; + u64 ucastBytesRxOK; + u64 mcastPktsRxOK; + u64 mcastBytesRxOK; + u64 bcastPktsRxOK; + u64 bcastBytesRxOK; + u64 pktsRxOutOfBuf; + u64 pktsRxError; +}; + +/* interrupt moderation level */ +enum { + UPT1_IML_NONE = 0, /* no interrupt moderation */ + UPT1_IML_HIGHEST = 7, /* least intr generated */ + UPT1_IML_ADAPTIVE = 8, /* adpative intr moderation */ +}; +/* values for UPT1_RSSConf.hashFunc */ +enum { + UPT1_RSS_HASH_TYPE_NONE = 0x0, + UPT1_RSS_HASH_TYPE_IPV4 = 0x01, + UPT1_RSS_HASH_TYPE_TCP_IPV4 = 0x02, + UPT1_RSS_HASH_TYPE_IPV6 = 0x04, + UPT1_RSS_HASH_TYPE_TCP_IPV6 = 0x08, +}; + +enum { + UPT1_RSS_HASH_FUNC_NONE = 0x0, + UPT1_RSS_HASH_FUNC_TOEPLITZ = 0x01, +}; + +#define UPT1_RSS_MAX_KEY_SIZE 40 +#define UPT1_RSS_MAX_IND_TABLE_SIZE 128 + +struct UPT1_RSSConf { + u16 hashType; + u16 hashFunc; + u16 hashKeySize; + u16 indTableSize; + u8 hashKey[UPT1_RSS_MAX_KEY_SIZE]; + u8 indTable[UPT1_RSS_MAX_IND_TABLE_SIZE]; +}; + +/* features */ +enum { + UPT1_F_RXCSUM = const_cpu_to_le64(0x0001), /* rx csum verification */ + UPT1_F_RSS = const_cpu_to_le64(0x0002), + UPT1_F_RXVLAN = const_cpu_to_le64(0x0004), /* VLAN tag stripping */ + UPT1_F_LRO = const_cpu_to_le64(0x0008), +}; + +/* all registers are 32 bit wide */ +/* BAR 1 */ +enum { + VMXNET3_REG_VRRS = 0x0, /* Vmxnet3 Revision Report Selection */ + VMXNET3_REG_UVRS = 0x8, /* UPT Version Report Selection */ + VMXNET3_REG_DSAL = 0x10, /* Driver Shared Address Low */ + VMXNET3_REG_DSAH = 0x18, /* Driver Shared Address High */ + VMXNET3_REG_CMD = 0x20, /* Command */ + VMXNET3_REG_MACL = 0x28, /* MAC Address Low */ + VMXNET3_REG_MACH = 0x30, /* MAC Address High */ + VMXNET3_REG_ICR = 0x38, /* Interrupt Cause Register */ + VMXNET3_REG_ECR = 0x40 /* Event Cause Register */ +}; + +/* BAR 0 */ +enum { + VMXNET3_REG_IMR = 0x0, /* Interrupt Mask Register */ + VMXNET3_REG_TXPROD = 0x600, /* Tx Producer Index */ + VMXNET3_REG_RXPROD = 0x800, /* Rx Producer Index for ring 1 */ + VMXNET3_REG_RXPROD2 = 0xA00 /* Rx Producer Index for ring 2 */ +}; + +#define VMXNET3_PT_REG_SIZE 4096 /* BAR 0 */ +#define VMXNET3_VD_REG_SIZE 4096 /* BAR 1 */ + +#define VMXNET3_REG_ALIGN 8 /* All registers are 8-byte aligned. */ +#define VMXNET3_REG_ALIGN_MASK 0x7 + +/* I/O Mapped access to registers */ +#define VMXNET3_IO_TYPE_PT 0 +#define VMXNET3_IO_TYPE_VD 1 +#define VMXNET3_IO_ADDR(type, reg) (((type) << 24) | ((reg) & 0xFFFFFF)) +#define VMXNET3_IO_TYPE(addr) ((addr) >> 24) +#define VMXNET3_IO_REG(addr) ((addr) & 0xFFFFFF) + +enum { + VMXNET3_CMD_FIRST_SET = 0xCAFE0000, + VMXNET3_CMD_ACTIVATE_DEV = VMXNET3_CMD_FIRST_SET, /* 0xCAFE0000 */ + VMXNET3_CMD_QUIESCE_DEV, /* 0xCAFE0001 */ + VMXNET3_CMD_RESET_DEV, /* 0xCAFE0002 */ + VMXNET3_CMD_UPDATE_RX_MODE, /* 0xCAFE0003 */ + VMXNET3_CMD_UPDATE_MAC_FILTERS, /* 0xCAFE0004 */ + VMXNET3_CMD_UPDATE_VLAN_FILTERS, /* 0xCAFE0005 */ + VMXNET3_CMD_UPDATE_RSSIDT, /* 0xCAFE0006 */ + VMXNET3_CMD_UPDATE_IML, /* 0xCAFE0007 */ + VMXNET3_CMD_UPDATE_PMCFG, /* 0xCAFE0008 */ + VMXNET3_CMD_UPDATE_FEATURE, /* 0xCAFE0009 */ + VMXNET3_CMD_LOAD_PLUGIN, /* 0xCAFE000A */ + + VMXNET3_CMD_FIRST_GET = 0xF00D0000, + VMXNET3_CMD_GET_QUEUE_STATUS = VMXNET3_CMD_FIRST_GET, /* 0xF00D0000 */ + VMXNET3_CMD_GET_STATS, /* 0xF00D0001 */ + VMXNET3_CMD_GET_LINK, /* 0xF00D0002 */ + VMXNET3_CMD_GET_PERM_MAC_LO, /* 0xF00D0003 */ + VMXNET3_CMD_GET_PERM_MAC_HI, /* 0xF00D0004 */ + VMXNET3_CMD_GET_DID_LO, /* 0xF00D0005 */ + VMXNET3_CMD_GET_DID_HI, /* 0xF00D0006 */ + VMXNET3_CMD_GET_DEV_EXTRA_INFO, /* 0xF00D0007 */ + VMXNET3_CMD_GET_CONF_INTR /* 0xF00D0008 */ +}; + +/* + * Little Endian layout of bitfields - + * Byte 0 : 7.....len.....0 + * Byte 1 : rsvd gen 13.len.8 + * Byte 2 : 5.msscof.0 ext1 dtype + * Byte 3 : 13...msscof...6 + * + * Big Endian layout of bitfields - + * Byte 0: 13...msscof...6 + * Byte 1 : 5.msscof.0 ext1 dtype + * Byte 2 : rsvd gen 13.len.8 + * Byte 3 : 7.....len.....0 + * + * Thus, le32_to_cpu on the dword will allow the big endian driver to read + * the bit fields correctly. And cpu_to_le32 will convert bitfields + * bit fields written by big endian driver to format required by device. + */ + +struct Vmxnet3_TxDesc { + __le64 addr; + +#ifdef __BIG_ENDIAN_BITFIELD + u32 msscof:14; /* MSS, checksum offset, flags */ + u32 ext1:1; + u32 dtype:1; /* descriptor type */ + u32 rsvd:1; + u32 gen:1; /* generation bit */ + u32 len:14; +#else + u32 len:14; + u32 gen:1; /* generation bit */ + u32 rsvd:1; + u32 dtype:1; /* descriptor type */ + u32 ext1:1; + u32 msscof:14; /* MSS, checksum offset, flags */ +#endif /* __BIG_ENDIAN_BITFIELD */ + +#ifdef __BIG_ENDIAN_BITFIELD + u32 tci:16; /* Tag to Insert */ + u32 ti:1; /* VLAN Tag Insertion */ + u32 ext2:1; + u32 cq:1; /* completion request */ + u32 eop:1; /* End Of Packet */ + u32 om:2; /* offload mode */ + u32 hlen:10; /* header len */ +#else + u32 hlen:10; /* header len */ + u32 om:2; /* offload mode */ + u32 eop:1; /* End Of Packet */ + u32 cq:1; /* completion request */ + u32 ext2:1; + u32 ti:1; /* VLAN Tag Insertion */ + u32 tci:16; /* Tag to Insert */ +#endif /* __BIG_ENDIAN_BITFIELD */ +}; + +/* TxDesc.OM values */ +#define VMXNET3_OM_NONE 0 +#define VMXNET3_OM_CSUM 2 +#define VMXNET3_OM_TSO 3 + +/* fields in TxDesc we access w/o using bit fields */ +#define VMXNET3_TXD_EOP_SHIFT 12 +#define VMXNET3_TXD_CQ_SHIFT 13 +#define VMXNET3_TXD_GEN_SHIFT 14 +#define VMXNET3_TXD_EOP_DWORD_SHIFT 3 +#define VMXNET3_TXD_GEN_DWORD_SHIFT 2 + +#define VMXNET3_TXD_CQ (1 << VMXNET3_TXD_CQ_SHIFT) +#define VMXNET3_TXD_EOP (1 << VMXNET3_TXD_EOP_SHIFT) +#define VMXNET3_TXD_GEN (1 << VMXNET3_TXD_GEN_SHIFT) + +#define VMXNET3_HDR_COPY_SIZE 128 + + +struct Vmxnet3_TxDataDesc { + u8 data[VMXNET3_HDR_COPY_SIZE]; +}; + +#define VMXNET3_TCD_GEN_SHIFT 31 +#define VMXNET3_TCD_GEN_SIZE 1 +#define VMXNET3_TCD_TXIDX_SHIFT 0 +#define VMXNET3_TCD_TXIDX_SIZE 12 +#define VMXNET3_TCD_GEN_DWORD_SHIFT 3 + +struct Vmxnet3_TxCompDesc { + u32 txdIdx:12; /* Index of the EOP TxDesc */ + u32 ext1:20; + + __le32 ext2; + __le32 ext3; + + u32 rsvd:24; + u32 type:7; /* completion type */ + u32 gen:1; /* generation bit */ +}; + +struct Vmxnet3_RxDesc { + __le64 addr; + +#ifdef __BIG_ENDIAN_BITFIELD + u32 gen:1; /* Generation bit */ + u32 rsvd:15; + u32 dtype:1; /* Descriptor type */ + u32 btype:1; /* Buffer Type */ + u32 len:14; +#else + u32 len:14; + u32 btype:1; /* Buffer Type */ + u32 dtype:1; /* Descriptor type */ + u32 rsvd:15; + u32 gen:1; /* Generation bit */ +#endif + u32 ext1; +}; + +/* values of RXD.BTYPE */ +#define VMXNET3_RXD_BTYPE_HEAD 0 /* head only */ +#define VMXNET3_RXD_BTYPE_BODY 1 /* body only */ + +/* fields in RxDesc we access w/o using bit fields */ +#define VMXNET3_RXD_BTYPE_SHIFT 14 +#define VMXNET3_RXD_GEN_SHIFT 31 + +struct Vmxnet3_RxCompDesc { +#ifdef __BIG_ENDIAN_BITFIELD + u32 ext2:1; + u32 cnc:1; /* Checksum Not Calculated */ + u32 rssType:4; /* RSS hash type used */ + u32 rqID:10; /* rx queue/ring ID */ + u32 sop:1; /* Start of Packet */ + u32 eop:1; /* End of Packet */ + u32 ext1:2; + u32 rxdIdx:12; /* Index of the RxDesc */ +#else + u32 rxdIdx:12; /* Index of the RxDesc */ + u32 ext1:2; + u32 eop:1; /* End of Packet */ + u32 sop:1; /* Start of Packet */ + u32 rqID:10; /* rx queue/ring ID */ + u32 rssType:4; /* RSS hash type used */ + u32 cnc:1; /* Checksum Not Calculated */ + u32 ext2:1; +#endif /* __BIG_ENDIAN_BITFIELD */ + + __le32 rssHash; /* RSS hash value */ + +#ifdef __BIG_ENDIAN_BITFIELD + u32 tci:16; /* Tag stripped */ + u32 ts:1; /* Tag is stripped */ + u32 err:1; /* Error */ + u32 len:14; /* data length */ +#else + u32 len:14; /* data length */ + u32 err:1; /* Error */ + u32 ts:1; /* Tag is stripped */ + u32 tci:16; /* Tag stripped */ +#endif /* __BIG_ENDIAN_BITFIELD */ + + +#ifdef __BIG_ENDIAN_BITFIELD + u32 gen:1; /* generation bit */ + u32 type:7; /* completion type */ + u32 fcs:1; /* Frame CRC correct */ + u32 frg:1; /* IP Fragment */ + u32 v4:1; /* IPv4 */ + u32 v6:1; /* IPv6 */ + u32 ipc:1; /* IP Checksum Correct */ + u32 tcp:1; /* TCP packet */ + u32 udp:1; /* UDP packet */ + u32 tuc:1; /* TCP/UDP Checksum Correct */ + u32 csum:16; +#else + u32 csum:16; + u32 tuc:1; /* TCP/UDP Checksum Correct */ + u32 udp:1; /* UDP packet */ + u32 tcp:1; /* TCP packet */ + u32 ipc:1; /* IP Checksum Correct */ + u32 v6:1; /* IPv6 */ + u32 v4:1; /* IPv4 */ + u32 frg:1; /* IP Fragment */ + u32 fcs:1; /* Frame CRC correct */ + u32 type:7; /* completion type */ + u32 gen:1; /* generation bit */ +#endif /* __BIG_ENDIAN_BITFIELD */ +}; + +/* fields in RxCompDesc we access via Vmxnet3_GenericDesc.dword[3] */ +#define VMXNET3_RCD_TUC_SHIFT 16 +#define VMXNET3_RCD_IPC_SHIFT 19 + +/* fields in RxCompDesc we access via Vmxnet3_GenericDesc.qword[1] */ +#define VMXNET3_RCD_TYPE_SHIFT 56 +#define VMXNET3_RCD_GEN_SHIFT 63 + +/* csum OK for TCP/UDP pkts over IP */ +#define VMXNET3_RCD_CSUM_OK (1 << VMXNET3_RCD_TUC_SHIFT | \ + 1 << VMXNET3_RCD_IPC_SHIFT) +#define VMXNET3_TXD_GEN_SIZE 1 +#define VMXNET3_TXD_EOP_SIZE 1 + +/* value of RxCompDesc.rssType */ +enum { + VMXNET3_RCD_RSS_TYPE_NONE = 0, + VMXNET3_RCD_RSS_TYPE_IPV4 = 1, + VMXNET3_RCD_RSS_TYPE_TCPIPV4 = 2, + VMXNET3_RCD_RSS_TYPE_IPV6 = 3, + VMXNET3_RCD_RSS_TYPE_TCPIPV6 = 4, +}; + + +/* a union for accessing all cmd/completion descriptors */ +union Vmxnet3_GenericDesc { + __le64 qword[2]; + __le32 dword[4]; + __le16 word[8]; + struct Vmxnet3_TxDesc txd; + struct Vmxnet3_RxDesc rxd; + struct Vmxnet3_TxCompDesc tcd; + struct Vmxnet3_RxCompDesc rcd; +}; + +#define VMXNET3_INIT_GEN 1 + +/* Max size of a single tx buffer */ +#define VMXNET3_MAX_TX_BUF_SIZE (1 << 14) + +/* # of tx desc needed for a tx buffer size */ +#define VMXNET3_TXD_NEEDED(size) (((size) + VMXNET3_MAX_TX_BUF_SIZE - 1) / \ + VMXNET3_MAX_TX_BUF_SIZE) + +/* max # of tx descs for a non-tso pkt */ +#define VMXNET3_MAX_TXD_PER_PKT 16 + +/* Max size of a single rx buffer */ +#define VMXNET3_MAX_RX_BUF_SIZE ((1 << 14) - 1) +/* Minimum size of a type 0 buffer */ +#define VMXNET3_MIN_T0_BUF_SIZE 128 +#define VMXNET3_MAX_CSUM_OFFSET 1024 + +/* Ring base address alignment */ +#define VMXNET3_RING_BA_ALIGN 512 +#define VMXNET3_RING_BA_MASK (VMXNET3_RING_BA_ALIGN - 1) + +/* Ring size must be a multiple of 32 */ +#define VMXNET3_RING_SIZE_ALIGN 32 +#define VMXNET3_RING_SIZE_MASK (VMXNET3_RING_SIZE_ALIGN - 1) + +/* Max ring size */ +#define VMXNET3_TX_RING_MAX_SIZE 4096 +#define VMXNET3_TC_RING_MAX_SIZE 4096 +#define VMXNET3_RX_RING_MAX_SIZE 4096 +#define VMXNET3_RC_RING_MAX_SIZE 8192 + +/* a list of reasons for queue stop */ + +enum { + VMXNET3_ERR_NOEOP = 0x80000000, /* cannot find the EOP desc of a pkt */ + VMXNET3_ERR_TXD_REUSE = 0x80000001, /* reuse TxDesc before tx completion */ + VMXNET3_ERR_BIG_PKT = 0x80000002, /* too many TxDesc for a pkt */ + VMXNET3_ERR_DESC_NOT_SPT = 0x80000003, /* descriptor type not supported */ + VMXNET3_ERR_SMALL_BUF = 0x80000004, /* type 0 buffer too small */ + VMXNET3_ERR_STRESS = 0x80000005, /* stress option firing in vmkernel */ + VMXNET3_ERR_SWITCH = 0x80000006, /* mode switch failure */ + VMXNET3_ERR_TXD_INVALID = 0x80000007, /* invalid TxDesc */ +}; + +/* completion descriptor types */ +#define VMXNET3_CDTYPE_TXCOMP 0 /* Tx Completion Descriptor */ +#define VMXNET3_CDTYPE_RXCOMP 3 /* Rx Completion Descriptor */ + +enum { + VMXNET3_GOS_BITS_UNK = 0, /* unknown */ + VMXNET3_GOS_BITS_32 = 1, + VMXNET3_GOS_BITS_64 = 2, +}; + +#define VMXNET3_GOS_TYPE_UNK 0 /* unknown */ +#define VMXNET3_GOS_TYPE_LINUX 1 +#define VMXNET3_GOS_TYPE_WIN 2 +#define VMXNET3_GOS_TYPE_SOLARIS 3 +#define VMXNET3_GOS_TYPE_FREEBSD 4 +#define VMXNET3_GOS_TYPE_PXE 5 + +struct Vmxnet3_GOSInfo { +#ifdef __BIG_ENDIAN_BITFIELD + u32 gosMisc:10; /* other info about gos */ + u32 gosVer:16; /* gos version */ + u32 gosType:4; /* which guest */ + u32 gosBits:2; /* 32-bit or 64-bit? */ +#else + u32 gosBits:2; /* 32-bit or 64-bit? */ + u32 gosType:4; /* which guest */ + u32 gosVer:16; /* gos version */ + u32 gosMisc:10; /* other info about gos */ +#endif /* __BIG_ENDIAN_BITFIELD */ +}; + +struct Vmxnet3_DriverInfo { + __le32 version; + struct Vmxnet3_GOSInfo gos; + __le32 vmxnet3RevSpt; + __le32 uptVerSpt; +}; + + +#define VMXNET3_REV1_MAGIC 0xbabefee1 + +/* + * QueueDescPA must be 128 bytes aligned. It points to an array of + * Vmxnet3_TxQueueDesc followed by an array of Vmxnet3_RxQueueDesc. + * The number of Vmxnet3_TxQueueDesc/Vmxnet3_RxQueueDesc are specified by + * Vmxnet3_MiscConf.numTxQueues/numRxQueues, respectively. + */ +#define VMXNET3_QUEUE_DESC_ALIGN 128 + + +struct Vmxnet3_MiscConf { + struct Vmxnet3_DriverInfo driverInfo; + __le64 uptFeatures; + __le64 ddPA; /* driver data PA */ + __le64 queueDescPA; /* queue descriptor table PA */ + __le32 ddLen; /* driver data len */ + __le32 queueDescLen; /* queue desc. table len in bytes */ + __le32 mtu; + __le16 maxNumRxSG; + u8 numTxQueues; + u8 numRxQueues; + __le32 reserved[4]; +}; + + +struct Vmxnet3_TxQueueConf { + __le64 txRingBasePA; + __le64 dataRingBasePA; + __le64 compRingBasePA; + __le64 ddPA; /* driver data */ + __le64 reserved; + __le32 txRingSize; /* # of tx desc */ + __le32 dataRingSize; /* # of data desc */ + __le32 compRingSize; /* # of comp desc */ + __le32 ddLen; /* size of driver data */ + u8 intrIdx; + u8 _pad[7]; +}; + + +struct Vmxnet3_RxQueueConf { + __le64 rxRingBasePA[2]; + __le64 compRingBasePA; + __le64 ddPA; /* driver data */ + __le64 reserved; + __le32 rxRingSize[2]; /* # of rx desc */ + __le32 compRingSize; /* # of rx comp desc */ + __le32 ddLen; /* size of driver data */ + u8 intrIdx; + u8 _pad[7]; +}; + + +enum vmxnet3_intr_mask_mode { + VMXNET3_IMM_AUTO = 0, + VMXNET3_IMM_ACTIVE = 1, + VMXNET3_IMM_LAZY = 2 +}; + +enum vmxnet3_intr_type { + VMXNET3_IT_AUTO = 0, + VMXNET3_IT_INTX = 1, + VMXNET3_IT_MSI = 2, + VMXNET3_IT_MSIX = 3 +}; + +#define VMXNET3_MAX_TX_QUEUES 8 +#define VMXNET3_MAX_RX_QUEUES 16 +/* addition 1 for events */ +#define VMXNET3_MAX_INTRS 25 + +/* value of intrCtrl */ +#define VMXNET3_IC_DISABLE_ALL 0x1 /* bit 0 */ + + +struct Vmxnet3_IntrConf { + bool autoMask; + u8 numIntrs; /* # of interrupts */ + u8 eventIntrIdx; + u8 modLevels[VMXNET3_MAX_INTRS]; /* moderation level for + * each intr */ + __le32 intrCtrl; + __le32 reserved[2]; +}; + +/* one bit per VLAN ID, the size is in the units of u32 */ +#define VMXNET3_VFT_SIZE (4096/(sizeof(uint32_t)*8)) + + +struct Vmxnet3_QueueStatus { + bool stopped; + u8 _pad[3]; + __le32 error; +}; + + +struct Vmxnet3_TxQueueCtrl { + __le32 txNumDeferred; + __le32 txThreshold; + __le64 reserved; +}; + + +struct Vmxnet3_RxQueueCtrl { + bool updateRxProd; + u8 _pad[7]; + __le64 reserved; +}; + +enum { + VMXNET3_RXM_UCAST = 0x01, /* unicast only */ + VMXNET3_RXM_MCAST = 0x02, /* multicast passing the filters */ + VMXNET3_RXM_BCAST = 0x04, /* broadcast only */ + VMXNET3_RXM_ALL_MULTI = 0x08, /* all multicast */ + VMXNET3_RXM_PROMISC = 0x10 /* promiscuous */ +}; + +struct Vmxnet3_RxFilterConf { + __le32 rxMode; /* VMXNET3_RXM_xxx */ + __le16 mfTableLen; /* size of the multicast filter table */ + __le16 _pad1; + __le64 mfTablePA; /* PA of the multicast filters table */ + __le32 vfTable[VMXNET3_VFT_SIZE]; /* vlan filter */ +}; + + +#define VMXNET3_PM_MAX_FILTERS 6 +#define VMXNET3_PM_MAX_PATTERN_SIZE 128 +#define VMXNET3_PM_MAX_MASK_SIZE (VMXNET3_PM_MAX_PATTERN_SIZE / 8) + +#define VMXNET3_PM_WAKEUP_MAGIC cpu_to_le16(0x01) /* wake up on magic pkts */ +#define VMXNET3_PM_WAKEUP_FILTER cpu_to_le16(0x02) /* wake up on pkts matching + * filters */ + + +struct Vmxnet3_PM_PktFilter { + u8 maskSize; + u8 patternSize; + u8 mask[VMXNET3_PM_MAX_MASK_SIZE]; + u8 pattern[VMXNET3_PM_MAX_PATTERN_SIZE]; + u8 pad[6]; +}; + + +struct Vmxnet3_PMConf { + __le16 wakeUpEvents; /* VMXNET3_PM_WAKEUP_xxx */ + u8 numFilters; + u8 pad[5]; + struct Vmxnet3_PM_PktFilter filters[VMXNET3_PM_MAX_FILTERS]; +}; + + +struct Vmxnet3_VariableLenConfDesc { + __le32 confVer; + __le32 confLen; + __le64 confPA; +}; + + +struct Vmxnet3_TxQueueDesc { + struct Vmxnet3_TxQueueCtrl ctrl; + struct Vmxnet3_TxQueueConf conf; + + /* Driver read after a GET command */ + struct Vmxnet3_QueueStatus status; + struct UPT1_TxStats stats; + u8 _pad[88]; /* 128 aligned */ +}; + + +struct Vmxnet3_RxQueueDesc { + struct Vmxnet3_RxQueueCtrl ctrl; + struct Vmxnet3_RxQueueConf conf; + /* Driver read after a GET commad */ + struct Vmxnet3_QueueStatus status; + struct UPT1_RxStats stats; + u8 __pad[88]; /* 128 aligned */ +}; + + +struct Vmxnet3_DSDevRead { + /* read-only region for device, read by dev in response to a SET cmd */ + struct Vmxnet3_MiscConf misc; + struct Vmxnet3_IntrConf intrConf; + struct Vmxnet3_RxFilterConf rxFilterConf; + struct Vmxnet3_VariableLenConfDesc rssConfDesc; + struct Vmxnet3_VariableLenConfDesc pmConfDesc; + struct Vmxnet3_VariableLenConfDesc pluginConfDesc; +}; + +/* All structures in DriverShared are padded to multiples of 8 bytes */ +struct Vmxnet3_DriverShared { + __le32 magic; + /* make devRead start at 64bit boundaries */ + __le32 pad; + struct Vmxnet3_DSDevRead devRead; + __le32 ecr; + __le32 reserved[5]; +}; + + +#define VMXNET3_ECR_RQERR (1 << 0) +#define VMXNET3_ECR_TQERR (1 << 1) +#define VMXNET3_ECR_LINK (1 << 2) +#define VMXNET3_ECR_DIC (1 << 3) +#define VMXNET3_ECR_DEBUG (1 << 4) + +/* flip the gen bit of a ring */ +#define VMXNET3_FLIP_RING_GEN(gen) ((gen) = (gen) ^ 0x1) + +/* only use this if moving the idx won't affect the gen bit */ +#define VMXNET3_INC_RING_IDX_ONLY(idx, ring_size) \ + do {\ + (idx)++;\ + if (unlikely((idx) == (ring_size))) {\ + (idx) = 0;\ + } \ + } while (0) + +#define VMXNET3_SET_VFTABLE_ENTRY(vfTable, vid) \ + (vfTable[vid >> 5] |= (1 << (vid & 31))) +#define VMXNET3_CLEAR_VFTABLE_ENTRY(vfTable, vid) \ + (vfTable[vid >> 5] &= ~(1 << (vid & 31))) + +#define VMXNET3_VFTABLE_ENTRY_IS_SET(vfTable, vid) \ + ((vfTable[vid >> 5] & (1 << (vid & 31))) != 0) + +#define VMXNET3_MAX_MTU 9000 +#define VMXNET3_MIN_MTU 60 + +#define VMXNET3_LINK_UP (10000 << 16 | 1) /* 10 Gbps, up */ +#define VMXNET3_LINK_DOWN 0 + +#undef u64 +#undef u32 +#undef u16 +#undef u8 +#undef __le16 +#undef __le32 +#undef __le64 +#undef __packed +#undef const_cpu_to_le64 +#if defined(HOST_WORDS_BIGENDIAN) +#undef __BIG_ENDIAN_BITFIELD +#endif + +#endif diff --git a/qemu/hw/vmxnet3_debug.h b/qemu/hw/vmxnet3_debug.h new file mode 100644 index 0000000..8383c22 --- /dev/null +++ b/qemu/hw/vmxnet3_debug.h @@ -0,0 +1,104 @@ +/* + * QEMU VMWARE VMXNET3 paravirtual NIC - debugging facilities + * + * Copyright (c) 2012 Ravello Systems LTD (http://ravellosystems.com) + * + * Developed by Daynix Computing LTD (http://www.daynix.com) + * + * Authors: + * Dmitry Fleytman + * Yan Vugenfirer + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + * + */ + +#ifndef _QEMU_VMXNET3_DEBUG_H +#define _QEMU_VMXNET3_DEBUG_H + +/* #define DEBUG_VMXNET3_CB */ +#define DEBUG_VMXNET3_WARNINGS +#define DEBUG_VMXNET3_ERRORS +/* #define DEBUG_VMXNET3_INTERRUPTS */ +/* #define DEBUG_VMXNET3_CONFIG */ +/* #define DEBUG_VMXNET3_SHMEM_ACCESS */ +/* #define DEBUG_VMXNET3_RINGS */ +/* #define DEBUG_VMXNET3_PACKETS */ + +#ifdef DEBUG_VMXNET3_SHMEM_ACCESS +#define DSHPRINTF(fmt, ...) \ + do { \ + printf("[vmxnet3][SH][%s]: " fmt "\n", __func__, ## __VA_ARGS__); \ + } while (0) +#else +#define DSHPRINTF(fmt, ...) do {} while (0) +#endif + +#ifdef DEBUG_VMXNET3_CB +#define DCBPRINTF(fmt, ...) \ + do { \ + printf("[vmxnet3][CB][%s]: " fmt "\n", __func__, ## __VA_ARGS__); \ + } while (0) +#else +#define DCBPRINTF(fmt, ...) do {} while (0) +#endif + +#ifdef DEBUG_VMXNET3_PACKETS +#define DPKPRINTF(fmt, ...) \ + do { \ + printf("[vmxnet3][PK][%s]: " fmt "\n", __func__, ## __VA_ARGS__); \ + } while (0) +#else +#define DPKPRINTF(fmt, ...) do {} while (0) +#endif + +#ifdef DEBUG_VMXNET3_WARNINGS +#define DWRPRINTF(fmt, ...) \ + do { \ + printf("[vmxnet3][WR][%s]: " fmt "\n", __func__, ## __VA_ARGS__); \ + } while (0) +#else +#define DWRPRINTF(fmt, ...) do {} while (0) +#endif + +#ifdef DEBUG_VMXNET3_ERRORS +#define DERPRINTF(fmt, ...) \ + do { \ + printf("[vmxnet3][ER][%s]: " fmt "\n", __func__, ## __VA_ARGS__); \ + } while (0) +#else +#define DERPRINTF(fmt, ...) do {} while (0) +#endif + +#ifdef DEBUG_VMXNET3_INTERRUPTS +#define DIRPRINTF(fmt, ...) \ + do { \ + printf("[vmxnet3][IR][%s]: " fmt "\n", __func__, ## __VA_ARGS__); \ + } while (0) +#else +#define DIRPRINTF(fmt, ...) do {} while (0) +#endif + +#ifdef DEBUG_VMXNET3_CONFIG +#define DCFPRINTF(fmt, ...) \ + do { \ + printf("[vmxnet3][CF][%s]: " fmt "\n", __func__, ## __VA_ARGS__); \ + } while (0) +#else +#define DCFPRINTF(fmt, ...) do {} while (0) +#endif + +#ifdef DEBUG_VMXNET3_RINGS +#define DRIPRINTF(fmt, ...) \ + do { \ + printf("[vmxnet3][RI][%s]: " fmt "\n", __func__, ## __VA_ARGS__); \ + } while (0) +#else +#define DRIPRINTF(fmt, ...) do {} while (0) +#endif + +#define MAC_FMT "%02X:%02X:%02X:%02X:%02X:%02X" +#define MAC_ARG(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] + +#endif /* _QEMU_VMXNET3_DEBUG_H */ diff --git a/qemu/hw/vmxnet_utils.c b/qemu/hw/vmxnet_utils.c new file mode 100644 index 0000000..e310828 --- /dev/null +++ b/qemu/hw/vmxnet_utils.c @@ -0,0 +1,172 @@ +/* + * QEMU VMWARE paravirtual devices - network auxiliary code + * + * Copyright (c) 2012 Ravello Systems LTD (http://ravellosystems.com) + * + * Developed by Daynix Computing LTD (http://www.daynix.com) + * + * Authors: + * Dmitry Fleytman + * Yan Vugenfirer + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + * + */ + +#include "hw.h" +#include "virtio-net.h" +#include "vmxnet_utils.h" +#include "net/checksum.h" + +void eth_setup_vlan_headers(struct eth_header *ehdr, uint16_t vlan_tag) +{ + switch (be16_to_cpu(ehdr->h_proto)) { + case ETH_P_VLAN: + case ETH_P_DVLAN: { + /* Header already present, just put proper VLAN tag */ + struct vlan_header *vhdr = PKT_GET_VLAN_HDR(ehdr); + vhdr->h_tci = cpu_to_be16(vlan_tag); + } + default: { + /* No VLAN header, put a new one */ + struct vlan_header *vhdr = PKT_GET_VLAN_HDR(ehdr); + vhdr->h_proto = ehdr->h_proto; + ehdr->h_proto = cpu_to_be16(ETH_P_VLAN); + vhdr->h_tci = cpu_to_be16(vlan_tag); + } + } +} + +bool eth_setup_tx_offloads(uint8_t *l3hdr, + size_t l3hdr_len, + size_t l3hdr_off, + uint32_t l3payload_len, + struct virtio_net_hdr *vhdr, + bool more_frags, + uint16_t fragmentation_offset) +{ + uint16_t csum; + + switch (vhdr->gso_type & ~VIRTIO_NET_HDR_GSO_ECN) { + case VIRTIO_NET_HDR_GSO_TCPV4: + case VIRTIO_NET_HDR_GSO_UDP: { + struct ip_header *iphdr = (struct ip_header *) l3hdr; + uint16_t new_ip_off; + + vhdr->flags = VIRTIO_NET_HDR_F_NEEDS_CSUM; + vhdr->csum_start = l3hdr_off; + vhdr->csum_offset = offsetof(struct ip_header, ip_sum); + + if (l3payload_len + l3hdr_len > ETH_MAX_IP_DGRAM_LEN) { + /* This must never happen with fragmentation enabled */ + assert(0 == more_frags); + assert(0 == fragmentation_offset); + return false; + } + + iphdr->ip_len = cpu_to_be16(l3payload_len + l3hdr_len); + assert(0 == (~IP_OFFMASK & fragmentation_offset)); + + new_ip_off = fragmentation_offset | (more_frags ? IP_MF : 0) | + (be16_to_cpu(iphdr->ip_off) & ~(IP_OFFMASK|IP_MF)); + + iphdr->ip_off = cpu_to_be16(new_ip_off); + + /* Due to Linux bridge bugs/features IP header checksum */ + /* must be calculated in order to make it process */ + /* packet with segmentation requirements successfully */ + eth_put_csum(l3hdr, vhdr->csum_offset, 0); + csum = net_raw_checksum(l3hdr, l3hdr_len); + eth_put_csum(l3hdr, vhdr->csum_offset, csum); + } + break; + + case VIRTIO_NET_HDR_GSO_TCPV6: + default: + vhdr->flags = 0; + break; + } + + return true; +} + +uint8_t +eth_get_gso_type(uint16_t l3_proto, uint8_t *l3_hdr) +{ + uint8_t ecn_state = 0; + + if (ETH_P_IP == l3_proto) { + struct ip_header *iphdr = (struct ip_header *) l3_hdr; + + if (IP_HEADER_VERSION_4 == IP_HEADER_VERSION(iphdr)) { + if (IPTOS_ECN_CE == IPTOS_ECN(iphdr->ip_tos)) { + ecn_state = VIRTIO_NET_HDR_GSO_ECN; + } + if (IP_PROTO_TCP == iphdr->ip_p) { + return VIRTIO_NET_HDR_GSO_TCPV4 | ecn_state; + } else if (IP_PROTO_UDP == iphdr->ip_p) { + return VIRTIO_NET_HDR_GSO_UDP | ecn_state; + } + } + } else if (ETH_P_IPV6 == l3_proto) { + struct ip6_header *ip6hdr = (struct ip6_header *) l3_hdr; + + if (IP6_ECN_CE == IP6_ECN(ip6hdr->ip6_ecn_acc)) { + ecn_state = VIRTIO_NET_HDR_GSO_ECN; + } + + if (IP_PROTO_TCP == ip6hdr->ip6_nxt) { + return VIRTIO_NET_HDR_GSO_TCPV6 | ecn_state; + } + } + + /* Unsupported offload */ + assert(false); + + return VIRTIO_NET_HDR_GSO_NONE | ecn_state; +} + +void eth_get_protocols(const uint8_t *headers, + uint32_t hdr_length, + bool *isip4, bool *isip6, + bool *isudp, bool *istcp) +{ + int proto; + size_t l2hdr_len = eth_get_l2_hdr_length(headers); + assert(hdr_length >= eth_get_l2_hdr_length(headers)); + *isip4 = *isip6 = *isudp = *istcp = false; + + proto = eth_get_l3_proto(headers, l2hdr_len); + if (ETH_P_IP == proto) { + *isip4 = true; + + struct ip_header *iphdr; + + assert(hdr_length >= + eth_get_l2_hdr_length(headers) + sizeof(struct ip_header)); + + iphdr = PKT_GET_IP_HDR(headers); + + if (IP_HEADER_VERSION_4 == IP_HEADER_VERSION(iphdr)) { + if (IP_PROTO_TCP == iphdr->ip_p) { + *istcp = true; + } else if (IP_PROTO_UDP == iphdr->ip_p) { + *isudp = true; + } + } + } else if (ETH_P_IPV6 == proto) { + *isip6 = true; + + struct ip6_header *ip6hdr; + assert(hdr_length >= + eth_get_l2_hdr_length(headers) + sizeof(struct ip6_header)); + ip6hdr = PKT_GET_IP6_HDR(headers); + + if (IP_PROTO_TCP == ip6hdr->ip6_nxt) { + *istcp = true; + } else if (IP_PROTO_UDP == ip6hdr->ip6_nxt) { + *isudp = true; + } + } +} diff --git a/qemu/hw/vmxnet_utils.h b/qemu/hw/vmxnet_utils.h new file mode 100644 index 0000000..f5e79dd --- /dev/null +++ b/qemu/hw/vmxnet_utils.h @@ -0,0 +1,242 @@ +/* + * QEMU VMWARE paravirtual devices - network auxiliary code + * + * Copyright (c) 2012 Ravello Systems LTD (http://ravellosystems.com) + * + * Developed by Daynix Computing LTD (http://www.daynix.com) + * + * Authors: + * Dmitry Fleytman + * Yan Vugenfirer + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + * + */ + +#define ETH_ALEN 6 + +struct eth_header { + uint8_t h_dest[ETH_ALEN]; /* destination eth addr */ + uint8_t h_source[ETH_ALEN]; /* source ether addr */ + uint16_t h_proto; /* packet type ID field */ +}; + +struct vlan_header { + uint16_t h_tci; /* priority and VLAN ID */ + uint16_t h_proto; /* encapsulated protocol */ +}; + +struct ip_header { + uint8_t ip_ver_len; /* version and header length */ + uint8_t ip_tos; /* type of service */ + uint16_t ip_len; /* total length */ + uint16_t ip_id; /* identification */ + uint16_t ip_off; /* fragment offset field */ + uint8_t ip_ttl; /* time to live */ + uint8_t ip_p; /* protocol */ + uint16_t ip_sum; /* checksum */ + uint32_t ip_src, ip_dst; /* source and dest address */ +}; + +/* IPv6 address */ +struct in6_addr { + union { + uint8_t __u6_addr8[16]; + } __in6_u; +}; + +struct ip6_header { + union { + struct ip6_hdrctl { + uint32_t ip6_un1_flow; /* 4 bits version, 8 bits TC, + 20 bits flow-ID */ + uint16_t ip6_un1_plen; /* payload length */ + uint8_t ip6_un1_nxt; /* next header */ + uint8_t ip6_un1_hlim; /* hop limit */ + } ip6_un1; + uint8_t ip6_un2_vfc; /* 4 bits version, top 4 bits tclass */ + struct ip6_ecn_access { + uint8_t ip6_un3_vfc; /* 4 bits version, top 4 bits tclass */ + uint8_t ip6_un3_ecn; /* 2 bits ECN, top 6 bits payload length */ + } ip6_un3; + } ip6_ctlun; + struct in6_addr ip6_src; /* source address */ + struct in6_addr ip6_dst; /* destination address */ +}; +#define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt +#define ip6_ecn_acc ip6_ctlun.ip6_un3.ip6_un3_ecn + +#define PKT_GET_ETH_HDR(p) \ + ((struct eth_header *)(p)) +#define PKT_GET_VLAN_HDR(p) \ + ((struct vlan_header *) (((uint8_t *)(p)) + sizeof(struct eth_header))) +#define PKT_GET_IP_HDR(p) \ + ((struct ip_header *)(((uint8_t *)(p)) + eth_get_l2_hdr_length(p))) +#define IP_HDR_GET_LEN(p) \ + ((((struct ip_header *)p)->ip_ver_len & 0x0F) << 2) +#define PKT_GET_IP_HDR_LEN(p) \ + (IP_HDR_GET_LEN(PKT_GET_IP_HDR(p))) +#define PKT_GET_IP6_HDR(p) \ + ((struct ip6_header *) (((uint8_t *)(p)) + eth_get_l2_hdr_length(p))) +#define IP_HEADER_VERSION(ip) \ + ((ip->ip_ver_len >> 4)&0xf) + +#define ETH_P_IP (0x0800) +#define ETH_P_IPV6 (0x86dd) +#define ETH_P_VLAN (0x8100) +#define ETH_P_DVLAN (0x88a8) +#define VLAN_VID_MASK 0x0fff +#define IP_HEADER_VERSION_4 (4) +#define IP_HEADER_VERSION_6 (6) +#define IP_PROTO_TCP (6) +#define IP_PROTO_UDP (17) +#define IPTOS_ECN_MASK 0x03 +#define IPTOS_ECN(x) ((x) & IPTOS_ECN_MASK) +#define IPTOS_ECN_CE 0x03 +#define IP6_ECN_MASK 0xC0 +#define IP6_ECN(x) ((x) & IP6_ECN_MASK) +#define IP6_ECN_CE 0xC0 +#define IP4_DONT_FRAGMENT_FLAG (1 << 14) + +#define IS_SPECIAL_VLAN_ID(x) \ + ((0 == (x)) || (0xFFF == (x))) + +#define ETH_MAX_L2_HDR_LEN \ + (sizeof(struct eth_header) + 2*sizeof(struct vlan_header)) + +#define ETH_MAX_IP4_HDR_LEN (60) +#define ETH_MAX_IP6_HDR_LEN \ + (sizeof(struct ip6_header)) +#define ETH_MAX_L3_HDR_LEN \ + (MAX(ETH_MAX_IP4_HDR_LEN, ETH_MAX_IP6_HDR_LEN)) +#define ETH_MAX_IP_DGRAM_LEN (0xFFFF) +#define ETH_MAX_IP_PLOAD_LEN \ + (ETH_MAX_IP_DGRAM_LEN - ETH_MAX_IP4_HDR_LEN - ETH_MAX_L2_HDR_LEN) + +#define IP_FRAG_UNIT_SIZE (8) +#define IP_FRAG_ALIGN_SIZE(x) ((x) & ~0x7) +#define IP_RF 0x8000 /* reserved fragment flag */ +#define IP_DF 0x4000 /* don't fragment flag */ +#define IP_MF 0x2000 /* more fragments flag */ +#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */ + + +static inline int is_multicast_ether_addr(const uint8_t *addr) +{ + return 0x01 & addr[0]; +} + +static inline int is_broadcast_ether_addr(const uint8_t *addr) +{ + return (addr[0] & addr[1] & addr[2] & addr[3] & addr[4] & addr[5]) == 0xff; +} + +static inline int is_unicast_ether_addr(const uint8_t *addr) +{ + return !is_multicast_ether_addr(addr); +} + +typedef enum { + VMXNET3_PKT_UCAST = 0xAABBCC00, + VMXNET3_PKT_BCAST, + VMXNET3_PKT_MCAST +} eth_pkt_types_e; + +static inline eth_pkt_types_e +get_eth_packet_type(const struct eth_header *ehdr) +{ + if (is_broadcast_ether_addr(ehdr->h_dest)) { + return VMXNET3_PKT_BCAST; + } else if (is_multicast_ether_addr(ehdr->h_dest)) { + return VMXNET3_PKT_MCAST; + } else { /* unicast */ + return VMXNET3_PKT_UCAST; + } +} + +static inline uint32_t +eth_get_l2_hdr_length(const void *p) +{ + uint16_t proto = be16_to_cpu(PKT_GET_ETH_HDR(p)->h_proto); + struct vlan_header *hvlan = PKT_GET_VLAN_HDR(p); + switch (proto) { + case ETH_P_VLAN: + return sizeof(struct eth_header) + sizeof(struct vlan_header); + case ETH_P_DVLAN: + if (ETH_P_VLAN == hvlan->h_proto) { + return sizeof(struct eth_header) + 2*sizeof(struct vlan_header); + } else { + return sizeof(struct eth_header) + sizeof(struct vlan_header); + } + default: + return sizeof(struct eth_header); + } +} + +static inline uint16_t +eth_get_pkt_vlan_tag(const void *p) +{ + uint16_t proto = be16_to_cpu(PKT_GET_ETH_HDR(p)->h_proto); + struct vlan_header *hvlan = PKT_GET_VLAN_HDR(p); + switch (proto) { + case ETH_P_VLAN: + case ETH_P_DVLAN: + return be16_to_cpu(hvlan->h_proto); + default: + return 0; + } +} + +static inline bool +eth_strip_vlan(const void *p, struct eth_header *new_ehdr, + uint16_t *payload_offset, uint16_t *vlan_tag) +{ + uint16_t proto = be16_to_cpu(PKT_GET_ETH_HDR(p)->h_proto); + struct vlan_header *hvlan = PKT_GET_VLAN_HDR(p); + + switch (proto) { + case ETH_P_VLAN: + case ETH_P_DVLAN: + memcpy(new_ehdr->h_source, PKT_GET_ETH_HDR(p)->h_source, ETH_ALEN); + memcpy(new_ehdr->h_dest, PKT_GET_ETH_HDR(p)->h_dest, ETH_ALEN); + new_ehdr->h_proto = hvlan->h_proto; + *vlan_tag = be16_to_cpu(hvlan->h_tci); + *payload_offset = + sizeof(struct eth_header) + sizeof(struct vlan_header); + return true; + default: + return false; + } +} + +static inline uint16_t +eth_get_l3_proto(const void *l2hdr, size_t l2hdr_len) +{ + uint8_t *proto_ptr = (uint8_t *) l2hdr + l2hdr_len - sizeof(uint16_t); + return be16_to_cpup((uint16_t *)proto_ptr); +} + +static inline void +eth_put_csum(uint8_t *buf, uint32_t cso, uint16_t csum) +{ + cpu_to_be16wu((uint16_t *)(buf + cso), csum); +} + +void eth_setup_vlan_headers(struct eth_header *ehdr, uint16_t vlan_tag); + + +bool eth_setup_tx_offloads(uint8_t *l3hdr, + size_t l3hdr_len, + size_t l3hdr_off, + uint32_t l3payload_len, + struct virtio_net_hdr *vhdr, + bool more_frags, + uint16_t fragmentation_offset); + +uint8_t eth_get_gso_type(uint16_t l3_proto, uint8_t *l3_hdr); + +void eth_get_protocols(const uint8_t *headers, + uint32_t hdr_length, + bool *isip4, bool *isip6, + bool *isudp, bool *istcp); diff --git a/qemu/net.c b/qemu/net.c index c34474f..e2f586c 100644 --- a/qemu/net.c +++ b/qemu/net.c @@ -857,7 +857,7 @@ static const struct { }, { .name = "model", .type = QEMU_OPT_STRING, - .help = "device model (e1000, rtl8139, virtio etc.)", + .help = "device model (e1000, rtl8139, virtio, vmxnet3 etc.)", }, { .name = "addr", .type = QEMU_OPT_STRING, diff --git a/qemu/net/checksum.h b/qemu/net/checksum.h index 1f05298..5f42a02 100644 --- a/qemu/net/checksum.h +++ b/qemu/net/checksum.h @@ -26,4 +26,11 @@ uint16_t net_checksum_tcpudp(uint16_t length, uint16_t proto, uint8_t *addrs, uint8_t *buf); void net_checksum_calculate(uint8_t *data, int length); +static inline uint16_t +net_raw_checksum(uint8_t *data, int length) +{ + return net_checksum_finish(net_checksum_add(length, data)); +} + + #endif /* QEMU_NET_CHECKSUM_H */ -- 1.7.7.6 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:44863) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5RQ4-00014w-IF for qemu-devel@nongnu.org; Wed, 07 Mar 2012 19:41:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5RQ3-0001XF-3l for qemu-devel@nongnu.org; Wed, 07 Mar 2012 19:41:24 -0500 Received: from ozlabs.org ([203.10.76.45]:35121) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5RQ2-0001Wx-Mu for qemu-devel@nongnu.org; Wed, 07 Mar 2012 19:41:23 -0500 From: David Gibson Date: Thu, 8 Mar 2012 11:41:08 +1100 Message-Id: <1331167272-9800-1-git-send-email-david@gibson.dropbear.id.au> In-Reply-To: <[0/4] RESEND: Outstanding bugfixes and cleanups> References: <[0/4] RESEND: Outstanding bugfixes and cleanups> Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: qemu-devel@nongnu.org These are patches that I've sent in before but don't seem to have been picked up by anybody yet. Resending so they don't fall off the radar. 1, 2, and 3 of 4 in particular fix real, observed bugs on powerpc. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38163) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5U0C-0002O8-5w for qemu-devel@nongnu.org; Wed, 07 Mar 2012 22:26:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S5U09-00025h-Qq for qemu-devel@nongnu.org; Wed, 07 Mar 2012 22:26:51 -0500 Received: from mail-ww0-f53.google.com ([74.125.82.53]:48329) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S5U09-00025M-Cu for qemu-devel@nongnu.org; Wed, 07 Mar 2012 22:26:49 -0500 Received: by wgbfm10 with SMTP id fm10so41942wgb.10 for ; Wed, 07 Mar 2012 19:26:46 -0800 (PST) MIME-Version: 1.0 Date: Thu, 8 Mar 2012 11:26:46 +0800 Message-ID: From: suyi wang Content-Type: multipart/alternative; boundary=0016e6d58fde8ac3af04bab2d841 Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --0016e6d58fde8ac3af04bab2d841 Content-Type: text/plain; charset=ISO-8859-1 Hi all: I tried kvm on my ubuntu with the libvirt.xml file as follows: instance-00000011 2097152 hvm 1 So it works well. Howerver, I want change the remote access method by spice, I simply changed the libvirt.xml as follows: instance-00000011 2097152 hvm 1 As you can see, I just change to , But it called the error as follows: libvirtError: internal error Process exited while reading console log output: char device redirected to /dev/pts/12 TRACE: do_spice_init: starting 0.8.1 TRACE: do_spice_init: statistics shm_open failed, Permission denied" Then I also tried "ls -ld /dev/shm" , yes, it is already 777. then my problem remained: libvirtError: internal error Process exited while reading console log output: char device redirected to /dev/pts/12 TRACE: do_spice_init: starting 0.8.1 TRACE: do_spice_init: statistics shm_open failed, Permission denied" I wish someone can give me some help! Thanks! -- Yours. suyi --0016e6d58fde8ac3af04bab2d841 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi all:

I tried kvm on my ubuntu =A0with the libvirt.xml file as fo= llows:
=A0 =A0<domain type=3D'kvm'>
=A0 =A0 =A0 =A0<name>instance-00000011</
name>=
=A0 =A0 =A0 =A0<memory>2097152</memory>
=A0 =A0 =A0 =A0<os>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<type>hvm</type>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<boot dev=3D"hd" />
=A0 =A0 =A0 =A0</os>
=A0 =A0 =A0 =A0<features>
=A0 =A0 =A0 =A0 =A0 =A0<acpi/>
=A0 =A0 =A0 =A0</features>
=A0 =A0 =A0 =A0<vcpu>1</vcpu>
=A0 =A0 =A0 =A0<devices>
=A0 =A0 =A0 =A0<sound model=3D'ac97'/>
=A0 =A0 =A0 =A0<input type=3D'tablet' bus=3D'usb'/><= br> =A0 =A0 =A0 =A0 =A0 =A0<disk type=3D'file'>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<driver type=3D'qcow2'/>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<source
=A0 =A0file=3D'/opt/stack/nova/nova/../
/instances/instance-000000= 11/disk'/>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<target dev=3D'vda' bus=3D'i= de'/>
=A0 =A0 =A0 =A0 =A0 =A0</disk>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<disk type=3D'file'>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<driver type=3D'qcow2'/&= gt;
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<source

- Ignored:
=A0 =A0file=3D'/opt/stack/nova/nova/..//instances/instance-00000011/di= sk.local'/>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<target dev=3D'vdb' bus= =3D'ide'/>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0</disk>

=A0 =A0 =A0 =A0 =A0 =A0<interface type=3D'bridge'>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<source bridge=3D'br100'/> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<mac address=3D'02:16:3e:44:a1:dd= 9;/>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<filterref
=A0 =A0filter=3D"nova-instance-instance-00000011-02163e44a1dd"&g= t;
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<parameter name=3D"IP"= value=3D"10.0.0.2" />
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<parameter name=3D"DHCPSERV= ER" value=3D"10.0.0.1" />
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0</filterref>
=A0 =A0 =A0 =A0 =A0 =A0</interface>

=A0 =A0 =A0 =A0 =A0 =A0<!-- The order is significant here. =A0File must= be defined first -->
=A0 =A0 =A0 =A0 =A0 =A0<serial type=3D"file">
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<source
=A0 =A0path=3D'/opt/stack/nova/nova/..//instances/instance-00000011/co= nsole.log'/>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<target port=3D'1'/>
=A0 =A0 =A0 =A0 =A0 =A0</serial>

=A0 =A0 =A0 =A0 =A0 =A0<console type=3D'pty' tty=3D'/dev/pt= s/2'>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<source path=3D'/dev/pts/2'/>=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<target port=3D'0'/>
=A0 =A0 =A0 =A0 =A0 =A0</console>

=A0 =A0 =A0 =A0 =A0 =A0<serial type=3D'pty'>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<source path=3D'/dev/pts/2'/>=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<target port=3D'0'/>
=A0 =A0 =A0 =A0 =A0 =A0</serial>


=A0 =A0 =A0 =A0 =A0 =A0<graphics type=3D'vnc' port=3D'-1= 9; autoport=3D'yes' keymap=3D'en-us'
=A0 =A0listen=3D'0.0.0.0'/>

=A0 =A0 =A0 =A0</devices>
=A0 =A0</domain>

=A0 =A0So it works well.

=A0 =A0Howerver, I want change the remote access method by spice, I simply= changed
=A0 =A0the libvirt.xml as follows:
=A0 =A0<domain type=3D'kvm'>
=A0 =A0 =A0 =A0<name>instance-00000011</name>
=A0 =A0 =A0 =A0<memory>2097152</memory>
=A0 =A0 =A0 =A0<os>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<type>hvm</type>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<boot dev=3D"hd" />
=A0 =A0 =A0 =A0</os>
=A0 =A0 =A0 =A0<features>
=A0 =A0 =A0 =A0 =A0 =A0<acpi/>
=A0 =A0 =A0 =A0</features>
=A0 =A0 =A0 =A0<vcpu>1</vcpu>
=A0 =A0 =A0 =A0<devices>
=A0 =A0 =A0 =A0<sound model=3D'ac97'/>
=A0 =A0 =A0 =A0<input type=3D'tablet' bus=3D'usb'/><= br> =A0 =A0 =A0 =A0 =A0 =A0<disk type=3D'file'>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<driver type=3D'qcow2'/>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<source
=A0 =A0file=3D'/opt/stack/nova/nova/..//instances/instance-00000011/di= sk'/>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<target dev=3D'vda' bus=3D'i= de'/>
=A0 =A0 =A0 =A0 =A0 =A0</disk>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<disk type=3D'file'>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<driver type=3D'qcow2'/&= gt;
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<source
=A0 =A0file=3D'/opt/stack/nova/nova/..//instances/instance-00000011/di= sk.local'/>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<target dev=3D'vdb' bus= =3D'ide'/>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0</disk>

=A0 =A0 =A0 =A0 =A0 =A0<interface type=3D'bridge'>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<source bridge=3D'br100'/> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<mac address=3D'02:16:3e:44:a1:dd= 9;/>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<filterref
=A0 =A0filter=3D"nova-instance-instance-00000011-02163e44a1dd"&g= t;
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<parameter name=3D"IP"= value=3D"10.0.0.2" />
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<parameter name=3D"DHCPSERV= ER" value=3D"10.0.0.1" />
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0</filterref>
=A0 =A0 =A0 =A0 =A0 =A0</interface>

=A0 =A0 =A0 =A0 =A0 =A0<!-- The order is significant here. =A0File must= be defined first -->
=A0 =A0 =A0 =A0 =A0 =A0<serial type=3D"file">
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<source
=A0 =A0path=3D'/opt/stack/nova/nova/..//instances/instance-00000011/co= nsole.log'/>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<target port=3D'1'/>
=A0 =A0 =A0 =A0 =A0 =A0</serial>

=A0 =A0 =A0 =A0 =A0 =A0<console type=3D'pty' tty=3D'/dev/pt= s/2'>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<source path=3D'/dev/pts/2'/>=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<target port=3D'0'/>
=A0 =A0 =A0 =A0 =A0 =A0</console>

=A0 =A0 =A0 =A0 =A0 =A0<serial type=3D'pty'>
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<source path=3D'/dev/pts/2'/>=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0<target port=3D'0'/>
=A0 =A0 =A0 =A0 =A0 =A0</serial>


=A0 =A0 =A0 =A0 =A0 =A0<graphics type=3D'spice' port=3D'-1&= #39; autoport=3D'yes' keymap=3D'en-us'
=A0 =A0listen=3D'0.0.0.0'/>

=A0 =A0 =A0 =A0</devices>
=A0 =A0</domain>

=A0 =A0As you can see, I just change <graphics type=3D'vnc' por= t=3D'-1' autoport=3D'yes'
=A0 =A0keymap=3D'en-us' listen=3D'0.0.0.0'/> to <gra= phics type=3D'spice' port=3D'-1'
=A0 =A0autoport=3D'yes' keymap=3D'en-us' listen=3D'0.0= .0.0'/> =A0 , =A0 But it called the
=A0 =A0error as follows:

=A0 =A0libvirtError: internal error Process exited while reading console l= og
=A0 =A0output: char device redirected to /dev/pts/12
=A0 =A0TRACE: do_spice_init: starting 0.8.1
=A0 =A0TRACE: do_spice_init: statistics shm_open failed, Permission denied= "


Then I also=A0 tried "ls -ld /dev/shm" =A0 , =A0yes, it i= s already=A0 777.
then my problem remained:
libvirtError: internal error Process exited while reading console log
=A0 =A0output: char device redirected to /dev/pts/12
=A0 =A0TRACE: do_spice_init: starting 0.8.1
=A0 =A0TRACE: do_spice_init: statistics shm_open failed, Permission denied= "


=A0 =A0I wish someone can give me some help! Thanks!


--
Yours.
suyi

--0016e6d58fde8ac3af04bab2d841-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34742) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SENUu-0007ur-7o for qemu-devel@nongnu.org; Sun, 01 Apr 2012 12:19:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SENUs-00025o-Ke for qemu-devel@nongnu.org; Sun, 01 Apr 2012 12:19:19 -0400 Received: from mail-ob0-f173.google.com ([209.85.214.173]:61580) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SENUs-00025c-DX for qemu-devel@nongnu.org; Sun, 01 Apr 2012 12:19:18 -0400 Received: by obbwd20 with SMTP id wd20so3403510obb.4 for ; Sun, 01 Apr 2012 09:19:15 -0700 (PDT) MIME-Version: 1.0 Date: Sun, 1 Apr 2012 13:19:15 -0300 Message-ID: From: =?ISO-8859-1?Q?C=E9sar?= Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hello there, Consider I`ve an apllication A executing in "linux-user" mode. How can I monitor the execution of some instructions from A? For example, all calls. I thought inserting an interrupt before all calls and creating a new interrupt handler could do the job, but I can=B4t get it working. Any ideas on this? C=E9sar. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:40472) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ss4E0-00068K-MR for qemu-devel@nongnu.org; Thu, 19 Jul 2012 23:49:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ss4Dz-0003Lk-NU for qemu-devel@nongnu.org; Thu, 19 Jul 2012 23:49:56 -0400 Received: from mprc.pku.edu.cn ([162.105.203.9]:57892) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ss4Dz-0003LA-1Q for qemu-devel@nongnu.org; Thu, 19 Jul 2012 23:49:55 -0400 From: Guan Xuetao Date: Fri, 20 Jul 2012 11:39:18 +0800 Message-Id: <1342755558-8011-1-git-send-email-gxt@mprc.pku.edu.cn> Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: blauwirbel@gmail.com, afaerber@suse.de are available in the git repository at: git://github.com/gxt/QEMU.git unicore32 Andreas Färber (1): target-unicore32: Drop UC32_CPUID macros Guan Xuetao (13): unicore32-softmmu: Add unicore32-softmmu build support unicore32-softmmu: Add coprocessor 0(sysctrl) and 1(ocd) instruction support unicore32-softmmu: Make UniCore32 cpuid & exceptions correct and runable unicore32-softmmu: Implement softmmu specific functions unicore32-softmmu: Make sure that kernel can access user space unicore32-softmmu: Add puv3 soc/board support unicore32-softmmu: Add puv3 interrupt support unicore32-softmmu: Add puv3 ostimer support unicore32-softmmu: Add puv3 gpio support unicore32-softmmu: Add puv3 pm support unicore32-softmmu: Add puv3 dma support unicore32-softmmu: Add ps2 support unicore32-softmmu: Add maintainer information for UniCore32 machine MAINTAINERS | 8 + arch_init.c | 2 + arch_init.h | 1 + configure | 1 + cpu-exec.c | 1 + default-configs/unicore32-softmmu.mak | 4 + hw/Makefile.objs | 7 + hw/puv3.c | 130 ++++++++++++++++ hw/puv3.h | 49 ++++++ hw/puv3_dma.c | 109 +++++++++++++ hw/puv3_gpio.c | 141 +++++++++++++++++ hw/puv3_intc.c | 135 +++++++++++++++++ hw/puv3_ost.c | 151 +++++++++++++++++++ hw/puv3_pm.c | 149 ++++++++++++++++++ hw/unicore32/Makefile.objs | 6 + linux-user/main.c | 3 +- target-unicore32/Makefile.objs | 2 +- target-unicore32/cpu.c | 19 ++- target-unicore32/cpu.h | 18 +-- target-unicore32/helper.c | 180 ++++++++++++++++++---- target-unicore32/helper.h | 17 +-- target-unicore32/machine.c | 23 +++ target-unicore32/op_helper.c | 44 ++++++- target-unicore32/softmmu.c | 267 +++++++++++++++++++++++++++++++++ target-unicore32/translate.c | 116 +++++++++++++-- 25 files changed, 1509 insertions(+), 74 deletions(-) create mode 100644 default-configs/unicore32-softmmu.mak create mode 100644 hw/puv3.c create mode 100644 hw/puv3.h create mode 100644 hw/puv3_dma.c create mode 100644 hw/puv3_gpio.c create mode 100644 hw/puv3_intc.c create mode 100644 hw/puv3_ost.c create mode 100644 hw/puv3_pm.c create mode 100644 hw/unicore32/Makefile.objs create mode 100644 target-unicore32/machine.c create mode 100644 target-unicore32/softmmu.c From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StGM8-0004fb-0g for qemu-devel@nongnu.org; Mon, 23 Jul 2012 06:59:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1StGM7-0002pw-DS for qemu-devel@nongnu.org; Mon, 23 Jul 2012 06:59:15 -0400 Received: from mail-lb0-f173.google.com ([209.85.217.173]:52502) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1StGM7-0002pi-6b for qemu-devel@nongnu.org; Mon, 23 Jul 2012 06:59:15 -0400 Received: by lbok6 with SMTP id k6so8447399lbo.4 for ; Mon, 23 Jul 2012 03:59:14 -0700 (PDT) MIME-Version: 1.0 Date: Mon, 23 Jul 2012 18:59:13 +0800 Message-ID: From: Paulo Arcinas Content-Type: multipart/alternative; boundary=bcaec552428ae57e9104c57d22d7 Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --bcaec552428ae57e9104c57d22d7 Content-Type: text/plain; charset=ISO-8859-1 --bcaec552428ae57e9104c57d22d7 Content-Type: text/html; charset=ISO-8859-1 --bcaec552428ae57e9104c57d22d7-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:56590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TaYYA-00087f-9g for qemu-devel@nongnu.org; Mon, 19 Nov 2012 16:06:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TaYY9-00020O-01 for qemu-devel@nongnu.org; Mon, 19 Nov 2012 16:06:38 -0500 Received: from packetbuilder64bit.de-nserver.de ([85.158.179.228]:42153) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TaYY8-000209-PW for qemu-devel@nongnu.org; Mon, 19 Nov 2012 16:06:36 -0500 From: Stefan Priebe Date: Mon, 19 Nov 2012 21:39:44 +0100 Message-Id: <1353357585-31746-1-git-send-email-s.priebe@profihost.ag> Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, ceph-devel@vger.kernel.org, pve-devel@pve.proxmox.com >>From Stefan Priebe # This line is ignored. From: Stefan Priebe Cc: pve-devel@pve.proxmox.com Cc: pbonzini@redhat.com Cc: ceph-devel@vger.kernel.org Subject: QEMU/PATCH: rbd block driver: fix race between completition and cancel In-Reply-To: ve-devel@pve.proxmox.com pbonzini@redhat.com ceph-devel@vger.kernel.org From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UN3fy-00075e-N8 for qemu-devel@nongnu.org; Tue, 02 Apr 2013 12:03:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UN3fn-0001Aj-N1 for qemu-devel@nongnu.org; Tue, 02 Apr 2013 12:03:10 -0400 Received: from mail-la0-x242.google.com ([2a00:1450:4010:c03::242]:46332) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UN3fn-00019x-EB for qemu-devel@nongnu.org; Tue, 02 Apr 2013 12:02:59 -0400 Received: by mail-la0-f66.google.com with SMTP id gw10so147000lab.5 for ; Tue, 02 Apr 2013 09:02:57 -0700 (PDT) MIME-Version: 1.0 Date: Tue, 2 Apr 2013 12:02:52 -0400 Message-ID: From: Elizabeth Brown Content-Type: multipart/alternative; boundary=f46d04017315be12ee04d962de48 Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --f46d04017315be12ee04d962de48 Content-Type: text/plain; charset=ISO-8859-1 I was wondering if anyone could help me by setting up a wiki account for me? thank you very much for your assistance! Elizabeth Brown --f46d04017315be12ee04d962de48 Content-Type: text/html; charset=ISO-8859-1
I was wondering if anyone could help me by setting up a wiki account for me?

thank you very much for your assistance!

Elizabeth Brown
--f46d04017315be12ee04d962de48-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43284) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UO0vR-0002NU-8K for qemu-devel@nongnu.org; Fri, 05 Apr 2013 03:19:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UO0vM-0005Hq-79 for qemu-devel@nongnu.org; Fri, 05 Apr 2013 03:19:05 -0400 Received: from mail-wi0-x22d.google.com ([2a00:1450:400c:c05::22d]:53963) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UO0vL-0005Hi-Tg for qemu-devel@nongnu.org; Fri, 05 Apr 2013 03:19:00 -0400 Received: by mail-wi0-f173.google.com with SMTP id ez12so275395wid.6 for ; Fri, 05 Apr 2013 00:18:59 -0700 (PDT) Date: Fri, 5 Apr 2013 09:18:56 +0200 From: Stefan Hajnoczi Message-ID: <20130405071856.GC27940@stefanha-thinkpad.redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Elizabeth Brown Cc: qemu-devel@nongnu.org On Tue, Apr 02, 2013 at 12:02:52PM -0400, Elizabeth Brown wrote: > I was wondering if anyone could help me by setting up a wiki account for me? Done. Stefan From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46413) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZksw-00026Z-9o for qemu-devel@nongnu.org; Tue, 07 May 2013 12:37:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UZksq-00005g-5v for qemu-devel@nongnu.org; Tue, 07 May 2013 12:37:02 -0400 Received: from smtp02.citrix.com ([66.165.176.63]:53404) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UZksq-000054-0D for qemu-devel@nongnu.org; Tue, 07 May 2013 12:36:56 -0400 From: John Baboval Date: Tue, 7 May 2013 12:36:24 -0400 Message-ID: <1367944585-20292-1-git-send-email-john.baboval@citrix.com> In-Reply-To: <5187B463.8000804@redhat.com> References: <5187B463.8000804@redhat.com> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com Thanks for the feedback. I've made the maxqdepth parameter optional as requested. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37704) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VB7a0-0005P5-Iu for qemu-devel@nongnu.org; Sun, 18 Aug 2013 14:20:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VB7Zt-0007t5-W3 for qemu-devel@nongnu.org; Sun, 18 Aug 2013 14:19:56 -0400 Received: from mga03.intel.com ([143.182.124.21]:3865) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VB7Zt-0007sQ-9M for qemu-devel@nongnu.org; Sun, 18 Aug 2013 14:19:49 -0400 From: "Liu, Jinsong" Date: Sun, 18 Aug 2013 18:19:43 +0000 Message-ID: Content-Language: en-US Content-Type: multipart/mixed; boundary="_002_DE8DF0795D48FD4CA783C40EC829233501338E8CSHSMSX101ccrcor_" MIME-Version: 1.0 Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gleb Natapov , Marcelo Tosatti , "qemu-devel@nongnu.org" , kvm --_002_DE8DF0795D48FD4CA783C40EC829233501338E8CSHSMSX101ccrcor_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable >>From 1273f8b2e5464ec987facf9942fd3ccc0b69087e Mon Sep 17 00:00:00 2001 From: Liu Jinsong Date: Mon, 19 Aug 2013 09:33:30 +0800 Subject: [PATCH] qemu-kvm bugfix for IA32_FEATURE_CONTROL This patch is to fix the bug https://bugs.launchpad.net/qemu-kvm/+bug/12076= 23 IA32_FEATURE_CONTROL is pointless if not expose VMX or SMX bits to cpuid.1.ecx of vcpu. Current qemu-kvm will error return when kvm_put_msrs or kvm_get_msrs. Signed-off-by: Liu Jinsong --- target-i386/kvm.c | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index 84ac00a..7facbfe 100644 --- a/target-i386/kvm.c +++ b/target-i386/kvm.c @@ -65,6 +65,7 @@ static bool has_msr_star; static bool has_msr_hsave_pa; static bool has_msr_tsc_adjust; static bool has_msr_tsc_deadline; +static bool has_msr_feature_control; static bool has_msr_async_pf_en; static bool has_msr_pv_eoi_en; static bool has_msr_misc_enable; @@ -644,6 +645,11 @@ int kvm_arch_init_vcpu(CPUState *cs) =20 qemu_add_vm_change_state_handler(cpu_update_state, env); =20 + c =3D cpuid_find_entry(&cpuid_data.cpuid, 1, 0); + if (c) + has_msr_feature_control =3D !!(c->ecx & CPUID_EXT_VMX) | + !!(c->ecx & CPUID_EXT_SMX); + cpuid_data.cpuid.padding =3D 0; r =3D kvm_vcpu_ioctl(cs, KVM_SET_CPUID2, &cpuid_data); if (r) { @@ -1121,7 +1127,10 @@ static int kvm_put_msrs(X86CPU *cpu, int level) if (hyperv_vapic_recommended()) { kvm_msr_entry_set(&msrs[n++], HV_X64_MSR_APIC_ASSIST_PAGE, 0); } - kvm_msr_entry_set(&msrs[n++], MSR_IA32_FEATURE_CONTROL, env->msr_i= a32_feature_control); + if (has_msr_feature_control) { + kvm_msr_entry_set(&msrs[n++], MSR_IA32_FEATURE_CONTROL, + env->msr_ia32_feature_control); + } } if (env->mcg_cap) { int i; @@ -1346,7 +1355,9 @@ static int kvm_get_msrs(X86CPU *cpu) if (has_msr_misc_enable) { msrs[n++].index =3D MSR_IA32_MISC_ENABLE; } - msrs[n++].index =3D MSR_IA32_FEATURE_CONTROL; + if (has_msr_feature_control) { + msrs[n++].index =3D MSR_IA32_FEATURE_CONTROL; + } =20 if (!env->tsc_valid) { msrs[n++].index =3D MSR_IA32_TSC; @@ -1447,6 +1458,7 @@ static int kvm_get_msrs(X86CPU *cpu) break; case MSR_IA32_FEATURE_CONTROL: env->msr_ia32_feature_control =3D msrs[i].data; + break; default: if (msrs[i].index >=3D MSR_MC0_CTL && msrs[i].index < MSR_MC0_CTL + (env->mcg_cap & 0xff) * 4) { --=20 1.7.1 --_002_DE8DF0795D48FD4CA783C40EC829233501338E8CSHSMSX101ccrcor_ Content-Type: application/octet-stream; name="0001-qemu-kvm-bugfix-for-IA32_FEATURE_CONTROL.patch" Content-Description: 0001-qemu-kvm-bugfix-for-IA32_FEATURE_CONTROL.patch Content-Disposition: attachment; filename="0001-qemu-kvm-bugfix-for-IA32_FEATURE_CONTROL.patch"; size=2676; creation-date="Sun, 18 Aug 2013 18:11:12 GMT"; modification-date="Mon, 19 Aug 2013 01:42:34 GMT" Content-Transfer-Encoding: base64 RnJvbSAxMjczZjhiMmU1NDY0ZWM5ODdmYWNmOTk0MmZkM2NjYzBiNjkwODdlIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBMaXUgSmluc29uZyA8amluc29uZy5saXVAaW50ZWwuY29tPgpE YXRlOiBNb24sIDE5IEF1ZyAyMDEzIDA5OjMzOjMwICswODAwClN1YmplY3Q6IFtQQVRDSF0gcWVt dS1rdm0gYnVnZml4IGZvciBJQTMyX0ZFQVRVUkVfQ09OVFJPTAoKVGhpcyBwYXRjaCBpcyB0byBm aXggdGhlIGJ1ZyBodHRwczovL2J1Z3MubGF1bmNocGFkLm5ldC9xZW11LWt2bS8rYnVnLzEyMDc2 MjMKCklBMzJfRkVBVFVSRV9DT05UUk9MIGlzIHBvaW50bGVzcyBpZiBub3QgZXhwb3NlIFZNWCBv ciBTTVggYml0cyB0bwpjcHVpZC4xLmVjeCBvZiB2Y3B1LiBDdXJyZW50IHFlbXUta3ZtIHdpbGwg ZXJyb3IgcmV0dXJuIHdoZW4ga3ZtX3B1dF9tc3JzCm9yI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jeCAmIENQVUlEX0VYVF9W TVgpIHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhIShjLT5lY3ggJiBDUFVJ RF9FWFRfU01YKTsKKwogICAgIGNwdWlkX2RhdGEuY3B1aWQucGFkZGluZyA9IDA7CiAgICAgciA9 IGt2bV92Y3B1X2lvY3RsKGNzLCBLVk1fU0VUX0NQVUlEMiwgJmNwdWlkX2RhdGEpOwogICAgIGlm IChyKSB7CkBAIC0xMTIxLDcgKzExMjcsMTAgQEAgc3RhdGljIGludCBrdm1fcHV0X21zcnMoWDg2 Q1BVICpjcHUsIGludCBsZXZlbCkKICAgICAgICAgaWYgKGh5cGVydl92YXBpY19yZWNvbW1lbmRl ZCgpKSB7CiAgICAgICAgICAgICBrdm1fbXNyX2VudHJ5X3NldCgmbXNyc1tuKytdLCBIVl9YNjRf TVNSX0FQSUNfQVNTSVNUX1BBR0UsIDApOwogICAgICAgICB9Ci0gICAgICAgIGt2bV9tc3JfZW50 cnlfc2V0KCZtc3JzW24rK10sIE1TUl9JQTMyX0ZFQVRVUkVfQ09OVFJPTCwgZW52LT5tc3JfaWEz Ml9mZWF0dXJlX2NvbnRyb2wpOworICAgICAgICBpZiAoaGFzX21zcl9mZWF0dXJlX2NvbnRyb2wp IHsKKyAgICAgICAgICAgIGt2bV9tc3JfZW50cnlfc2V0KCZtc3JzW24rK10sIE1TUl9JQTMyX0ZF QVRVUkVfQ09OVFJPTCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudi0+bXNyX2lh MzJfZmVhdHVyZV9jb250cm9sKTsKKyAgICAgICAgfQogICAgIH0KICAgICBpZiAoZW52LT5tY2df Y2FwKSB7CiAgICAgICAgIGludCBpOwpAQCAtMTM0Niw3ICsxMzU1LDkgQEAgc3RhdGljIGludCBr dm1fZ2V0X21zcnMoWDg2Q1BVICpjcHUpCiAgICAgaWYgKGhhc19tc3JfbWlzY19lbmFibGUpIHsK ICAgICAgICAgbXNyc1tuKytdLmluZGV4ID0gTVNSX0lBMzJfTUlTQ19FTkFCTEU7CiAgICAgfQot ICAgIG1zcnNbbisrXS5pbmRleCA9IE1TUl9JQTMyX0ZFQVRVUkVfQ09OVFJPTDsKKyAgICBpZiAo aGFzX21zcl9mZWF0dXJlX2NvbnRyb2wpIHsKKyAgICAgICAgbXNyc1tuKytdLmluZGV4ID0gTVNS X0lBMzJfRkVBVFVSRV9DT05UUk9MOworICAgIH0KIAogICAgIGlmICghZW52LT50c2NfdmFsaWQp IHsKICAgICAgICAgbXNyc1tuKytdLmluZGV4ID0gTVNSX0lBMzJfVFNDOwpAQCAtMTQ0Nyw2ICsx NDU4LDcgQEAgc3RhdGljIGludCBrdm1fZ2V0X21zcnMoWDg2Q1BVICpjcHUpCiAgICAgICAgICAg ICBicmVhazsKICAgICAgICAgY2FzZSBNU1JfSUEzMl9GRUFUVVJFX0NPTlRST0w6CiAgICAgICAg ICAgICBlbnYtPm1zcl9pYTMyX2ZlYXR1cmVfY29udHJvbCA9IG1zcnNbaV0uZGF0YTsKKyAgICAg ICAgICAgIGJyZWFrOwogICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgaWYgKG1zcnNbaV0u aW5kZXggPj0gTVNSX01DMF9DVEwgJiYKICAgICAgICAgICAgICAgICBtc3JzW2ldLmluZGV4IDwg TVNSX01DMF9DVEwgKyAoZW52LT5tY2dfY2FwICYgMHhmZikgKiA0KSB7Ci0tIAoxLjcuMQoK --_002_DE8DF0795D48FD4CA783C40EC829233501338E8CSHSMSX101ccrcor_-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50387) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqQL2-0005xI-Dz for qemu-devel@nongnu.org; Tue, 10 Dec 2013 11:39:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VqQKw-0002pO-FF for qemu-devel@nongnu.org; Tue, 10 Dec 2013 11:39:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:16184) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqQKw-0002pI-7J for qemu-devel@nongnu.org; Tue, 10 Dec 2013 11:39:06 -0500 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rBAGd5ca015414 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 10 Dec 2013 11:39:05 -0500 Date: Tue, 10 Dec 2013 18:42:45 +0200 From: "Michael S. Tsirkin" Message-ID: <20131210164245.GB2112@redhat.com> References: <1385062405-3800-1-git-send-email-marcel.a@redhat.com> <1385062405-3800-3-git-send-email-marcel.a@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1385062405-3800-3-git-send-email-marcel.a@redhat.com> Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Marcel Apfelbaum Cc: qemu-devel@nongnu.org On Thu, Nov 21, 2013 at 09:33:22PM +0200, Marcel Apfelbaum wrote: > Ensure more then one instance of test_data may exist > at a given time. It will help to compare different > acpi table versions. > > Signed-off-by: Marcel Apfelbaum Applied, thanks. > --- > tests/acpi-test.c | 55 ++++++++++++++++++++++++++++++++----------------------- > 1 file changed, 32 insertions(+), 23 deletions(-) > > diff --git a/tests/acpi-test.c b/tests/acpi-test.c > index 43775cd..ca83b1d 100644 > --- a/tests/acpi-test.c > +++ b/tests/acpi-test.c > @@ -34,7 +34,7 @@ typedef struct { > uint32_t *rsdt_tables_addr; > int rsdt_tables_nr; > AcpiSdtTable dsdt_table; > - AcpiSdtTable *ssdt_tables; > + GArray *ssdt_tables; > } test_data; > > #define LOW(x) ((x) & 0xff) > @@ -118,6 +118,18 @@ static uint8_t boot_sector[0x200] = { > > static const char *disk = "tests/acpi-test-disk.raw"; > > +static void free_test_data(test_data *data) > +{ > + int i; > + > + g_free(data->rsdt_tables_addr); > + for (i = 0; i < data->ssdt_tables->len; ++i) { > + g_free(g_array_index(data->ssdt_tables, AcpiSdtTable, i).aml); > + } > + g_array_free(data->ssdt_tables, false); > + g_free(data->dsdt_table.aml); > +} > + > static uint8_t acpi_checksum(const uint8_t *data, int len) > { > int i; > @@ -295,30 +307,30 @@ static void test_acpi_dsdt_table(test_data *data) > > static void test_acpi_ssdt_tables(test_data *data) > { > - AcpiSdtTable *ssdt_tables; > + GArray *ssdt_tables; > int ssdt_tables_nr = data->rsdt_tables_nr - 1; /* fadt is first */ > int i; > > - ssdt_tables = g_new0(AcpiSdtTable, ssdt_tables_nr); > + ssdt_tables = g_array_sized_new(false, true, sizeof(AcpiSdtTable), > + ssdt_tables_nr); > for (i = 0; i < ssdt_tables_nr; i++) { > - AcpiSdtTable *ssdt_table = &ssdt_tables[i]; > + AcpiSdtTable ssdt_table; > uint32_t addr = data->rsdt_tables_addr[i + 1]; /* fadt is first */ > - > - test_dst_table(ssdt_table, addr); > + test_dst_table(&ssdt_table, addr); > + g_array_append_val(ssdt_tables, ssdt_table); > } > data->ssdt_tables = ssdt_tables; > } > > -static void test_acpi_one(const char *params) > +static void test_acpi_one(const char *params, test_data *data) > { > char *args; > uint8_t signature_low; > uint8_t signature_high; > uint16_t signature; > int i; > - test_data data; > > - memset(&data, 0, sizeof(data)); > + memset(data, 0, sizeof(*data)); > args = g_strdup_printf("-net none -display none %s %s", > params ? params : "", disk); > qtest_start(args); > @@ -342,20 +354,13 @@ static void test_acpi_one(const char *params) > } > g_assert_cmphex(signature, ==, SIGNATURE); > > - test_acpi_rsdp_address(&data); > - test_acpi_rsdp_table(&data); > - test_acpi_rsdt_table(&data); > - test_acpi_fadt_table(&data); > + test_acpi_rsdp_address(data); > + test_acpi_rsdp_table(data); > + test_acpi_rsdt_table(data); > + test_acpi_fadt_table(data); > test_acpi_facs_table(data); > - test_acpi_dsdt_table(&data); > - test_acpi_ssdt_tables(&data); > - > - g_free(data.rsdt_tables_addr); > - for (i = 0; i < (data.rsdt_tables_nr - 1); ++i) { > - g_free(data.ssdt_tables[i].aml); > - } > - g_free(data.ssdt_tables); > - g_free(data.dsdt_table.aml); > + test_acpi_dsdt_table(data); > + test_acpi_ssdt_tables(data); > > qtest_quit(global_qtest); > g_free(args); > @@ -363,10 +368,14 @@ static void test_acpi_one(const char *params) > > static void test_acpi_tcg(void) > { > + test_data data; > + > /* Supplying -machine accel argument overrides the default (qtest). > * This is to make guest actually run. > */ > - test_acpi_one("-machine accel=tcg"); > + test_acpi_one("-machine accel=tcg", &data); > + > + free_test_data(&data); > } > > int main(int argc, char *argv[]) > -- > 1.8.3.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55110) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAgpb-0006wD-Fu for qemu-devel@nongnu.org; Tue, 04 Feb 2014 09:18:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WAgpV-0005yd-JW for qemu-devel@nongnu.org; Tue, 04 Feb 2014 09:18:31 -0500 Received: from mail-we0-x22d.google.com ([2a00:1450:400c:c03::22d]:38406) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAgpV-0005yD-CF for qemu-devel@nongnu.org; Tue, 04 Feb 2014 09:18:25 -0500 Received: by mail-we0-f173.google.com with SMTP id x55so4143433wes.18 for ; Tue, 04 Feb 2014 06:18:23 -0800 (PST) MIME-Version: 1.0 Date: Tue, 4 Feb 2014 18:18:22 +0400 Message-ID: From: =?KOI8-R?B?98HMxc7Uyc4g88HKy8/X?= Content-Type: multipart/alternative; boundary=089e016347f01802b904f19550e0 Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: kvm@vger.kernel.org Cc: qemu-devel@nongnu.org --089e016347f01802b904f19550e0 Content-Type: text/plain; charset=ISO-8859-1 Good day. Very little speed drives Virtio. Drivers are the latest guest on the system "Windows server 2008". Host system centos 6.5. All that can be tried, but failed to increase the speed. And there I have a database running. Screenshots test speed drives http://itmages.ru/image/view/1471772/feec35c3 http://itmages.ru/image/view/1471774/2b0baeae http://itmages.ru/image/view/1471785/9fffb8f5 Thanks in advance. Apply nowhere else. --089e016347f01802b904f19550e0 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Good day. Very little speed drives Virtio. Drivers ar= e the latest guest on the system "Windows server 2008". Host syst= em centos 6.5.

All that can be tried, but failed t= o increase the speed. And there I have a database running.=A0

Screenshots test speed drives


Th= anks in advance. Apply nowhere else.
--089e016347f01802b904f19550e0-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53105) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wv6Fw-0000Vm-CM for qemu-devel@nongnu.org; Thu, 12 Jun 2014 10:45:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wv6Fu-0002P6-NZ for qemu-devel@nongnu.org; Thu, 12 Jun 2014 10:45:32 -0400 Received: from mail-qa0-x232.google.com ([2607:f8b0:400d:c00::232]:43135) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wv6Fu-0002Os-CM for qemu-devel@nongnu.org; Thu, 12 Jun 2014 10:45:30 -0400 Received: by mail-qa0-f50.google.com with SMTP id m5so1790961qaj.9 for ; Thu, 12 Jun 2014 07:45:29 -0700 (PDT) MIME-Version: 1.0 Date: Thu, 12 Jun 2014 20:15:29 +0530 Message-ID: From: Puneet Bakshi Content-Type: multipart/alternative; boundary=089e0153758ebc6e9804fba49c07 Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --089e0153758ebc6e9804fba49c07 Content-Type: text/plain; charset=UTF-8 Hi, I want to be able to install RPM packages (available in host system at some path) to the online guest VM and want this facility to be available as a tool. I am thinking of having a gemu guest agent (qemu-ga) running inside guest VM. I did not find any available command ("virsh qemu-agent-command ...") which can do the same. I am planning to implement a command in qemu guest agent, which I can invoke from virsh like below. "virsh qemu-agent-command vm_01 \ '{"execute":"guest-rpm- install", \ "arguments":{"path":"/usr/local/bin/ABC.rpm"}} I am able to pass arguments from host to guest VM but how am I supposed to pass the whole RPM image from host to guest (which the guest agent can receive and install)? Basically, I want to know how can we do following in QEMU environment. 1. take some bulky file from host to guest 2. perform some operation on that file 3. get the result of that operation. Regards, ~Puneet --089e0153758ebc6e9804fba49c07 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,

I want to be able to install RPM packages (availa= ble in host=20 system at some path) to the online guest VM and want this facility to be=20 available as a tool.

I am thinking of having a gemu guest agent (qemu-ga) running inside=20 guest VM. I did not find any available command ("virsh=20 qemu-agent-command <guest_vm> ...") which can do the same.
I am planning to implement a command in qemu guest agent, which I can inv= oke from virsh like below.

=C2=A0=C2=A0=C2=A0 "virsh qemu-agent-command vm_01=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 \
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 '{"execute":"guest-rpm-
install",=C2=A0=C2=A0=C2=A0=C2=A0 \
=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "arguments":{"path":&= quot;/usr/local/bin/ABC.rpm"}}
=C2=A0=C2=A0=C2=A0=C2=A0
I am able to pass arguments from host to guest= VM but how am I=20 supposed to pass the whole RPM image from host to guest (which the guest agent can receive and install)?

= Basically, I want to know how can we do following in QEMU environment.
<= br>=C2=A0=C2=A0=C2=A0 1. take some bulky file from host to guest
= =C2=A0=C2=A0=C2=A0 2. perform some operation on that file
=C2=A0= =C2=A0=C2=A0 3. get the result of that operation.

Regards,
~Puneet
--089e0153758ebc6e9804fba49c07-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUHyJ-0004Jn-Sp for qemu-devel@nongnu.org; Wed, 17 Sep 2014 12:20:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUHyI-0006cT-2n for qemu-devel@nongnu.org; Wed, 17 Sep 2014 12:20:47 -0400 MIME-Version: 1.0 Date: Wed, 17 Sep 2014 21:50:39 +0530 Message-ID: From: Priyanka Ranjan Content-Type: multipart/alternative; boundary=047d7bacc1e4b0ade90503453fce Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-discuss@nongnu.org Cc: qemu-devel@nongnu.org --047d7bacc1e4b0ade90503453fce Content-Type: text/plain; charset=UTF-8 Hello Experts, I am using CentOS 6.5. I am getting an issue with libguestfs (qemu-kvm) # /usr/libexec/qemu-kvm -nographic -machine accel=kvm:tcg -device \? open /dev/kvm: No such file or directory failed to initialize KVM: Operation not permitted Back to tcg accelerator. Could not allocate dynamic translator buffer I saw this issue listed in libguestfs faq " http://libguestfs.org/guestfs-faq.1.html" and executed "setsebool -P virt_use_execmem=on" as a solution but that also did not help. I confirmed this solution with libguestfs mailing list. They asked me to to write to you. Could you please help me. Thanks a lot in advance, --047d7bacc1e4b0ade90503453fce Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hello Experts,
I am using CentOS 6.5. I am getting an = issue with libguestfs (qemu-kvm)

=C2=A0#=C2=A0 /usr/libexec/qemu-kvm -nographic -machine accel=3Dkvm:tcg -d= evice \?

=C2=A0open= /dev/kvm: No such file or directory
=C2=A0Back to tcg accelerator.
=C2=A0Could not allocate dynamic translator buffer

I saw this issue listed in libguestfs faqhttp://libguestfs.org/guestfs-faq.1.html&q= uot; =C2=A0and executed=C2=A0
=C2=A0&quo= t;setsebool -P virt_use_execmem=3Don" =C2=A0as a solution but=C2=A0=C2=A0that also did not help. I confirmed this soluti= on with libguestfs mailing list. They asked me to to write to you. Could yo= u please help me.

Thanks a lot in advance,
--047d7bacc1e4b0ade90503453fce-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54571) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XnfR0-0000JC-Ij for qemu-devel@nongnu.org; Sun, 09 Nov 2014 22:14:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XnfQz-0002Hc-VL for qemu-devel@nongnu.org; Sun, 09 Nov 2014 22:14:30 -0500 Received: from mail-wi0-x242.google.com ([2a00:1450:400c:c05::242]:53026) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XnfQz-0002HY-OC for qemu-devel@nongnu.org; Sun, 09 Nov 2014 22:14:29 -0500 Received: by mail-wi0-f194.google.com with SMTP id ex7so3658543wid.5 for ; Sun, 09 Nov 2014 19:14:29 -0800 (PST) MIME-Version: 1.0 Date: Mon, 10 Nov 2014 11:14:29 +0800 Message-ID: From: xubin yan Content-Type: multipart/alternative; boundary=bcaec53f386b8a599a0507788f46 Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --bcaec53f386b8a599a0507788f46 Content-Type: text/plain; charset=UTF-8 hello --bcaec53f386b8a599a0507788f46 Content-Type: text/html; charset=UTF-8
hello
--bcaec53f386b8a599a0507788f46-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44556) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XxD0r-0005Sw-Po for qemu-devel@nongnu.org; Sat, 06 Dec 2014 05:55:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XxD0i-0005AJ-Ng for qemu-devel@nongnu.org; Sat, 06 Dec 2014 05:54:57 -0500 Received: from mail-pa0-x229.google.com ([2607:f8b0:400e:c03::229]:52423) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XxD0i-0005AF-FZ for qemu-devel@nongnu.org; Sat, 06 Dec 2014 05:54:48 -0500 Received: by mail-pa0-f41.google.com with SMTP id rd3so2279694pab.28 for ; Sat, 06 Dec 2014 02:54:47 -0800 (PST) Date: Sat, 6 Dec 2014 18:54:41 +0800 From: Jun Li Message-ID: <20141206105440.GA5805@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: josh.durgin@inktank.com, juli@redhat.com, qemu-devel@nongnu.org stefanha@redhat.com Bcc: Subject: Re: [Qemu-devel] qcow2: Can create qcow2 image format on rbd server Reply-To: In-Reply-To: <5481E4E7.9010402@redhat.com> On Fri, 12/05 18:01, Max Reitz wrote: > On 2014-12-05 at 16:32, Jun Li wrote: > >Currently, qemu-img can not create qcow2 image format on rbd server. Analysis > >the code as followings: > >when create qcow2 format image: > >qcow2_create2 > > bdrv_create_file(filename, opts, &local_err); --> Here will create a 0 size > > file(e.g: file1) on rbd server. > > ... > > ret = bdrv_pwrite(bs, 0, header, cluster_size); --> So here can not write > > qcow2 header into file1 due to the file1's length is 0. Seems > > qemu_rbd_aio_writev can not write beyond EOF. > > ... > > > >As above analysis, there are two methods to solve the above bz as followings: > >1, When create file1, just create a fixed-size file1 on rbd server(not 0 size). > > Should be possible by using -o preallocation=falloc or -o > preallocation=full. Sure. If bdrv_create_file(filename, opts, &local_err) create a fixed-size(not 0 size) just as using "preallocation=falloc or preallocation=full", it will create a fixed-size file on rbd server. So it won't exist above issue. > > I can't say a lot about making rbd growable because I know near to nothing > about rbd; but there are protocols which really simply don't support writes > beyond the end of file, and where that's intended (for instance, while nbd > somehow does support it when using the qemu nbd server, normally (strictly > according to the protocol) it does not); so for these protocols, you have to > use a preallocated image file or an image format which does not grow on > writes (such as raw). > Here just want to use rbd_resize to realize rbd growable. > Of course, while that may be a solution for nbd, it doesn't sound like a > good solution for rbd, so writes beyond the EOF should probably be supported > there (although once again, I don't know rbd well enough to judge that). > Yes, you are right. Also talked with stefan. Here just want to ask Josh Durgin whether it has other solutions or rbd can support asynchronous rbd_resize. Regards, Jun Li > > >2, When write the qcow2 header into file1, just let qemu_rbd_aio_writev can > >enlarge the file1. So should add qemu_rbd_truncate inside qemu_rbd_aio_writev. > >qemu_rbd_truncate will call rbd_resize, but seems rbd_resize is > >synchronous function. If so, when do bdrv_pwrite, guest will hang.This is not > >our expected. > > > >For method 1, maybe it's not corresponding to the original principle of qcow2. > >Yes, it's very easy to solve the above bz. Nevertheless, I just want to use > >method 2 to solve above issue. > > > >For method 2, could anyone give some suggestions on howto realize a > >asynchronous rbd_resize. Thanks. > > > >Above analysis also based on stefan's hints. Thanks. > > > >Best Regards, > >Jun Li > From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49353) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YPKug-0005hK-Dw for qemu-devel@nongnu.org; Sat, 21 Feb 2015 20:00:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YPKud-0003vR-6F for qemu-devel@nongnu.org; Sat, 21 Feb 2015 20:00:50 -0500 Received: from nm19-vm4.bullet.mail.ne1.yahoo.com ([98.138.91.179]:59375) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YPKuc-0003vJ-Vl for qemu-devel@nongnu.org; Sat, 21 Feb 2015 20:00:47 -0500 Date: Sun, 22 Feb 2015 01:00:01 +0000 (UTC) From: Sunil Kumar Message-ID: <698041007.1331045.1424566801336.JavaMail.yahoo@mail.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] (no subject) Reply-To: Sunil Kumar List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel Hi, I ran into an issue where the OVA created from the VMDK file created by qemu-img is rejected by vSphere with a message like "Not a supported disk format (sparse VMDK too old)". I was looking through the archives and found this: http://lists.gnu.org/archive/html/qemu-devel/2014-08/msg01028.html That's exactly my issue and the patch will resolve it. But this patch has not been merged yet and it does not apply on top of 2.2.0 cleanly. Any ideas what happened to the patch there? I will appreciate any help. -devsk From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54597) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YouY8-0001Ak-9i for qemu-devel@nongnu.org; Sun, 03 May 2015 10:07:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YouY7-0006B5-4S for qemu-devel@nongnu.org; Sun, 03 May 2015 10:07:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57948) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YouY6-0006Av-V5 for qemu-devel@nongnu.org; Sun, 03 May 2015 10:07:15 -0400 Date: Sun, 03 May 2015 17:07:10 +0300 From: yhindin@redhat.com Message-ID: <55462b8e.Qk12flsw1bGFW/h4%yhindin@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, mdroth@linux.vnet.ibm.com Hi Recently, I've submitted patches to QEMU mailing list, introducing creation of Windows MSI installation package for Windows QEMU Guest Agent, but received not replies. Please, look into the suggested changes. The patches may be found in patchwork as http://patchwork.ozlabs.org/patch/464618-464622 Regards, Yossi Hindin From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54709) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YouYP-0001Yv-VA for qemu-devel@nongnu.org; Sun, 03 May 2015 10:07:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YouYO-0006Hk-Vj for qemu-devel@nongnu.org; Sun, 03 May 2015 10:07:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53210) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YouYO-0006HZ-MH for qemu-devel@nongnu.org; Sun, 03 May 2015 10:07:32 -0400 Date: Sun, 03 May 2015 17:07:26 +0300 From: yhindin@redhat.com Message-ID: <55462b9e.DjEQN+e0WZ5JXr4E%yhindin@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, mdroth@linux.vnet.ibm.com Hi Recently, I've submitted patches to QEMU mailing list, introducing creation of Windows MSI installation package for Windows QEMU Guest Agent, but received not replies. Please, look into the suggested changes. The patches may be found in patchwork as http://patchwork.ozlabs.org/patch/464618-464622 Regards, Yossi Hindin From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55369) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Youav-0003gn-UI for qemu-devel@nongnu.org; Sun, 03 May 2015 10:10:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Youas-0007GS-OC for qemu-devel@nongnu.org; Sun, 03 May 2015 10:10:09 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46433) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Youas-0007EU-Gn for qemu-devel@nongnu.org; Sun, 03 May 2015 10:10:06 -0400 Date: Sun, 03 May 2015 17:10:00 +0300 From: yhindin@redhat.com Message-ID: <55462c38.7r+qBGgYfDgL9qrP%yhindin@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, mdroth@linux.vnet.ibm.com Hi Recently, I've submitted patches to QEMU mailing list, introducing creation of Windows MSI installation package for Windows QEMU Guest Agent, but received not replies. Please, look into the suggested changes. The patches may be found in patchwork as http://patchwork.ozlabs.org/patch/464618-464622 Regards, Yossi Hindin From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55405) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoubE-00042t-1S for qemu-devel@nongnu.org; Sun, 03 May 2015 10:10:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Youb9-0007OB-Tp for qemu-devel@nongnu.org; Sun, 03 May 2015 10:10:27 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36385) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Youb9-0007O1-KA for qemu-devel@nongnu.org; Sun, 03 May 2015 10:10:23 -0400 Date: Sun, 03 May 2015 17:10:17 +0300 From: yhindin@redhat.com Message-ID: <55462c49.grohp4f+jHbcYK/s%yhindin@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, mdroth@linux.vnet.ibm.com Hi Recently, I've submitted patches to QEMU mailing list, introducing creation of Windows MSI installation package for Windows QEMU Guest Agent, but received not replies. Please, look into the suggested changes. The patches may be found in patchwork as http://patchwork.ozlabs.org/patch/464618-464622 Regards, Yossi Hindin From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55444) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoubY-0004Ed-49 for qemu-devel@nongnu.org; Sun, 03 May 2015 10:10:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YoubU-0007Vc-TW for qemu-devel@nongnu.org; Sun, 03 May 2015 10:10:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36186) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YoubU-0007VN-Cq for qemu-devel@nongnu.org; Sun, 03 May 2015 10:10:44 -0400 Date: Sun, 03 May 2015 17:10:38 +0300 From: yhindin@redhat.com Message-ID: <55462c5e.H6a5Jjm4Cc80Mj1r%yhindin@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, mdroth@linux.vnet.ibm.com Hi Recently, I've submitted patches to QEMU mailing list, introducing creation of Windows MSI installation package for Windows QEMU Guest Agent, but received not replies. Please, look into the suggested changes. The patches may be found in patchwork as http://patchwork.ozlabs.org/patch/464618-464622 Regards, Yossi Hindin From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47555) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9nUE-00006K-JD for qemu-devel@nongnu.org; Tue, 30 Jun 2015 00:49:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9nUD-0004eN-F3 for qemu-devel@nongnu.org; Tue, 30 Jun 2015 00:49:34 -0400 Received: from mail-oi0-x22d.google.com ([2607:f8b0:4003:c06::22d]:32892) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9nUD-0004dz-A5 for qemu-devel@nongnu.org; Tue, 30 Jun 2015 00:49:33 -0400 Received: by oiyy130 with SMTP id y130so133121154oiy.0 for ; Mon, 29 Jun 2015 21:49:31 -0700 (PDT) MIME-Version: 1.0 From: Scott Feldman Date: Tue, 30 Jun 2015 00:49:12 -0400 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU Developers , famz@redhat.com, Stefan Hajnoczi Cc: =?UTF-8?B?SmnFmcOtIFDDrXJrbw==?= Hi Fam, Stefan, I'm running a test with rocker device using UDP sockets connections and I'm seeing the socket s->read_poll stay disabled if the device receives a packet when the device's can_receive returns false. Receive is stuck after that; nothing ever re-enables s->read_poll. I see the first packet queued on queue->packets and that's it. No more receives. If I modify the device to lie and always return can_receive=true, and drop the pkt in driver receive, then things work fine. I think this patch broke can_receive semantics for net/socket.c: commit 6e99c631f116221d169ea53953d91b8aa74d297a Author: Fam Zheng Date: Thu Jun 4 14:45:16 2015 +0800 net/socket: Drop net_socket_can_send Anything jump out? (In the test, rocker device is enabling the netdev port once the guest OS driver signals to enable the port based on STP process running on the guest. The initial STP state is DISABLED, so the port is isolated from the network. As STP algo progresses, the port is opened up and the netdev is enabled for Rx traffic). -scott From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58589) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9poE-0006nO-8q for qemu-devel@nongnu.org; Tue, 30 Jun 2015 03:18:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9poA-00024F-4z for qemu-devel@nongnu.org; Tue, 30 Jun 2015 03:18:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49047) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9po9-000245-WE for qemu-devel@nongnu.org; Tue, 30 Jun 2015 03:18:18 -0400 Date: Tue, 30 Jun 2015 15:18:13 +0800 From: Fam Zheng Message-ID: <20150630071813.GB5599@ad.nay.redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Scott Feldman Cc: =?utf-8?B?SmnFmcOtIFDDrXJrbw==?= , QEMU Developers , Stefan Hajnoczi On Tue, 06/30 00:49, Scott Feldman wrote: > Hi Fam, Stefan, > > I'm running a test with rocker device using UDP sockets connections > and I'm seeing the socket s->read_poll stay disabled if the device > receives a packet when the device's can_receive returns false. > Receive is stuck after that; nothing ever re-enables s->read_poll. I > see the first packet queued on queue->packets and that's it. No more > receives. If I modify the device to lie and always return > can_receive=true, and drop the pkt in driver receive, then things work > fine. > > I think this patch broke can_receive semantics for net/socket.c: Yes. The semantics now is if .can_receive returns false, the NIC needs to flush the queue explicitly when the conditions in .can_receive become true, because net/{socket,tap,...} no longer polls .can_receive(). > > commit 6e99c631f116221d169ea53953d91b8aa74d297a > Author: Fam Zheng > Date: Thu Jun 4 14:45:16 2015 +0800 > > net/socket: Drop net_socket_can_send > > Anything jump out? > > (In the test, rocker device is enabling the netdev port once the guest > OS driver signals to enable the port based on STP process running on > the guest. The initial STP state is DISABLED, so the port is isolated > from the network. As STP algo progresses, the port is opened up and > the netdev is enabled for Rx traffic). > > -scott > Does dropping .can_receive or forcing 1 work for you? Or maybe something like this: diff --git a/hw/net/rocker/rocker_fp.c b/hw/net/rocker/rocker_fp.c index d8d934c..3209ccd 100644 --- a/hw/net/rocker/rocker_fp.c +++ b/hw/net/rocker/rocker_fp.c @@ -203,6 +203,7 @@ void fp_port_enable(FpPort *port) fp_port_set_link(port, true); port->enabled = true; DPRINTF("port %d enabled\n", port->index); + qemu_flush_queued_packets(qemu_get_queue(port->nic)); } void fp_port_disable(FpPort *port) --- Fam From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43688) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9wQx-0006UA-Db for qemu-devel@nongnu.org; Tue, 30 Jun 2015 10:22:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z9wQw-0006gt-M2 for qemu-devel@nongnu.org; Tue, 30 Jun 2015 10:22:47 -0400 Received: from mail-ob0-x22f.google.com ([2607:f8b0:4003:c01::22f]:35351) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9wQw-0006gf-H0 for qemu-devel@nongnu.org; Tue, 30 Jun 2015 10:22:46 -0400 Received: by obbop1 with SMTP id op1so7462167obb.2 for ; Tue, 30 Jun 2015 07:22:46 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20150630071813.GB5599@ad.nay.redhat.com> References: <20150630071813.GB5599@ad.nay.redhat.com> From: Scott Feldman Date: Tue, 30 Jun 2015 10:22:26 -0400 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: =?UTF-8?B?SmnFmcOtIFDDrXJrbw==?= , QEMU Developers , Stefan Hajnoczi On Tue, Jun 30, 2015 at 3:18 AM, Fam Zheng wrote: > On Tue, 06/30 00:49, Scott Feldman wrote: >> Hi Fam, Stefan, >> >> I'm running a test with rocker device using UDP sockets connections >> and I'm seeing the socket s->read_poll stay disabled if the device >> receives a packet when the device's can_receive returns false. >> Receive is stuck after that; nothing ever re-enables s->read_poll. I >> see the first packet queued on queue->packets and that's it. No more >> receives. If I modify the device to lie and always return >> can_receive=true, and drop the pkt in driver receive, then things work >> fine. >> >> I think this patch broke can_receive semantics for net/socket.c: > > Yes. The semantics now is if .can_receive returns false, the NIC needs to flush > the queue explicitly when the conditions in .can_receive become true, because > net/{socket,tap,...} no longer polls .can_receive(). Ah, that makes sense. >> commit 6e99c631f116221d169ea53953d91b8aa74d297a >> Author: Fam Zheng >> Date: Thu Jun 4 14:45:16 2015 +0800 >> >> net/socket: Drop net_socket_can_send >> >> Anything jump out? >> >> (In the test, rocker device is enabling the netdev port once the guest >> OS driver signals to enable the port based on STP process running on >> the guest. The initial STP state is DISABLED, so the port is isolated >> from the network. As STP algo progresses, the port is opened up and >> the netdev is enabled for Rx traffic). >> >> -scott >> > > Does dropping .can_receive or forcing 1 work for you? Or maybe something like > this: Dropping .can_receive works. Actually, we really don't want any pkts queued when the device port is disabled, otherwise when the port transitions to enabled, we'll receive stale network pkts. This would be bad for a switch device. So I think this is a happy outcome: removing .can_receive prevents pkt queuing on the backend, and the .receive handler can eat the pkt if the port is disabled. I'll send a rocker patch to fix this. Thanks Fam. -scott From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35162) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAhCb-0002ru-NL for qemu-devel@nongnu.org; Thu, 02 Jul 2015 12:19:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZAhCY-0001tV-1F for qemu-devel@nongnu.org; Thu, 02 Jul 2015 12:19:05 -0400 Received: from mailhub.sw.ru ([195.214.232.25]:8488 helo=relay.sw.ru) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZAhCU-0001rH-Iu for qemu-devel@nongnu.org; Thu, 02 Jul 2015 12:19:01 -0400 From: "Denis V. Lunev" Date: Thu, 2 Jul 2015 19:18:46 +0300 Message-Id: <1435853929-5862-1-git-send-email-den@openvz.org> Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Pavel Butsykin , qemu-devel@nongnu.org, Luiz Capitulino , Paolo Bonzini , "Denis V. Lunev" The monivation of this set is simple. Recently we have proposed patch to monitor.c with specific x86 APIC HMP commands. The patchset was denied with the main motivation "No more arch specific code in monitor.c" This patchset is the first step to move arch specific code from monitor.c targets. So, monitor.c already contains a lot of generic code, as well as the target specifics code and eventually monitor.c volume will only grow. This trend leads to a variety of fouling code ifdeffery(and combinations thereof), poor readability, and entanglement of architecture of the project. If someone wants to improve processing logic commands at the monitor, it isn't necessarily must differentiate amongst the implementation of some ARM or x86_64 specific commands, because the project already has separation of target specific code on directories. The presented solution is not the best, but it is quite simple (PATCH doesn't add more code!) and decides the above mentioned issue. Subsequently it will not prevent the introduction of more advanced mechanism that can more effectively resolve the issue. There is a issue with the placement of code for multiple architectures (isn't for everyone), but this code is very small. This patch is a step towards solving the issue associated with maintaining the purity of the code and structure of the project, which solves not all, but doing a little better than it is. Signed-off-by: Pavel Butsykin Signed-off-by: Denis V. Lunev CC: Luiz Capitulino CC: Paolo Bonzini CC: Peter Maydell Pavel Butsykin (3): hmp-commands-info: move info_cmds content out of monitor.c monitor: remove target-specific code from monitor.c monitor: added generation of documentation for hmp-commands-info.hx .gitignore | 1 + Makefile | 9 +- Makefile.target | 5 +- hmp-commands-info.hx | 715 ++++++++++++++++++++++ hmp-commands.hx | 120 ---- include/monitor/monitor-common.h | 43 ++ monitor.c | 1227 +------------------------------------- qemu-doc.texi | 2 + target-i386/Makefile.objs | 2 +- target-i386/monitor.c | 489 +++++++++++++++ target-ppc/Makefile.objs | 2 +- target-ppc/monitor.c | 250 ++++++++ target-sh4/Makefile.objs | 1 + target-sh4/monitor.c | 52 ++ target-sparc/Makefile.objs | 2 +- target-sparc/monitor.c | 153 +++++ target-xtensa/Makefile.objs | 1 + target-xtensa/monitor.c | 34 ++ 18 files changed, 1762 insertions(+), 1346 deletions(-) create mode 100644 hmp-commands-info.hx create mode 100644 include/monitor/monitor-common.h create mode 100644 target-i386/monitor.c create mode 100644 target-ppc/monitor.c create mode 100644 target-sh4/monitor.c create mode 100644 target-sparc/monitor.c create mode 100644 target-xtensa/monitor.c From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEuiX-0000fq-Kn for qemu-devel@nongnu.org; Tue, 14 Jul 2015 03:33:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZEuiU-0000FZ-Fi for qemu-devel@nongnu.org; Tue, 14 Jul 2015 03:33:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56078) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEuiU-0000FR-Ax for qemu-devel@nongnu.org; Tue, 14 Jul 2015 03:33:26 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 58AD3AB10E for ; Tue, 14 Jul 2015 07:33:25 +0000 (UTC) From: Pankaj Gupta Date: Tue, 14 Jul 2015 13:03:08 +0530 Message-Id: <1436859190-20002-1-git-send-email-pagupta@redhat.com> Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: amit.shah@redhat.com, Pankaj Gupta , mst@redhat.com Subject: [PATCH 0/2 v2] virtio-rng: Avoid uncessary timer trigger to bump up quota value Timer was added in virtio-rng to rate limit the entropy. It used to trigger at regular intervals to bump up the quota value. The value of quota and timer is used to ensure single guest should not use up all the entropy from the host. This resulted in triggering of timer even when quota is not exhausted at all and resulting in extra processing. This series has two patches: patch1 : Bump up quota value only when guest requests entropy. patch2 : Serve pending request if any after timer bumps up quota. Changes from v1: Amit Shah : Serve pending request if any after timer bumps up quota. Add testing details. I tested this with '/dev/urandom' at host side. Below are the details: * Quota+timer specified on command line, Ran in Guest 'dd if=/dev/hwrng of=/dev/null' - Quota (4096 bytes), Time slice (1000 ms) 48152 bytes (49 KB) copied, 12.0005 s, 4.1 kB/s 48640 bytes (49 KB) copied, 12.0014 s, 4.1 kB/s - Quota (8192), Time slice (1000 ms) 65536 bytes (66 KB) copied, 8.00088 s, 8.2 kB/s 146944 bytes (147 KB)copied, 18.0021 s, 8.2 kB/s - No quota/timer specified on command line, takes default values. Quota (INT64_MAX), Time slice(65536 ms) 8050688 bytes (8.1 MB) copied, 93.1198 s, 86.5 kB/s 35568128 bytes (36 MB) copied, 408.823 s, 87.0 kB/s hw/virtio/virtio-rng.c | 51 +++++++++++++++++++++++++---------------- include/hw/virtio/virtio-rng.h | 1 2 files changed, 33 insertions(+), 19 deletions(-) From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45867) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zyg4N-0002GO-Tb for qemu-devel@nongnu.org; Tue, 17 Nov 2015 08:13:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zyg4J-0002Wx-2f for qemu-devel@nongnu.org; Tue, 17 Nov 2015 08:13:11 -0500 From: Christoph Hellwig Date: Tue, 17 Nov 2015 14:08:08 +0100 Message-Id: <1447765689-28940-1-git-send-email-hch@lst.de> Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Keith Busch Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org From: Christoph Hellwig Subject: a nasty nvme fix In-Reply-To: Hi all, below is a fix for a bug in the qemu NVMe identify implementation that's causing us some trouble with an updated Linux driver. We'll have to blacklist the existing Qemu device ID for it, so I wonder how we can advertize a fixed controller. Maybe a new PCI ID? Or maybe just bump the PCI revision, altough that would be a bit more complicated in the driver. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46159) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zyk4C-0004xG-As for qemu-devel@nongnu.org; Tue, 17 Nov 2015 12:29:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zyk4B-0002wT-ER for qemu-devel@nongnu.org; Tue, 17 Nov 2015 12:29:16 -0500 Sender: Paolo Bonzini References: <1447765689-28940-1-git-send-email-hch@lst.de> From: Paolo Bonzini Message-ID: <564B63E2.4040306@redhat.com> Date: Tue, 17 Nov 2015 18:29:06 +0100 MIME-Version: 1.0 In-Reply-To: <1447765689-28940-1-git-send-email-hch@lst.de> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christoph Hellwig , Keith Busch Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org On 17/11/2015 14:08, Christoph Hellwig wrote: > below is a fix for a bug in the qemu NVMe identify implementation that's > causing us some trouble with an updated Linux driver. We'll have to > blacklist the existing Qemu device ID for it, so I wonder how we can > advertize a fixed controller. Maybe a new PCI ID? Or maybe just bump > the PCI revision, altough that would be a bit more complicated in the > driver. Bumping the PCI revision would be ideal, but I guess the PCI ID would work too if it's really that bad. Paolo From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35016) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aK1KP-0001v0-Sy for qemu-devel@nongnu.org; Fri, 15 Jan 2016 05:09:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aK1KM-0008V9-LU for qemu-devel@nongnu.org; Fri, 15 Jan 2016 05:09:57 -0500 Received: from mga04.intel.com ([192.55.52.120]:48456) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aK1KM-0008V2-G3 for qemu-devel@nongnu.org; Fri, 15 Jan 2016 05:09:54 -0500 From: Liang Li Date: Fri, 15 Jan 2016 18:06:08 +0800 Message-Id: <1452852370-11604-1-git-send-email-liang.z.li@intel.com> Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: amit.shah@redhat.com, zhang.zhanghailiang@huawei.com, Liang Li , dgilbert@redhat.com, quintela@redhat.com Subject: [PATCH RESEND v2 0/2] Fix flaw of qemu_put_compression_data The implementation of qemu_put_compression_data only consider the case QEMUFile is writable, it can't work with a writable QEMUFile and does not provide any measure to prevent users from using it with a writable QEMUFile. For safety, it should be improved to avoid some issues. ram_save_compressed_page can be refined based on the change of qemu_put_compression_data, very small improvement, but code looks better. Liang Li (2): qemu-file: Fix qemu_put_compression_data flaw migration: refine ram_save_compressed_page migration/qemu-file.c | 23 +++++++++++++++++++++-- migration/ram.c | 20 ++++++++------------ 2 files changed, 29 insertions(+), 14 deletions(-) -- 1.9.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47673) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahvRl-000118-KW for qemu-devel@nongnu.org; Mon, 21 Mar 2016 04:44:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ahvRk-0005Zd-Jw for qemu-devel@nongnu.org; Mon, 21 Mar 2016 04:44:21 -0400 Received: from mail-oi0-x229.google.com ([2607:f8b0:4003:c06::229]:36509) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ahvRk-0005ZP-DZ for qemu-devel@nongnu.org; Mon, 21 Mar 2016 04:44:20 -0400 Received: by mail-oi0-x229.google.com with SMTP id r187so134185003oih.3 for ; Mon, 21 Mar 2016 01:44:19 -0700 (PDT) MIME-Version: 1.0 Date: Mon, 21 Mar 2016 16:44:19 +0800 Message-ID: From: Yunqiang Gao Content-Type: multipart/alternative; boundary=001a1137c99c406014052e8b1a15 Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "qemu-devel@nongnu.org" --001a1137c99c406014052e8b1a15 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi,alls, I compile qemu on ubuntu 12.04,when "make",some error appears.the error: migration/rdma.c: In function =E2=80=98qemu_rdma_dump_id=E2=80=99: migration/rdma.c:738:21: error: =E2=80=98struct ibv_port_attr=E2=80=99 has = no member named =E2=80=98link_layer=E2=80=99 migration/rdma.c:739:22: error: =E2=80=98struct ibv_port_attr=E2=80=99 has = no member named =E2=80=98link_layer=E2=80=99 migration/rdma.c:739:37: error: =E2=80=98IBV_LINK_LAYER_INFINIBAND=E2=80=99= undeclared (first use in this function) migration/rdma.c:739:37: note: each undeclared identifier is reported only once for each function it appears in migration/rdma.c:740:24: error: =E2=80=98struct ibv_port_attr=E2=80=99 has = no member named =E2=80=98link_layer=E2=80=99 migration/rdma.c:740:39: error: =E2=80=98IBV_LINK_LAYER_ETHERNET=E2=80=99 u= ndeclared (first use in this function) migration/rdma.c: In function =E2=80=98qemu_rdma_broken_ipv6_kernel=E2=80= =99: migration/rdma.c:839:26: error: =E2=80=98struct ibv_port_attr=E2=80=99 has = no member named =E2=80=98link_layer=E2=80=99 migration/rdma.c:839:41: error: =E2=80=98IBV_LINK_LAYER_INFINIBAND=E2=80=99= undeclared (first use in this function) migration/rdma.c:841:33: error: =E2=80=98struct ibv_port_attr=E2=80=99 has = no member named =E2=80=98link_layer=E2=80=99 migration/rdma.c:841:48: error: =E2=80=98IBV_LINK_LAYER_ETHERNET=E2=80=99 u= ndeclared (first use in this function) migration/rdma.c:880:18: error: =E2=80=98struct ibv_port_attr=E2=80=99 has = no member named =E2=80=98link_layer=E2=80=99 make: *** [migration/rdma.o] Error 1 I have do that: apt-get build-dep qemu. when I install Recommended additional packages,two packages can't be installed,these are libseccomp-dev,libvdeplug-dev. errpr information: Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package libvdeplug-dev my linux kernel is 4.4.1. Could anybody know how to deal with it? Thanks! --001a1137c99c406014052e8b1a15 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,alls,

=C2=A0I compile qemu on ubuntu 12.04,when "make= ",some error appears.the=C2=A0er= ror:

migration= /rdma.c: In function =E2=80=98qemu_rdma_dump_id=E2=80=99:
= migration/rdma.c:738:21: error: =E2=80=98struct ibv= _port_attr=E2=80=99 has no member named =E2=80=98link_layer=E2=80=99=
migration/rdma.c:739:22: error: =E2=80= =98struct ibv_port_attr=E2=80=99 has no member named =E2=80=98link_layer=E2= =80=99
migration/rdma.c:739:37: er= ror: =E2=80=98IBV_LINK_LAYER_INFINIBAND=E2=80=99 undeclared (first use in t= his function)
migration/rdma.c:739= :37: note: each undeclared identifier is reported only once for each functi= on it appears in
migration/rdma.c:= 740:24: error: =E2=80=98struct ibv_port_attr=E2=80=99 has no member named = =E2=80=98link_layer=E2=80=99
migra= tion/rdma.c:740:39: error: =E2=80=98IBV_LINK_LAYER_ETHERNET=E2=80=99 undecl= ared (first use in this function)
= migration/rdma.c: In function =E2=80=98qemu_rdma_broken_ipv6_kernel=E2=80= =99:
migration/rdma.c:839:26: erro= r: =E2=80=98struct ibv_port_attr=E2=80=99 has no member named =E2=80=98link= _layer=E2=80=99
migration/rdma.c:8= 39:41: error: =E2=80=98IBV_LINK_LAYER_INFINIBAND=E2=80=99 undeclared (first= use in this function)
migration/r= dma.c:841:33: error: =E2=80=98struct ibv_port_attr=E2=80=99 has no member n= amed =E2=80=98link_layer=E2=80=99
= migration/rdma.c:841:48: error: =E2=80=98IBV_LINK_LAYER_ETHERNET=E2=80=99 u= ndeclared (first use in this function)
migration/rdma.c:880:18: error: =E2=80=98struct ibv_port_attr=E2=80=99= has no member named =E2=80=98link_layer=E2=80=99
make: *** [migration/rdma.o] Error 1

I have do = that:=C2=A0apt-get build-dep qemu.

<= /font>
when I install=C2=A0Recommend= ed additional packages,two packages can't be installed,these are=C2=A0<= /span>libseccomp-dev,libvdeplug-dev.
<= font color=3D"#000000">errpr information:
Reading pa= ckage lists... Done
Building dependency tree =C2=A0 = =C2=A0 =C2=A0=C2=A0
Reading state information... Don= e
E: Unable to locate package libvdeplug-dev<= /font>

my linux kernel is 4.4.1.

Could anybody know how to dea= l with it?

Thanks!

--001a1137c99c406014052e8b1a15-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35718) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ai47n-0000hA-Us for qemu-devel@nongnu.org; Mon, 21 Mar 2016 14:00:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ai47j-0002GB-VR for qemu-devel@nongnu.org; Mon, 21 Mar 2016 14:00:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41502) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ai47j-0002G5-Pa for qemu-devel@nongnu.org; Mon, 21 Mar 2016 14:00:15 -0400 References: From: John Snow Message-ID: <56F036AE.5050408@redhat.com> Date: Mon, 21 Mar 2016 14:00:14 -0400 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yunqiang Gao , "qemu-devel@nongnu.org" On 03/21/2016 04:44 AM, Yunqiang Gao wrote: > Hi,alls, >=20 > I compile qemu on ubuntu 12.04,when "make",some error appears.the erro= r: >=20 > migration/rdma.c: In function =E2=80=98qemu_rdma_dump_id=E2=80=99: > migration/rdma.c:738:21: error: =E2=80=98struct ibv_port_attr=E2=80=99 = has no member > named =E2=80=98link_layer=E2=80=99 > migration/rdma.c:739:22: error: =E2=80=98struct ibv_port_attr=E2=80=99 = has no member > named =E2=80=98link_layer=E2=80=99 > migration/rdma.c:739:37: error: =E2=80=98IBV_LINK_LAYER_INFINIBAND=E2=80= =99 undeclared > (first use in this function) > migration/rdma.c:739:37: note: each undeclared identifier is reported > only once for each function it appears in > migration/rdma.c:740:24: error: =E2=80=98struct ibv_port_attr=E2=80=99 = has no member > named =E2=80=98link_layer=E2=80=99 > migration/rdma.c:740:39: error: =E2=80=98IBV_LINK_LAYER_ETHERNET=E2=80=99= undeclared > (first use in this function) > migration/rdma.c: In function =E2=80=98qemu_rdma_broken_ipv6_kernel=E2=80= =99: > migration/rdma.c:839:26: error: =E2=80=98struct ibv_port_attr=E2=80=99 = has no member > named =E2=80=98link_layer=E2=80=99 > migration/rdma.c:839:41: error: =E2=80=98IBV_LINK_LAYER_INFINIBAND=E2=80= =99 undeclared > (first use in this function) > migration/rdma.c:841:33: error: =E2=80=98struct ibv_port_attr=E2=80=99 = has no member > named =E2=80=98link_layer=E2=80=99 > migration/rdma.c:841:48: error: =E2=80=98IBV_LINK_LAYER_ETHERNET=E2=80=99= undeclared > (first use in this function) > migration/rdma.c:880:18: error: =E2=80=98struct ibv_port_attr=E2=80=99 = has no member > named =E2=80=98link_layer=E2=80=99 > make: *** [migration/rdma.o] Error 1 >=20 > I have do that: apt-get build-dep qemu. >=20 > when I install Recommended additional packages,two packages can't be > installed,these are libseccomp-dev,libvdeplug-dev. > errpr information: > Reading package lists... Done > Building dependency tree =20 > Reading state information... Done > E: Unable to locate package libvdeplug-dev >=20 > my linux kernel is 4.4.1. >=20 > Could anybody know how to deal with it? >=20 > Thanks! >=20 If you don't need the RDMA feature, you could always just --disable-rdma for now to see if you can get QEMU to build. Looks like one of your libraries is outdated, for me 'IBV_LINK_LAYER_INFINIBAND' is defined in /usr/include/infiniband/verbs.h; provided by libibverbs-devel-1.1.8-3.fc22.x86_64. Maybe your libibverbs is too old. --js From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ai75U-0001PD-Lu for qemu-devel@nongnu.org; Mon, 21 Mar 2016 17:10:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ai75T-0000BU-TE for qemu-devel@nongnu.org; Mon, 21 Mar 2016 17:10:08 -0400 Received: from mail-vk0-x22f.google.com ([2607:f8b0:400c:c05::22f]:32775) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ai75T-0000BE-KP for qemu-devel@nongnu.org; Mon, 21 Mar 2016 17:10:07 -0400 Received: by mail-vk0-x22f.google.com with SMTP id k1so230522617vkb.0 for ; Mon, 21 Mar 2016 14:10:07 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <56F036AE.5050408@redhat.com> References: <56F036AE.5050408@redhat.com> From: Peter Maydell Date: Mon, 21 Mar 2016 21:09:47 +0000 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: John Snow Cc: "qemu-devel@nongnu.org" , Yunqiang Gao On 21 March 2016 at 18:00, John Snow wrote: > Looks like one of your libraries is outdated, for me > 'IBV_LINK_LAYER_INFINIBAND' is defined in > /usr/include/infiniband/verbs.h; provided by > libibverbs-devel-1.1.8-3.fc22.x86_64. > > Maybe your libibverbs is too old. We should probably add a suitable configure test. thanks -- PMM From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40260) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiU7A-0002ii-3e for qemu-devel@nongnu.org; Tue, 22 Mar 2016 17:45:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aiU76-0008Ik-Sd for qemu-devel@nongnu.org; Tue, 22 Mar 2016 17:45:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37202) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiU76-0008Id-Mn for qemu-devel@nongnu.org; Tue, 22 Mar 2016 17:45:20 -0400 References: <56F036AE.5050408@redhat.com> From: John Snow Message-ID: <56F1BCEF.8030706@redhat.com> Date: Tue, 22 Mar 2016 17:45:19 -0400 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: "qemu-devel@nongnu.org" , Yunqiang Gao On 03/21/2016 05:09 PM, Peter Maydell wrote: > On 21 March 2016 at 18:00, John Snow wrote: >> Looks like one of your libraries is outdated, for me >> 'IBV_LINK_LAYER_INFINIBAND' is defined in >> /usr/include/infiniband/verbs.h; provided by >> libibverbs-devel-1.1.8-3.fc22.x86_64. >> >> Maybe your libibverbs is too old. > > We should probably add a suitable configure test. > > thanks > -- PMM > Sure, I don't know formally what our minimum version requirement for libibverbs is. In this case at least, http://git.kernel.org/cgit/libs/infiniband/libibverbs.git/commit/include/infiniband/verbs.h?id=e5df8c64df6877facc045608a25f4d4fecd5f2b0 committed 2011-07-26 20:15:33 (GMT), so probably: http://git.kernel.org/cgit/libs/infiniband/libibverbs.git/commit/?id=8b2ffc598bd7f8294f3653cab430146985040739 libibverbs 1.1.6 (December 2011) as a minimum, unless there's an even newer requirement? --js From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34765) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTsLQ-0001A8-MO for qemu-devel@nongnu.org; Sun, 31 Jul 2016 11:08:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bTsLP-0006lP-QZ for qemu-devel@nongnu.org; Sun, 31 Jul 2016 11:08:00 -0400 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]:33490) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bTsLP-0006lE-JO for qemu-devel@nongnu.org; Sun, 31 Jul 2016 11:07:59 -0400 Received: by mail-wm0-x229.google.com with SMTP id p129so49215507wmp.0 for ; Sun, 31 Jul 2016 08:07:59 -0700 (PDT) MIME-Version: 1.0 From: Kumud Bhat Date: Sun, 31 Jul 2016 11:07:56 -0400 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org *Kumud Bhat* Department of Computer and Information science Purdue School of Science,IUPUI Indianapolis-IN, United States From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55681) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjYhH-0007SF-0M for qemu-devel@nongnu.org; Mon, 12 Sep 2016 17:23:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjYhC-000519-TB for qemu-devel@nongnu.org; Mon, 12 Sep 2016 17:23:22 -0400 Received: from gateway33.websitewelcome.com ([192.185.146.70]:40018) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjYhC-000511-NO for qemu-devel@nongnu.org; Mon, 12 Sep 2016 17:23:18 -0400 Received: from cm4.websitewelcome.com (unknown [108.167.139.16]) by gateway33.websitewelcome.com (Postfix) with ESMTP id 03EC98ADE59AF for ; Mon, 12 Sep 2016 16:23:18 -0500 (CDT) Received: from raithlin by estate.websitewelcome.com with local (Exim 4.86_1) (envelope-from ) id 1bjYhA-000Jyd-PD for qemu-devel@nongnu.org; Mon, 12 Sep 2016 16:23:16 -0500 Message-ID: Date: Mon, 12 Sep 2016 16:23:16 -0500 From: "Stephen Bates" MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi I sent this to qemu-discuss with no success so resending to qemu-devel. I am doing some very low level OS design work and wanted to be able to alter some values in the physical memory of my QEMU guest. I can see quit= e a few ways to print/dump both physical and virtual addresses but nothing that can alter arbitrary physical/virtual addresses? Does such a feature exist in Qemu and if it does are there pointers to documentation for it? I do see that we can use file backing for very large memory regions via the memory-backing-file option but I am not really trying to alter massiv= e regions of memory in this case. Cheers Stephen Bates From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54393) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjdSi-0008By-EY for qemu-devel@nongnu.org; Mon, 12 Sep 2016 22:28:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjdSc-0002f2-Dt for qemu-devel@nongnu.org; Mon, 12 Sep 2016 22:28:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35176) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjdSc-0002dy-8Q for qemu-devel@nongnu.org; Mon, 12 Sep 2016 22:28:34 -0400 Date: Tue, 13 Sep 2016 10:28:27 +0800 From: Fam Zheng Message-ID: <20160913022827.GD15800@lemon> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stephen Bates Cc: qemu-devel@nongnu.org On Mon, 09/12 16:23, Stephen Bates wrote: > Hi Hi Stephen, > > I sent this to qemu-discuss with no success so resending to qemu-devel. > > I am doing some very low level OS design work and wanted to be able to > alter some values in the physical memory of my QEMU guest. I can see quite > a few ways to print/dump both physical and virtual addresses but nothing > that can alter arbitrary physical/virtual addresses? > > Does such a feature exist in Qemu and if it does are there pointers to > documentation for it? Have you tried the builtin gdbstub in QEMU? You can add "-s" to the QEMU command line and then connect to it from gdb with "target remote :1234". There you can inspect or change memory more easily. Fam > > I do see that we can use file backing for very large memory regions via > the memory-backing-file option but I am not really trying to alter massive > regions of memory in this case. > > Cheers > > Stephen Bates > From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53519) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bm0u0-0006XY-DR for qemu-devel@nongnu.org; Mon, 19 Sep 2016 11:54:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bm0tx-0005sb-8G for qemu-devel@nongnu.org; Mon, 19 Sep 2016 11:54:40 -0400 Received: from gateway30.websitewelcome.com ([192.185.196.18]:56570) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bm0tx-0005jX-2B for qemu-devel@nongnu.org; Mon, 19 Sep 2016 11:54:37 -0400 Received: from cm2.websitewelcome.com (cm2.websitewelcome.com [192.185.178.13]) by gateway30.websitewelcome.com (Postfix) with ESMTP id B6810E6A2CE3E for ; Mon, 19 Sep 2016 10:54:22 -0500 (CDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) From: Stephen Bates In-Reply-To: <20160913022827.GD15800@lemon> Date: Mon, 19 Sep 2016 08:54:19 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <65FEEFCD-F0CB-4030-BA2D-3EDA87687158@raithlin.com> References: <20160913022827.GD15800@lemon> Subject: Re: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng Cc: qemu-devel@nongnu.org Hi Fam Thanks! Yes gdb provides one approach but I was wondering if there was somet= hing built in to QEMU monitor. Another application I can see for this would be to inject errors into the me= mory, This will be useful for testing new NVDIMM-P technology that builds NV= DIMMs out of material that is less reliable than DRAM... Cheers Stephen > On Sep 12, 2016, at 7:28 PM, Fam Zheng wrote: >=20 >> On Mon, 09/12 16:23, Stephen Bates wrote: >> Hi >=20 > Hi Stephen, >=20 >>=20 >> I sent this to qemu-discuss with no success so resending to qemu-devel. >>=20 >> I am doing some very low level OS design work and wanted to be able to >> alter some values in the physical memory of my QEMU guest. I can see quit= e >> a few ways to print/dump both physical and virtual addresses but nothing >> that can alter arbitrary physical/virtual addresses? >>=20 >> Does such a feature exist in Qemu and if it does are there pointers to >> documentation for it? >=20 > Have you tried the builtin gdbstub in QEMU? You can add "-s" to the QEMU > command line and then connect to it from gdb with "target remote :1234". T= here > you can inspect or change memory more easily. >=20 > Fam >=20 >>=20 >> I do see that we can use file backing for very large memory regions via >> the memory-backing-file option but I am not really trying to alter massiv= e >> regions of memory in this case. >>=20 >> Cheers >>=20 >> Stephen Bates >>=20 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33257) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bqaZB-0002IR-86 for qemu-devel@nongnu.org; Sun, 02 Oct 2016 02:48:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bqaZ8-0007WF-1K for qemu-devel@nongnu.org; Sun, 02 Oct 2016 02:48:05 -0400 Received: from mx2.sigaint.org ([87.121.52.221]:52958) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bqaZ5-0007Sy-II for qemu-devel@nongnu.org; Sun, 02 Oct 2016 02:48:01 -0400 Message-ID: Date: Sun, 2 Oct 2016 06:47:38 -0000 From: "Shreya Shrivastava" MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: stefanha@gmail.com Cc: qemu-devel@nongnu.org HI , I am interested in applying for Outreachy 2016 December- March round by contributing to VIRTIO 1.0 support in libqos project for Qemu. Kindly let me know how to get started with this project. Shreya Shrivastava From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44515) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buRP5-0008Ob-NU for qemu-devel@nongnu.org; Wed, 12 Oct 2016 17:49:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1buRP4-0001xr-U5 for qemu-devel@nongnu.org; Wed, 12 Oct 2016 17:49:35 -0400 Received: from mail-qk0-x235.google.com ([2607:f8b0:400d:c09::235]:34601) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1buRP4-0001xV-OV for qemu-devel@nongnu.org; Wed, 12 Oct 2016 17:49:34 -0400 Received: by mail-qk0-x235.google.com with SMTP id f128so54582540qkb.1 for ; Wed, 12 Oct 2016 14:49:34 -0700 (PDT) MIME-Version: 1.0 From: Neeraj Sharma Date: Thu, 13 Oct 2016 03:19:32 +0530 Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Dear Sir/Ma'am I want to =E2=80=98annotate=E2=80=99 the translation buffers - (adding a me= chanism in the translation buffers where we can store how many times they were executed, and, for each one, add some =E2=80=98amount=E2=80=99 could be power, could = be anything). I need held to understand the translation buffer code in qemu, starts fom cpu-exec.c. Neeraj Thanks From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35033) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bx7K5-0007eJ-MP for qemu-devel@nongnu.org; Thu, 20 Oct 2016 02:59:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bx7K2-0002TE-Lg for qemu-devel@nongnu.org; Thu, 20 Oct 2016 02:59:29 -0400 From: Nicholas Piggin Date: Thu, 20 Oct 2016 17:59:09 +1100 Message-Id: <20161020065912.16132-1-npiggin@gmail.com> Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Nicholas Piggin , qemu-ppc@nongnu.org, Alexey Kardashevskiy , David Gibson , Alexander Graf Date: Thu, 20 Oct 2016 17:38:24 +1100 Subject: [PATCH 0/3] ppc: system reset interrupt fixes and new hcall IPI Hi, We are implementing this new unmaskable IPI hcall for crash dumping and debugging. I had some issues with QEMU delivering system reset interrupt to guests, which was caused by the HV bit being set. After changing that, the interrupt was being handled okay. Should there be a more general check to ensure the HV bit is not set in the guest? I implemented Linux support for the new hcall in crashdump code, and it works. Thanks, Nick Nicholas Piggin (3): ppc: fix MSR_ME handling for system reset interrupt ppc: allow system reset interrupt to be delivered to guests ppc/spapr: implement H_SIGNAL_SYS_RESET hw/ppc/spapr_hcall.c | 42 ++++++++++++++++++++++++++++++++++++++++++ include/hw/ppc/spapr.h | 8 +++++++- target-ppc/excp_helper.c | 10 +++++++--- 3 files changed, 56 insertions(+), 4 deletions(-) -- 2.9.3 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50080) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c0s4z-0007Y3-2L for qemu-devel@nongnu.org; Sun, 30 Oct 2016 11:31:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c0s4v-00085P-1K for qemu-devel@nongnu.org; Sun, 30 Oct 2016 11:31:25 -0400 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:36396) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c0s4u-00085C-Lm for qemu-devel@nongnu.org; Sun, 30 Oct 2016 11:31:20 -0400 Received: by mail-wm0-x244.google.com with SMTP id c17so14910301wmc.3 for ; Sun, 30 Oct 2016 08:31:20 -0700 (PDT) From: Pradeep Jagadeesh Date: Sun, 30 Oct 2016 11:30:43 -0400 Message-Id: <1477841443-19428-1-git-send-email-pradeep.jagadeesh@huawei.com> Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Greg Kurz , Alberto Garcia Cc: Pradeep Jagadeesh , qemu-devel@nongnu.org, Claudio Fontana Date: Sun, 30 Oct 2016 10:53:16 -0400 Subject: [PATCH V8] fsdev: add IO throttle support to fsdev devices Uses throttling APIs to limit I/O bandwidth and number of operations on the devices which use 9p-local driver. This adds the support for the 9p-local driver. For now this functionality can be enabled only through qemu cli options. QMP interface and support to other drivers need further extensions. To make it simple for other drivers, the throttle code has been put in separate files. Signed-off-by: Pradeep Jagadeesh --- fsdev/Makefile.objs | 2 +- fsdev/file-op-9p.h | 3 + fsdev/qemu-fsdev-opts.c | 76 ++++++++++++++++++++++++ fsdev/qemu-fsdev-throttle.c | 139 ++++++++++++++++++++++++++++++++++++++++++++ fsdev/qemu-fsdev-throttle.h | 39 +++++++++++++ hw/9pfs/9p-local.c | 2 + hw/9pfs/9p.c | 10 ++++ hw/9pfs/cofile.c | 2 + 8 files changed, 272 insertions(+), 1 deletion(-) create mode 100644 fsdev/qemu-fsdev-throttle.c create mode 100644 fsdev/qemu-fsdev-throttle.h v1 -> v2: -Fixed FsContext redeclaration issue -Removed couple of function declarations from 9p-throttle.h -Fixed some of the .help messages v2 -> v3: -Addressed follwing comments by Claudio Fontana -Removed redundant memset calls in fsdev_throttle_configure_iolimits function -Checking throttle structure validity before initializing other structures in fsdev_throttle_configure_iolimits -Addressed following comments by Greg Kurz -Moved the code from 9pfs directory to fsdev directory, because the throttling is for the fsdev devices.Renamed the files and functions to fsdev_ from 9pfs_ -Renamed throttling cli options to throttling.*, as in QMP cli options -Removed some of the unwanted .h files from qemu-fsdev-throttle.[ch] -Using throttle_enabled() function to set the thottle enabled flag for fsdev. v3 -> v4: -Addressed following comments by Alberto Garcia -Removed the unwanted locking and other data structures in qemu-fsdev-throttle.[ch] -Addressed following comments by Greg Kurz -Removed fsdev_iolimitsenable/disable functions, instead using throttle_enabled function v4 -> V5: -Fixed the issue with the larger block size accounting. (i.e, when the 9pfs mounted using msize=xxx option) V5 -> V6: -Addressed the comments by Alberto Garcia -Removed the fsdev_throttle_timer_cb() -Simplified the fsdev_throttle_schedule_next_request() as suggested V6 -> V7: -Addressed the comments by Alberto Garcia -changed the fsdev_throttle_schedule_next_request() as suggested v7 -> v8: -Addressed comments by Alberto Garcia -Fixed some indentation issues and split the configure_io_limit function -Inlined throttle_timer_check code diff --git a/fsdev/Makefile.objs b/fsdev/Makefile.objs index 1b120a4..659df6e 100644 --- a/fsdev/Makefile.objs +++ b/fsdev/Makefile.objs @@ -5,7 +5,7 @@ common-obj-y = qemu-fsdev.o 9p-marshal.o 9p-iov-marshal.o else common-obj-y = qemu-fsdev-dummy.o endif -common-obj-y += qemu-fsdev-opts.o +common-obj-y += qemu-fsdev-opts.o qemu-fsdev-throttle.o # Toplevel always builds this; targets without virtio will put it in # common-obj-y diff --git a/fsdev/file-op-9p.h b/fsdev/file-op-9p.h index 6db9fea..33fe822 100644 --- a/fsdev/file-op-9p.h +++ b/fsdev/file-op-9p.h @@ -17,6 +17,7 @@ #include #include #include +#include "qemu-fsdev-throttle.h" #define SM_LOCAL_MODE_BITS 0600 #define SM_LOCAL_DIR_MODE_BITS 0700 @@ -74,6 +75,7 @@ typedef struct FsDriverEntry { char *path; int export_flags; FileOperations *ops; + FsThrottle fst; } FsDriverEntry; typedef struct FsContext @@ -83,6 +85,7 @@ typedef struct FsContext int export_flags; struct xattr_operations **xops; struct extended_ops exops; + FsThrottle *fst; /* fs driver specific data */ void *private; } FsContext; diff --git a/fsdev/qemu-fsdev-opts.c b/fsdev/qemu-fsdev-opts.c index 1dd8c7a..395d497 100644 --- a/fsdev/qemu-fsdev-opts.c +++ b/fsdev/qemu-fsdev-opts.c @@ -37,6 +37,82 @@ static QemuOptsList qemu_fsdev_opts = { }, { .name = "sock_fd", .type = QEMU_OPT_NUMBER, + }, { + .name = "throttling.iops-total", + .type = QEMU_OPT_NUMBER, + .help = "limit total I/O operations per second", + },{ + .name = "throttling.iops-read", + .type = QEMU_OPT_NUMBER, + .help = "limit read operations per second", + },{ + .name = "throttling.iops-write", + .type = QEMU_OPT_NUMBER, + .help = "limit write operations per second", + },{ + .name = "throttling.bps-total", + .type = QEMU_OPT_NUMBER, + .help = "limit total bytes per second", + },{ + .name = "throttling.bps-read", + .type = QEMU_OPT_NUMBER, + .help = "limit read bytes per second", + },{ + .name = "throttling.bps-write", + .type = QEMU_OPT_NUMBER, + .help = "limit write bytes per second", + },{ + .name = "throttling.iops-total-max", + .type = QEMU_OPT_NUMBER, + .help = "I/O operations burst", + },{ + .name = "throttling.iops-read-max", + .type = QEMU_OPT_NUMBER, + .help = "I/O operations read burst", + },{ + .name = "throttling.iops-write-max", + .type = QEMU_OPT_NUMBER, + .help = "I/O operations write burst", + },{ + .name = "throttling.bps-total-max", + .type = QEMU_OPT_NUMBER, + .help = "total bytes burst", + },{ + .name = "throttling.bps-read-max", + .type = QEMU_OPT_NUMBER, + .help = "total bytes read burst", + },{ + .name = "throttling.bps-write-max", + .type = QEMU_OPT_NUMBER, + .help = "total bytes write burst", + },{ + .name = "throttling.iops-total-max-length", + .type = QEMU_OPT_NUMBER, + .help = "length of the iops-total-max burst period, in seconds", + },{ + .name = "throttling.iops-read-max-length", + .type = QEMU_OPT_NUMBER, + .help = "length of the iops-read-max burst period, in seconds", + },{ + .name = "throttling.iops-write-max-length", + .type = QEMU_OPT_NUMBER, + .help = "length of the iops-write-max burst period, in seconds", + },{ + .name = "throttling.bps-total-max-length", + .type = QEMU_OPT_NUMBER, + .help = "length of the bps-total-max burst period, in seconds", + },{ + .name = "throttling.bps-read-max-length", + .type = QEMU_OPT_NUMBER, + .help = "length of the bps-read-max burst period, in seconds", + },{ + .name = "throttling.bps-write-max-length", + .type = QEMU_OPT_NUMBER, + .help = "length of the bps-write-max burst period, in seconds", + },{ + .name = "throttling.iops-size", + .type = QEMU_OPT_NUMBER, + .help = "when limiting by iops max size of an I/O in bytes", }, { /*End of list */ } diff --git a/fsdev/qemu-fsdev-throttle.c b/fsdev/qemu-fsdev-throttle.c new file mode 100644 index 0000000..768d27b --- /dev/null +++ b/fsdev/qemu-fsdev-throttle.c @@ -0,0 +1,139 @@ +/* + * Fsdev Throttle + * + * Copyright (C) 2016 Huawei Technologies Duesseldorf GmbH + * + * Author: Pradeep Jagadeesh + * + * This work is licensed under the terms of the GNU GPL, version 2 or + * (at your option) any later version. + * + * See the COPYING file in the top-level directory for details. + * + */ + +#include "qemu/osdep.h" +#include "qemu/error-report.h" +#include "qapi/error.h" +#include "qemu-fsdev-throttle.h" + +static void fsdev_throttle_schedule_next_request(FsThrottle *fst, bool is_write) +{ + if (!qemu_co_queue_empty(&fst->throttled_reqs[is_write])) { + if (throttle_schedule_timer(&fst->ts, &fst->tt, is_write)) { + return; + } + qemu_co_queue_next(&fst->throttled_reqs[is_write]); + } +} + +static void fsdev_throttle_read_timer_cb(void *opaque) +{ + FsThrottle *fst = opaque; + qemu_co_enter_next(&fst->throttled_reqs[false]); +} + +static void fsdev_throttle_write_timer_cb(void *opaque) +{ + FsThrottle *fst = opaque; + qemu_co_enter_next(&fst->throttled_reqs[true]); +} + +void fsdev_throttle_parse_opts(QemuOpts *opts, FsThrottle *fst) +{ + fst->cfg.buckets[THROTTLE_BPS_TOTAL].avg = + qemu_opt_get_number(opts, "throttling.bps-total", 0); + fst->cfg.buckets[THROTTLE_BPS_READ].avg = + qemu_opt_get_number(opts, "throttling.bps-read", 0); + fst->cfg.buckets[THROTTLE_BPS_WRITE].avg = + qemu_opt_get_number(opts, "throttling.bps-write", 0); + fst->cfg.buckets[THROTTLE_OPS_TOTAL].avg = + qemu_opt_get_number(opts, "throttling.iops-total", 0); + fst->cfg.buckets[THROTTLE_OPS_READ].avg = + qemu_opt_get_number(opts, "throttling.iops-read", 0); + fst->cfg.buckets[THROTTLE_OPS_WRITE].avg = + qemu_opt_get_number(opts, "throttling.iops-write", 0); + + fst->cfg.buckets[THROTTLE_BPS_TOTAL].max = + qemu_opt_get_number(opts, "throttling.bps-total-max", 0); + fst->cfg.buckets[THROTTLE_BPS_READ].max = + qemu_opt_get_number(opts, "throttling.bps-read-max", 0); + fst->cfg.buckets[THROTTLE_BPS_WRITE].max = + qemu_opt_get_number(opts, "throttling.bps-write-max", 0); + fst->cfg.buckets[THROTTLE_OPS_TOTAL].max = + qemu_opt_get_number(opts, "throttling.iops-total-max", 0); + fst->cfg.buckets[THROTTLE_OPS_READ].max = + qemu_opt_get_number(opts, "throttling.iops-read-max", 0); + fst->cfg.buckets[THROTTLE_OPS_WRITE].max = + qemu_opt_get_number(opts, "throttling.iops-write-max", 0); + + fst->cfg.buckets[THROTTLE_BPS_TOTAL].burst_length = + qemu_opt_get_number(opts, "throttling.bps-total-max-length", 1); + fst->cfg.buckets[THROTTLE_BPS_READ].burst_length = + qemu_opt_get_number(opts, "throttling.bps-read-max-length", 1); + fst->cfg.buckets[THROTTLE_BPS_WRITE].burst_length = + qemu_opt_get_number(opts, "throttling.bps-write-max-length", 1); + fst->cfg.buckets[THROTTLE_OPS_TOTAL].burst_length = + qemu_opt_get_number(opts, "throttling.iops-total-max-length", 1); + fst->cfg.buckets[THROTTLE_OPS_READ].burst_length = + qemu_opt_get_number(opts, "throttling.iops-read-max-length", 1); + fst->cfg.buckets[THROTTLE_OPS_WRITE].burst_length = + qemu_opt_get_number(opts, "throttling.iops-write-max-length", 1); + fst->cfg.op_size = + qemu_opt_get_number(opts, "throttling.iops-size", 0); +} + +int fsdev_throttle_init(FsThrottle *fst) +{ + Error *err = NULL; + + if (!throttle_is_valid(&fst->cfg, &err)) { + error_reportf_err(err, "Throttle configuration is not valid: "); + return -1; + } + if (throttle_enabled(&fst->cfg)) { + g_assert((fst->aioctx = qemu_get_aio_context())); + throttle_init(&fst->ts); + throttle_timers_init(&fst->tt, + fst->aioctx, + QEMU_CLOCK_REALTIME, + fsdev_throttle_read_timer_cb, + fsdev_throttle_write_timer_cb, + fst); + throttle_config(&fst->ts, &fst->tt, &fst->cfg); + qemu_co_queue_init(&fst->throttled_reqs[0]); + qemu_co_queue_init(&fst->throttled_reqs[1]); + } + return 0; +} + +static uint64_t get_num_bytes(struct iovec *iov, int iovcnt) +{ + int i; + uint64_t bytes = 0; + + for (i = 0; i < iovcnt; i++) { + bytes += iov[i].iov_len; + } + return bytes; +} + +void coroutine_fn fsdev_co_throttle_request(FsThrottle *fst, bool is_write, + struct iovec *iov, int iovcnt) +{ + if (throttle_enabled(&fst->cfg)) { + uint64_t bytes = get_num_bytes(iov, iovcnt); + bool must_wait = throttle_schedule_timer(&fst->ts, &fst->tt, is_write); + if (must_wait || !qemu_co_queue_empty(&fst->throttled_reqs[is_write])) { + qemu_co_queue_wait(&fst->throttled_reqs[is_write]); + } + throttle_account(&fst->ts, is_write, bytes); + + fsdev_throttle_schedule_next_request(fst, is_write); + } +} + +void fsdev_throttle_cleanup(FsThrottle *fst) +{ + throttle_timers_destroy(&fst->tt); +} diff --git a/fsdev/qemu-fsdev-throttle.h b/fsdev/qemu-fsdev-throttle.h new file mode 100644 index 0000000..bafb340 --- /dev/null +++ b/fsdev/qemu-fsdev-throttle.h @@ -0,0 +1,39 @@ +/* + * Fsdev Throttle + * + * Copyright (C) 2016 Huawei Technologies Duesseldorf GmbH + * + * Author: Pradeep Jagadeesh + * + * This work is licensed under the terms of the GNU GPL, version 2 or + * (at your option) any later version. + * + * See the COPYING file in the top-level directory for details. + * + */ + +#ifndef _FSDEV_THROTTLE_H +#define _FSDEV_THROTTLE_H + +#include "block/aio.h" +#include "qemu/main-loop.h" +#include "qemu/coroutine.h" +#include "qemu/throttle.h" + +typedef struct FsThrottle { + ThrottleState ts; + ThrottleTimers tt; + AioContext *aioctx; + ThrottleConfig cfg; + CoQueue throttled_reqs[2]; +} FsThrottle; + +void fsdev_throttle_parse_opts(QemuOpts *, FsThrottle *); + +int fsdev_throttle_init(FsThrottle *); + +void coroutine_fn fsdev_co_throttle_request(FsThrottle *, bool , + struct iovec *, int); + +void fsdev_throttle_cleanup(FsThrottle *); +#endif /* _FSDEV_THROTTLE_H */ diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c index 845675e..842b82e 100644 --- a/hw/9pfs/9p-local.c +++ b/hw/9pfs/9p-local.c @@ -1237,6 +1237,8 @@ static int local_parse_opts(QemuOpts *opts, struct FsDriverEntry *fse) error_report("fsdev: No path specified"); return -1; } + + fsdev_throttle_parse_opts(opts, &fse->fst); fse->path = g_strdup(path); return 0; diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index e88cf25..450ed12 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -3506,6 +3506,13 @@ int v9fs_device_realize_common(V9fsState *s, Error **errp) error_setg(errp, "share path %s is not a directory", fse->path); goto out; } + + s->ctx.fst = &fse->fst; + if (fsdev_throttle_init(s->ctx.fst) < 0) { + error_report("fsdev: Throttle configuration specified is not valid"); + return -1; + } + v9fs_path_free(&path); rc = 0; @@ -3520,6 +3527,9 @@ out: void v9fs_device_unrealize_common(V9fsState *s, Error **errp) { + if (throttle_enabled(&s->ctx.fst->cfg)) { + fsdev_throttle_cleanup(s->ctx.fst); + } g_free(s->ctx.fs_root); g_free(s->tag); } diff --git a/hw/9pfs/cofile.c b/hw/9pfs/cofile.c index 120e267..88791bc 100644 --- a/hw/9pfs/cofile.c +++ b/hw/9pfs/cofile.c @@ -247,6 +247,7 @@ int coroutine_fn v9fs_co_pwritev(V9fsPDU *pdu, V9fsFidState *fidp, if (v9fs_request_cancelled(pdu)) { return -EINTR; } + fsdev_co_throttle_request(s->ctx.fst, true, iov, iovcnt); v9fs_co_run_in_worker( { err = s->ops->pwritev(&s->ctx, &fidp->fs, iov, iovcnt, offset); @@ -266,6 +267,7 @@ int coroutine_fn v9fs_co_preadv(V9fsPDU *pdu, V9fsFidState *fidp, if (v9fs_request_cancelled(pdu)) { return -EINTR; } + fsdev_co_throttle_request(s->ctx.fst, false, iov, iovcnt); v9fs_co_run_in_worker( { err = s->ops->preadv(&s->ctx, &fidp->fs, iov, iovcnt, offset); -- 1.8.3.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49306) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c765f-0000Ud-7y for qemu-devel@nongnu.org; Wed, 16 Nov 2016 14:41:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c765c-0003Iy-1Y for qemu-devel@nongnu.org; Wed, 16 Nov 2016 14:41:51 -0500 Date: Wed, 16 Nov 2016 14:41:44 -0500 From: Christopher Oliver Message-Id: <20161116144144.674250d7644ef8f8cc516993@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Wed__16_Nov_2016_14_41_44_-0500_HtMuwJmBbN8p5ASM" Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-block@nongnu.org, mreitz@redhat.com, kwolf@redhat.com This is a multi-part message in MIME format. --Multipart=_Wed__16_Nov_2016_14_41_44_-0500_HtMuwJmBbN8p5ASM Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit This patch (hack?) works around the slowness in SEEK_HOLE for large dense files on Linux tmpfs. It may improve life elsewhere as well, and the penalty of the checks should be vanishingly small where it is not needed. If I'm subtly (or not so subtly) wrong, please fire back. Sincerely, -- Christopher Oliver --Multipart=_Wed__16_Nov_2016_14_41_44_-0500_HtMuwJmBbN8p5ASM Content-Type: application/octet-stream; name="qemu-patch" Content-Disposition: attachment; filename="qemu-patch" Content-Transfer-Encoding: base64 VGhlIGZvbGxvd2luZyBwYXRjaCBpcyBhIHdvcmstYXJvdW5kIGZvciBzbG93IFNFRUtfSE9MRSBv biBzb21lIGZpbGVzeXN0ZW1zLgpTcGVjaWZpY2FsbHksIFNFRUtfSE9MRSBvbiBhIGRlbnNlIGZp bGUgb24gTGludXggdG1wZnM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c2lkZSBvZiB0aGF0IGludGVydmFsLCBz ZWVrCisgICAgICogYW5kIGNhY2hlIHRoZSBuZXcgcmFuZ2UuCisgICAgICovCisgICAgaWYgICgo cy0+b3Blbl9mbGFncyAmIChPX1JEV1J8T19SRE9OTFkpKSA9PSBPX1JET05MWSkgeworICAgICAg ICBpZiAoc3RhcnQgPD0gcy0+bGFzdF9ob2xlICYmIHN0YXJ0ID49IHMtPmhvbGVfZm9sbG93cykg eworICAgICAgICAgICAgb2ZmcyA9IGxzZWVrKHMtPmZkLCBzLT5sYXN0X2hvbGUsIFNFRUtfU0VU KTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIG9mZnMgPSBsc2VlayhzLT5mZCwgc3Rh cnQsIFNFRUtfSE9MRSk7CisgICAgICAgICAgICBzLT5sYXN0X2hvbGUgPSBvZmZzOworICAgICAg ICAgICAgcy0+aG9sZV9mb2xsb3dzID0gc3RhcnQ7CisgICAgICAgIH0KKyAgICB9IGVsc2Ugewor ICAgICAgICBvZmZzID0gbHNlZWsocy0+ZmQsIHN0YXJ0LCBTRUVLX0hPTEUpOworICAgIH0KKwog ICAgIGlmIChvZmZzIDwgMCkgewogICAgICAgICByZXR1cm4gLWVycm5vOyAgICAgICAgICAvKiBE MSBhbmQgKEgzIG9yIEg0KSAqLwogICAgIH0K --Multipart=_Wed__16_Nov_2016_14_41_44_-0500_HtMuwJmBbN8p5ASM-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46592) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c7In0-0001Lk-3D for qemu-devel@nongnu.org; Thu, 17 Nov 2016 04:15:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c7Imz-0005O7-5i for qemu-devel@nongnu.org; Thu, 17 Nov 2016 04:15:26 -0500 References: <20161116144144.674250d7644ef8f8cc516993@gmail.com> From: Thomas Huth Message-ID: <681d18e8-0ffb-5877-acc9-1a0e3fc251b3@tuxfamily.org> Date: Thu, 17 Nov 2016 10:15:15 +0100 MIME-Version: 1.0 In-Reply-To: <20161116144144.674250d7644ef8f8cc516993@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christopher Oliver , qemu-devel@nongnu.org Cc: kwolf@redhat.com, qemu-block@nongnu.org, mreitz@redhat.com Hi Christopher, On 16.11.2016 20:41, Christopher Oliver wrote: > This patch (hack?) works around the slowness in SEEK_HOLE for large dense files > on Linux tmpfs. It may improve life elsewhere as well, and the penalty of the checks > should be vanishingly small where it is not needed. > > If I'm subtly (or not so subtly) wrong, please fire back. When submitting QEMU patches, there are some rules to be followed: First, please have a look at http://qemu-project.org/Contribute/SubmitAPatch#Do_not_send_as_an_attachment and the other paragraphs there. Your mail should also have a proper subject, and the Signed-off-by line should contain your e-mail address. Thanks, Thomas From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33430) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cO1LL-0006Qv-SW for qemu-devel@nongnu.org; Mon, 02 Jan 2017 07:04:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cO1LK-0006RY-Sn for qemu-devel@nongnu.org; Mon, 02 Jan 2017 07:03:59 -0500 Received: from mail-it0-x231.google.com ([2607:f8b0:4001:c0b::231]:36335) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cO1LK-0006R6-Mf for qemu-devel@nongnu.org; Mon, 02 Jan 2017 07:03:58 -0500 Received: by mail-it0-x231.google.com with SMTP id 75so247057316ite.1 for ; Mon, 02 Jan 2017 04:03:57 -0800 (PST) MIME-Version: 1.0 From: morgenlette madeBy Date: Mon, 2 Jan 2017 21:03:55 +0900 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org hello. I got problem using QEMU. when i turn on virtual machine, this message was shown, virsh: error while loading shared libraries: libapparmor.so.1: cannot open shared object file: No such file or directory I have no idea about libapparmor. What should I do? From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49571) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cOS58-0000mx-CR for qemu-devel@nongnu.org; Tue, 03 Jan 2017 11:37:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cOS54-0007yx-F8 for qemu-devel@nongnu.org; Tue, 03 Jan 2017 11:37:02 -0500 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]:33259) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cOS54-0007yV-8o for qemu-devel@nongnu.org; Tue, 03 Jan 2017 11:36:58 -0500 Received: by mail-wm0-x244.google.com with SMTP id u144so87435349wmu.0 for ; Tue, 03 Jan 2017 08:36:58 -0800 (PST) Date: Tue, 3 Jan 2017 16:36:55 +0000 From: Stefan Hajnoczi Message-ID: <20170103163655.GK14707@stefanha-x1.localdomain> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="M9kwpIYUMbI/2cCx" Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: morgenlette madeBy Cc: qemu-devel@nongnu.org --M9kwpIYUMbI/2cCx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 02, 2017 at 09:03:55PM +0900, morgenlette madeBy wrote: > I got problem using QEMU. >=20 > when i turn on virtual machine, >=20 > this message was shown, >=20 >=20 > virsh: error while loading shared libraries: libapparmor.so.1: cannot open > shared object file: No such file or directory >=20 > I have no idea about libapparmor. >=20 >=20 > What should I do? Hi, Looks like the libvirt packages do not have all dependencies installed. If you are using Ubuntu try "apt-get install libapparmor1" to install the missing library. I looked up the package that provides the "libapparmor.so.1" filename here: http://packages.ubuntu.com/search?searchon=3Dcontents&keywords=3Dlibapparmo= r.so.1&mode=3Dexactfilename&suite=3Dxenial&arch=3Dany If you have further questions please try asking for help from your Linux distribution (e.g. #ubuntu on irc.freenode.net) since this question is not directly related to QEMU. Good luck, Stefan --M9kwpIYUMbI/2cCx Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJYa9MnAAoJEJykq7OBq3PIFdwH/RgotdU+Gf7Op2/Q5kYyxeBz vOdjphRuUnEkZTow2mYYOR64TI1tHCfNbt0FyXH2tNttsmjLddymnnzP4nHp11D/ DZoXoq6vW/qkjYAjvuCbZB9dW3aGHIOx3y5slUzk6ZTES7/BlKfacydIZqy/M2Un oWucKE0YIQ575xeZjQdjRXcdKYZp0YAU0pF3LXlnh6NBs+DyhPxhgvMr1JKcB26v 26RTuh4xLJsgNz4aa0DAmapfPHw/JkSNOfD4dLb77lVLQkHqerrcSZP3hyrQCN7I nIPHuubIqrzr2RwOAguJdApCTuYrJGUyJzW9OHHoTtfaWdlGHQ87XOpvTKksZTw= =8nZ8 -----END PGP SIGNATURE----- --M9kwpIYUMbI/2cCx-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41817) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cekff-0007XA-HQ for qemu-devel@nongnu.org; Fri, 17 Feb 2017 10:42:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cekfa-0006hk-Kz for qemu-devel@nongnu.org; Fri, 17 Feb 2017 10:42:07 -0500 Received: from mail-yb0-x242.google.com ([2607:f8b0:4002:c09::242]:34899) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cekfa-0006hN-H0 for qemu-devel@nongnu.org; Fri, 17 Feb 2017 10:42:02 -0500 Received: by mail-yb0-x242.google.com with SMTP id u130so59316ybb.2 for ; Fri, 17 Feb 2017 07:42:02 -0800 (PST) From: Pranith Kumar Date: Fri, 17 Feb 2017 10:42:00 -0500 Message-Id: <20170217154200.10504-1-bobby.prani@gmail.com> Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: alex.bennee@linaro.org Cc: qemu-devel@nongnu.org, rth@twiddle.net, peter.maydell@linaro.org Subject: [PATCH] aarch64: Change ext type to TCGType to fix warnings To fix the following warnings: In file included from /users/pranith/qemu/tcg/tcg.c:255: /users/pranith/qemu/tcg/aarch64/tcg-target.inc.c:879:24: warning: implicit conversion from enumeration type 'TCGMemOp' (aka 'enum TCGMemOp') to different enumeration type 'TCGType' (aka 'enum TCGType') [-Wenum-conversion] tcg_out_cmp(s, ext, a, b, b_const); ~~~~~~~~~~~ ^~~ /users/pranith/qemu/tcg/aarch64/tcg-target.inc.c:893:36: warning: implicit conversion from enumeration type 'TCGMemOp' (aka 'enum TCGMemOp') to different enumeration type 'TCGType' (aka 'enum TCGType') [-Wenum-conversion] tcg_out_insn(s, 3201, CBZ, ext, a, offset); ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~ /users/pranith/qemu/tcg/aarch64/tcg-target.inc.c:389:65: note: expanded from macro 'tcg_out_insn' glue(tcg_out_insn_,FMT)(S, glue(glue(glue(I,FMT),_),OP), ## __VA_ARGS__) ^ /users/pranith/qemu/tcg/aarch64/tcg-target.inc.c:895:37: warning: implicit conversion from enumeration type 'TCGMemOp' (aka 'enum TCGMemOp') to different enumeration type 'TCGType' (aka 'enum TCGType') [-Wenum-conversion] tcg_out_insn(s, 3201, CBNZ, ext, a, offset); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~ /users/pranith/qemu/tcg/aarch64/tcg-target.inc.c:389:65: note: expanded from macro 'tcg_out_insn' glue(tcg_out_insn_,FMT)(S, glue(glue(glue(I,FMT),_),OP), ## __VA_ARGS__) ^ /users/pranith/qemu/tcg/aarch64/tcg-target.inc.c:1610:27: warning: implicit conversion from enumeration type 'TCGType' (aka 'enum TCGType') to different enumeration type 'TCGMemOp' (aka 'enum TCGMemOp') [-Wenum-conversion] tcg_out_brcond(s, ext, a2, a0, a1, const_args[1], arg_label(args[3])); ~~~~~~~~~~~~~~ ^~~ Signed-off-by: Pranith Kumar --- tcg/aarch64/tcg-target.inc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tcg/aarch64/tcg-target.inc.c b/tcg/aarch64/tcg-target.inc.c index 6d227a5a6a..290de6dae6 100644 --- a/tcg/aarch64/tcg-target.inc.c +++ b/tcg/aarch64/tcg-target.inc.c @@ -866,7 +866,7 @@ static inline void tcg_out_goto_label(TCGContext *s, TCGLabel *l) } } -static void tcg_out_brcond(TCGContext *s, TCGMemOp ext, TCGCond c, TCGArg a, +static void tcg_out_brcond(TCGContext *s, TCGType ext, TCGCond c, TCGArg a, TCGArg b, bool b_const, TCGLabel *l) { intptr_t offset; @@ -937,7 +937,7 @@ static void tcg_out_addsubi(TCGContext *s, int ext, TCGReg rd, } } -static inline void tcg_out_addsub2(TCGContext *s, int ext, TCGReg rl, +static inline void tcg_out_addsub2(TCGContext *s, TCGType ext, TCGReg rl, TCGReg rh, TCGReg al, TCGReg ah, tcg_target_long bl, tcg_target_long bh, bool const_bl, bool const_bh, bool sub) -- 2.11.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55344) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chFmS-0003IQ-B3 for qemu-devel@nongnu.org; Fri, 24 Feb 2017 08:19:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1chFmP-0008V4-51 for qemu-devel@nongnu.org; Fri, 24 Feb 2017 08:19:28 -0500 Received: from nat.nue.novell.com ([195.135.221.2]:36736 helo=tegan.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1chFmO-0008QN-Sk for qemu-devel@nongnu.org; Fri, 24 Feb 2017 08:19:25 -0500 From: Eric Bischoff Date: Fri, 24 Feb 2017 14:19:17 +0100 Message-Id: <20170224131918.15480-1-ebischoff@suse.com> Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org (forgot to CC the list, already sent to Richard Henderson and Alexander Graf) From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46673) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cqc1r-00058w-4k for qemu-devel@nongnu.org; Wed, 22 Mar 2017 04:54:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cqc1l-0001AP-Lr for qemu-devel@nongnu.org; Wed, 22 Mar 2017 04:54:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44598) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cqc1l-0001A9-Fq for qemu-devel@nongnu.org; Wed, 22 Mar 2017 04:53:57 -0400 From: Vinzenz 'evilissimo' Feenstra Date: Thu, 16 Mar 2017 15:50:44 +0100 Message-Id: <20170316145045.10840-1-vfeenstr@redhat.com> In-Reply-To: <0342808A-63C6-40BE-91AB-B6088AD62CD2@redhat.com> References: <0342808A-63C6-40BE-91AB-B6088AD62CD2@redhat.com> Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mdroth@linux.vnet.ibm.com, eblake@redhat.com In this version: - Changed the use of strdup to g_strdup and the use of sprintf with a local buffer to use g_strdup_printf instead. - Made the majority of fields in the GuestOSInfo optional to allow 0 values - Used the right target version in the schema (2.10 vs 2.8 before) - Refactored the code for deciding which release/version file to use to use a configuration struct and a while loop to iterate over the options. I was looking into the usage of uname, as suggested by eric, however after looking into this I realized that there's no additional information to be gained from this. Therefore I decided that this is still a feasible approach. In most cases the code will break out of the loop after accessing the second file. For older systems there are some supported fallbacks available, but /etc/os-release and /usr/lib/os-release are already quite established. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38265) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cr32i-00082X-9P for qemu-devel@nongnu.org; Thu, 23 Mar 2017 09:44:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cr32d-0003J2-E5 for qemu-devel@nongnu.org; Thu, 23 Mar 2017 09:44:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42678) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cr32d-0003Ik-6P for qemu-devel@nongnu.org; Thu, 23 Mar 2017 09:44:39 -0400 References: <0342808A-63C6-40BE-91AB-B6088AD62CD2@redhat.com> <20170316145045.10840-1-vfeenstr@redhat.com> From: Eric Blake Message-ID: Date: Thu, 23 Mar 2017 08:44:36 -0500 MIME-Version: 1.0 In-Reply-To: <20170316145045.10840-1-vfeenstr@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="fAp5xGlj33qtJbG2cSHiwg60qpLOSl6F4" Subject: Re: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vinzenz 'evilissimo' Feenstra , qemu-devel@nongnu.org Cc: mdroth@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --fAp5xGlj33qtJbG2cSHiwg60qpLOSl6F4 From: Eric Blake To: Vinzenz 'evilissimo' Feenstra , qemu-devel@nongnu.org Cc: mdroth@linux.vnet.ibm.com Message-ID: Subject: Re: References: <0342808A-63C6-40BE-91AB-B6088AD62CD2@redhat.com> <20170316145045.10840-1-vfeenstr@redhat.com> In-Reply-To: <20170316145045.10840-1-vfeenstr@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 03/16/2017 09:50 AM, Vinzenz 'evilissimo' Feenstra wrote: > In this version: When sending a v2, it's best to send it as a new top-level thread instead of burying it in-reply-to an older thread. Also, don't forget the subject line on the header message. >=20 > - Changed the use of strdup to g_strdup and the use of sprintf with a l= ocal > buffer to use g_strdup_printf instead. > - Made the majority of fields in the GuestOSInfo optional to allow 0 va= lues > - Used the right target version in the schema (2.10 vs 2.8 before) > - Refactored the code for deciding which release/version file to use to= use a > configuration struct and a while loop to iterate over the options. >=20 > I was looking into the usage of uname, as suggested by eric, however af= ter > looking into this I realized that there's no additional information to = be > gained from this. Therefore I decided that this is still a feasible app= roach. > In most cases the code will break out of the loop after accessing the s= econd > file. For older systems there are some supported fallbacks available, b= ut > /etc/os-release and /usr/lib/os-release are already quite established. >=20 >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --fAp5xGlj33qtJbG2cSHiwg60qpLOSl6F4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJY09FEAAoJEKeha0olJ0NqjnoH/iYDUo0YOuaoBhfL/RrowttI tcq/vZ5q1aHBApG8z0Egn2CFhg8h/0iPNKZPVtD1PQlOBuduK1GvftBcmpVx79ms AZsByUh8h1XTOPTqYyNDiDD7YrSdj2MCRDwvojF/pl+iGVii/hVm+vIicDVXAipr VJAs19ux7900edmFFpLDFH0tI6/oYFrZjZYkSDxVXOpAGWGBNKQmbcw33/4szRw6 PIcCnfdHdJOt6scYpthquQPZxZLELltqTU3TCYLB3MKdWInhKV2Nm80zyMqVkwa9 metObRRJul2a1x2C566VBB/9unjqVKukSjipf5IWdCUrI/jNSLfDgcbCs1I+4F4= =WO3i -----END PGP SIGNATURE----- --fAp5xGlj33qtJbG2cSHiwg60qpLOSl6F4-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54616) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6Jro-0004Wt-6M for qemu-devel@nongnu.org; Thu, 04 May 2017 12:44:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6Jrm-0004EW-M3 for qemu-devel@nongnu.org; Thu, 04 May 2017 12:44:36 -0400 MIME-Version: 1.0 In-Reply-To: References: From: gengdongjiu Date: Fri, 5 May 2017 00:44:33 +0800 Message-ID: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: mtsirkin@redhat.com, kvm@vger.kernel.org, Tyler Baicar , qemu-devel@nongnu.org, Xiongfeng Wang , ben@skyportsystems.com, linux@armlinux.org.uk, kvmarm@lists.cs.columbia.edu, huangshaoyu@huawei.com, lersek@redhat.com, songwenjun@huawei.com, wuquanming@huawei.com, Marc Zyngier , qemu-arm@nongnu.org, imammedo@redhat.com, linux-arm-kernel@lists.infradead.org, Ard Biesheuvel , pbonzini@redhat.com, James Morse Dear James, Thanks a lot for your review and comments. I am very sorry for the late response. 2017-05-04 23:42 GMT+08:00 gengdongjiu : > Hi Dongjiu Geng, > > On 30/04/17 06:37, Dongjiu Geng wrote: >> when happen SEA, deliver signal bus and handle the ioctl that >> inject SEA abort to guest, so that guest can handle the SEA error. > >> diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c >> index 105b6ab..a96594f 100644 >> --- a/arch/arm/kvm/mmu.c >> +++ b/arch/arm/kvm/mmu.c >> @@ -20,8 +20,10 @@ >> @@ -1238,6 +1240,36 @@ static void coherent_cache_guest_page(struct kvm_= vcpu *vcpu, kvm_pfn_t pfn, >> __coherent_cache_guest_page(vcpu, pfn, size); >> } >> >> +static void kvm_send_signal(unsigned long address, bool hugetlb, bool h= wpoison) >> +{ >> + siginfo_t info; >> + >> + info.si_signo =3D SIGBUS; >> + info.si_errno =3D 0; >> + if (hwpoison) >> + info.si_code =3D BUS_MCEERR_AR; >> + else >> + info.si_code =3D 0; >> + >> + info.si_addr =3D (void __user *)address; >> + if (hugetlb) >> + info.si_addr_lsb =3D PMD_SHIFT; >> + else >> + info.si_addr_lsb =3D PAGE_SHIFT; >> + >> + send_sig_info(SIGBUS, &info, current); >> +} >> + > =C2=AB [hide part of quote] > > Punit reviewed the other version of this patch, this PMD_SHIFT is not the= right > thing to do, it needs a more accurate set of calls and shifts as there ma= y be > hugetlbfs pages other than PMD_SIZE. > > https://www.spinics.net/lists/arm-kernel/msg568919.html > > I haven't posted a new version of that patch because I was still hunting = a bug > in the hugepage/hwpoison code, even with Punit's fixes series I see -EFAU= LT > returned to userspace instead of this hwpoison code being invoked. Ok, got it, thanks for your information. > > Please avoid duplicating functionality between patches, it wastes reviewe= rs > time, especially when we know there are problems with this approach. > > >> +static void kvm_handle_bad_page(unsigned long address, >> + bool hugetlb, bool hwpoison) >> +{ >> + /* handle both hwpoison and other synchronous external Abort */ >> + if (hwpoison) >> + kvm_send_signal(address, hugetlb, true); >> + else >> + kvm_send_signal(address, hugetlb, false); >> +} > > Why the extra level of indirection? We only want to signal userspace like= this > from KVM for hwpoison. Signals for RAS related reasons should come from t= he bits > of the kernel that decoded the error. For the SEA, the are maily two types: 0b010000 Synchronous External Abort on memory access. 0b0101xx Synchronous External Abort on page table walk. DFSC[1:0] encode the level. hwpoison should belong to the "Synchronous External Abort on memory access= " if the SEA type is not hwpoison, such as page table walk, do you mean KVM do not deliver the SIGBUS? If so, how the KVM handle the SEA type other than hwpoison? > > (hwpoison for KVM is a corner case as Qemu's memory effectively has two u= sers, > Qemu and KVM. This isn't the example of how user-space gets signalled.) > > >> diff --git a/arch/arm64/kvm/guest.c b/arch/arm64/kvm/guest.c >> index b37446a..780e3c4 100644 >> --- a/arch/arm64/kvm/guest.c >> +++ b/arch/arm64/kvm/guest.c >> @@ -277,6 +277,13 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *= vcpu, >> return -EINVAL; >> } >> >> +int kvm_vcpu_ioctl_sea(struct kvm_vcpu *vcpu) >> +{ >> + kvm_inject_dabt(vcpu, kvm_vcpu_get_hfar(vcpu)); >> + >> + return 0; >> +} > >> diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h >> index bb02909..1d2e2e7 100644 >> --- a/include/uapi/linux/kvm.h >> +++ b/include/uapi/linux/kvm.h >> @@ -1306,6 +1306,7 @@ struct kvm_s390_ucas_mapping { >> #define KVM_S390_GET_IRQ_STATE _IOW(KVMIO, 0xb6, struct kvm_s390_irq_s= tate) >> /* Available with KVM_CAP_X86_SMM */ >> #define KVM_SMI _IO(KVMIO, 0xb7) >> +#define KVM_ARM_SEA _IO(KVMIO, 0xb8) >> >> #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) >> #define KVM_DEV_ASSIGN_PCI_2_3 (1 << 1) >> > > Why do we need a userspace API for SEA? It can also be done by using > KVM_{G,S}ET_ONE_REG to change the vcpu registers. The advantage of doing = it this > way is you can choose which ESR value to use. > > Adding a new API call to do something you could do with an old one doesn'= t look > right. James, I considered your suggestion before that use the KVM_{G,S}ET_ONE_REG to change the vcpu registers. but I found it does not have difference to use the alread existed KVM API. so may be changing the vcpu registers in qemu will duplicate with the KVM APIs. injection a SEA is no more than setting some registers: elr_el1, PC, PSTATE, SPSR_el1, far_el1, esr_el1 I seen this KVM API do the same thing as Qemu. do you found call this API will have issue and necessary to choose another ESR value? I pasted the alread existed KVM API code: static void inject_abt64(struct kvm_vcpu *vcpu, bool is_iabt, unsigned long addr) { unsigned long cpsr =3D *vcpu_cpsr(vcpu); bool is_aarch32 =3D vcpu_mode_is_32bit(vcpu); u32 esr =3D 0; *vcpu_elr_el1(vcpu) =3D *vcpu_pc(vcpu); *vcpu_pc(vcpu) =3D get_except_vector(vcpu, except_type_sync); *vcpu_cpsr(vcpu) =3D PSTATE_FAULT_BITS_64; *vcpu_spsr(vcpu) =3D cpsr; vcpu_sys_reg(vcpu, FAR_EL1) =3D addr; /* * Build an {i,d}abort, depending on the level and the * instruction set. Report an external synchronous abort. */ if (kvm_vcpu_trap_il_is32bit(vcpu)) esr |=3D ESR_ELx_IL; /* * Here, the guest runs in AArch64 mode when in EL1. If we get * an AArch32 fault, it means we managed to trap an EL0 fault. */ if (is_aarch32 || (cpsr & PSR_MODE_MASK) =3D=3D PSR_MODE_EL0t) esr |=3D (ESR_ELx_EC_IABT_LOW << ESR_ELx_EC_SHIFT); else esr |=3D (ESR_ELx_EC_IABT_CUR << ESR_ELx_EC_SHIFT); if (!is_iabt) esr |=3D ESR_ELx_EC_DABT_LOW << ESR_ELx_EC_SHIFT; vcpu_sys_reg(vcpu, ESR_EL1) =3D esr | ESR_ELx_FSC_EXTABT; } static void inject_abt32(struct kvm_vcpu *vcpu, bool is_pabt, unsigned long addr) { u32 vect_offset; u32 *far, *fsr; bool is_lpae; if (is_pabt) { vect_offset =3D 12; far =3D &vcpu_cp15(vcpu, c6_IFAR); fsr =3D &vcpu_cp15(vcpu, c5_IFSR); } else { /* !iabt */ vect_offset =3D 16; far =3D &vcpu_cp15(vcpu, c6_DFAR); fsr =3D &vcpu_cp15(vcpu, c5_DFSR); } prepare_fault32(vcpu, COMPAT_PSR_MODE_ABT | COMPAT_PSR_A_BIT, vect_offset)= ; *far =3D addr; /* Give the guest an IMPLEMENTATION DEFINED exception */ is_lpae =3D (vcpu_cp15(vcpu, c2_TTBCR) >> 31); if (is_lpae) *fsr =3D 1 << 9 | 0x34; else *fsr =3D 0x14; } /** * kvm_inject_dabt - inject a data abort into the guest * @vcpu: The VCPU to receive the undefined exception * @addr: The address to report in the DFAR * * It is assumed that this code is called from the VCPU thread and that the * VCPU therefore is not currently executing guest code. */ void kvm_inject_dabt(struct kvm_vcpu *vcpu, unsigned long addr) { if (!(vcpu->arch.hcr_el2 & HCR_RW)) inject_abt32(vcpu, false, addr); else inject_abt64(vcpu, false, addr); } > > > Thanks, > > James From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57416) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dB7dz-0002RT-3r for qemu-devel@nongnu.org; Wed, 17 May 2017 18:42:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dB7dw-0007V2-01 for qemu-devel@nongnu.org; Wed, 17 May 2017 18:42:11 -0400 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:33393) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dB7dv-0007Ub-Jg for qemu-devel@nongnu.org; Wed, 17 May 2017 18:42:07 -0400 Received: by mail-wr0-x243.google.com with SMTP id w50so3791670wrc.0 for ; Wed, 17 May 2017 15:42:07 -0700 (PDT) Date: Wed, 17 May 2017 15:42:04 -0700 (PDT) From: John Bradley Message-ID: <536fb79a-5753-4143-a5a6-7a189ef5137e@ONE.local> MIME-Version: 1.0 Content-Type: text/plain; Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: flypie@rocketmail.com, eblake@redhat.comflypie@rocketmail.com, peter.maydell@linaro.org, qemu-arm@nongnu.org >>From 836daaff38940535548043f2e8f2e3df7a62d473 Mon Sep 17 00:00:00 2001 From: John Bradley Date: Wed, 17 May 2017 18:57:21 +0100 Subject: [PATCH] [PATCH] Add code to connect with https://github.com/flypie/GDummyPanel The code uses GNU Sockets & Windows sockets as on MINGW GNU no available. This is inteded as a Demo for RFC. Signed-off-by: John Bradley --- hw/gpio/bcm2835_gpio.c | 330 +++++++++++++++++++++++------------------ include/hw/gpio/bcm2835_gpio.h | 5 + include/qemu/PanelEmu.h | 54 +++++++ util/Makefile.objs | 1 + util/PanelEmu.c | 329 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 577 insertions(+), 142 deletions(-) create mode 100644 include/qemu/PanelEmu.h create mode 100644 util/PanelEmu.c diff --git a/hw/gpio/bcm2835_gpio.c b/hw/gpio/bcm2835_gpio.c index acc2e3cf9e..14bd059861 100644 --- a/hw/gpio/bcm2835_gpio.c +++ b/hw/gpio/bcm2835_gpio.c @@ -19,6 +19,8 @@ #include "hw/sd/sd.h" #include "hw/gpio/bcm2835_gpio.h" + + #define GPFSEL0 0x00 #define GPFSEL1 0x04 #define GPFSEL2 0x08 @@ -53,9 +55,9 @@ static uint32_t gpfsel_get(BCM2835GpioState *s, uint8_t reg) { int i; uint32_t value = 0; - for (i = 0; i < 10; i++) { + for (i = 0; i < 10; i ++) { uint32_t index = 10 * reg + i; - if (index < sizeof(s->fsel)) { + if (index < sizeof (s->fsel)) { value |= (s->fsel[index] & 0x7) << (3 * i); } } @@ -65,9 +67,9 @@ static uint32_t gpfsel_get(BCM2835GpioState *s, uint8_t reg) static void gpfsel_set(BCM2835GpioState *s, uint8_t reg, uint32_t value) { int i; - for (i = 0; i < 10; i++) { + for (i = 0; i < 10; i ++) { uint32_t index = 10 * reg + i; - if (index < sizeof(s->fsel)) { + if (index < sizeof (s->fsel)) { int fsel = (value >> (3 * i)) & 0x7; s->fsel[index] = fsel; } @@ -75,24 +77,24 @@ static void gpfsel_set(BCM2835GpioState *s, uint8_t reg, uint32_t value) /* SD controller selection (48-53) */ if (s->sd_fsel != 0 - && (s->fsel[48] == 0) /* SD_CLK_R */ - && (s->fsel[49] == 0) /* SD_CMD_R */ - && (s->fsel[50] == 0) /* SD_DATA0_R */ - && (s->fsel[51] == 0) /* SD_DATA1_R */ - && (s->fsel[52] == 0) /* SD_DATA2_R */ - && (s->fsel[53] == 0) /* SD_DATA3_R */ - ) { + && (s->fsel[48] == 0) /* SD_CLK_R */ + && (s->fsel[49] == 0) /* SD_CMD_R */ + && (s->fsel[50] == 0) /* SD_DATA0_R */ + && (s->fsel[51] == 0) /* SD_DATA1_R */ + && (s->fsel[52] == 0) /* SD_DATA2_R */ + && (s->fsel[53] == 0) /* SD_DATA3_R */ + ) { /* SDHCI controller selected */ sdbus_reparent_card(s->sdbus_sdhost, s->sdbus_sdhci); s->sd_fsel = 0; } else if (s->sd_fsel != 4 - && (s->fsel[48] == 4) /* SD_CLK_R */ - && (s->fsel[49] == 4) /* SD_CMD_R */ - && (s->fsel[50] == 4) /* SD_DATA0_R */ - && (s->fsel[51] == 4) /* SD_DATA1_R */ - && (s->fsel[52] == 4) /* SD_DATA2_R */ - && (s->fsel[53] == 4) /* SD_DATA3_R */ - ) { + && (s->fsel[48] == 4) /* SD_CLK_R */ + && (s->fsel[49] == 4) /* SD_CMD_R */ + && (s->fsel[50] == 4) /* SD_DATA0_R */ + && (s->fsel[51] == 4) /* SD_DATA1_R */ + && (s->fsel[52] == 4) /* SD_DATA2_R */ + && (s->fsel[53] == 4) /* SD_DATA3_R */ + ) { /* SDHost controller selected */ sdbus_reparent_card(s->sdbus_sdhci, s->sdbus_sdhost); s->sd_fsel = 4; @@ -108,13 +110,13 @@ static int gpfsel_is_out(BCM2835GpioState *s, int index) } static void gpset(BCM2835GpioState *s, - uint32_t val, uint8_t start, uint8_t count, uint32_t *lev) + uint32_t val, uint8_t start, uint8_t count, uint32_t *lev) { - uint32_t changes = val & ~*lev; + uint32_t changes = val & ~ *lev; uint32_t cur = 1; int i; - for (i = 0; i < count; i++) { + for (i = 0; i < count; i ++) { if ((changes & cur) && (gpfsel_is_out(s, start + i))) { qemu_set_irq(s->out[start + i], 1); } @@ -125,132 +127,165 @@ static void gpset(BCM2835GpioState *s, } static void gpclr(BCM2835GpioState *s, - uint32_t val, uint8_t start, uint8_t count, uint32_t *lev) + uint32_t val, uint8_t start, uint8_t count, uint32_t *lev) { uint32_t changes = val & *lev; uint32_t cur = 1; int i; - for (i = 0; i < count; i++) { + for (i = 0; i < count; i ++) { if ((changes & cur) && (gpfsel_is_out(s, start + i))) { qemu_set_irq(s->out[start + i], 0); } cur <<= 1; } - *lev &= ~val; + *lev &= ~ val; } -static uint64_t bcm2835_gpio_read(void *opaque, hwaddr offset, - unsigned size) +static uint64_t bcm2835_gpio_read(void *opaque, hwaddr offset, unsigned size) { - BCM2835GpioState *s = (BCM2835GpioState *)opaque; + BCM2835GpioState *s = (BCM2835GpioState *) opaque; + + uint64_t Data; switch (offset) { - case GPFSEL0: - case GPFSEL1: - case GPFSEL2: - case GPFSEL3: - case GPFSEL4: - case GPFSEL5: - return gpfsel_get(s, offset / 4); - case GPSET0: - case GPSET1: - /* Write Only */ - return 0; - case GPCLR0: - case GPCLR1: - /* Write Only */ - return 0; - case GPLEV0: - return s->lev0; - case GPLEV1: - return s->lev1; - case GPEDS0: - case GPEDS1: - case GPREN0: - case GPREN1: - case GPFEN0: - case GPFEN1: - case GPHEN0: - case GPHEN1: - case GPLEN0: - case GPLEN1: - case GPAREN0: - case GPAREN1: - case GPAFEN0: - case GPAFEN1: - case GPPUD: - case GPPUDCLK0: - case GPPUDCLK1: - /* Not implemented */ - return 0; - default: - qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset %"HWADDR_PRIx"\n", - __func__, offset); - break; + case GPFSEL0: + case GPFSEL1: + case GPFSEL2: + case GPFSEL3: + case GPFSEL4: + case GPFSEL5: + return gpfsel_get(s, offset / 4); + case GPSET0: + case GPSET1: + /* Write Only */ + return 0; + case GPCLR0: + case GPCLR1: + /* Write Only */ + return 0; + case GPLEV0: + if (s->panel.socket != - 1) { + if (panel_read(&s->panel, &Data)) { + s->lev0 = (uint32_t) Data; + s->lev1 = (uint32_t) (Data >> 32); + } + } + return s->lev0; + case GPLEV1: + if (s->panel.socket != - 1) { + if (panel_read(&s->panel, &Data)) { + s->lev0 = (uint32_t) Data; + s->lev1 = (uint32_t) (Data >> 32); + } + } + return s->lev1; + case GPEDS0: + case GPEDS1: + case GPREN0: + case GPREN1: + case GPFEN0: + case GPFEN1: + case GPHEN0: + case GPHEN1: + case GPLEN0: + case GPLEN1: + case GPAREN0: + case GPAREN1: + case GPAFEN0: + case GPAFEN1: + case GPPUD: + case GPPUDCLK0: + case GPPUDCLK1: + /* Not implemented */ + return 0; + default: + qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset %"HWADDR_PRIx"\n", + __func__, offset); + break; } return 0; } static void bcm2835_gpio_write(void *opaque, hwaddr offset, - uint64_t value, unsigned size) + uint64_t value, unsigned size) { - BCM2835GpioState *s = (BCM2835GpioState *)opaque; + BCM2835GpioState *s = (BCM2835GpioState *) opaque; + uint64_t Data; + switch (offset) { - case GPFSEL0: - case GPFSEL1: - case GPFSEL2: - case GPFSEL3: - case GPFSEL4: - case GPFSEL5: - gpfsel_set(s, offset / 4, value); - break; - case GPSET0: - gpset(s, value, 0, 32, &s->lev0); - break; - case GPSET1: - gpset(s, value, 32, 22, &s->lev1); - break; - case GPCLR0: - gpclr(s, value, 0, 32, &s->lev0); - break; - case GPCLR1: - gpclr(s, value, 32, 22, &s->lev1); - break; - case GPLEV0: - case GPLEV1: - /* Read Only */ - break; - case GPEDS0: - case GPEDS1: - case GPREN0: - case GPREN1: - case GPFEN0: - case GPFEN1: - case GPHEN0: - case GPHEN1: - case GPLEN0: - case GPLEN1: - case GPAREN0: - case GPAREN1: - case GPAFEN0: - case GPAFEN1: - case GPPUD: - case GPPUDCLK0: - case GPPUDCLK1: - /* Not implemented */ - break; - default: - goto err_out; + case GPFSEL0: + case GPFSEL1: + case GPFSEL2: + case GPFSEL3: + case GPFSEL4: + case GPFSEL5: + gpfsel_set(s, offset / 4, value); + break; + case GPSET0: + gpset(s, value, 0, 32, &s->lev0); + if (s->panel.socket != - 1) { + Data = value; + senddatatopanel(&s->panel, Data, true); //John Bradley dummy GPIO Panel + } + break; + case GPSET1: + gpset(s, value, 32, 22, &s->lev1); + if (s->panel.socket != - 1) { + Data = value; + Data <<= 32; + senddatatopanel(&s->panel, Data, true); //John Bradley dummy GPIO Panel + } + break; + case GPCLR0: + gpclr(s, value, 0, 32, &s->lev0); + if (s->panel.socket != - 1) { + Data = value; + senddatatopanel(&s->panel, Data, false); //John Bradley dummy GPIO Panel + } + break; + case GPCLR1: + gpclr(s, value, 32, 22, &s->lev1); + if (s->panel.socket != - 1) { + Data = value; + Data <<= 32; + senddatatopanel(&s->panel, Data, false); //John Bradley dummy GPIO Panel + } + break; + case GPLEV0: + case GPLEV1: + /* Read Only */ + break; + case GPEDS0: + case GPEDS1: + case GPREN0: + case GPREN1: + case GPFEN0: + case GPFEN1: + case GPHEN0: + case GPHEN1: + case GPLEN0: + case GPLEN1: + case GPAREN0: + case GPAREN1: + case GPAFEN0: + case GPAFEN1: + case GPPUD: + case GPPUDCLK0: + case GPPUDCLK1: + /* Not implemented */ + break; + default: + goto err_out; } return; err_out: qemu_log_mask(LOG_GUEST_ERROR, "%s: Bad offset %"HWADDR_PRIx"\n", - __func__, offset); + __func__, offset); } static void bcm2835_gpio_reset(DeviceState *dev) @@ -258,7 +293,7 @@ static void bcm2835_gpio_reset(DeviceState *dev) BCM2835GpioState *s = BCM2835_GPIO(dev); int i; - for (i = 0; i < 6; i++) { + for (i = 0; i < 6; i ++) { gpfsel_set(s, i, 0); } @@ -272,21 +307,22 @@ static void bcm2835_gpio_reset(DeviceState *dev) } static const MemoryRegionOps bcm2835_gpio_ops = { - .read = bcm2835_gpio_read, - .write = bcm2835_gpio_write, - .endianness = DEVICE_NATIVE_ENDIAN, + .read = bcm2835_gpio_read, + .write = bcm2835_gpio_write, + .endianness = DEVICE_NATIVE_ENDIAN, }; static const VMStateDescription vmstate_bcm2835_gpio = { - .name = "bcm2835_gpio", - .version_id = 1, - .minimum_version_id = 1, - .fields = (VMStateField[]) { - VMSTATE_UINT8_ARRAY(fsel, BCM2835GpioState, 54), - VMSTATE_UINT32(lev0, BCM2835GpioState), - VMSTATE_UINT32(lev1, BCM2835GpioState), - VMSTATE_UINT8(sd_fsel, BCM2835GpioState), - VMSTATE_END_OF_LIST() + .name = "bcm2835_gpio", + .version_id = 1, + .minimum_version_id = 1, + .fields = (VMStateField[]) + { + VMSTATE_UINT8_ARRAY(fsel, BCM2835GpioState, 54), + VMSTATE_UINT32(lev0, BCM2835GpioState), + VMSTATE_UINT32(lev1, BCM2835GpioState), + VMSTATE_UINT8(sd_fsel, BCM2835GpioState), + VMSTATE_END_OF_LIST() } }; @@ -296,13 +332,23 @@ static void bcm2835_gpio_init(Object *obj) DeviceState *dev = DEVICE(obj); SysBusDevice *sbd = SYS_BUS_DEVICE(obj); - qbus_create_inplace(&s->sdbus, sizeof(s->sdbus), + qbus_create_inplace(&s->sdbus, sizeof (s->sdbus), TYPE_SD_BUS, DEVICE(s), "sd-bus"); memory_region_init_io(&s->iomem, obj, - &bcm2835_gpio_ops, s, "bcm2835_gpio", 0x1000); + &bcm2835_gpio_ops, s, "bcm2835_gpio", 0x1000); sysbus_init_mmio(sbd, &s->iomem); qdev_init_gpio_out(dev, s->out, 54); + + /* Get access to the GPIO panel, program will quit on fail */ + if (panel_open(&s->panel)) { + sendpincount(&s->panel, 54); //PI Has 54 Pins + sendenabledmap(&s->panel, 0x003FFFFFFFFFFFFC); //Pins 0 & 1 are I2C so disable + sendinputmap(&s->panel, 0x0000000000000000); //There are no dedicated input pins I know off + sendoutputmap(&s->panel, 0x0000800000000000); //Pin 53 is dedicated output LED + } else { + printf("Couldn't connect to a GPIO panel\n"); //John Bradley dummy GPIO Panel + } } static void bcm2835_gpio_realize(DeviceState *dev, Error **errp) @@ -314,7 +360,7 @@ static void bcm2835_gpio_realize(DeviceState *dev, Error **errp) obj = object_property_get_link(OBJECT(dev), "sdbus-sdhci", &err); if (obj == NULL) { error_setg(errp, "%s: required sdhci link not found: %s", - __func__, error_get_pretty(err)); + __func__, error_get_pretty(err)); return; } s->sdbus_sdhci = SD_BUS(obj); @@ -322,7 +368,7 @@ static void bcm2835_gpio_realize(DeviceState *dev, Error **errp) obj = object_property_get_link(OBJECT(dev), "sdbus-sdhost", &err); if (obj == NULL) { error_setg(errp, "%s: required sdhost link not found: %s", - __func__, error_get_pretty(err)); + __func__, error_get_pretty(err)); return; } s->sdbus_sdhost = SD_BUS(obj); @@ -332,17 +378,17 @@ static void bcm2835_gpio_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); - dc->vmsd = &vmstate_bcm2835_gpio; - dc->realize = &bcm2835_gpio_realize; - dc->reset = &bcm2835_gpio_reset; + dc->vmsd = & vmstate_bcm2835_gpio; + dc->realize = & bcm2835_gpio_realize; + dc->reset = & bcm2835_gpio_reset; } static const TypeInfo bcm2835_gpio_info = { - .name = TYPE_BCM2835_GPIO, - .parent = TYPE_SYS_BUS_DEVICE, - .instance_size = sizeof(BCM2835GpioState), - .instance_init = bcm2835_gpio_init, - .class_init = bcm2835_gpio_class_init, + .name = TYPE_BCM2835_GPIO, + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof (BCM2835GpioState), + .instance_init = bcm2835_gpio_init, + .class_init = bcm2835_gpio_class_init, }; static void bcm2835_gpio_register_types(void) diff --git a/include/hw/gpio/bcm2835_gpio.h b/include/hw/gpio/bcm2835_gpio.h index 9f8e0c720c..73cfda6a6b 100644 --- a/include/hw/gpio/bcm2835_gpio.h +++ b/include/hw/gpio/bcm2835_gpio.h @@ -16,6 +16,8 @@ #include "hw/sd/sd.h" +#include "qemu/PanelEmu.h" + typedef struct BCM2835GpioState { SysBusDevice parent_obj; @@ -30,6 +32,9 @@ typedef struct BCM2835GpioState { uint32_t lev0, lev1; uint8_t sd_fsel; qemu_irq out[54]; + + panel_connection_t panel; + } BCM2835GpioState; #define TYPE_BCM2835_GPIO "bcm2835_gpio" diff --git a/include/qemu/PanelEmu.h b/include/qemu/PanelEmu.h new file mode 100644 index 0000000000..eb9bf053d0 --- /dev/null +++ b/include/qemu/PanelEmu.h @@ -0,0 +1,54 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ + +/* + * File: PanelEmu.h + * Author: John Bradley + * + * Created on 22 April 2017, 22:26 + */ + +#ifndef PANELEMU_H +#define PANELEMU_H + +#ifdef __cplusplus +extern "C" { +#endif + + +#define DRIVER_NAME "RDC-GPIO: " +#define PANEL_NAME "GPIO panel: " + + +#define DEFAULT_PORT 0xb1ff //45567 + +#define PANEL_PINS 54 + + typedef struct panel_connection { + int socket; /* socket we'll connect to the panel with */ + fd_set fds; /* list of descriptors (only the above socket */ + char last[PANEL_PINS / 8]; /* we don't want to send updates to the panel + unless something changed */ + int ProtocolInUse; //What version of the protocol are we using. + } panel_connection_t; + + bool panel_open(panel_connection_t* h); + + bool panel_read(panel_connection_t* h, uint64_t *pinS); + void senddatatopanel(panel_connection_t* h, uint64_t pinS, bool Value); + void panel_send_read_command(panel_connection_t* h); + void sendpincount(panel_connection_t* h, int Num); + void sendenabledmap(panel_connection_t* h, uint64_t pins); + void sendinputmap(panel_connection_t* h, uint64_t pins); + void sendoutputmap(panel_connection_t* h, uint64_t pins); + + +#ifdef __cplusplus +} +#endif + +#endif /* PANELEMU_H */ + diff --git a/util/Makefile.objs b/util/Makefile.objs index c6205ebf86..8316ed79ba 100644 --- a/util/Makefile.objs +++ b/util/Makefile.objs @@ -43,3 +43,4 @@ util-obj-y += qdist.o util-obj-y += qht.o util-obj-y += range.o util-obj-y += systemd.o +util-obj-y += PanelEmu.o \ No newline at end of file diff --git a/util/PanelEmu.c b/util/PanelEmu.c new file mode 100644 index 0000000000..d428dd7b53 --- /dev/null +++ b/util/PanelEmu.c @@ -0,0 +1,329 @@ +/* + * Emulation for Rasp PI GPIO via Server connected to via Socket + * + */ +#include "qemu/osdep.h" + +#include +#include +#include +#include +#include +#include +#ifdef __MINGW32__ +#include +#else +#include +#include +#include +#endif + + +#include "qemu/PanelEmu.h" + +typedef enum +{ + PROTOCOLDESCFROMQEMU = 0, + PROTOCOLDESCFROMPANEL = 1, + PINSTOPANEL = 2, + READREQ = 3, + PINCOUNT = 4, + ENABLEMAP = 5, + INPUTMAP = 6, + OUTPUTMAP = 7, + PINSTOQEMU = 8 +} PacketType; + +#define MINPROTOCOL 0 +#define MAXPROTOCOL 0 + +#define MAXPACKET 255 + +#define PACKETLEN 0 //Includes Packet Length +#define PACKETTYPE 1 + +typedef struct +{ + unsigned short int Data[MAXPACKET]; +} CommandPacket; + +static void panel_command(panel_connection_t *h, CommandPacket *Pkt); + +static void panel_send_protocol_command(panel_connection_t* h) +{ + CommandPacket Pkt; + + Pkt.Data[PACKETLEN] = 8; + Pkt.Data[PACKETTYPE] = PROTOCOLDESCFROMQEMU; + Pkt.Data[2] = MINPROTOCOL; + Pkt.Data[3] = MAXPROTOCOL; + + panel_command(h, &Pkt); +} + +void panel_send_read_command(panel_connection_t* h) +{ + CommandPacket Pkt; + + Pkt.Data[PACKETLEN] = 4; + Pkt.Data[PACKETTYPE] = READREQ; + + panel_command(h, &Pkt); +} + +/* Set a pin to a specified value */ +void senddatatopanel(panel_connection_t* h, uint64_t pin, bool val) +{ + CommandPacket Pkt; + + Pkt.Data[PACKETLEN] = (char *) &Pkt.Data[6 + 1]-(char *) &Pkt.Data[0]; + Pkt.Data[PACKETTYPE] = PINSTOPANEL; + Pkt.Data[2] = (unsigned short int) (pin & 0xFFFF); + Pkt.Data[3] = (unsigned short int) ((pin >> 16)&0xFFFF); + Pkt.Data[4] = (unsigned short int) (pin >> 32 & 0xFFFF); + Pkt.Data[5] = (unsigned short int) ((pin >> 48)&0xFFFF); + Pkt.Data[6] = val; + + panel_command(h, &Pkt); +} + +void sendpincount(panel_connection_t* h, int val) +{ + CommandPacket Pkt; + + Pkt.Data[PACKETLEN] = (char *) &Pkt.Data[2 + 1]-(char *) &Pkt.Data[0]; + Pkt.Data[PACKETTYPE] = PINCOUNT; + Pkt.Data[2] = val; + + panel_command(h, &Pkt); +} + +void sendenabledmap(panel_connection_t* h, uint64_t pin) +{ + CommandPacket Pkt; + + Pkt.Data[PACKETLEN] = (char *) &Pkt.Data[5 + 1]-(char *) &Pkt.Data[0]; + Pkt.Data[PACKETTYPE] = ENABLEMAP; + Pkt.Data[2] = (unsigned short int) (pin & 0xFFFF); + Pkt.Data[3] = (unsigned short int) ((pin >> 16)&0xFFFF); + Pkt.Data[4] = (unsigned short int) (pin >> 32 & 0xFFFF); + Pkt.Data[5] = (unsigned short int) ((pin >> 48)&0xFFFF); + + panel_command(h, &Pkt); +} + +void sendinputmap(panel_connection_t* h, uint64_t pin) +{ + CommandPacket Pkt; + + Pkt.Data[PACKETLEN] = (char *) &Pkt.Data[5 + 1]-(char *) &Pkt.Data[0]; + Pkt.Data[PACKETTYPE] = INPUTMAP; + Pkt.Data[2] = (unsigned short int) (pin & 0xFFFF); + Pkt.Data[3] = (unsigned short int) ((pin >> 16)&0xFFFF); + Pkt.Data[4] = (unsigned short int) (pin >> 32 & 0xFFFF); + Pkt.Data[5] = (unsigned short int) ((pin >> 48)&0xFFFF); + + panel_command(h, &Pkt); +} + +void sendoutputmap(panel_connection_t* h, uint64_t pin) +{ + CommandPacket Pkt; + + Pkt.Data[PACKETLEN] = (char *) &Pkt.Data[5 + 1]-(char *) &Pkt.Data[0]; + Pkt.Data[PACKETTYPE] = OUTPUTMAP; + Pkt.Data[2] = (unsigned short int) (pin & 0xFFFF); + Pkt.Data[3] = (unsigned short int) ((pin >> 16)&0xFFFF); + Pkt.Data[4] = (unsigned short int) (pin >> 32 & 0xFFFF); + Pkt.Data[5] = (unsigned short int) ((pin >> 48)&0xFFFF); + + panel_command(h, &Pkt); +} + +static void panel_command(panel_connection_t *h, CommandPacket *Pkt) +{ + if (send(h->socket, (char *) Pkt, Pkt->Data[PACKETLEN], 0) == - 1) { + perror(PANEL_NAME "send"); +#ifdef __MINGW32__ + closesocket(h->socket); +#else + close(h->socket); +#endif + h->socket = - 1; /* act like we never connected */ + } +} + +/* Wait for values to be read back from panel */ +bool panel_read(panel_connection_t* h, uint64_t* Data) +{ + fd_set rfds, efds; + int LengthInBuffer; + int select_res = 0; + + CommandPacket *PktPtr = (CommandPacket *) malloc(sizeof (CommandPacket)); + CommandPacket *Pkt; + bool NoError = true; + bool NewData = false; + bool NoData = false; + struct timeval timeout; + + int ReadStart = 0; + + timeout.tv_sec = 0; + timeout.tv_usec = 0; + + if (h->socket != - 1) { + rfds = h->fds; + efds = h->fds; + +// printf(PANEL_NAME "panel_read\n"); + + Pkt = PktPtr; + while (NoError&&! NoData) { + select_res = select(h->socket + 1, &rfds, NULL, &efds, &timeout); + if (select_res > 0) { + if (FD_ISSET(h->socket, &rfds)) { + /* receive more data */ + if ((LengthInBuffer = recv(h->socket, (char *) &Pkt[ReadStart], sizeof (*Pkt) - ReadStart, 0)) > 0) { + LengthInBuffer += ReadStart; + for (int i = 0; LengthInBuffer > 0; i ++) { + if (LengthInBuffer >= Pkt->Data[i + PACKETLEN]) { + switch (Pkt->Data[i + PACKETTYPE]) + { + case PINSTOQEMU: + *Data = (uint64_t) Pkt->Data[i + 2]; + *Data |= ((uint64_t) Pkt->Data[i + 3]) << 16; + *Data |= ((uint64_t) Pkt->Data[i + 4]) << 32; + *Data |= ((uint64_t) Pkt->Data[i + 5]) << 48; + + NewData = true; + break; + + case PROTOCOLDESCFROMPANEL: + h->ProtocolInUse = (int) Pkt->Data[i + 2]; + if(h->ProtocolInUse!=-1) + { + printf(PANEL_NAME "Protocol %d in used\n",h->ProtocolInUse); + } + else + { + printf(PANEL_NAME "No Common Protocol\n"); + } + break; + + default: + printf(PANEL_NAME "Invalid data received\n"); + break; + } + LengthInBuffer -= Pkt->Data[PACKETLEN]; + i += Pkt->Data[PACKETLEN]; // Pkt=(CommandPacket *)&(Pkt->Data[Pkt->Data[PACKETLEN]]); + } else { + ReadStart = LengthInBuffer; + for (int j = 0; j < LengthInBuffer; j ++) { + Pkt->Data[j] = Pkt->Data[i + j]; + } + printf(PANEL_NAME "Partial Packet Read"); + } + } + } else { + if (LengthInBuffer < 0) { + if (errno != EINTR) { + printf(PANEL_NAME "recv"); + NoError = FALSE; + } + } else { + printf(PANEL_NAME "closed connection\n"); + NoError = FALSE; + } + } + } + } else if (select_res == 0) { + NoData = true; + } else if (errno != EINTR) { +#ifdef __MINGW32__ + closesocket(h->socket); +#else + close(h->socket); +#endif + h->socket = - 1; /* act like we never connected */ + perror(PANEL_NAME "select error"); + NoError = FALSE; + } + } + } + + free(PktPtr); + + return NewData; +} + +bool panel_open(panel_connection_t* h) +{ + int rv; +#ifdef __MINGW32__ + struct sockaddr_in remote; +#else + struct sockaddr_in remote; +#endif + + bool returnval = false; + +#ifdef __MINGW32__ + printf("__MINGW32__\n"); +#else + printf("NOT __MINGW32__\n"); +#endif + + h->socket=-1; + h->ProtocolInUse=-1; + +#ifdef __MINGW32__ + WSADATA wsadata; + if (WSAStartup(MAKEWORD(1, 1), &wsadata) == SOCKET_ERROR) { + printf("Error creating socket.\n"); + } + else +#endif + { + if ((h->socket = socket(AF_INET, SOCK_STREAM, 0)) != - 1) { +#ifdef __MINGW32__ + memset((char *)&remote, 0, sizeof(remote)); + remote.sin_family = AF_INET; + remote.sin_port = htons(DEFAULT_PORT); + remote.sin_addr.s_addr = inet_addr("127.0.0.1"); +#else + bzero((char *)&remote, sizeof(remote)); + remote.sin_family = AF_INET; + remote.sin_port = htons(DEFAULT_PORT); + remote.sin_addr.s_addr = inet_addr("127.0.0.1"); +#endif + if ((rv=connect(h->socket, (struct sockaddr *) &remote, sizeof (remote))) != - 1) { +#ifdef __MINGW32__ + char value = 1; + setsockopt(h->socket, IPPROTO_TCP, TCP_NODELAY, &value, sizeof ( value)); + +#endif + FD_ZERO(&h->fds); + + /* Set our connected socket */ + FD_SET(h->socket, &h->fds); + + printf(PANEL_NAME "Connected OK %d\n",rv); + + panel_send_protocol_command(h); + + returnval=true; + } else { + printf(PANEL_NAME "connection Failes %d\n",rv); +#ifdef __MINGW32__ + closesocket(h->socket); +#else + close(h->socket); +#endif + h->socket = - 1; + } + } + } + return returnval; +} + -- 2.13.0.windows.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42721) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dBE0f-0004R1-U7 for qemu-devel@nongnu.org; Thu, 18 May 2017 01:30:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dBE0b-0007XD-OX for qemu-devel@nongnu.org; Thu, 18 May 2017 01:30:01 -0400 Resent-Message-Id: In-Reply-To: <536fb79a-5753-4143-a5a6-7a189ef5137e@ONE.local> Message-ID: <149508537961.609.12608690738396744114@c05f1edc8ed1> Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 From: no-reply@patchew.org Date: Wed, 17 May 2017 22:29:40 -0700 (PDT) Subject: Re: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flytart@gmail.com Cc: famz@redhat.com, qemu-devel@nongnu.org, flypie@rocketmail.com, peter.maydell@linaro.org, qemu-arm@nongnu.org SGksCgpUaGlzIHNlcmllcyBmYWlsZWQgYXV0b21hdGljIGJ1aWxkIHRlc3QuIFBsZWFzZSBmaW5k IHRoZSB0ZXN0aW5nIGNvbW1hbmRzIGFuZAp0aGVpciBvdXRwdXQgYmVsb3cuIElmIHlvdSBoYXZl IGRvY2tlciBpbnN0YWxsZWQsIHlvdSBjYW4gcHJvYmFibHkgcmVwcm9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CiAgR0VO ICAgICB0cmFjZS9nZW5lcmF0ZWQtaGVscGVycy5oCiAgR0VOICAgICB0cmFjZS9nZW5lcmF0ZWQt aGVscGVycy5jCiAgR0VOICAgICBtb2R1bGVfYmxvY2suaAogIEdFTiAgICAgdGVzdHMvdGVzdC1x YXBpLXR5cGVzLmgKICBHRU4gICAgIHRlc3RzL3Rlc3QtcWFwaS12aXNpdC5oCiAgR0VOICAgICB0 ZXN0cy90ZXN0LXFhcGktZXZlbnQuaAogIEdFTiAgICAgdGVzdHMvdGVzdC1xbXAtY29tbWFuZHMu aAogIEdFTiAgICAgdGVzdHMvdGVzdC1xbXAtaW50cm9zcGVjdC5oCiAgR0VOICAgICB0cmFjZS1y b290LmgKICBHRU4gICAgIHV0aWwvdHJhY2UuaAogIEdFTiAgICAgY3J5cHRvL3RyYWNlLmgKICBH RU4gICAgIGlvL3RyYWNlLmgKICBHRU4gICAgIG1pZ3JhdGlvbi90cmFjZS5oCiAgR0VOICAgICBi bG9jay90cmFjZS5oCiAgR0VOICAgICBiYWNrZW5kcy90cmFjZS5oCiAgR0VOICAgICBody9ibG9j ay90cmFjZS5oCiAgR0VOICAgICBody9ibG9jay9kYXRhcGxhbmUvdHJhY2UuaAogIEdFTiAgICAg aHcvY2hhci90cmFjZS5oCiAgR0VOICAgICBody9pbnRjL3RyYWNlLmgKICBHRU4gICAgIGh3L25l dC90cmFjZS5oCiAgR0VOICAgICBody92aXJ0aW8vdHJhY2UuaAogIEdFTiAgICAgaHcvYXVkaW8v dHJhY2UuaAogIEdFTiAgICAgaHcvbWlzYy90cmFjZS5oCiAgR0VOICAgICBody91c2IvdHJhY2Uu aAogIEdFTiAgICAgaHcvc2NzaS90cmFjZS5oCiAgR0VOICAgICBody9udnJhbS90cmFjZS5oCiAg R0VOICAgICBody9kaXNwbGF5L3RyYWNlLmgKICBHRU4gICAgIGh3L2lucHV0L3RyYWNlLmgKICBH RU4gICAgIGh3L3RpbWVyL3RyYWNlLmgKICBHRU4gICAgI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aC5vCiAgQ0MgICAgICBxYXBpL3N0cmluZy1pbnB1 dC12aXNpdG9yLm8KICBDQyAgICAgIHFhcGkvc3RyaW5nLW91dHB1dC12aXNpdG9yLm8KICBDQyAg ICAgIHFhcGkvb3B0cy12aXNpdG9yLm8KICBDQyAgICAgIHFhcGkvcWFwaS1jbG9uZS12aXNpdG9y Lm8KICBDQyAgICAgIHFhcGkvcWFwaS11dGlsLm8KICBDQyAgICAgIHFhcGkvcW1wLWV2ZW50Lm8K ICBDQyAgICAgIHFvYmplY3QvcW51bGwubwogIENDICAgICAgcW9iamVjdC9xaW50Lm8KICBDQyAg ICAgIHFvYmplY3QvcXN0cmluZy5vCiAgQ0MgICAgICBxb2JqZWN0L3FkaWN0Lm8KICBDQyAgICAg IHFvYmplY3QvcWZsb2F0Lm8KICBDQyAgICAgIHFvYmplY3QvcWxpc3QubwogIENDICAgICAgcW9i amVjdC9xYm9vbC5vCiAgQ0MgICAgICBxb2JqZWN0L3Fqc29uLm8KICBDQyAgICAgIHFvYmplY3Qv cW9iamVjdC5vCiAgQ0MgICAgICBxb2JqZWN0L2pzb24tbGV4ZXIubwogIENDICAgICAgcW9iamVj dC9qc29uLXN0cmVhbWVyLm8KICBDQyAgICAgIHFvYmplY3QvanNvbi1wYXJzZXIubwogIENDICAg ICAgdHJhY2UvY29udHJvbC5vCiAgQ0MgICAgICB0cmFjZS9xbXAubwogIENDICAgICAgdXRpbC9v c2RlcC5vCiAgQ0MgICAgICB1dGlsL2N1dGlscy5vCiAgQ0MgICAgICB1dGlsL3VuaWNvZGUubwog IENDICAgICAgdXRpbC9xZW11LXRpbWVyLWNvbW1vbi5vCiAgQ0MgICAgICB1dGlsL2J1ZmZlcmlz emVyby5vCiAgQ0MgICAgICB1dGlsL2xvY2tjbnQubwogIENDICAgICAgdXRpbC9haW9jYi5vCiAg Q0MgICAgICB1dGlsL2FzeW5jLm8KICBDQyAgICAgIHV0aWwvdGhyZWFkLXBvb2wubwogIENDICAg ICAgdXRpbC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IENDICAgICAgaHcvbmV0L3RyYWNlLm8KICBDQyAgICAgIGh3L3ZpcnRpby90cmFj ZS5vCiAgQ0MgICAgICBody9hdWRpby90cmFjZS5vCiAgQ0MgICAgICBody9taXNjL3RyYWNlLm8K ICBDQyAgICAgIGh3L3VzYi90cmFjZS5vCiAgQ0MgICAgICBody9kaXNwbGF5L3RyYWNlLm8KICBD QyAgICAgIGh3L252cmFtL3RyYWNlLm8KICBDQyAgICAgIGh3L3Njc2kvdHJhY2UubwogIENDICAg ICAgaHcvdGltZXIvdHJhY2UubwogIENDICAgICAgaHcvaW5wdXQvdHJhY2UubwogIENDICAgICAg aHcvZG1hL3RyYWNlLm8KICBDQyAgICAgIGh3L3NwYXJjL3RyYWNlLm8KICBDQyAgICAgIGh3L3Nk L3RyYWNlLm8KICBDQyAgICAgIGh3L2lzYS90cmFjZS5vCiAgQ0MgICAgICBody9tZW0vdHJhY2Uu bwogIENDICAgICAgaHcvaTM4Ni90cmFjZS5vCiAgQ0MgICAgICBody9pMzg2L3hlbi90cmFjZS5v CiAgQ0MgICAgICBody85cGZzL3RyYWNlLm8KICBDQyAgICAgIGh3L3BwYy90cmFjZS5vCiAgQ0Mg ICAgICBody9wY2kvdHJhY2UubwogIENDICAgICAgaHcvczM5MHgvdHJhY2UubwogIENDICAgICAg aHcvdmZpby90cmFjZS5vCiAgQ0MgICAgICBody9hcm0vdHJhY2UubwogIENDICAgICAgaHcvYWNw aS90cmFjZS5vCiAgQ0MgICAgICBody9hbHBoYS90cmFjZS5vCiAgQ0MgICAgICBody94ZW4vdHJh Y2UubwogIENDICAgICAgdWkvdHJhY2UubwogIENDICAgICAgYXVkaW8vdHJhY2UubwogIENDICAg ICAgbmV0L3RyYWNlLm8KICBDQyAgICAgIHRhcmdldC9hcm0vdHJhY2UubwogIENDICAgICAgdGFy Z2V0L2kzODYvdHJhY2UubwogIENDICAgICAgdGFyZ2V0L21pcHMvdHJhY2UubwogIENDICAgICAg dGFyZ2V0L3NwYXJjL3R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dkb2NrZXItcnVuLXRlc3QtcXVpY2tAY2VudG9zNicgZmFpbGVkCm1ha2U6ICoqKiBbZG9j a2VyLXJ1bi10ZXN0LXF1aWNrQGNlbnRvczZdIEVycm9yIDIKPT09IE9VVFBVVCBFTkQgPT09CgpU ZXN0IGNvbW1hbmQgZXhpdGVkIHdpdGggY29kZTogMgoKCi0tLQpFbWFpbCBnZW5lcmF0ZWQgYXV0 b21hdGljYWxseSBieSBQYXRjaGV3IFtodHRwOi8vcGF0Y2hldy5vcmcvXS4KUGxlYXNlIHNlbmQg eW91ciBmZWVkYmFjayB0byBwYXRjaGV3LWRldmVsQGZyZWVsaXN0cy5vcmc= From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42896) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dBE21-0005DY-IB for qemu-devel@nongnu.org; Thu, 18 May 2017 01:31:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dBE1x-00086g-EN for qemu-devel@nongnu.org; Thu, 18 May 2017 01:31:25 -0400 Resent-Message-Id: In-Reply-To: <536fb79a-5753-4143-a5a6-7a189ef5137e@ONE.local> Message-ID: <149508547028.609.9088696617244871022@c05f1edc8ed1> Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 From: no-reply@patchew.org Date: Wed, 17 May 2017 22:31:10 -0700 (PDT) Subject: Re: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flytart@gmail.com Cc: famz@redhat.com, qemu-devel@nongnu.org, flypie@rocketmail.com, peter.maydell@linaro.org, qemu-arm@nongnu.org SGksCgpUaGlzIHNlcmllcyBzZWVtcyB0byBoYXZlIHNvbWUgY29kaW5nIHN0eWxlIHByb2JsZW1z LiBTZWUgb3V0cHV0IGJlbG93IGZvcgptb3JlIGluZm9ybWF0aW9uOgoKU3Vi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ToKKyAgICBmb3IgKGkgPSAwOyBpIDwgY291bnQ7IGkgKyspIHsKICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgXgoKRVJST1I6IHNwYWNlIHByb2hpYml0ZWQgYmVm b3JlIHRoYXQgJysrJyAoY3R4Old4QikKIzEyMTogRklMRTogaHcvZ3Bpby9iY20yODM1X2dwaW8u YzoxMzY6CisgICAgZm9yIChpID0gMDsgaSA8IGNvdW50OyBpICsrKSB7CiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIF4KCkVSUk9SOiBzcGFjZSBwcm9oaWJpdGVkIGFmdGVyIHRoYXQgJ34n IChjdHg6V3hXKQojMTI5OiBGSUxFOiBody9ncGlvL2JjbTI4MzVfZ3Bpby5jOjE0MzoKKyAgICAq bGV2ICY9IH4gdmFsOwogICAgICAgICAgICAgXgoKRVJST1I6IHN3aXRjaCBhbmQgY2FzZSBzaG91 bGQgYmUgYXQgdGhlIHNhbWUgaW5kZW50CiMxNDE6IEZJTEU6IGh3L2dwaW8vYmNtMjgzNV9ncGlv LmM6MTUyOgogICAgIHN3aXRjaCAob2Zmc2V0KSB7CisgICAgICAgIGNhc2UgR1BGU0VMMDoKKyAg ICAgICAgY2FzZSBHUEZTRUwxOgorICAgICAgICBjYXNlIEdQRlNFTDI6CisgICAgICAgIGNhc2Ug R1BGU0VMMzoKKyAgICAgICAgY2FzZSBHUEZTRUw0OgorICAgICAgICBjYXNlIEdQRlNFTDU6Clsu Li5dCisgICAgICAgIGNhc2UgR1BTRVQwOgorICAgICAgICBjYXNlIEdQU0VUMToKWy4uLl0KKyAg ICAgICAgY2FzZSBHUENMUjA6CisgICAgICAgIGNhc2UgR1BDTFIxOgpbLi4uXQorICAgICAgICBj YXNlIEdQTEVWMDoKWy4uLl0KKyAgICAgICAgY2FzZSBHUExFVjE6ClsuLi5dCisgICAgICAgIGNh c2UgR1BFRFMwOgorICAgICAgICBjYXNlIEdQRURTMToKKyAgICAgICAgY2FzZSBHUFJFTjA6Cisg ICAgICAgIGNhc2UgR1BSRU4xOgorICAgICAgICBjYXNlIEdQRkVOMDoKKyAgICAgICAgY2FzZSBH UEZFTjE6CisgICAgICAgIGNhc2UgR1BIRU4wOgorICAgICAgICBjYXNlIEdQSEVOMToKKyAgICAg ICAgY2FzZSBHUExFTjA6CisgICAgICAgIGNhc2UgR1BMRU4xOgorICAgICAgICBjYXNlIEdQQVJF TjA6CisgICAgICAgIGNhc2UgR1BBUkVOMToKKyAgICAgICAgY2FzZSBHUEFGRU4wOgorICAgICAg ICBjYXNlIEdQQUZFTjE6CisgICAgICAgIGNhc2UgR1BQVUQ6CisgICAgICAgIGNhc2UgR1BQVURD TEswOgorICAgICAgICBjYXNlIEdQUFVEQ0xLMToKWy4uLl0KKyAgICAgICAgZGVmYXVsdDoKCkVS Uk9SOiBzcGFjZSBwcm9oaWJpdGVkIGFmdGVyIHRoYXQgJy0nIChjdHg6V3hXKQojMjAwOiBGSUxF OiBody9ncGlvL2JjbTI4MzVfZ3Bpby5jOjE2OToKKyAgICAgICAgICAgIGlmIChzLT5wYW5lbC5z b2NrZXQgIT0gLSAxKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF4KCkVS Uk9SOiBzcGFjZSBwcm9oaWJpdGVkIGFmdGVyIHRoYXQgJy0nIChjdHg6V3hXKQojMjA4OiBGSUxF OiBody9ncGlvL2JjbTI4MzVfZ3Bpby5jOjE3NzoKKyAgICAgICAgICAgIGlmIChzLT5wYW5lbC5z b2NrZXQgIT0gLSAxKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF4KCkVS Uk9SOiBzd2l0Y2ggYW5kIGNhc2Ugc2hvdWxkIGJlIGF0IHRoZSBzYW1lIGluZGVudAojMjUyOiBG SUxFOiBody9ncGlvL2JjbTI4MzVfZ3Bpby5jOjIxOToKICAgICBzd2l0Y2ggKG9mZnNldCkgewor ICAgICAgICBjYXNlIEdQRlNFTDA6CisgICAgICAgIGNhc2UgR1BGU0VMMToKKyAgICAgICAgY2Fz ZSBHUEZTRUwyOgorICAgICAgICBjYXNlIEdQRlNFTDM6CisgICAgICAgIGNhc2UgR1BGU0VMNDoK KyAgICAgICAgY2FzZSBHUEZTRUw1OgpbLi4uXQorICAgICAgICBjYXNlIEdQU0VUMDoKWy4uLl0K KyAgICAgICAgY2FzZSBHUFNFVDE6ClsuLi5dCisgICAgICAgIGNhc2UgR1BDTFIwOgpbLi4uXQor ICAgICAgICBjYXNlIEdQQ0xSMToKWy4uLl0KKyAgICAgICAgY2FzZSBHUExFVjA6CisgICAgICAg IGNhc2UgR1BMRVYxOgpbLi4uXQorICAgICAgICBjYXNlIEdQRURTMDoKKyAgICAgICAgY2FzZSBH UEVEUzE6CisgICAgICAgIGNhc2UgR1BSRU4wOgorICAgICAgICBjYXNlIEdQUkVOMToKKyAgICAg ICAgY2FzZSBHUEZFTjA6CisgICAgICAgIGNhc2UgR1BGRU4xOgorICAgICAgICBjYXNlIEdQSEVO MDoKKyAgICAgICAgY2FzZSBHUEhFTjE6CisgICAgICAgIGNhc2UgR1BMRU4wOgorICAgICAgICBj YXNlIEdQTEVOMToKKyAgICAgICAgY2FzZSBHUEFSRU4wOgorICAgICAgICBjYXNlIEdQQVJFTjE6 CisgICAgICAgIGNhc2UgR1BBRkVOMDoKKyAgICAgICAgY2FzZSBHUEFGRU4xOgorICAgICAgICBj YXNlIEdQUFVEOgorICAgICAgICBjYXNlIEdQUFVEQ0xLMDoKKyAgICAgICAgY2FzZSBHUFBVRENM SzE6ClsuLi5dCisgICAgICAgIGRlZmF1bHQ6CgpFUlJPUjogc3BhY2UgcHJvaGliaXRlZCBhZnRl ciB0aGF0ICctJyAoY3R4Old4VykKIzMwODogRklMRTogaHcvZ3Bpby9iY20yODM1X2dwaW8uYzoy MzA6CisgICAgICAgICAgICBpZiAocy0+cGFuZWwuc29ja2V0ICE9IC0gMSkgewogICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBeCgpXQVJOSU5HOi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VjdGlvbl90KiBoKQoKRVJST1I6ICJmb28qIGJhciIgc2hvdWxkIGJl ICJmb28gKmJhciIKIzY1ODogRklMRTogdXRpbC9QYW5lbEVtdS5jOjc1Ogordm9pZCBzZW5kZGF0 YXRvcGFuZWwocGFuZWxfY29ubmVjdGlvbl90KiBoLCB1aW50NjRfdCBwaW4sIGJvb2wgdmFsKQoK RVJST1I6IHNwYWNlcyByZXF1aXJlZCBhcm91bmQgdGhhdCAnLScgKGN0eDpWeFYpCiM2NjI6IEZJ TEU6IHV0aWwvUGFuZWxFbXUuYzo3OToKKyAgICBQa3QuRGF0YVtQQUNLRVRMRU5dID0gKGNoYXIg KikgJlBrdC5EYXRhWzYgKyAxXS0oY2hhciAqKSAmUGt0LkRhdGFbMF07CiAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBeCgpFUlJPUjogc3BhY2VzIHJl cXVpcmVkIGFyb3VuZCB0aGF0ICcmJyAoY3R4OlZ4VikKIzY2NTogRklMRTogdXRpbC9QYW5lbEVt dS5jOjgyOgorICAgIFBrdC5EYXRhWzNdID0gKHVuc2lnbmVkIHNob3J0IGludCkgKChwaW4gPj4g MTYpJjB4RkZGRik7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBeCgpFUlJPUjogc3BhY2VzIHJlcXVpcmVkIGFyb3VuZCB0aGF0ICcmJyAoY3R4OlZ4 VikKIzY2NzogRklMRTogdXRpbC9QYW5lbEVtdS5jOjg0OgorICAgIFBrdC5EYXRhWzVdID0gKHVu c2lnbmVkIHNob3J0IGludCkgKChwaW4gPj4gNDgpJjB4RkZGRik7CiAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBeCgpFUlJPUjogImZvbyogYmFyIiBz aG91bGQgYmUgImZvbyAqYmFyIgojNjczOiBGSUxFOiB1dGlsL1BhbmVsRW11LmM6OTA6Cit2b2lk IHNlbmRwaW5jb3VudChwYW5lbF9jb25uZWN0aW9uX3QqIGgsIGludCB2YWwpCgpFUlJPUjogc3Bh Y2VzIHJlcXVpcmVkIGFyb3VuZCB0aGF0ICctJyAoY3R4OlZ4VikKIzY3NzogRklMRTogdXRpbC9Q YW5lbEVtdS5jOjk0OgorICAgIFBrdC5EYXRhW1BBQ0tFVExFTl0gPSAoY2hhciAqKSAmUGt0LkRh dGFbMiArIDFdLShjaGFyICopICZQa3QuRGF0YVswXTsKICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIF4KCkVSUk9SOiAiZm9vKiBiYXIiIHNob3VsZCBi ZSAiZm9vICpiYXIiCiM2ODQ6IEZJTEU6IHV0aWwvUGFuZWxFbXUuYzoxMDE6Cit2b2lkIHNlbmRl bmFibGVkbWFwKHBhbmVsX2Nvbm5lY3Rpb25fdCogaCwgdWludDY0X3QgcGluKQoKRVJST1I6IHNw YWNlcyByZXF1aXJlZCBhcm91bmQgdGhhdCAnLScgKGN0eDpWeFYpCiM2ODg6IEZJTEU6IHV0aWwv UGFuZWxFbXUuYzoxMDU6CisgICAgUGt0LkRhdGFbUEFDS0VUTEVOXSA9IChjaGFyICopICZQa3Qu RGF0YVs1ICsgMV0tKGNoYXIgKikgJlBrdC5EYXRhWzBdOwogICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXgoKRVJST1I6IHNwYWNlcyByZXF1aXJlZCBh cm91bmQgdGhhdCAnJicgKGN0eDpWeFYpCiM2OTE6IEZJTEU6IHV0aWwvUGFuZWxFbXUuYzoxMDg6 CisgICAgUGt0LkRhdGFbM10gPSAodW5zaWduZWQgc2hvcnQgaW50KSAoKHBpbiA+PiAxNikmMHhG RkZGKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IF4KCkVSUk9SOiBzcGFjZXMgcmVxdWlyZWQgYXJvdW5kIHRoYXQgJyYnIChjdHg6VnhWKQojNjkz OiBGSUxFOiB1dGlsL1BhbmVsRW11LmM6MTEwOgorICAgIFBrdC5EYXRhWzVdID0gKHVuc2lnbmVk IHNob3J0IGludCkgKChwaW4gPj4gNDgpJjB4RkZGRik7CiAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBeCgpFUlJPUjogImZvbyogYmFyIiBzaG91bGQg YmUgImZvbyAqYmFyIgojNjk4OiBGSUxFOiB1dGlsL1BhbmVsRW11LmM6MTE1Ogordm9pZCBzZW5k aW5wdXRtYXAocGFuZWxfY29ubmVjdGlvbl90KiBoLCB1aW50NjRfdCBwaW4pCgpFUlJPUjogc3Bh Y2VzIHJlcXVpcmVkIGFyb3VuZCB0aGF0ICctJyAoY3R4OlZ4VikKIzcwMjogRklMRTogdXRpbC9Q YW5lbEVtdS5jOjExOToKKyAgICBQa3QuRGF0YVtQQUNLRVRMRU5dID0gKGNoYXIgKikgJlBrdC5E YXRhWzUgKyAxXS0oY2hhciAqKSAmUGt0LkRhdGFbMF07CiAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBeCgpFUlJPUjogc3BhY2VzIHJlcXVpcmVkIGFy b3VuZCB0aGF0ICcmJyAoY3R4OlZ4VikKIzcwNTogRklMRTogdXRpbC9QYW5lbEVtdS5jOjEyMjoK KyAgICBQa3QuRGF0YVszXSA9ICh1bnNpZ25lZCBzaG9ydCBpbnQpICgocGluID4+IDE2KSYweEZG RkYpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg XgoKRVJST1I6IHNwYWNlcyByZXF1aXJlZCBhcm91bmQgdGhhdCAnJicgKGN0eDpWeFYpCiM3MDc6 IEZJTEU6IHV0aWwvUGFuZWxFbXUuYzoxMjQ6CisgICAgUGt0LkRhdGFbNV0gPSAodW5zaWduZWQg c2hvcnQgaW50KSAoKHBpbiA+PiA0OCkmMHhGRkZGKTsKICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIF4KCkVSUk9SOiAiZm9vKiBiYXIiIHNob3VsZCBi ZSAiZm9vICpiYXIiCiM3MTI6IEZJTEU6IHV0aWwvUGFuZWxFbXUuYzoxMjk6Cit2b2lkIHNlbmRv dXRwdXRtYXAocGFuZWxfY29ubmVjdGlvbl90KiBoLCB1aW50NjRfdCBwaW4pCgpFUlJPUjogc3Bh Y2VzIHJlcXVpcmVkIGFyb3VuZCB0aGF0ICctJyAoY3R4OlZ4VikKIzcxNjogRklMRTogdXRpbC9Q YW5lbEVtdS5jOjEzMzoKKyAgICBQa3QuRGF0YVtQQUNLRVRMRU5dID0gKGNoYXIgKikgJlBrdC5E YXRhWzUgKyAxXS0oY2hhciAqKSAmUGt0LkRhdGFbMF07CiAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBeCgpFUlJPUjogc3BhY2VzIHJlcXVpcmVkIGFy b3VuZCB0aGF0ICcmJyAoY3R4OlZ4VikKIzcxOTogRklMRTogdXRpbC9QYW5lbEVtdS5jOjEzNjoK KyAgICBQa3QuRGF0YVszXSA9ICh1bnNpZ25lZCBzaG9ydCBpbnQpICgocGluID4+IDE2KSYweEZG RkYpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg XgoKRVJST1I6IHNwYWNlcyByZXF1aXJlZCBhcm91bmQgdGhhdCAnJicgKGN0eDpWeFYpCiM3MjE6 IEZJTEU6IHV0aWwvUGFuZWxFbXUuYzoxMzg6CisgICAgUGt0LkRhdGFbNV0gPSAodW5zaWduZWQg c2hvcnQgaW50KSAoKHBpbiA+PiA0OCkmMHhGRkZGKTsKICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIF4KCkVSUk9SOiBzcGFjZSBwcm9oaWJpdGVkIGFm dGVyIHRoYXQgJy0nIChjdHg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3YoaC0+c29ja2V0LCAoY2hhciAqKSAmUGt0W1JlYWRTdGFydF0sIHNp emVvZiAoKlBrdCkgLSBSZWFkU3RhcnQsIDApKSA+IDApIHsKCkVSUk9SOiBkbyBub3QgdXNlIGFz c2lnbm1lbnQgaW4gaWYgY29uZGl0aW9uCiM3NzA6IEZJTEU6IHV0aWwvUGFuZWxFbXUuYzoxODc6 CisgICAgICAgICAgICAgICAgICAgIGlmICgoTGVuZ3RoSW5CdWZmZXIgPSByZWN2KGgtPnNvY2tl dCwgKGNoYXIgKikgJlBrdFtSZWFkU3RhcnRdLCBzaXplb2YgKCpQa3QpIC0gUmVhZFN0YXJ0LCAw KSkgPiAwKSB7CgpFUlJPUjogc3BhY2UgcHJvaGliaXRlZCBiZWZvcmUgdGhhdCAnKysnIChjdHg6 V3hCKQojNzcyOiBGSUxFOiB1dGlsL1BhbmVsRW11LmM6MTg5OgorICAgICAgICAgICAgICAgICAg ICAgICAgZm9yIChpbnQgaSA9IDA7IExlbmd0aEluQnVmZmVyID4gMDsgaSArKykgewogICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBe CgpFUlJPUjogdGhhdCBvcGVuIGJyYWNlIHsgc2hvdWxkIGJlIG9uIHRoZSBwcmV2aW91cyBsaW5l CiM3NzQ6IEZJTEU6IHV0aWwvUGFuZWxFbXUuYzoxOTE6CisgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHN3aXRjaCAoUGt0LT5EYXRhW2kgKyBQQUNLRVRUWVBFXSkKKyAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgewoKV0FSTklORzogbGluZSBvdmVyIDgwIGNoYXJhY3RlcnMK Izc3ODogRklMRTogdXRpbC9QYW5lbEVtdS5jOjE5NToKKyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAqRGF0YSB8PSAoKHVpbnQ2NF90KSBQa3QtPkRhdGFbaSArIDNdKSA8 PCAxNjsKCldBUk5JTkc6IGxpbmUgb3ZlciA4MCBjaGFyYWN0ZXJzCiM3Nzk6IEZJTEU6IHV0aWwv UGFuZWxFbXUuYzoxOTY6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg KkRhdGEgfD0gKCh1aW50NjRfdCkgUGt0LT5EYXRhW2kgKyA0XSkgPDwgMzI7CgpXQVJOSU5HOiBs aW5lIG92ZXIgODAgY2hhcmFjdGVycwojNzgwOiBGSUxFOiB1dGlsL1BhbmVsRW11LmM6MTk3Ogor ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICpEYXRhIHw9ICgodWludDY0 X3QpIFBrdC0+RGF0YVtpICsgNV0pIDw8IDQ4OwoKV0FSTklORzogbGluZSBvdmVyIDgwIGNoYXJh Y3RlcnMKIzc4NjogRklMRTogdXRpbC9QYW5lbEVtdS5jOjIwMzoKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBoLT5Qcm90b2NvbEluVXNlID0gKGludCkgUGt0LT5EYXRh W2kgKyAyXTsKCkVSUk9SOiB0aGF0IG9wZW4gYnJhY2UgeyBzaG91bGQgYmUgb24gdGhlIHByZXZp b3VzIGxpbmUKIzc4NzogRklMRTogdXRpbC9QYW5lbEVtdS5jOjIwNDoKKyAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBpZihoLT5Qcm90b2NvbEluVXNlIT0tMSkKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CgpFUlJPUjogc3BhY2VzIHJlcXVp cmVkIGFyb3VuZCB0aGF0ICchPScgKGN0eDpWeE8pCiM3ODc6IEZJTEU6IHV0aWwvUGFuZWxFbXUu YzoyMDQ6CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoaC0+UHJv dG9jb2xJblVzZSE9LTEpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIF4KCkVSUk9SOiBzcGFjZSByZXF1aXJlZCBiZWZvcmUgdGhhdCAn LScgKGN0eDpPeFYpCiM3ODc6IEZJTEU6IHV0aWwvUGFuZWxFbXUuYzoyMDQ6CisgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoaC0+UHJvdG9jb2xJblVzZSE9LTEpCiAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgXgoKRVJST1I6IHNwYWNlIHJlcXVpcmVkIGJlZm9yZSB0aGUgb3BlbiBwYXJlbnRoZXNpcyAn KCcKIzc4NzogRklMRTogdXRpbC9QYW5lbEVtdS5jOjIwNDoKKyAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBpZihoLT5Qcm90b2NvbEluVXNlIT0tMSkKCkVSUk9SOiBsaW5l IG92ZXIgOTAgY2hhcmFjdGVycwojNzg5OiBGSUxFOiB1dGlsL1BhbmVsRW11LmM6MjA2OgorICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmludGYoUEFORUxfTkFN RSAiUHJvdG9jb2wgJWQgaW4gdXNlZFxuIixoLT5Qcm90b2NvbEluVXNlKTsKCkVSUk9SOiBzcGFj ZSByZXF1aXJlZCBhZnRlciB0aGF0ICcsJyAoY3R4OlZ4VikKIzc4OTogRklMRTogdXRpbC9QYW5l bEVtdS5jOjIwNjoKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg cHJpbnRmKFBBTkVMX05BTUUgIlByb3RvY29sICVkIGluIHVzZWRcbiIsaC0+UHJvdG9jb2xJblVz ZSk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXgoKRVJST1I6IHRoYXQgb3BlbiBicmFj ZSB7IHNob3VsZCBiZSBvbiB0aGUgcHJldmlvdXMgbGluZQojNzkxOiBGSUxFOiB1dGlsL1BhbmVs RW11LmM6MjA4OgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UK KyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7CgpFUlJPUjogZWxzZSBz aG91bGQgZm9sbG93IGNsb3NlIGJyYWNlICd9JwojNzkxOiBGSUxFOiB1dGlsL1BhbmVsRW11LmM6 MjA4OgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCgpFUlJPUjogdHJhaWxpbmcgd2hp dGVzcGFjZQojNzkzOiBGSUxFOiB1dGlsL1BhbmVsRW11LmM6MjEwOgorICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmludGYoUEFORUxfTkFNRSAiTm8gQ29tbW9u IFByb3RvY29sXG4iKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICQKCkVSUk9SOiBsaW5lIG92ZXIgOTAgY2hhcmFjdGVycwojNzkzOiBGSUxFOiB1dGlsL1BhbmVs RW11LmM6MjEwOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBw cmludGYoUEFORUxfTkFNRSAiTm8gQ29tbW9uIFByb3RvY29sXG4iKTsgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIAoKV0FSTklORzogbGluZSBvdmVyIDgwIGNoYXJh Y3RlcnMKIzc5ODogRklMRTogdXRpbC9QYW5lbEVtdS5jOjIxNToKKyAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBwcmludGYoUEFORUxfTkFNRSAiSW52YWxpZCBkYXRhIHJl Y2VpdmVkXG4iKTsKCkVSUk9SOiBsaW5lIG92ZXIgOTAgY2hhcmFjdGVycwojODAyOiBGSUxFOiB1 dGlsL1BhbmVsRW11LmM6MjE5OgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpICs9 IFBrdC0+RGF0YVtQQUNLRVRMRU5dOyAvLwkJCQkJCQkJUGt0PShDb21tYW5kUGFja2V0ICopJihQ a3QtPkRhdGFbUGt0LT5EYXRhW1BBQ0tFVExFTl1dKTsKCkVSUk9SOiBjb2RlIGluZGVudCBzaG91 bGQgbmV2ZXIgdXNlIHRhYnMKIzgwMjogRklMRTogdXRpbC9QYW5lbEVtdS5jOjIxOToKKyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgaSArPSBQa3QtPkRhdGFbUEFDS0VUTEVOXTsgLy9e SV5JXkleSV5JXkleSV5JUGt0PShDb21tYW5kUGFja2V0ICopJihQa3QtPkRhdGFbUGt0LT5EYXRh W1BBQ0tFVExFTl1dKTskCgpFUlJPUjogZG8gbm90IHVzZSBDOTkgLy8gY29tbWVudHMKIzgwMjog RklMRTogdXRpbC9QYW5lbEVtdS5jOjIxOToKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgaSArPSBQa3QtPkRhdGFbUEFDS0VUTEVOXTsgLy8JCQkJCQkJCVBrdD0oQ29tbWFuZFBhY2tl dCAqKSYoUGt0LT5EYXRhW1BrdC0+RGF0YVtQQUNLRVRMRU5dXSk7CgpFUlJPUjogc3BhY2UgcHJv aGliaXRlZCBiZWZvcmUgdGhhdCAnKysnIChjdHg6V3hCKQojODA1OiBGSUxFOiB1dGlsL1BhbmVs RW11LmM6MjIyOgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBqID0g MDsgaiA8IExlbmd0aEluQnVmZmVyOyBqICsrKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXgoKV0FSTklORzog YXJjaGl0ZWN0dXJlIHNwZWNpZmljIGRlZmluZXMgc2hvdWxkIGJlIGF2b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HRoYXQgJz0nIChjdHg6 VnhWKQojODgzOiBGSUxFOiB1dGlsL1BhbmVsRW11LmM6MzAwOgorICAgICAgICAgICAgaWYgKChy dj1jb25uZWN0KGgtPnNvY2tldCwgKHN0cnVjdCBzb2NrYWRkciAqKSAmcmVtb3RlLCBzaXplb2Yg KHJlbW90ZSkpKSAhPSAtIDEpIHsKICAgICAgICAgICAgICAgICAgICBeCgpFUlJPUjogc3BhY2Ug cHJvaGliaXRlZCBhZnRlciB0aGF0ICctJyAoY3R4Old4VykKIzg4MzogRklMRTogdXRpbC9QYW5l bEVtdS5jOjMwMDoKKyAgICAgICAgICAgIGlmICgocnY9Y29ubmVjdChoLT5zb2NrZXQsIChzdHJ1 Y3Qgc29ja2FkZHIgKikgJnJlbW90ZSwgc2l6ZW9mIChyZW1vdGUpKSkgIT0gLSAxKSB7CiAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIF4KCkVSUk9SOiBkbyBub3QgdXNlIGFzc2lnbm1l bnQgaW4gaWYgY29uZGl0aW9uCiM4ODM6IEZJTEU6IHV0aWwvUGFuZWxFbXUuYzozMDA6CisgICAg ICAgICAgICBpZiAoKHJ2PWNvbm5lY3QoaC0+c29ja2V0LCAoc3RydWN0IHNvY2thZGRyICopICZy ZW1vdGUsIHNpemVvZiAocmVtb3RlKSkpICE9IC0gMSkgewoKV0FSTklORzogYXJjaGl0ZWN0dXJl IHNwZWNpZmljIGRlZmluZXMgc2hvdWxkIGJlIGF2b2lkZWQKIzg4NDogRklMRTogdXRpbC9QYW5l bEVtdS5jOjMwMToKKyNpZmRlZiBfX01JTkdXMzJfXwoKV0FSTklORzogbGluZSBvdmVyIDgwIGNo YXJhY3RlcnMKIzg4NjogRklMRTogdXRpbC9QYW5lbEVtdS5jOjMwMzoKKyAgICAgICAgICAgICAg ICBzZXRzb2Nrb3B0KGgtPnNvY2tldCwgSVB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HNlbmQgeW91ciBmZWVkYmFjayB0byBwYXRjaGV3LWRldmVs QGZyZWVsaXN0cy5vcmc= From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44031) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dei8E-0003TB-Ah for qemu-devel@nongnu.org; Mon, 07 Aug 2017 09:31:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dei89-0002iy-My for qemu-devel@nongnu.org; Mon, 07 Aug 2017 09:31:42 -0400 Received: from mail-pg0-x242.google.com ([2607:f8b0:400e:c05::242]:32768) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dei89-0002i9-GA for qemu-devel@nongnu.org; Mon, 07 Aug 2017 09:31:37 -0400 Received: by mail-pg0-x242.google.com with SMTP id u185so433695pgb.0 for ; Mon, 07 Aug 2017 06:31:35 -0700 (PDT) Received: from [192.168.0.4] ([202.78.235.74]) by smtp.gmail.com with ESMTPSA id c191sm16636371pga.15.2017.08.07.06.31.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Aug 2017 06:31:33 -0700 (PDT) From: vaibhav shukla Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Message-Id: <4D61F663-65D4-4980-8A99-AA8FB4E72CDE@gmail.com> Date: Mon, 7 Aug 2017 19:01:30 +0530 Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hello, I am Vaibhav Shukla, sophomore student of Indian Institute of = Information Technology, Kalyani, India. I would like to contribute in some projects in your company, please = guide me that how can I do so. I shall be highly grateful to you. Yours Sincerely= From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50724) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dekzB-0000RH-KV for qemu-devel@nongnu.org; Mon, 07 Aug 2017 12:34:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dekz6-000587-7l for qemu-devel@nongnu.org; Mon, 07 Aug 2017 12:34:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58780) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dekz6-00057t-0h for qemu-devel@nongnu.org; Mon, 07 Aug 2017 12:34:28 -0400 Date: Mon, 7 Aug 2017 18:34:24 +0200 From: Eduardo Otubo Message-ID: <20170807163424.GA15485@bluepex.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel Cc: zhang.zhanghailiang@huawei.com, wency@cn.fujitsu.com zhangchen.fnst@cn.fujitsu.com, wang.guang55@zte.com.cn, wang.yong155@zte.com.cn Bcc: Subject: colo-compare: segfault and assert on colo_compare_finalize Reply-To: Hi all, I have found a problem on colo-compare that leads to segmentation fault when calling qemu like this: $ qemu-system-x86_64 -S -machine pc -object colo-compare,id=test-object First I got an assert failed: (qemu-system-x86_64:7887): GLib-CRITICAL **: g_main_loop_quit: assertion 'loop != NULL' failed >>From this looks like s->compare_loop is NULL on the function colo_compare_finalize(), then I just added a check there and the assert went away. But then there's the segfault: Thread 1 "qemu-system-x86" received signal SIGSEGV, Segmentation fault. 0x00007ffff333f79e in pthread_join () from /lib64/libpthread.so.0 (gdb) bt #0 0x00007ffff333f79e in pthread_join () at /lib64/libpthread.so.0 #1 0x0000555555c379d2 in qemu_thread_join (thread=0x7ffff7ff5160) at util/qemu-thread-posix.c:547 #2 0x0000555555adfc1a in colo_compare_finalize (obj=0x7ffff7fd3010) at net/colo-compare.c:867 #3 0x0000555555b2cd87 in object_deinit (obj=0x7ffff7fd3010, type=0x5555567432e0) at qom/object.c:453 #4 0x0000555555b2cdf9 in object_finalize (data=0x7ffff7fd3010) at qom/object.c:467 #5 0x0000555555b2dd80 in object_unref (obj=0x7ffff7fd3010) at qom/object.c:902 #6 0x0000555555b319a5 in user_creatable_add_type (type=0x5555567499a0 "colo-compare", id=0x555556749960 "test-object", qdict=0x555556835750, v=0x55555681a3f0, errp=0x7fffffffde58) at qom/object_interfaces.c:105 #7 0x0000555555b31b02 in user_creatable_add_opts (opts=0x555556749910, errp=0x7fffffffde58) at qom/object_interfaces.c:135 #8 0x0000555555b31bfd in user_creatable_add_opts_foreach (opaque=0x5555558e9c39 , opts=0x555556749910, errp=0x0) at qom/object_interfaces.c:159 #9 0x0000555555c4aecf in qemu_opts_foreach (list=0x555556157ac0 , func=0x555555b31b6f , opaque=0x5555558e9c39 , errp=0x0) at util/qemu-option.c:1104 #10 0x00005555558edb75 in main (argc=6, argv=0x7fffffffe2d8, envp=0x7fffffffe310) at vl.c:4520 At this point '&s->thread' is '0'. Is this segfault and the above mentioned assert trigged because I'm creating a colo-compare object without any other parameter? In a positive case, a simple workaround and error check should do it. Otherwise I'll debug a little more. Best regards, -- Eduardo Otubo Senior Software Engineer @ RedHat From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54011) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e2nJP-0003vZ-7z for qemu-devel@nongnu.org; Thu, 12 Oct 2017 19:54:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e2nJO-0001Ng-IX for qemu-devel@nongnu.org; Thu, 12 Oct 2017 19:54:47 -0400 Received: from mail-pf0-x234.google.com ([2607:f8b0:400e:c00::234]:44878) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e2nJO-0001LW-CK for qemu-devel@nongnu.org; Thu, 12 Oct 2017 19:54:46 -0400 Received: by mail-pf0-x234.google.com with SMTP id x7so7230847pfa.1 for ; Thu, 12 Oct 2017 16:54:44 -0700 (PDT) From: Anatol Pomozov Date: Thu, 12 Oct 2017 16:54:35 -0700 Message-Id: <20171012235439.19457-1-anatol.pomozov@gmail.com> Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, rth@twiddle.net, ehabkost@redhat.com, pbonzini@redhat.com, agraf@suse.de It is V3 of multiboot improvements to Qemu Changes made sinse V2: - rebase on top of qemu master changes - make multiboot/sections test more reliable Add generate_sections_out.py script that generates ELF sections information - rename 'struct section_data' to 'struct SectionData' to match naming convention in include/hw/loader.h From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58245) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXrf9-0003ae-Tf for qemu-devel@nongnu.org; Tue, 26 Jun 2018 13:21:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXrf6-0000r3-Po for qemu-devel@nongnu.org; Tue, 26 Jun 2018 13:21:55 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:60140 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fXrf6-0000qx-KV for qemu-devel@nongnu.org; Tue, 26 Jun 2018 13:21:52 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3C1A8407606B for ; Tue, 26 Jun 2018 17:21:52 +0000 (UTC) From: Markus Armbruster References: <20180620073223.31964-1-peterx@redhat.com> Date: Tue, 26 Jun 2018 19:21:49 +0200 In-Reply-To: <20180620073223.31964-1-peterx@redhat.com> (Peter Xu's message of "Wed, 20 Jun 2018 15:32:16 +0800") Message-ID: <871sctea4y.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Xu Cc: qemu-devel@nongnu.org I fooled around a bit, and I think there are a few lose ends. Lets update the examples in docs/interop/qmp-spec.txt to show the current greeting (section 3.1) and how to accept a capability (section 3.2). The capability negotiation documentation could use some polish. I'll post a patch. Talking to a QMP monitor that supports OOB: $ socat UNIX:test-qmp READLINE,history=$HOME/.qmp_history,prompt='QMP> ' {"QMP": {"version": {"qemu": {"micro": 50, "minor": 12, "major": 2}, "package": "v2.12.0-1703-gb909799463"}, "capabilities": ["oob"]}} QMP> { "execute": "qmp_capabilities", "arguments": { "oob": true } } {"error": {"class": "GenericError", "desc": "Parameter 'oob' is unexpected"}} QMP> { "execute": "qmp_capabilities", "arguments": { "enable": ["oob"] } } {"return": {}} QMP> { "execute": "query-qmp-schema" } {"error": {"class": "GenericError", "desc": "Out-Of-Band capability requires that every command contains an 'id' field"}} Why does every command require 'id'? Talking to a QMP monitor that doesn't support OOB: {"QMP": {"version": {"qemu": {"micro": 50, "minor": 12, "major": 2}, "package": "v2.12.0-1703-gb909799463"}, "capabilities": []}} QMP> { "execute": "qmp_capabilities", "arguments": { "enable": ["oob"] } } {"error": {"class": "GenericError", "desc": "This monitor does not support Out-Of-Band (OOB)"}} QMP> { "execute": "qmp_capabilities" } {"return": {}} QMP> { "execute": "query-kvm" } {"return": {"enabled": true, "present": true}} QMP> { "execute": "query-kvm", "control": { "run-oob": true } } {"error": {"class": "GenericError", "desc": "Please enable Out-Of-Band first for the session during capabilities negotiation"}} Telling people to enable OOB when that cannot be done is suboptimal. More so when it cannot be used here anyway. I'll post a patch. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45198) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhAR2-0007QR-TT for qemu-devel@nongnu.org; Sun, 22 Jul 2018 05:13:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fhAQz-0007oA-PO for qemu-devel@nongnu.org; Sun, 22 Jul 2018 05:13:48 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:2335 helo=huawei.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fhAQz-0007nI-CP for qemu-devel@nongnu.org; Sun, 22 Jul 2018 05:13:45 -0400 Received: from dggemi402-hub.china.huawei.com (unknown [172.30.72.53]) by Forcepoint Email with ESMTP id D72EC69FDFDAD for ; Sun, 22 Jul 2018 17:13:40 +0800 (CST) From: "Liujinsong (Paul)" Date: Sun, 22 Jul 2018 09:13:38 +0000 Message-ID: <0611CA7DC2501642811B80D56CDC6A3CE6EBE8@dggemi522-mbx.china.huawei.com> Content-Language: zh-CN MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "qemu-devel@nongnu.org" From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53574) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gRoLB-00046W-0b for qemu-devel@nongnu.org; Tue, 27 Nov 2018 20:08:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gRoL6-00033c-Ua for qemu-devel@nongnu.org; Tue, 27 Nov 2018 20:08:32 -0500 Received: from mail-it1-x130.google.com ([2607:f8b0:4864:20::130]:54956) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gRoL6-000331-P2 for qemu-devel@nongnu.org; Tue, 27 Nov 2018 20:08:28 -0500 Received: by mail-it1-x130.google.com with SMTP id m123-v6so1734114ita.4 for ; Tue, 27 Nov 2018 17:08:28 -0800 (PST) From: John Arbuckle Date: Tue, 27 Nov 2018 20:08:17 -0500 Message-Id: <20181128010817.6191-1-programmingkidx@gmail.com> Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org, berkus@gmail.com, qemu-devel@nongnu.org Cc: John Arbuckle >>From af4497f2b161bb4165acb8eee5cae3f2a7ea2227 Mon Sep 17 00:00:00 2001 From: John Arbuckle Date: Tue, 27 Nov 2018 20:01:20 -0500 Subject: [PATCH] ui/cocoa.m: fix crash due to cocoa_refresh() on Mac OS 10.14 Mac OS 10.14 only wants UI code to be called from the main thread. The cocoa_refresh() function is called on another thread and this causes a crash to take place. To fix this problem the cocoa_refresh() code is called from the main thread only. Signed-off-by: John Arbuckle --- ui/cocoa.m | 59 ++++++++++++++++++++++++++++++++++------------------------- 1 file changed, 34 insertions(+), 25 deletions(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index ecf12bfc2e..17c168d08f 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -972,6 +972,8 @@ - (void)openDocumentation:(NSString *)filename; - (IBAction) do_about_menu_item: (id) sender; - (void)make_about_window; - (void)adjustSpeed:(id)sender; +- (void) cocoa_refresh; +- (void) cocoa_refresh_internal: (id) dummy; @end @implementation QemuCocoaAppController @@ -1406,6 +1408,37 @@ - (void)adjustSpeed:(id)sender COCOA_DEBUG("cpu throttling at %d%c\n", cpu_throttle_get_percentage(), '%'); } +- (void) cocoa_refresh +{ + [self performSelectorOnMainThread: @selector(cocoa_refresh_internal:) withObject: nil waitUntilDone: YES]; +} + +- (void) cocoa_refresh_internal: (id) dummy +{ + COCOA_DEBUG("qemu_cocoa: cocoa_refresh\n"); + graphic_hw_update(NULL); + + if (qemu_input_is_absolute()) { + if (![cocoaView isAbsoluteEnabled]) { + if ([cocoaView isMouseGrabbed]) { + [cocoaView ungrabMouse]; + } + } + [cocoaView setAbsoluteEnabled:YES]; + } + + NSDate *distantPast; + NSEvent *event; + distantPast = [NSDate distantPast]; + do { + event = [NSApp nextEventMatchingMask:NSEventMaskAny untilDate:distantPast + inMode: NSDefaultRunLoopMode dequeue:YES]; + if (event != nil) { + [cocoaView handleEvent:event]; + } + } while(event != nil); +} + @end @@ -1579,31 +1612,7 @@ static void cocoa_switch(DisplayChangeListener *dcl, static void cocoa_refresh(DisplayChangeListener *dcl) { - NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; - - COCOA_DEBUG("qemu_cocoa: cocoa_refresh\n"); - graphic_hw_update(NULL); - - if (qemu_input_is_absolute()) { - if (![cocoaView isAbsoluteEnabled]) { - if ([cocoaView isMouseGrabbed]) { - [cocoaView ungrabMouse]; - } - } - [cocoaView setAbsoluteEnabled:YES]; - } - - NSDate *distantPast; - NSEvent *event; - distantPast = [NSDate distantPast]; - do { - event = [NSApp nextEventMatchingMask:NSEventMaskAny untilDate:distantPast - inMode: NSDefaultRunLoopMode dequeue:YES]; - if (event != nil) { - [cocoaView handleEvent:event]; - } - } while(event != nil); - [pool release]; + [[NSApp delegate] cocoa_refresh]; } static void cocoa_cleanup(void) -- 2.14.3 (Apple Git-98) From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gS5gb-00032L-NS for qemu-devel@nongnu.org; Wed, 28 Nov 2018 14:39:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gS5ga-0001Ex-R0 for qemu-devel@nongnu.org; Wed, 28 Nov 2018 14:39:49 -0500 Received: from mail-oi1-x231.google.com ([2607:f8b0:4864:20::231]:41213) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gS5ga-000163-Ki for qemu-devel@nongnu.org; Wed, 28 Nov 2018 14:39:48 -0500 Received: by mail-oi1-x231.google.com with SMTP id j21so23633776oii.8 for ; Wed, 28 Nov 2018 11:39:38 -0800 (PST) MIME-Version: 1.0 References: <20181128010817.6191-1-programmingkidx@gmail.com> In-Reply-To: <20181128010817.6191-1-programmingkidx@gmail.com> From: Peter Maydell Date: Wed, 28 Nov 2018 19:39:25 +0000 Message-ID: Content-Type: text/plain; charset="UTF-8" Subject: Re: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: G 3 Cc: Berkus Decker , QEMU Developers On Wed, 28 Nov 2018 at 01:12, John Arbuckle wrote: > > From af4497f2b161bb4165acb8eee5cae3f2a7ea2227 Mon Sep 17 00:00:00 2001 > From: John Arbuckle > Date: Tue, 27 Nov 2018 20:01:20 -0500 > Subject: [PATCH] ui/cocoa.m: fix crash due to cocoa_refresh() on Mac OS 10.14 Something seems to have got the formatting of this patch email wrong -- it's got all this in the body and the actual Subject line of the email is blank. > Mac OS 10.14 only wants UI code to be called from the main thread. The > cocoa_refresh() function is called on another thread and this causes a > crash to take place. To fix this problem the cocoa_refresh() code is > called from the main thread only. > > Signed-off-by: John Arbuckle > --- > ui/cocoa.m | 59 ++++++++++++++++++++++++++++++++++------------------------- > 1 file changed, 34 insertions(+), 25 deletions(-) I get a compile warning with this patch: /Users/pm215/src/qemu/ui/cocoa.m:1615:23: warning: instance method '-cocoa_refresh' not found (return type defaults to 'id') [-Wobjc-method-access] [[NSApp delegate] cocoa_refresh]; ^~~~~~~~~~~~~ To be honest, I'm still confused about what is causing the problems on Mojave. The refresh method should be being called on the main thread even with the code on master -- it's just that that is the iothread and it's running the event pumping code in the refresh callback rather than a standard OSX event loop. I'm hoping that the backtrace with symbols of the Mojave assertion failure will help there, since I can't currently see where refresh gets called from some non-main thread. I also think that this patch doesn't address the problems of locking that I mention on the discussion thread for Berkus' patch. It also doesn't handle any of the other callbacks from QEMU to the cocoa UI -- surely we need to handle all of them if there is a problem here? (I have some prototype patches which I've been working on which address the locking problem and also make all the QEMU callbacks run their work on the main thread. I may be able get those into shape to post those next week.) thanks -- PMM From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38434) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSA5j-0001J7-5j for qemu-devel@nongnu.org; Wed, 28 Nov 2018 19:22:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gSA5f-0002sr-KN for qemu-devel@nongnu.org; Wed, 28 Nov 2018 19:22:02 -0500 Received: from mail-io1-xd44.google.com ([2607:f8b0:4864:20::d44]:39759) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gSA5e-0002h4-Un for qemu-devel@nongnu.org; Wed, 28 Nov 2018 19:21:59 -0500 Received: by mail-io1-xd44.google.com with SMTP id k7so118699iob.6 for ; Wed, 28 Nov 2018 16:21:44 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) From: Programmingkid In-Reply-To: Date: Wed, 28 Nov 2018 19:21:40 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: References: <20181128010817.6191-1-programmingkidx@gmail.com> Subject: Re: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: Berkus Decker , QEMU Developers > On Nov 28, 2018, at 2:39 PM, Peter Maydell = wrote: >=20 > On Wed, 28 Nov 2018 at 01:12, John Arbuckle = wrote: >>=20 >> =46rom af4497f2b161bb4165acb8eee5cae3f2a7ea2227 Mon Sep 17 00:00:00 = 2001 >> From: John Arbuckle >> Date: Tue, 27 Nov 2018 20:01:20 -0500 >> Subject: [PATCH] ui/cocoa.m: fix crash due to cocoa_refresh() on Mac = OS 10.14 >=20 > Something seems to have got the formatting of this patch email > wrong -- it's got all this in the body and the actual Subject > line of the email is blank. I don't know what happened. >=20 >> Mac OS 10.14 only wants UI code to be called from the main thread. = The >> cocoa_refresh() function is called on another thread and this causes = a >> crash to take place. To fix this problem the cocoa_refresh() code is >> called from the main thread only. >>=20 >> Signed-off-by: John Arbuckle >> --- >> ui/cocoa.m | 59 = ++++++++++++++++++++++++++++++++++------------------------- >> 1 file changed, 34 insertions(+), 25 deletions(-) >=20 > I get a compile warning with this patch: > /Users/pm215/src/qemu/ui/cocoa.m:1615:23: warning: instance method > '-cocoa_refresh' not found (return type defaults to 'id') > [-Wobjc-method-access] > [[NSApp delegate] cocoa_refresh]; > ^~~~~~~~~~~~~ This will fix the problem: static void cocoa_refresh(DisplayChangeListener *dcl) { QemuCocoaAppController *controller =3D (QemuCocoaAppController = *)[NSApp delegate]; [controller cocoa_refresh]; } > To be honest, I'm still confused about what is causing the > problems on Mojave. The refresh method should be being called > on the main thread even with the code on master -- it's just > that that is the iothread and it's running the event pumping > code in the refresh callback rather than a standard OSX > event loop. I'm hoping that the backtrace with symbols of > the Mojave assertion failure will help there, since I > can't currently see where refresh gets called from some > non-main thread. This might be a Mojave issue and not a QEMU issue.=20 I'm on Mac OS 10.12 so I can't confirm anything. > I also think that this patch doesn't address the problems > of locking that I mention on the discussion thread for > Berkus' patch. It also doesn't handle any of the other > callbacks from QEMU to the cocoa UI -- surely we need to > handle all of them if there is a problem here? To answer this question I would have to know how my patch does on Mac OS 10.14. Does it stop the crashing issue? If this patch does fix that problem then I think sticking to a simple solution may be the answer. The use of locks may not be needed. > (I have some prototype patches which I've been working > on which address the locking problem and also make all > the QEMU callbacks run their work on the main thread. > I may be able get those into shape to post those next week.) Please CC me when do release it. I will test it on Mac OS 10.12 and Mac OS 10.6.=20= From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39054) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSBoH-0000wx-1T for qemu-devel@nongnu.org; Wed, 28 Nov 2018 21:12:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gSBo5-0001Ad-G4 for qemu-devel@nongnu.org; Wed, 28 Nov 2018 21:12:04 -0500 Received: from mail-lf1-x131.google.com ([2a00:1450:4864:20::131]:33434) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gSBnx-00013C-Au for qemu-devel@nongnu.org; Wed, 28 Nov 2018 21:11:51 -0500 Received: by mail-lf1-x131.google.com with SMTP id i26so262573lfc.0 for ; Wed, 28 Nov 2018 18:11:46 -0800 (PST) MIME-Version: 1.0 References: <20181128010817.6191-1-programmingkidx@gmail.com> In-Reply-To: From: berkus infinitus Date: Thu, 29 Nov 2018 04:11:34 +0200 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Programmingkid Cc: Peter Maydell , QEMU Developers I suspect the main problem is the blocking call to qemu_main from the UI thread in the app delegate didFinishLoadingWithOptions if i=E2=80=99m not m= istaken and everything else grows from there. Going to build and run it now, since I woke up in the middle of the night anyway for reasons unexplainable) On Thu, 29 Nov 2018 at 02:21, Programmingkid wrote: > > > On Nov 28, 2018, at 2:39 PM, Peter Maydell > wrote: > > > > On Wed, 28 Nov 2018 at 01:12, John Arbuckle > wrote: > >> > >> From af4497f2b161bb4165acb8eee5cae3f2a7ea2227 Mon Sep 17 00:00:00 2001 > >> From: John Arbuckle > >> Date: Tue, 27 Nov 2018 20:01:20 -0500 > >> Subject: [PATCH] ui/cocoa.m: fix crash due to cocoa_refresh() on Mac O= S > 10.14 > > > > Something seems to have got the formatting of this patch email > > wrong -- it's got all this in the body and the actual Subject > > line of the email is blank. > > I don't know what happened. > > > > >> Mac OS 10.14 only wants UI code to be called from the main thread. The > >> cocoa_refresh() function is called on another thread and this causes a > >> crash to take place. To fix this problem the cocoa_refresh() code is > >> called from the main thread only. > >> > >> Signed-off-by: John Arbuckle > >> --- > >> ui/cocoa.m | 59 > ++++++++++++++++++++++++++++++++++------------------------- > >> 1 file changed, 34 insertions(+), 25 deletions(-) > > > > I get a compile warning with this patch: > > /Users/pm215/src/qemu/ui/cocoa.m:1615:23: warning: instance method > > '-cocoa_refresh' not found (return type defaults to 'id') > > [-Wobjc-method-access] > > [[NSApp delegate] cocoa_refresh]; > > ^~~~~~~~~~~~~ > > This will fix the problem: > > static void cocoa_refresh(DisplayChangeListener *dcl) > { > QemuCocoaAppController *controller =3D (QemuCocoaAppController *)[NSA= pp > delegate]; > [controller cocoa_refresh]; > } > > > To be honest, I'm still confused about what is causing the > > problems on Mojave. The refresh method should be being called > > on the main thread even with the code on master -- it's just > > that that is the iothread and it's running the event pumping > > code in the refresh callback rather than a standard OSX > > event loop. I'm hoping that the backtrace with symbols of > > the Mojave assertion failure will help there, since I > > can't currently see where refresh gets called from some > > non-main thread. > > This might be a Mojave issue and not a QEMU issue. > I'm on Mac OS 10.12 so I can't confirm anything. > > > I also think that this patch doesn't address the problems > > of locking that I mention on the discussion thread for > > Berkus' patch. It also doesn't handle any of the other > > callbacks from QEMU to the cocoa UI -- surely we need to > > handle all of them if there is a problem here? > > To answer this question I would have to know how my patch > does on Mac OS 10.14. Does it stop the crashing issue? If > this patch does fix that problem then I think sticking to > a simple solution may be the answer. The use of locks may > not be needed. > > > (I have some prototype patches which I've been working > > on which address the locking problem and also make all > > the QEMU callbacks run their work on the main thread. > > I may be able get those into shape to post those next week.) > > Please CC me when do release it. I will test it on Mac OS 10.12 > and Mac OS 10.6. From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48049) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gSJPB-00081p-Nb for qemu-devel@nongnu.org; Thu, 29 Nov 2018 05:18:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gSJP9-0005IY-Bg for qemu-devel@nongnu.org; Thu, 29 Nov 2018 05:18:45 -0500 Received: from mail-ot1-x332.google.com ([2607:f8b0:4864:20::332]:36370) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gSJP8-0005Hz-VC for qemu-devel@nongnu.org; Thu, 29 Nov 2018 05:18:43 -0500 Received: by mail-ot1-x332.google.com with SMTP id k98so1255930otk.3 for ; Thu, 29 Nov 2018 02:18:42 -0800 (PST) MIME-Version: 1.0 References: <20181128010817.6191-1-programmingkidx@gmail.com> In-Reply-To: From: Peter Maydell Date: Thu, 29 Nov 2018 10:18:30 +0000 Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Berkus Decker Cc: G 3 , QEMU Developers On Thu, 29 Nov 2018 at 02:11, berkus infinitus wrote: > > I suspect the main problem is the blocking call to qemu_main > from the UI thread in the app delegate didFinishLoadingWithOptions > if i=E2=80=99m not mistaken and everything else grows from there. Yes; if there's no way that Mojave will allow us to run qemu_main directly on the main thread, then we have to create a 2nd thread to run qemu_main on (which then becomes what QEMU thinks of as the "main loop thread"), and then we run into the need to make all the UI calls be forwarded from the main loop thread to the main thread, and to get QEMU locks when making calls into qemu from the main thread. I think the code we have in git currently will already do all the UI calls on the main thread -- it just does it by doing a blocking call into qemu_main which later does event processing itself. (It's a shame OSX doesn't document what you need to do to write code that way, it's a fairly common paradigm for other GUIs.) For High Sierra there is apparently a "main thread checker" utility: https://developer.apple.com/documentation/code_diagnostics/main_th= read_checker so running DYLD_INSERT_LIBRARIES=3D/Applications/Xcode.app/Contents/Developer/usr/lib/= libMainThreadChecker.dylib qemu-system-x86_64 args... will let us check for violations of the "do things on main thread" principle even without Mohave. For me with current QEMU it doesn't report any issues. thanks -- PMM From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50122) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gXNxH-0001k9-CD for qemu-devel@nongnu.org; Thu, 13 Dec 2018 05:10:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gXNxF-0007ft-Rj for qemu-devel@nongnu.org; Thu, 13 Dec 2018 05:10:55 -0500 Received: from mail-it1-x136.google.com ([2607:f8b0:4864:20::136]:51011) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gXNxF-0007eT-Gf for qemu-devel@nongnu.org; Thu, 13 Dec 2018 05:10:53 -0500 Received: by mail-it1-x136.google.com with SMTP id z7so2878950iti.0 for ; Thu, 13 Dec 2018 02:10:52 -0800 (PST) MIME-Version: 1.0 From: =?UTF-8?B?0JjQu9GM0Y8g0KDQtdC30L3QuNC60L7Qsg==?= Date: Thu, 13 Dec 2018 16:10:40 +0600 Message-ID: Content-Type: text/plain; charset="UTF-8" Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Please add android support From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1geVsQ-00030o-4d for qemu-devel@nongnu.org; Tue, 01 Jan 2019 21:03:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1geVsF-0006xE-IS for qemu-devel@nongnu.org; Tue, 01 Jan 2019 21:03:19 -0500 Date: Wed, 2 Jan 2019 10:02:58 +0800 From: Yaowei Bai Message-ID: <20190102020258.GA26683@byw> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: fam@euphon.net, qemu-block@nongnu.org, famz@redhat.com, atumball@redhat.com, mchristi@redhat.com, pkalever@redhat.com, pbonzini@redhat.com, xiubli@redhat.com, baiyaowei@cmss.chinamobile.com baiyaowei@cmss.chinamobile.com Bcc: Subject: Re: [Qemu-devel] [PATCH] tcmu: Introduce qemu-tcmu utility Reply-To: baiyaowei@cmss.chinamobile.com In-Reply-To: <20190102015321.GA26514@byw> Add Xiubo. On Wed, Jan 02, 2019 at 09:53:21AM +0800, Yaowei Bai wrote: > Ping. > > BTW, it should be update docker image to install glib to fix this. > > On Wed, Dec 26, 2018 at 12:19:48AM -0800, no-reply@patchew.org wrote: > > Patchew URL: https://patchew.org/QEMU/1545387387-9613-1-git-send-email-baiyaowei@cmss.chinamobile.com/ > > > > > > > > Hi, > > > > This series seems to have some coding style problems. See output below for > > more information: > > > > Message-id: 1545387387-9613-1-git-send-email-baiyaowei@cmss.chinamobile.com > > Type: series > > Subject: [Qemu-devel] [PATCH] tcmu: Introduce qemu-tcmu utility > > > > === TEST SCRIPT BEGIN === > > #!/bin/bash > > > > BASE=base > > n=1 > > total=$(git log --oneline $BASE.. | wc -l) > > failed=0 > > > > git config --local diff.renamelimit 0 > > git config --local diff.renames True > > git config --local diff.algorithm histogram > > > > commits="$(git log --format=%H --reverse $BASE..)" > > for c in $commits; do > > echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..." > > if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then > > failed=1 > > echo > > fi > > n=$((n+1)) > > done > > > > exit $failed > > === TEST SCRIPT END === > > > > Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384 > > Switched to a new branch 'test' > > 52869e1 tcmu: Introduce qemu-tcmu utility > > > > === OUTPUT BEGIN === > > Checking PATCH 1/1: tcmu: Introduce qemu-tcmu utility... > > WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? > > #157: > > new file mode 100644 > > > > ERROR: trailing whitespace > > #329: FILE: qemu-tcmu.c:51: > > +"Usage:\n" $ > > > > WARNING: Block comments use a leading /* on a separate line > > #466: FILE: qemu-tcmu.c:188: > > + /* now when the initialization is (almost) complete, chdir("/") > > > > WARNING: Block comments use a trailing */ on a separate line > > #467: FILE: qemu-tcmu.c:189: > > + * to free any busy filesystems */ > > > > ERROR: code indent should never use tabs > > #525: FILE: tcmu/helper.c:16: > > +^Iuint8_t *cdb,$ > > > > ERROR: code indent should never use tabs > > #526: FILE: tcmu/helper.c:17: > > +^Istruct iovec *iovec,$ > > > > ERROR: code indent should never use tabs > > #527: FILE: tcmu/helper.c:18: > > +^Isize_t iov_cnt)$ > > > > ERROR: code indent should never use tabs > > #529: FILE: tcmu/helper.c:20: > > +^Iuint8_t buf[36];$ > > > > ERROR: code indent should never use tabs > > #531: FILE: tcmu/helper.c:22: > > +^Imemset(buf, 0, sizeof(buf));$ > > > > ERROR: code indent should never use tabs > > #533: FILE: tcmu/helper.c:24: > > +^Ibuf[2] = 0x05; /* SPC-3 */$ > > > > ERROR: code indent should never use tabs > > #534: FILE: tcmu/helper.c:25: > > +^Ibuf[3] = 0x02; /* response data format */$ > > > > ERROR: code indent should never use tabs > > #536: FILE: tcmu/helper.c:27: > > +^I/*$ > > > > ERROR: code indent should never use tabs > > #537: FILE: tcmu/helper.c:28: > > +^I * A Third-Party Copy (3PC)$ > > > > ERROR: code indent should never use tabs > > #538: FILE: tcmu/helper.c:29: > > +^I *$ > > > > ERROR: code indent should never use tabs > > #539: FILE: tcmu/helper.c:30: > > +^I * Enable the XCOPY$ > > > > ERROR: code indent should never use tabs > > #540: FILE: tcmu/helper.c:31: > > +^I */$ > > > > ERROR: code indent should never use tabs > > #541: FILE: tcmu/helper.c:32: > > +^Ibuf[5] = 0x08;$ > > > > ERROR: code indent should never use tabs > > #543: FILE: tcmu/helper.c:34: > > +^Ibuf[7] = 0x02; /* CmdQue */$ > > > > ERROR: code indent should never use tabs > > #545: FILE: tcmu/helper.c:36: > > +^Imemcpy(&buf[8], "LIO-ORG ", 8);$ > > > > ERROR: code indent should never use tabs > > #546: FILE: tcmu/helper.c:37: > > +^Imemset(&buf[16], 0x20, 16);$ > > > > ERROR: code indent should never use tabs > > #547: FILE: tcmu/helper.c:38: > > +^Imemcpy(&buf[16], "TCMU device", 11);$ > > > > ERROR: code indent should never use tabs > > #548: FILE: tcmu/helper.c:39: > > +^Imemcpy(&buf[32], "0002", 4);$ > > > > ERROR: code indent should never use tabs > > #549: FILE: tcmu/helper.c:40: > > +^Ibuf[4] = 31; /* Set additional length to 31 */$ > > > > ERROR: code indent should never use tabs > > #551: FILE: tcmu/helper.c:42: > > +^Itcmu_memcpy_into_iovec(iovec, iov_cnt, buf, sizeof(buf));$ > > > > ERROR: code indent should never use tabs > > #552: FILE: tcmu/helper.c:43: > > +^Ireturn TCMU_STS_OK;$ > > > > ERROR: code indent should never use tabs > > #558: FILE: tcmu/helper.c:49: > > +^Iif (c >= '0' && c <= '9') {$ > > > > ERROR: code indent should never use tabs > > #559: FILE: tcmu/helper.c:50: > > +^I^I*val = c - '0';$ > > > > ERROR: code indent should never use tabs > > #560: FILE: tcmu/helper.c:51: > > +^I^Ireturn true;$ > > > > ERROR: code indent should never use tabs > > #561: FILE: tcmu/helper.c:52: > > +^I}$ > > > > ERROR: code indent should never use tabs > > #562: FILE: tcmu/helper.c:53: > > +^Iif (c >= 'a' && c <= 'f') {$ > > > > ERROR: code indent should never use tabs > > #563: FILE: tcmu/helper.c:54: > > +^I^I*val = c - 'a' + 10;$ > > > > ERROR: code indent should never use tabs > > #564: FILE: tcmu/helper.c:55: > > +^I^Ireturn true;$ > > > > ERROR: code indent should never use tabs > > #565: FILE: tcmu/helper.c:56: > > +^I}$ > > > > ERROR: code indent should never use tabs > > #566: FILE: tcmu/helper.c:57: > > +^Iif (c >= 'A' && c <= 'F') {$ > > > > ERROR: code indent should never use tabs > > #567: FILE: tcmu/helper.c:58: > > +^I^I*val = c - 'A' + 10;$ > > > > ERROR: code indent should never use tabs > > #568: FILE: tcmu/helper.c:59: > > +^I^Ireturn true;$ > > > > ERROR: code indent should never use tabs > > #569: FILE: tcmu/helper.c:60: > > +^I}$ > > > > ERROR: code indent should never use tabs > > #570: FILE: tcmu/helper.c:61: > > +^Ireturn false;$ > > > > ERROR: code indent should never use tabs > > #574: FILE: tcmu/helper.c:65: > > +^Istruct tcmu_device *dev,$ > > > > ERROR: code indent should never use tabs > > #575: FILE: tcmu/helper.c:66: > > +^Iuint8_t *cdb,$ > > > > ERROR: code indent should never use tabs > > #576: FILE: tcmu/helper.c:67: > > +^Istruct iovec *iovec,$ > > > > ERROR: code indent should never use tabs > > #577: FILE: tcmu/helper.c:68: > > +^Isize_t iov_cnt)$ > > > > ERROR: code indent should never use tabs > > #579: FILE: tcmu/helper.c:70: > > +^Iswitch (cdb[2]) {$ > > > > ERROR: code indent should never use tabs > > #580: FILE: tcmu/helper.c:71: > > +^Icase 0x0: /* Supported VPD pages */$ > > > > ERROR: code indent should never use tabs > > #581: FILE: tcmu/helper.c:72: > > +^I{$ > > > > ERROR: code indent should never use tabs > > #582: FILE: tcmu/helper.c:73: > > +^I^Ichar data[16];$ > > > > ERROR: code indent should never use tabs > > #584: FILE: tcmu/helper.c:75: > > +^I^Imemset(data, 0, sizeof(data));$ > > > > ERROR: code indent should never use tabs > > #586: FILE: tcmu/helper.c:77: > > +^I^I/* data[1] (page code) already 0 */$ > > > > ERROR: code indent should never use tabs > > #587: FILE: tcmu/helper.c:78: > > +^I^I/*$ > > > > ERROR: code indent should never use tabs > > #588: FILE: tcmu/helper.c:79: > > +^I^I * spc4r22 7.7.13 The supported VPD page list shall contain$ > > > > WARNING: Block comments should align the * on each line > > #588: FILE: tcmu/helper.c:79: > > + /* > > + * spc4r22 7.7.13 The supported VPD page list shall contain > > > > ERROR: code indent should never use tabs > > #589: FILE: tcmu/helper.c:80: > > +^I^I * a list of all VPD page codes (see 7.7) implemented by the$ > > > > WARNING: line over 80 characters > > #590: FILE: tcmu/helper.c:81: > > + * logical unit in ascending order beginning with page code 00h > > > > ERROR: code indent should never use tabs > > #590: FILE: tcmu/helper.c:81: > > +^I^I * logical unit in ascending order beginning with page code 00h$ > > > > ERROR: code indent should never use tabs > > #591: FILE: tcmu/helper.c:82: > > +^I^I */$ > > > > ERROR: code indent should never use tabs > > #592: FILE: tcmu/helper.c:83: > > +^I^Idata[4] = 0x00;$ > > > > ERROR: code indent should never use tabs > > #593: FILE: tcmu/helper.c:84: > > +^I^Idata[5] = 0x80;$ > > > > ERROR: code indent should never use tabs > > #594: FILE: tcmu/helper.c:85: > > +^I^Idata[6] = 0x83;$ > > > > ERROR: code indent should never use tabs > > #595: FILE: tcmu/helper.c:86: > > +^I^Idata[7] = 0xb0;$ > > > > ERROR: code indent should never use tabs > > #596: FILE: tcmu/helper.c:87: > > +^I^Idata[8] = 0xb1;$ > > > > ERROR: code indent should never use tabs > > #597: FILE: tcmu/helper.c:88: > > +^I^Idata[9] = 0xb2;$ > > > > ERROR: code indent should never use tabs > > #599: FILE: tcmu/helper.c:90: > > +^I^Idata[3] = 6;$ > > > > ERROR: code indent should never use tabs > > #601: FILE: tcmu/helper.c:92: > > +^I^Itcmu_memcpy_into_iovec(iovec, iov_cnt, data, sizeof(data));$ > > > > ERROR: code indent should never use tabs > > #602: FILE: tcmu/helper.c:93: > > +^I^Ireturn TCMU_STS_OK;$ > > > > ERROR: code indent should never use tabs > > #603: FILE: tcmu/helper.c:94: > > +^I}$ > > > > ERROR: code indent should never use tabs > > #604: FILE: tcmu/helper.c:95: > > +^Ibreak;$ > > > > ERROR: code indent should never use tabs > > #605: FILE: tcmu/helper.c:96: > > +^Icase 0x80: /* Unit Serial Number */$ > > > > ERROR: code indent should never use tabs > > #606: FILE: tcmu/helper.c:97: > > +^I{$ > > > > ERROR: code indent should never use tabs > > #607: FILE: tcmu/helper.c:98: > > +^I^Ichar data[512];$ > > > > ERROR: code indent should never use tabs > > #608: FILE: tcmu/helper.c:99: > > +^I^Ichar *wwn;$ > > > > ERROR: code indent should never use tabs > > #609: FILE: tcmu/helper.c:100: > > +^I^Iuint32_t len;$ > > > > ERROR: code indent should never use tabs > > #611: FILE: tcmu/helper.c:102: > > +^I^Imemset(data, 0, sizeof(data));$ > > > > ERROR: code indent should never use tabs > > #613: FILE: tcmu/helper.c:104: > > +^I^Idata[1] = 0x80;$ > > > > ERROR: code indent should never use tabs > > #615: FILE: tcmu/helper.c:106: > > +^I^Iwwn = tcmu_cfgfs_dev_get_wwn(dev);$ > > > > ERROR: code indent should never use tabs > > #616: FILE: tcmu/helper.c:107: > > +^I^Iif (!wwn)$ > > > > ERROR: braces {} are necessary for all arms of this statement > > #616: FILE: tcmu/helper.c:107: > > + if (!wwn) > > [...] > > > > ERROR: code indent should never use tabs > > #617: FILE: tcmu/helper.c:108: > > +^I^I^Ireturn TCMU_STS_HW_ERR;$ > > > > ERROR: code indent should never use tabs > > #619: FILE: tcmu/helper.c:110: > > +^I^I/*$ > > > > ERROR: code indent should never use tabs > > #620: FILE: tcmu/helper.c:111: > > +^I^I * The maximum length of the unit_serial has limited$ > > > > ERROR: code indent should never use tabs > > #621: FILE: tcmu/helper.c:112: > > +^I^I * to 254 Bytes in kernel, so here limit to 256 Bytes$ > > > > ERROR: code indent should never use tabs > > #622: FILE: tcmu/helper.c:113: > > +^I^I * will be enough.$ > > > > ERROR: code indent should never use tabs > > #623: FILE: tcmu/helper.c:114: > > +^I^I */$ > > > > ERROR: code indent should never use tabs > > #624: FILE: tcmu/helper.c:115: > > +^I^Ilen = snprintf(&data[4], 256, "%s", wwn);$ > > > > ERROR: code indent should never use tabs > > #625: FILE: tcmu/helper.c:116: > > +^I^Idata[3] = len + 1;$ > > > > ERROR: code indent should never use tabs > > #627: FILE: tcmu/helper.c:118: > > +^I^Itcmu_memcpy_into_iovec(iovec, iov_cnt, data, sizeof(data));$ > > > > ERROR: code indent should never use tabs > > #629: FILE: tcmu/helper.c:120: > > +^I^Ifree(wwn);$ > > > > ERROR: code indent should never use tabs > > #630: FILE: tcmu/helper.c:121: > > +^I^Ireturn TCMU_STS_OK;$ > > > > ERROR: code indent should never use tabs > > #631: FILE: tcmu/helper.c:122: > > +^I}$ > > > > ERROR: code indent should never use tabs > > #632: FILE: tcmu/helper.c:123: > > +^Ibreak;$ > > > > ERROR: code indent should never use tabs > > #633: FILE: tcmu/helper.c:124: > > +^Icase 0x83: /* Device identification */$ > > > > ERROR: code indent should never use tabs > > #634: FILE: tcmu/helper.c:125: > > +^I{$ > > > > ERROR: code indent should never use tabs > > #635: FILE: tcmu/helper.c:126: > > +^I^Ichar data[512];$ > > > > ERROR: code indent should never use tabs > > #636: FILE: tcmu/helper.c:127: > > +^I^Ichar *ptr, *p, *wwn;$ > > > > ERROR: code indent should never use tabs > > #637: FILE: tcmu/helper.c:128: > > +^I^Isize_t len, used = 0;$ > > > > ERROR: code indent should never use tabs > > #638: FILE: tcmu/helper.c:129: > > +^I^Iuint16_t *tot_len = (uint16_t*) &data[2];$ > > > > ERROR: "(foo*)" should be "(foo *)" > > #638: FILE: tcmu/helper.c:129: > > + uint16_t *tot_len = (uint16_t*) &data[2]; > > > > ERROR: code indent should never use tabs > > #639: FILE: tcmu/helper.c:130: > > +^I^Ibool next;$ > > > > ERROR: code indent should never use tabs > > #640: FILE: tcmu/helper.c:131: > > +^I^Iint i;$ > > > > ERROR: code indent should never use tabs > > #642: FILE: tcmu/helper.c:133: > > +^I^Imemset(data, 0, sizeof(data));$ > > > > ERROR: code indent should never use tabs > > #644: FILE: tcmu/helper.c:135: > > +^I^Idata[1] = 0x83;$ > > > > ERROR: code indent should never use tabs > > #646: FILE: tcmu/helper.c:137: > > +^I^Iwwn = tcmu_cfgfs_dev_get_wwn(dev);$ > > > > ERROR: code indent should never use tabs > > #647: FILE: tcmu/helper.c:138: > > +^I^Iif (!wwn)$ > > > > ERROR: braces {} are necessary for all arms of this statement > > #647: FILE: tcmu/helper.c:138: > > + if (!wwn) > > [...] > > > > ERROR: code indent should never use tabs > > #648: FILE: tcmu/helper.c:139: > > +^I^I^Ireturn TCMU_STS_HW_ERR;$ > > > > ERROR: code indent should never use tabs > > #650: FILE: tcmu/helper.c:141: > > +^I^Iptr = &data[4];$ > > > > ERROR: code indent should never use tabs > > #652: FILE: tcmu/helper.c:143: > > +^I^I/* 1/5: T10 Vendor id */$ > > > > ERROR: code indent should never use tabs > > #653: FILE: tcmu/helper.c:144: > > +^I^Iptr[0] = 2; /* code set: ASCII */$ > > > > ERROR: code indent should never use tabs > > #654: FILE: tcmu/helper.c:145: > > +^I^Iptr[1] = 1; /* identifier: T10 vendor id */$ > > > > ERROR: code indent should never use tabs > > #655: FILE: tcmu/helper.c:146: > > +^I^Imemcpy(&ptr[4], "LIO-ORG ", 8);$ > > > > ERROR: code indent should never use tabs > > #656: FILE: tcmu/helper.c:147: > > +^I^Ilen = snprintf(&ptr[12], sizeof(data) - 16, "%s", wwn);$ > > > > ERROR: code indent should never use tabs > > #658: FILE: tcmu/helper.c:149: > > +^I^Iptr[3] = 8 + len + 1;$ > > > > ERROR: code indent should never use tabs > > #659: FILE: tcmu/helper.c:150: > > +^I^Iused += (uint8_t)ptr[3] + 4;$ > > > > ERROR: code indent should never use tabs > > #660: FILE: tcmu/helper.c:151: > > +^I^Iptr += used;$ > > > > ERROR: code indent should never use tabs > > #662: FILE: tcmu/helper.c:153: > > +^I^I/* 2/5: NAA binary */$ > > > > ERROR: code indent should never use tabs > > #663: FILE: tcmu/helper.c:154: > > +^I^Iptr[0] = 1; /* code set: binary */$ > > > > ERROR: code indent should never use tabs > > #664: FILE: tcmu/helper.c:155: > > +^I^Iptr[1] = 3; /* identifier: NAA */$ > > > > WARNING: line over 80 characters > > #665: FILE: tcmu/helper.c:156: > > + ptr[3] = 16; /* body length for naa registered extended format */ > > > > ERROR: code indent should never use tabs > > #665: FILE: tcmu/helper.c:156: > > +^I^Iptr[3] = 16; /* body length for naa registered extended format */$ > > > > ERROR: code indent should never use tabs > > #667: FILE: tcmu/helper.c:158: > > +^I^I/*$ > > > > ERROR: code indent should never use tabs > > #668: FILE: tcmu/helper.c:159: > > +^I^I * Set type 6 and use OpenFabrics IEEE Company ID: 00 14 05$ > > > > ERROR: code indent should never use tabs > > #669: FILE: tcmu/helper.c:160: > > +^I^I */$ > > > > ERROR: code indent should never use tabs > > #670: FILE: tcmu/helper.c:161: > > +^I^Iptr[4] = 0x60;$ > > > > ERROR: code indent should never use tabs > > #671: FILE: tcmu/helper.c:162: > > +^I^Iptr[5] = 0x01;$ > > > > ERROR: code indent should never use tabs > > #672: FILE: tcmu/helper.c:163: > > +^I^Iptr[6] = 0x40;$ > > > > ERROR: code indent should never use tabs > > #673: FILE: tcmu/helper.c:164: > > +^I^Iptr[7] = 0x50;$ > > > > ERROR: code indent should never use tabs > > #675: FILE: tcmu/helper.c:166: > > +^I^I/*$ > > > > ERROR: code indent should never use tabs > > #676: FILE: tcmu/helper.c:167: > > +^I^I * Fill in the rest with a binary representation of WWN$ > > > > ERROR: code indent should never use tabs > > #677: FILE: tcmu/helper.c:168: > > +^I^I *$ > > > > ERROR: code indent should never use tabs > > #678: FILE: tcmu/helper.c:169: > > +^I^I * This implementation only uses a nibble out of every byte of$ > > > > ERROR: code indent should never use tabs > > #679: FILE: tcmu/helper.c:170: > > +^I^I * WWN, but this is what the kernel does, and it's nice for our$ > > > > ERROR: code indent should never use tabs > > #680: FILE: tcmu/helper.c:171: > > +^I^I * values to match.$ > > > > ERROR: code indent should never use tabs > > #681: FILE: tcmu/helper.c:172: > > +^I^I */$ > > > > ERROR: code indent should never use tabs > > #682: FILE: tcmu/helper.c:173: > > +^I^Inext = true;$ > > > > ERROR: code indent should never use tabs > > #683: FILE: tcmu/helper.c:174: > > +^I^Ifor (p = wwn, i = 7; *p && i < 20; p++) {$ > > > > ERROR: code indent should never use tabs > > #684: FILE: tcmu/helper.c:175: > > +^I^I^Iuint8_t val;$ > > > > ERROR: code indent should never use tabs > > #686: FILE: tcmu/helper.c:177: > > +^I^I^Iif (!char_to_hex(&val, *p))$ > > > > ERROR: braces {} are necessary for all arms of this statement > > #686: FILE: tcmu/helper.c:177: > > + if (!char_to_hex(&val, *p)) > > [...] > > > > ERROR: code indent should never use tabs > > #687: FILE: tcmu/helper.c:178: > > +^I^I^I^Icontinue;$ > > > > ERROR: code indent should never use tabs > > #689: FILE: tcmu/helper.c:180: > > +^I^I^Iif (next) {$ > > > > ERROR: code indent should never use tabs > > #690: FILE: tcmu/helper.c:181: > > +^I^I^I^Inext = false;$ > > > > ERROR: code indent should never use tabs > > #691: FILE: tcmu/helper.c:182: > > +^I^I^I^Iptr[i++] |= val;$ > > > > ERROR: code indent should never use tabs > > #692: FILE: tcmu/helper.c:183: > > +^I^I^I} else {$ > > > > ERROR: code indent should never use tabs > > #693: FILE: tcmu/helper.c:184: > > +^I^I^I^Inext = true;$ > > > > ERROR: code indent should never use tabs > > #694: FILE: tcmu/helper.c:185: > > +^I^I^I^Iptr[i] = val << 4;$ > > > > ERROR: code indent should never use tabs > > #695: FILE: tcmu/helper.c:186: > > +^I^I^I}$ > > > > ERROR: code indent should never use tabs > > #696: FILE: tcmu/helper.c:187: > > +^I^I}$ > > > > ERROR: code indent should never use tabs > > #698: FILE: tcmu/helper.c:189: > > +^I^Iused += 20;$ > > > > ERROR: code indent should never use tabs > > #699: FILE: tcmu/helper.c:190: > > +^I^Iptr += 20;$ > > > > ERROR: code indent should never use tabs > > #701: FILE: tcmu/helper.c:192: > > +^I^I/* 3/6: Vendor specific */$ > > > > ERROR: code indent should never use tabs > > #702: FILE: tcmu/helper.c:193: > > +^I^Iptr[0] = 2; /* code set: ASCII */$ > > > > ERROR: code indent should never use tabs > > #703: FILE: tcmu/helper.c:194: > > +^I^Iptr[1] = 0; /* identifier: vendor-specific */$ > > > > ERROR: line over 90 characters > > #705: FILE: tcmu/helper.c:196: > > + len = snprintf(&ptr[4], sizeof(data) - used - 4, "%s", tcmu_dev_get_cfgstring(dev)); > > > > ERROR: code indent should never use tabs > > #705: FILE: tcmu/helper.c:196: > > +^I^Ilen = snprintf(&ptr[4], sizeof(data) - used - 4, "%s", tcmu_dev_get_cfgstring(dev));$ > > > > ERROR: code indent should never use tabs > > #706: FILE: tcmu/helper.c:197: > > +^I^Iptr[3] = len + 1;$ > > > > ERROR: code indent should never use tabs > > #708: FILE: tcmu/helper.c:199: > > +^I^Iused += (uint8_t)ptr[3] + 4;$ > > > > ERROR: code indent should never use tabs > > #709: FILE: tcmu/helper.c:200: > > +^I^Iptr += (uint8_t)ptr[3] + 4;$ > > > > ERROR: code indent should never use tabs > > #711: FILE: tcmu/helper.c:202: > > +^I^I/* Done with descriptor list */$ > > > > ERROR: code indent should never use tabs > > #713: FILE: tcmu/helper.c:204: > > +^I^I*tot_len = htobe16(used);$ > > > > ERROR: code indent should never use tabs > > #715: FILE: tcmu/helper.c:206: > > +^I^Itcmu_memcpy_into_iovec(iovec, iov_cnt, data, used + 4);$ > > > > ERROR: code indent should never use tabs > > #717: FILE: tcmu/helper.c:208: > > +^I^Ifree(wwn);$ > > > > ERROR: code indent should never use tabs > > #718: FILE: tcmu/helper.c:209: > > +^I^Iwwn = NULL;$ > > > > ERROR: code indent should never use tabs > > #720: FILE: tcmu/helper.c:211: > > +^I^Ireturn TCMU_STS_OK;$ > > > > ERROR: code indent should never use tabs > > #721: FILE: tcmu/helper.c:212: > > +^I}$ > > > > ERROR: code indent should never use tabs > > #722: FILE: tcmu/helper.c:213: > > +^Ibreak;$ > > > > ERROR: code indent should never use tabs > > #723: FILE: tcmu/helper.c:214: > > +^Icase 0xb0: /* Block Limits */$ > > > > ERROR: code indent should never use tabs > > #724: FILE: tcmu/helper.c:215: > > +^I{$ > > > > ERROR: code indent should never use tabs > > #725: FILE: tcmu/helper.c:216: > > +^I^Ichar data[64];$ > > > > ERROR: code indent should never use tabs > > #726: FILE: tcmu/helper.c:217: > > +^I^Iuint32_t max_xfer_length;$ > > > > ERROR: code indent should never use tabs > > #727: FILE: tcmu/helper.c:218: > > +^I^Iuint16_t val16;$ > > > > ERROR: code indent should never use tabs > > #728: FILE: tcmu/helper.c:219: > > +^I^Iuint32_t val32;$ > > > > ERROR: code indent should never use tabs > > #730: FILE: tcmu/helper.c:221: > > +^I^Imemset(data, 0, sizeof(data));$ > > > > ERROR: code indent should never use tabs > > #732: FILE: tcmu/helper.c:223: > > +^I^Idata[1] = 0xb0;$ > > > > ERROR: code indent should never use tabs > > #734: FILE: tcmu/helper.c:225: > > +^I^Ival16 = htobe16(0x3c);$ > > > > ERROR: code indent should never use tabs > > #735: FILE: tcmu/helper.c:226: > > +^I^Imemcpy(&data[2], &val16, 2);$ > > > > ERROR: code indent should never use tabs > > #737: FILE: tcmu/helper.c:228: > > +^I^I/* WSNZ = 1: the device server won't support a value of zero$ > > > > WARNING: Block comments use a leading /* on a separate line > > #737: FILE: tcmu/helper.c:228: > > + /* WSNZ = 1: the device server won't support a value of zero > > > > ERROR: code indent should never use tabs > > #738: FILE: tcmu/helper.c:229: > > +^I^I * in the NUMBER OF LOGICAL BLOCKS field in the WRITE SAME$ > > > > ERROR: code indent should never use tabs > > #739: FILE: tcmu/helper.c:230: > > +^I^I * command CDBs$ > > > > ERROR: code indent should never use tabs > > #740: FILE: tcmu/helper.c:231: > > +^I^I */$ > > > > ERROR: code indent should never use tabs > > #741: FILE: tcmu/helper.c:232: > > +^I^Idata[4] = 0x01;$ > > > > ERROR: code indent should never use tabs > > #743: FILE: tcmu/helper.c:234: > > +^I^I/*$ > > > > ERROR: code indent should never use tabs > > #744: FILE: tcmu/helper.c:235: > > +^I^I * Daemons like runner may override the user requested$ > > > > ERROR: code indent should never use tabs > > #745: FILE: tcmu/helper.c:236: > > +^I^I * value due to device specific limits.$ > > > > ERROR: code indent should never use tabs > > #746: FILE: tcmu/helper.c:237: > > +^I^I */$ > > > > ERROR: code indent should never use tabs > > #747: FILE: tcmu/helper.c:238: > > +^I^Imax_xfer_length = tcmu_dev_get_max_xfer_len(dev);$ > > > > ERROR: code indent should never use tabs > > #749: FILE: tcmu/helper.c:240: > > +^I^Ival32 = htobe32(max_xfer_length);$ > > > > ERROR: code indent should never use tabs > > #750: FILE: tcmu/helper.c:241: > > +^I^I/* Max xfer length */$ > > > > ERROR: code indent should never use tabs > > #751: FILE: tcmu/helper.c:242: > > +^I^Imemcpy(&data[8], &val32, 4);$ > > > > ERROR: code indent should never use tabs > > #752: FILE: tcmu/helper.c:243: > > +^I^I/* Optimal xfer length */$ > > > > ERROR: code indent should never use tabs > > #753: FILE: tcmu/helper.c:244: > > +^I^Imemcpy(&data[12], &val32, 4);$ > > > > ERROR: code indent should never use tabs > > #755: FILE: tcmu/helper.c:246: > > +^I^Itcmu_memcpy_into_iovec(iovec, iov_cnt, data, sizeof(data));$ > > > > ERROR: code indent should never use tabs > > #757: FILE: tcmu/helper.c:248: > > +^I^Ireturn TCMU_STS_OK;$ > > > > ERROR: code indent should never use tabs > > #758: FILE: tcmu/helper.c:249: > > +^I}$ > > > > ERROR: code indent should never use tabs > > #759: FILE: tcmu/helper.c:250: > > +^Ibreak;$ > > > > ERROR: code indent should never use tabs > > #760: FILE: tcmu/helper.c:251: > > +^Icase 0xb1: /* Block Device Characteristics VPD page */$ > > > > ERROR: code indent should never use tabs > > #761: FILE: tcmu/helper.c:252: > > +^I{$ > > > > ERROR: code indent should never use tabs > > #762: FILE: tcmu/helper.c:253: > > +^I^Ichar data[64];$ > > > > ERROR: code indent should never use tabs > > #763: FILE: tcmu/helper.c:254: > > +^I^Iuint16_t val16;$ > > > > ERROR: code indent should never use tabs > > #765: FILE: tcmu/helper.c:256: > > +^I^Imemset(data, 0, sizeof(data));$ > > > > ERROR: code indent should never use tabs > > #767: FILE: tcmu/helper.c:258: > > +^I^I/*$ > > > > ERROR: code indent should never use tabs > > #768: FILE: tcmu/helper.c:259: > > +^I^I * From spc-5 Revision 14, section 6.7.2 Standard INQUIRY data$ > > > > ERROR: code indent should never use tabs > > #769: FILE: tcmu/helper.c:260: > > +^I^I * set the devive type to Direct access block device.$ > > > > ERROR: code indent should never use tabs > > #770: FILE: tcmu/helper.c:261: > > +^I^I */$ > > > > ERROR: code indent should never use tabs > > #771: FILE: tcmu/helper.c:262: > > +^I^Idata[0] = 0x00;$ > > > > ERROR: code indent should never use tabs > > #773: FILE: tcmu/helper.c:264: > > +^I^I/* PAGE CODE (B1h) */$ > > > > ERROR: code indent should never use tabs > > #774: FILE: tcmu/helper.c:265: > > +^I^Idata[1] = 0xb1;$ > > > > ERROR: code indent should never use tabs > > #776: FILE: tcmu/helper.c:267: > > +^I^I/* PAGE LENGTH (003Ch)*/$ > > > > ERROR: code indent should never use tabs > > #777: FILE: tcmu/helper.c:268: > > +^I^Ival16 = htobe16(0x003c);$ > > > > ERROR: code indent should never use tabs > > #778: FILE: tcmu/helper.c:269: > > +^I^Imemcpy(&data[2], &val16, 2);$ > > > > ERROR: code indent should never use tabs > > #780: FILE: tcmu/helper.c:271: > > +^I^Iif (tcmu_dev_get_solid_state_media(dev)) {$ > > > > ERROR: code indent should never use tabs > > #781: FILE: tcmu/helper.c:272: > > +^I^I^Ival16 = htobe16(0x0001);$ > > > > ERROR: code indent should never use tabs > > #782: FILE: tcmu/helper.c:273: > > +^I^I^Imemcpy(&data[4], &val16, 2);$ > > > > ERROR: code indent should never use tabs > > #783: FILE: tcmu/helper.c:274: > > +^I^I}$ > > > > ERROR: code indent should never use tabs > > #785: FILE: tcmu/helper.c:276: > > +^I^Itcmu_memcpy_into_iovec(iovec, iov_cnt, data, sizeof(data));$ > > > > ERROR: code indent should never use tabs > > #786: FILE: tcmu/helper.c:277: > > +^I^Ireturn TCMU_STS_OK;$ > > > > ERROR: code indent should never use tabs > > #787: FILE: tcmu/helper.c:278: > > +^I}$ > > > > ERROR: code indent should never use tabs > > #788: FILE: tcmu/helper.c:279: > > +^Ibreak;$ > > > > ERROR: code indent should never use tabs > > #789: FILE: tcmu/helper.c:280: > > +^Icase 0xb2: /* Logical Block Provisioning VPD page */$ > > > > ERROR: code indent should never use tabs > > #790: FILE: tcmu/helper.c:281: > > +^I{$ > > > > ERROR: code indent should never use tabs > > #791: FILE: tcmu/helper.c:282: > > +^I^Ichar data[64];$ > > > > ERROR: code indent should never use tabs > > #792: FILE: tcmu/helper.c:283: > > +^I^Iuint16_t val16;$ > > > > ERROR: code indent should never use tabs > > #794: FILE: tcmu/helper.c:285: > > +^I^Imemset(data, 0, sizeof(data));$ > > > > ERROR: code indent should never use tabs > > #796: FILE: tcmu/helper.c:287: > > +^I^I/*$ > > > > ERROR: code indent should never use tabs > > #797: FILE: tcmu/helper.c:288: > > +^I^I * From spc-5 Revision 14, section 6.7.2 Standard INQUIRY data$ > > > > ERROR: code indent should never use tabs > > #798: FILE: tcmu/helper.c:289: > > +^I^I * set the device type to Direct access block device.$ > > > > ERROR: code indent should never use tabs > > #799: FILE: tcmu/helper.c:290: > > +^I^I */$ > > > > ERROR: code indent should never use tabs > > #800: FILE: tcmu/helper.c:291: > > +^I^Idata[0] = 0x00;$ > > > > ERROR: code indent should never use tabs > > #802: FILE: tcmu/helper.c:293: > > +^I^I/* PAGE CODE (B2h) */$ > > > > ERROR: code indent should never use tabs > > #803: FILE: tcmu/helper.c:294: > > +^I^Idata[1] = 0xb2;$ > > > > ERROR: code indent should never use tabs > > #805: FILE: tcmu/helper.c:296: > > +^I^I/*$ > > > > WARNING: line over 80 characters > > #806: FILE: tcmu/helper.c:297: > > + * PAGE LENGTH field: PROVISIONING GROUP DESCRIPTOR field will be > > > > ERROR: code indent should never use tabs > > #806: FILE: tcmu/helper.c:297: > > +^I^I * PAGE LENGTH field: PROVISIONING GROUP DESCRIPTOR field will be$ > > > > ERROR: code indent should never use tabs > > #807: FILE: tcmu/helper.c:298: > > +^I^I * not present.$ > > > > ERROR: code indent should never use tabs > > #808: FILE: tcmu/helper.c:299: > > +^I^I */$ > > > > ERROR: code indent should never use tabs > > #809: FILE: tcmu/helper.c:300: > > +^I^Ival16 = htobe16(0x0004);$ > > > > ERROR: code indent should never use tabs > > #810: FILE: tcmu/helper.c:301: > > +^I^Imemcpy(&data[2], &val16, 2);$ > > > > ERROR: code indent should never use tabs > > #812: FILE: tcmu/helper.c:303: > > +^I^I/*$ > > > > ERROR: code indent should never use tabs > > #813: FILE: tcmu/helper.c:304: > > +^I^I * The logical block provisioning read zeros (LBPRZ) field.$ > > > > ERROR: code indent should never use tabs > > #814: FILE: tcmu/helper.c:305: > > +^I^I *$ > > > > WARNING: line over 80 characters > > #815: FILE: tcmu/helper.c:306: > > + * The logical block data represented by unmapped LBAs is set to zeros > > > > ERROR: code indent should never use tabs > > #815: FILE: tcmu/helper.c:306: > > +^I^I * The logical block data represented by unmapped LBAs is set to zeros$ > > > > ERROR: code indent should never use tabs > > #816: FILE: tcmu/helper.c:307: > > +^I^I */$ > > > > ERROR: code indent should never use tabs > > #817: FILE: tcmu/helper.c:308: > > +^I^Idata[5] = 0x04;$ > > > > ERROR: code indent should never use tabs > > #819: FILE: tcmu/helper.c:310: > > +^I^Itcmu_memcpy_into_iovec(iovec, iov_cnt, data, sizeof(data));$ > > > > ERROR: code indent should never use tabs > > #820: FILE: tcmu/helper.c:311: > > +^I^Ireturn TCMU_STS_OK;$ > > > > ERROR: code indent should never use tabs > > #821: FILE: tcmu/helper.c:312: > > +^I}$ > > > > ERROR: code indent should never use tabs > > #822: FILE: tcmu/helper.c:313: > > +^Ibreak;$ > > > > ERROR: code indent should never use tabs > > #823: FILE: tcmu/helper.c:314: > > +^Idefault:$ > > > > ERROR: code indent should never use tabs > > #824: FILE: tcmu/helper.c:315: > > +^I^Ierror_report("Vital product data page code 0x%x not support\n",$ > > > > ERROR: Error messages should not contain newlines > > #824: FILE: tcmu/helper.c:315: > > + error_report("Vital product data page code 0x%x not support\n", > > > > ERROR: code indent should never use tabs > > #825: FILE: tcmu/helper.c:316: > > +^I^I^I cdb[2]);$ > > > > ERROR: code indent should never use tabs > > #826: FILE: tcmu/helper.c:317: > > +^I^Ireturn TCMU_STS_INVALID_CDB;$ > > > > ERROR: code indent should never use tabs > > #827: FILE: tcmu/helper.c:318: > > +^I}$ > > > > ERROR: code indent should never use tabs > > #834: FILE: tcmu/helper.c:325: > > +^Istruct tcmu_device *dev,$ > > > > ERROR: code indent should never use tabs > > #835: FILE: tcmu/helper.c:326: > > +^Iuint8_t *cdb,$ > > > > ERROR: code indent should never use tabs > > #836: FILE: tcmu/helper.c:327: > > +^Istruct iovec *iovec,$ > > > > ERROR: code indent should never use tabs > > #837: FILE: tcmu/helper.c:328: > > +^Isize_t iov_cnt)$ > > > > ERROR: code indent should never use tabs > > #839: FILE: tcmu/helper.c:330: > > +^Iif (!(cdb[1] & 0x01)) {$ > > > > ERROR: code indent should never use tabs > > #840: FILE: tcmu/helper.c:331: > > +^I^Iif (!cdb[2])$ > > > > ERROR: code indent should never use tabs > > #841: FILE: tcmu/helper.c:332: > > +^I^I^Ireturn tcmu_emulate_std_inquiry(cdb, iovec,$ > > > > ERROR: code indent should never use tabs > > #842: FILE: tcmu/helper.c:333: > > +^I^I^I^I^I^I^Iiov_cnt);$ > > > > ERROR: code indent should never use tabs > > #843: FILE: tcmu/helper.c:334: > > +^I^Ielse$ > > > > ERROR: code indent should never use tabs > > #844: FILE: tcmu/helper.c:335: > > +^I^I^Ireturn TCMU_STS_INVALID_CDB;$ > > > > ERROR: code indent should never use tabs > > #845: FILE: tcmu/helper.c:336: > > +^I} else {$ > > > > ERROR: code indent should never use tabs > > #846: FILE: tcmu/helper.c:337: > > +^I^Ireturn tcmu_emulate_evpd_inquiry(dev, cdb, iovec, iov_cnt);$ > > > > ERROR: code indent should never use tabs > > #847: FILE: tcmu/helper.c:338: > > +^I}$ > > > > ERROR: code indent should never use tabs > > #851: FILE: tcmu/helper.c:342: > > +^Iuint8_t *cdb,$ > > > > ERROR: code indent should never use tabs > > #852: FILE: tcmu/helper.c:343: > > +^Istruct iovec *iovec,$ > > > > ERROR: code indent should never use tabs > > #853: FILE: tcmu/helper.c:344: > > +^Isize_t iov_cnt)$ > > > > ERROR: code indent should never use tabs > > #855: FILE: tcmu/helper.c:346: > > +^Ireturn TCMU_STS_OK;$ > > > > ERROR: code indent should never use tabs > > #859: FILE: tcmu/helper.c:350: > > +^Iuint64_t num_lbas,$ > > > > ERROR: code indent should never use tabs > > #860: FILE: tcmu/helper.c:351: > > +^Iuint32_t block_size,$ > > > > ERROR: code indent should never use tabs > > #861: FILE: tcmu/helper.c:352: > > +^Iuint8_t *cdb,$ > > > > ERROR: code indent should never use tabs > > #862: FILE: tcmu/helper.c:353: > > +^Istruct iovec *iovec,$ > > > > ERROR: code indent should never use tabs > > #863: FILE: tcmu/helper.c:354: > > +^Isize_t iov_cnt)$ > > > > ERROR: code indent should never use tabs > > #865: FILE: tcmu/helper.c:356: > > +^Iuint8_t buf[8];$ > > > > ERROR: code indent should never use tabs > > #866: FILE: tcmu/helper.c:357: > > +^Iuint32_t val32;$ > > > > ERROR: code indent should never use tabs > > #868: FILE: tcmu/helper.c:359: > > +^Imemset(buf, 0, sizeof(buf));$ > > > > ERROR: code indent should never use tabs > > #870: FILE: tcmu/helper.c:361: > > +^Iif (num_lbas < 0x100000000ULL) {$ > > > > ERROR: code indent should never use tabs > > #871: FILE: tcmu/helper.c:362: > > +^I^I// Return the LBA of the last logical block, so subtract 1.$ > > > > ERROR: do not use C99 // comments > > #871: FILE: tcmu/helper.c:362: > > + // Return the LBA of the last logical block, so subtract 1. > > > > ERROR: code indent should never use tabs > > #872: FILE: tcmu/helper.c:363: > > +^I^Ival32 = htobe32(num_lbas-1);$ > > > > ERROR: spaces required around that '-' (ctx:VxV) > > #872: FILE: tcmu/helper.c:363: > > + val32 = htobe32(num_lbas-1); > > ^ > > > > ERROR: code indent should never use tabs > > #873: FILE: tcmu/helper.c:364: > > +^I} else {$ > > > > ERROR: code indent should never use tabs > > #874: FILE: tcmu/helper.c:365: > > +^I^I// This lets the initiator know that he needs to use$ > > > > ERROR: do not use C99 // comments > > #874: FILE: tcmu/helper.c:365: > > + // This lets the initiator know that he needs to use > > > > ERROR: code indent should never use tabs > > #875: FILE: tcmu/helper.c:366: > > +^I^I// Read Capacity(16).$ > > > > ERROR: do not use C99 // comments > > #875: FILE: tcmu/helper.c:366: > > + // Read Capacity(16). > > > > ERROR: code indent should never use tabs > > #876: FILE: tcmu/helper.c:367: > > +^I^Ival32 = 0xffffffff;$ > > > > ERROR: code indent should never use tabs > > #877: FILE: tcmu/helper.c:368: > > +^I}$ > > > > ERROR: code indent should never use tabs > > #879: FILE: tcmu/helper.c:370: > > +^Imemcpy(&buf[0], &val32, 4);$ > > > > ERROR: code indent should never use tabs > > #881: FILE: tcmu/helper.c:372: > > +^Ival32 = htobe32(block_size);$ > > > > ERROR: code indent should never use tabs > > #882: FILE: tcmu/helper.c:373: > > +^Imemcpy(&buf[4], &val32, 4);$ > > > > ERROR: code indent should never use tabs > > #884: FILE: tcmu/helper.c:375: > > +^I/* all else is zero */$ > > > > ERROR: code indent should never use tabs > > #886: FILE: tcmu/helper.c:377: > > +^Itcmu_memcpy_into_iovec(iovec, iov_cnt, buf, sizeof(buf));$ > > > > ERROR: code indent should never use tabs > > #888: FILE: tcmu/helper.c:379: > > +^Ireturn TCMU_STS_OK;$ > > > > ERROR: code indent should never use tabs > > #892: FILE: tcmu/helper.c:383: > > +^Iuint64_t num_lbas,$ > > > > ERROR: code indent should never use tabs > > #893: FILE: tcmu/helper.c:384: > > +^Iuint32_t block_size,$ > > > > ERROR: code indent should never use tabs > > #894: FILE: tcmu/helper.c:385: > > +^Iuint8_t *cdb,$ > > > > ERROR: code indent should never use tabs > > #895: FILE: tcmu/helper.c:386: > > +^Istruct iovec *iovec,$ > > > > ERROR: code indent should never use tabs > > #896: FILE: tcmu/helper.c:387: > > +^Isize_t iov_cnt)$ > > > > ERROR: code indent should never use tabs > > #898: FILE: tcmu/helper.c:389: > > +^Iuint8_t buf[32];$ > > > > ERROR: code indent should never use tabs > > #899: FILE: tcmu/helper.c:390: > > +^Iuint64_t val64;$ > > > > ERROR: code indent should never use tabs > > #900: FILE: tcmu/helper.c:391: > > +^Iuint32_t val32;$ > > > > ERROR: code indent should never use tabs > > #902: FILE: tcmu/helper.c:393: > > +^Imemset(buf, 0, sizeof(buf));$ > > > > ERROR: code indent should never use tabs > > #904: FILE: tcmu/helper.c:395: > > +^I// Return the LBA of the last logical block, so subtract 1.$ > > > > ERROR: do not use C99 // comments > > #904: FILE: tcmu/helper.c:395: > > + // Return the LBA of the last logical block, so subtract 1. > > > > ERROR: code indent should never use tabs > > #905: FILE: tcmu/helper.c:396: > > +^Ival64 = htobe64(num_lbas-1);$ > > > > ERROR: spaces required around that '-' (ctx:VxV) > > #905: FILE: tcmu/helper.c:396: > > + val64 = htobe64(num_lbas-1); > > ^ > > > > ERROR: code indent should never use tabs > > #906: FILE: tcmu/helper.c:397: > > +^Imemcpy(&buf[0], &val64, 8);$ > > > > ERROR: code indent should never use tabs > > #908: FILE: tcmu/helper.c:399: > > +^Ival32 = htobe32(block_size);$ > > > > ERROR: code indent should never use tabs > > #909: FILE: tcmu/helper.c:400: > > +^Imemcpy(&buf[8], &val32, 4);$ > > > > ERROR: code indent should never use tabs > > #911: FILE: tcmu/helper.c:402: > > +^I/*$ > > > > ERROR: code indent should never use tabs > > #912: FILE: tcmu/helper.c:403: > > +^I * Logical Block Provisioning Management Enabled (LBPME) bit$ > > > > ERROR: code indent should never use tabs > > #913: FILE: tcmu/helper.c:404: > > +^I *$ > > > > ERROR: code indent should never use tabs > > #914: FILE: tcmu/helper.c:405: > > +^I * The LBPME bit sets to one and then the logical unit implements$ > > > > ERROR: code indent should never use tabs > > #915: FILE: tcmu/helper.c:406: > > +^I * logical block provisioning management$ > > > > ERROR: code indent should never use tabs > > #916: FILE: tcmu/helper.c:407: > > +^I */$ > > > > ERROR: code indent should never use tabs > > #917: FILE: tcmu/helper.c:408: > > +^Ibuf[14] = 0x80;$ > > > > ERROR: code indent should never use tabs > > #919: FILE: tcmu/helper.c:410: > > +^I/*$ > > > > ERROR: code indent should never use tabs > > #920: FILE: tcmu/helper.c:411: > > +^I * The logical block provisioning read zeros (LBPRZ) bit shall be$ > > > > ERROR: code indent should never use tabs > > #921: FILE: tcmu/helper.c:412: > > +^I * set to one if the LBPRZ field is set to xx1b in VPD B2. The$ > > > > ERROR: code indent should never use tabs > > #922: FILE: tcmu/helper.c:413: > > +^I * LBPRZ bit shall be set to zero if the LBPRZ field is not set$ > > > > ERROR: code indent should never use tabs > > #923: FILE: tcmu/helper.c:414: > > +^I * to xx1b.$ > > > > ERROR: code indent should never use tabs > > #924: FILE: tcmu/helper.c:415: > > +^I */$ > > > > ERROR: code indent should never use tabs > > #925: FILE: tcmu/helper.c:416: > > +^Ibuf[14] |= 0x40;$ > > > > ERROR: code indent should never use tabs > > #927: FILE: tcmu/helper.c:418: > > +^I/* all else is zero */$ > > > > ERROR: code indent should never use tabs > > #929: FILE: tcmu/helper.c:420: > > +^Itcmu_memcpy_into_iovec(iovec, iov_cnt, buf, sizeof(buf));$ > > > > ERROR: code indent should never use tabs > > #931: FILE: tcmu/helper.c:422: > > +^Ireturn TCMU_STS_OK;$ > > > > ERROR: code indent should never use tabs > > #935: FILE: tcmu/helper.c:426: > > +^I^I^I^I uint8_t *from_buf, size_t from_len)$ > > > > ERROR: code indent should never use tabs > > #937: FILE: tcmu/helper.c:428: > > +^Iif (!to_buf)$ > > > > ERROR: braces {} are necessary for all arms of this statement > > #937: FILE: tcmu/helper.c:428: > > + if (!to_buf) > > [...] > > > > ERROR: code indent should never use tabs > > #938: FILE: tcmu/helper.c:429: > > +^I^Ireturn;$ > > > > ERROR: code indent should never use tabs > > #939: FILE: tcmu/helper.c:430: > > +^I/*$ > > > > ERROR: code indent should never use tabs > > #940: FILE: tcmu/helper.c:431: > > +^I * SPC 4r37: 4.3.5.6 Allocation length:$ > > > > ERROR: code indent should never use tabs > > #941: FILE: tcmu/helper.c:432: > > +^I *$ > > > > ERROR: code indent should never use tabs > > #942: FILE: tcmu/helper.c:433: > > +^I * The device server shall terminate transfers to the Data-In Buffer$ > > > > ERROR: code indent should never use tabs > > #943: FILE: tcmu/helper.c:434: > > +^I * when the number of bytes or blocks specified by the ALLOCATION$ > > > > ERROR: code indent should never use tabs > > #944: FILE: tcmu/helper.c:435: > > +^I * LENGTH field have been transferred or when all available data$ > > > > ERROR: code indent should never use tabs > > #945: FILE: tcmu/helper.c:436: > > +^I * have been transferred, whichever is less.$ > > > > ERROR: code indent should never use tabs > > #946: FILE: tcmu/helper.c:437: > > +^I */$ > > > > ERROR: code indent should never use tabs > > #947: FILE: tcmu/helper.c:438: > > +^Imemcpy(to_buf, from_buf, to_len > from_len ? from_len : to_len);$ > > > > ERROR: code indent should never use tabs > > #951: FILE: tcmu/helper.c:442: > > +^I^I^I size_t ret_buf_len)$ > > > > ERROR: code indent should never use tabs > > #953: FILE: tcmu/helper.c:444: > > +^Iuint8_t buf[12];$ > > > > ERROR: code indent should never use tabs > > #955: FILE: tcmu/helper.c:446: > > +^Imemset(buf, 0, sizeof(buf));$ > > > > ERROR: code indent should never use tabs > > #956: FILE: tcmu/helper.c:447: > > +^Ibuf[0] = 0x1;$ > > > > ERROR: code indent should never use tabs > > #957: FILE: tcmu/helper.c:448: > > +^Ibuf[1] = 0xa;$ > > > > ERROR: code indent should never use tabs > > #959: FILE: tcmu/helper.c:450: > > +^Icopy_to_response_buf(ret_buf, ret_buf_len, buf, 12);$ > > > > ERROR: code indent should never use tabs > > #960: FILE: tcmu/helper.c:451: > > +^Ireturn 12;$ > > > > ERROR: code indent should never use tabs > > #964: FILE: tcmu/helper.c:455: > > +^I^I size_t ret_buf_len)$ > > > > ERROR: code indent should never use tabs > > #966: FILE: tcmu/helper.c:457: > > +^Iuint8_t buf[20];$ > > > > ERROR: code indent should never use tabs > > #968: FILE: tcmu/helper.c:459: > > +^Imemset(buf, 0, sizeof(buf));$ > > > > ERROR: code indent should never use tabs > > #969: FILE: tcmu/helper.c:460: > > +^Ibuf[0] = 0x8;$ > > > > ERROR: code indent should never use tabs > > #970: FILE: tcmu/helper.c:461: > > +^Ibuf[1] = 0x12;$ > > > > ERROR: code indent should never use tabs > > #972: FILE: tcmu/helper.c:463: > > +^I/*$ > > > > ERROR: code indent should never use tabs > > #973: FILE: tcmu/helper.c:464: > > +^I * If device supports a writeback cache then set writeback$ > > > > ERROR: code indent should never use tabs > > #974: FILE: tcmu/helper.c:465: > > +^I * cache enable (WCE)$ > > > > ERROR: code indent should never use tabs > > #975: FILE: tcmu/helper.c:466: > > +^I */$ > > > > ERROR: code indent should never use tabs > > #976: FILE: tcmu/helper.c:467: > > +^Iif (tcmu_dev_get_write_cache_enabled(dev))$ > > > > ERROR: braces {} are necessary for all arms of this statement > > #976: FILE: tcmu/helper.c:467: > > + if (tcmu_dev_get_write_cache_enabled(dev)) > > [...] > > > > ERROR: code indent should never use tabs > > #977: FILE: tcmu/helper.c:468: > > +^I^Ibuf[2] = 0x4;$ > > > > ERROR: code indent should never use tabs > > #979: FILE: tcmu/helper.c:470: > > +^Icopy_to_response_buf(ret_buf, ret_buf_len, buf, 20);$ > > > > ERROR: code indent should never use tabs > > #980: FILE: tcmu/helper.c:471: > > +^Ireturn 20;$ > > > > ERROR: code indent should never use tabs > > #984: FILE: tcmu/helper.c:475: > > +^I^I^I size_t ret_buf_len)$ > > > > ERROR: code indent should never use tabs > > #986: FILE: tcmu/helper.c:477: > > +^Iuint8_t buf[12];$ > > > > ERROR: code indent should never use tabs > > #988: FILE: tcmu/helper.c:479: > > +^Imemset(buf, 0, sizeof(buf));$ > > > > ERROR: code indent should never use tabs > > #989: FILE: tcmu/helper.c:480: > > +^Ibuf[0] = 0x0a;$ > > > > ERROR: code indent should never use tabs > > #990: FILE: tcmu/helper.c:481: > > +^Ibuf[1] = 0x0a;$ > > > > ERROR: code indent should never use tabs > > #992: FILE: tcmu/helper.c:483: > > +^I/* From spc4r31, section 7.5.7 Control mode Page$ > > > > WARNING: Block comments use a leading /* on a separate line > > #992: FILE: tcmu/helper.c:483: > > + /* From spc4r31, section 7.5.7 Control mode Page > > > > ERROR: code indent should never use tabs > > #993: FILE: tcmu/helper.c:484: > > +^I *$ > > > > ERROR: code indent should never use tabs > > #994: FILE: tcmu/helper.c:485: > > +^I * GLTSD = 1: because we don't implicitly save log parameters$ > > > > ERROR: code indent should never use tabs > > #995: FILE: tcmu/helper.c:486: > > +^I *$ > > > > ERROR: code indent should never use tabs > > #996: FILE: tcmu/helper.c:487: > > +^I * A global logging target save disable (GLTSD) bit set to$ > > > > ERROR: code indent should never use tabs > > #997: FILE: tcmu/helper.c:488: > > +^I * zero specifies that the logical unit implicitly saves, at$ > > > > ERROR: code indent should never use tabs > > #998: FILE: tcmu/helper.c:489: > > +^I * vendor specific intervals, each log parameter in which the$ > > > > ERROR: code indent should never use tabs > > #999: FILE: tcmu/helper.c:490: > > +^I * TSD bit (see 7.3) is set to zero. A GLTSD bit set to one$ > > > > ERROR: code indent should never use tabs > > #1000: FILE: tcmu/helper.c:491: > > +^I * specifies that the logical unit shall not implicitly save$ > > > > ERROR: code indent should never use tabs > > #1001: FILE: tcmu/helper.c:492: > > +^I * any log parameters.$ > > > > ERROR: code indent should never use tabs > > #1002: FILE: tcmu/helper.c:493: > > +^I */$ > > > > ERROR: code indent should never use tabs > > #1003: FILE: tcmu/helper.c:494: > > +^Ibuf[2] = 0x02;$ > > > > ERROR: code indent should never use tabs > > #1005: FILE: tcmu/helper.c:496: > > +^I/* From spc4r31, section 7.5.7 Control mode Page$ > > > > WARNING: Block comments use a leading /* on a separate line > > #1005: FILE: tcmu/helper.c:496: > > + /* From spc4r31, section 7.5.7 Control mode Page > > > > ERROR: code indent should never use tabs > > #1006: FILE: tcmu/helper.c:497: > > +^I *$ > > > > ERROR: code indent should never use tabs > > #1007: FILE: tcmu/helper.c:498: > > +^I * TAS = 1: Currently not settable by tcmu. Using the LIO default$ > > > > ERROR: code indent should never use tabs > > #1008: FILE: tcmu/helper.c:499: > > +^I *$ > > > > ERROR: code indent should never use tabs > > #1009: FILE: tcmu/helper.c:500: > > +^I * A task aborted status (TAS) bit set to zero specifies that$ > > > > ERROR: code indent should never use tabs > > #1010: FILE: tcmu/helper.c:501: > > +^I * aborted commands shall be terminated by the device server$ > > > > ERROR: code indent should never use tabs > > #1011: FILE: tcmu/helper.c:502: > > +^I * without any response to the application client. A TAS bit$ > > > > ERROR: code indent should never use tabs > > #1012: FILE: tcmu/helper.c:503: > > +^I * set to one specifies that commands aborted by the actions$ > > > > ERROR: code indent should never use tabs > > #1013: FILE: tcmu/helper.c:504: > > +^I * of an I_T nexus other than the I_T nexus on which the command$ > > > > ERROR: code indent should never use tabs > > #1014: FILE: tcmu/helper.c:505: > > +^I * was received shall be completed with TASK ABORTED status$ > > > > ERROR: code indent should never use tabs > > #1015: FILE: tcmu/helper.c:506: > > +^I */$ > > > > ERROR: code indent should never use tabs > > #1016: FILE: tcmu/helper.c:507: > > +^Ibuf[5] = 0x40;$ > > > > ERROR: code indent should never use tabs > > #1018: FILE: tcmu/helper.c:509: > > +^I/* From spc4r31, section 7.5.7 Control mode Page$ > > > > WARNING: Block comments use a leading /* on a separate line > > #1018: FILE: tcmu/helper.c:509: > > + /* From spc4r31, section 7.5.7 Control mode Page > > > > ERROR: code indent should never use tabs > > #1019: FILE: tcmu/helper.c:510: > > +^I *$ > > > > ERROR: code indent should never use tabs > > #1020: FILE: tcmu/helper.c:511: > > +^I * BUSY TIMEOUT PERIOD: Currently is unlimited$ > > > > ERROR: code indent should never use tabs > > #1021: FILE: tcmu/helper.c:512: > > +^I *$ > > > > ERROR: code indent should never use tabs > > #1022: FILE: tcmu/helper.c:513: > > +^I * The BUSY TIMEOUT PERIOD field specifies the maximum time, in$ > > > > ERROR: code indent should never use tabs > > #1023: FILE: tcmu/helper.c:514: > > +^I * 100 milliseconds increments, that the application client allows$ > > > > ERROR: code indent should never use tabs > > #1024: FILE: tcmu/helper.c:515: > > +^I * for the device server to return BUSY status for unanticipated$ > > > > ERROR: code indent should never use tabs > > #1025: FILE: tcmu/helper.c:516: > > +^I * conditions that are not a routine part of commands from the$ > > > > ERROR: code indent should never use tabs > > #1026: FILE: tcmu/helper.c:517: > > +^I * application client. This value may be rounded down as defined$ > > > > ERROR: code indent should never use tabs > > #1027: FILE: tcmu/helper.c:518: > > +^I * in 5.4(the Parameter rounding section).$ > > > > ERROR: code indent should never use tabs > > #1028: FILE: tcmu/helper.c:519: > > +^I *$ > > > > ERROR: code indent should never use tabs > > #1029: FILE: tcmu/helper.c:520: > > +^I * A 0000h value in this field is undefined by this standard.$ > > > > ERROR: code indent should never use tabs > > #1030: FILE: tcmu/helper.c:521: > > +^I * An FFFFh value in this field is defined as an unlimited period.$ > > > > ERROR: code indent should never use tabs > > #1031: FILE: tcmu/helper.c:522: > > +^I */$ > > > > ERROR: code indent should never use tabs > > #1032: FILE: tcmu/helper.c:523: > > +^Ibuf[8] = 0xff;$ > > > > ERROR: code indent should never use tabs > > #1033: FILE: tcmu/helper.c:524: > > +^Ibuf[9] = 0xff;$ > > > > ERROR: code indent should never use tabs > > #1035: FILE: tcmu/helper.c:526: > > +^Icopy_to_response_buf(ret_buf, ret_buf_len, buf, 12);$ > > > > ERROR: code indent should never use tabs > > #1036: FILE: tcmu/helper.c:527: > > +^Ireturn 12;$ > > > > ERROR: code indent should never use tabs > > #1041: FILE: tcmu/helper.c:532: > > +^Iuint8_t page;$ > > > > ERROR: code indent should never use tabs > > #1042: FILE: tcmu/helper.c:533: > > +^Iuint8_t subpage;$ > > > > ERROR: code indent should never use tabs > > #1043: FILE: tcmu/helper.c:534: > > +^Iint (*get)(struct tcmu_device *dev, uint8_t *buf, size_t buf_len);$ > > > > ERROR: code indent should never use tabs > > #1045: FILE: tcmu/helper.c:536: > > +^I{0x1, 0, handle_rwrecovery_page},$ > > > > ERROR: code indent should never use tabs > > #1046: FILE: tcmu/helper.c:537: > > +^I{0x8, 0, handle_cache_page},$ > > > > ERROR: code indent should never use tabs > > #1047: FILE: tcmu/helper.c:538: > > +^I{0xa, 0, handle_control_page},$ > > > > ERROR: code indent should never use tabs > > #1051: FILE: tcmu/helper.c:542: > > +^I^I^I^I struct mode_sense_handler *handler,$ > > > > ERROR: code indent should never use tabs > > #1052: FILE: tcmu/helper.c:543: > > +^I^I^I^I uint8_t **buf, size_t alloc_len,$ > > > > ERROR: code indent should never use tabs > > #1053: FILE: tcmu/helper.c:544: > > +^I^I^I^I size_t *used_len, bool sense_ten)$ > > > > ERROR: code indent should never use tabs > > #1055: FILE: tcmu/helper.c:546: > > +^Iint ret;$ > > > > ERROR: code indent should never use tabs > > #1057: FILE: tcmu/helper.c:548: > > +^Iret = handler->get(dev, *buf, alloc_len - *used_len);$ > > > > ERROR: code indent should never use tabs > > #1059: FILE: tcmu/helper.c:550: > > +^Iif (!sense_ten && (*used_len + ret >= 255))$ > > > > ERROR: braces {} are necessary for all arms of this statement > > #1059: FILE: tcmu/helper.c:550: > > + if (!sense_ten && (*used_len + ret >= 255)) > > [...] > > > > ERROR: code indent should never use tabs > > #1060: FILE: tcmu/helper.c:551: > > +^I^Ireturn -EINVAL;$ > > > > ERROR: code indent should never use tabs > > #1062: FILE: tcmu/helper.c:553: > > +^I/*$ > > > > ERROR: code indent should never use tabs > > #1063: FILE: tcmu/helper.c:554: > > +^I * SPC 4r37: 4.3.5.6 Allocation length:$ > > > > ERROR: code indent should never use tabs > > #1064: FILE: tcmu/helper.c:555: > > +^I *$ > > > > ERROR: code indent should never use tabs > > #1065: FILE: tcmu/helper.c:556: > > +^I * If the information being transferred to the Data-In Buffer includes$ > > > > ERROR: code indent should never use tabs > > #1066: FILE: tcmu/helper.c:557: > > +^I * fields containing counts of the number of bytes in some or all of$ > > > > ERROR: code indent should never use tabs > > #1067: FILE: tcmu/helper.c:558: > > +^I * the data (e.g., the PARAMETER DATA LENGTH field, the PAGE LENGTH$ > > > > ERROR: code indent should never use tabs > > #1068: FILE: tcmu/helper.c:559: > > +^I * field, the DESCRIPTOR LENGTH field, the AVAILABLE DATA field),$ > > > > ERROR: code indent should never use tabs > > #1069: FILE: tcmu/helper.c:560: > > +^I * then the contents of these fields shall not be altered to reflect$ > > > > ERROR: code indent should never use tabs > > #1070: FILE: tcmu/helper.c:561: > > +^I * the truncation, if any, that results from an insufficient$ > > > > ERROR: code indent should never use tabs > > #1071: FILE: tcmu/helper.c:562: > > +^I * ALLOCATION LENGTH value$ > > > > ERROR: code indent should never use tabs > > #1072: FILE: tcmu/helper.c:563: > > +^I */$ > > > > ERROR: code indent should never use tabs > > #1073: FILE: tcmu/helper.c:564: > > +^I/*$ > > > > ERROR: code indent should never use tabs > > #1074: FILE: tcmu/helper.c:565: > > +^I * Setup the buffer so to still loop over the handlers, but just$ > > > > ERROR: code indent should never use tabs > > #1075: FILE: tcmu/helper.c:566: > > +^I * increment the used_len so we can return the$ > > > > ERROR: code indent should never use tabs > > #1076: FILE: tcmu/helper.c:567: > > +^I * final value.$ > > > > ERROR: code indent should never use tabs > > #1077: FILE: tcmu/helper.c:568: > > +^I */$ > > > > ERROR: code indent should never use tabs > > #1078: FILE: tcmu/helper.c:569: > > +^Iif (*buf && (*used_len + ret >= alloc_len))$ > > > > ERROR: braces {} are necessary for all arms of this statement > > #1078: FILE: tcmu/helper.c:569: > > + if (*buf && (*used_len + ret >= alloc_len)) > > [...] > > > > ERROR: code indent should never use tabs > > #1079: FILE: tcmu/helper.c:570: > > +^I^I*buf = NULL;$ > > > > ERROR: code indent should never use tabs > > #1081: FILE: tcmu/helper.c:572: > > +^I*used_len += ret;$ > > > > ERROR: code indent should never use tabs > > #1082: FILE: tcmu/helper.c:573: > > +^Iif (*buf)$ > > > > ERROR: braces {} are necessary for all arms of this statement > > #1082: FILE: tcmu/helper.c:573: > > + if (*buf) > > [...] > > > > ERROR: code indent should never use tabs > > #1083: FILE: tcmu/helper.c:574: > > +^I^I*buf += ret;$ > > > > ERROR: code indent should never use tabs > > #1084: FILE: tcmu/helper.c:575: > > +^Ireturn ret;$ > > > > ERROR: code indent should never use tabs > > #1093: FILE: tcmu/helper.c:584: > > +^Istruct tcmu_device *dev,$ > > > > ERROR: code indent should never use tabs > > #1094: FILE: tcmu/helper.c:585: > > +^Iuint8_t *cdb,$ > > > > ERROR: code indent should never use tabs > > #1095: FILE: tcmu/helper.c:586: > > +^Istruct iovec *iovec,$ > > > > ERROR: code indent should never use tabs > > #1096: FILE: tcmu/helper.c:587: > > +^Isize_t iov_cnt)$ > > > > ERROR: code indent should never use tabs > > #1098: FILE: tcmu/helper.c:589: > > +^Ibool sense_ten = (cdb[0] == MODE_SENSE_10);$ > > > > ERROR: code indent should never use tabs > > #1099: FILE: tcmu/helper.c:590: > > +^Iuint8_t page_code = cdb[2] & 0x3f;$ > > > > ERROR: code indent should never use tabs > > #1100: FILE: tcmu/helper.c:591: > > +^Iuint8_t subpage_code = cdb[3];$ > > > > ERROR: code indent should never use tabs > > #1101: FILE: tcmu/helper.c:592: > > +^Isize_t alloc_len = tcmu_dev_get_max_xfer_len(dev);$ > > > > ERROR: code indent should never use tabs > > #1102: FILE: tcmu/helper.c:593: > > +^Iint i;$ > > > > ERROR: code indent should never use tabs > > #1103: FILE: tcmu/helper.c:594: > > +^Iint ret;$ > > > > ERROR: code indent should never use tabs > > #1104: FILE: tcmu/helper.c:595: > > +^Isize_t used_len;$ > > > > ERROR: code indent should never use tabs > > #1105: FILE: tcmu/helper.c:596: > > +^Iuint8_t *buf;$ > > > > ERROR: code indent should never use tabs > > #1106: FILE: tcmu/helper.c:597: > > +^Iuint8_t *orig_buf = NULL;$ > > > > ERROR: code indent should never use tabs > > #1108: FILE: tcmu/helper.c:599: > > +^Iif (!alloc_len)$ > > > > ERROR: braces {} are necessary for all arms of this statement > > #1108: FILE: tcmu/helper.c:599: > > + if (!alloc_len) > > [...] > > > > ERROR: code indent should never use tabs > > #1109: FILE: tcmu/helper.c:600: > > +^I^Ireturn TCMU_STS_OK;$ > > > > ERROR: code indent should never use tabs > > #1111: FILE: tcmu/helper.c:602: > > +^I/* Mode parameter header. Mode data length filled in at the end. */$ > > > > ERROR: code indent should never use tabs > > #1112: FILE: tcmu/helper.c:603: > > +^Iused_len = sense_ten ? 8 : 4;$ > > > > ERROR: code indent should never use tabs > > #1113: FILE: tcmu/helper.c:604: > > +^Iif (used_len > alloc_len)$ > > > > ERROR: braces {} are necessary for all arms of this statement > > #1113: FILE: tcmu/helper.c:604: > > + if (used_len > alloc_len) > > [...] > > > > ERROR: code indent should never use tabs > > #1114: FILE: tcmu/helper.c:605: > > +^I^Igoto fail;$ > > > > ERROR: code indent should never use tabs > > #1116: FILE: tcmu/helper.c:607: > > +^Ibuf = calloc(1, alloc_len);$ > > > > ERROR: code indent should never use tabs > > #1117: FILE: tcmu/helper.c:608: > > +^Iif (!buf)$ > > > > ERROR: braces {} are necessary for all arms of this statement > > #1117: FILE: tcmu/helper.c:608: > > + if (!buf) > > [...] > > > > ERROR: code indent should never use tabs > > #1118: FILE: tcmu/helper.c:609: > > +^I^Ireturn TCMU_STS_NO_RESOURCE;$ > > > > ERROR: code indent should never use tabs > > #1120: FILE: tcmu/helper.c:611: > > +^Iorig_buf = buf;$ > > > > ERROR: code indent should never use tabs > > #1121: FILE: tcmu/helper.c:612: > > +^Ibuf += used_len;$ > > > > ERROR: code indent should never use tabs > > #1123: FILE: tcmu/helper.c:614: > > +^I/* Don't fill in device-specific parameter */$ > > > > ERROR: code indent should never use tabs > > #1124: FILE: tcmu/helper.c:615: > > +^I/* This helper fn doesn't support sw write protect (SWP) */$ > > > > ERROR: code indent should never use tabs > > #1126: FILE: tcmu/helper.c:617: > > +^I/* Don't report block descriptors */$ > > > > ERROR: code indent should never use tabs > > #1128: FILE: tcmu/helper.c:619: > > +^Iif (page_code == 0x3f) {$ > > > > ERROR: code indent should never use tabs > > #1129: FILE: tcmu/helper.c:620: > > +^I^Ifor (i = 0; i < ARRAY_SIZE(modesense_handlers); i++) {$ > > > > ERROR: code indent should never use tabs > > #1130: FILE: tcmu/helper.c:621: > > +^I^I^Iret = handle_mode_sense(dev, &modesense_handlers[i],$ > > > > ERROR: code indent should never use tabs > > #1131: FILE: tcmu/helper.c:622: > > +^I^I^I^I^I^I&buf, alloc_len, &used_len,$ > > > > ERROR: code indent should never use tabs > > #1132: FILE: tcmu/helper.c:623: > > +^I^I^I^I^I^Isense_ten);$ > > > > ERROR: code indent should never use tabs > > #1133: FILE: tcmu/helper.c:624: > > +^I^I^Iif (ret < 0)$ > > > > ERROR: braces {} are necessary for all arms of this statement > > #1133: FILE: tcmu/helper.c:624: > > + if (ret < 0) > > [...] > > > > ERROR: code indent should never use tabs > > #1134: FILE: tcmu/helper.c:625: > > +^I^I^I^Igoto free_buf;$ > > > > ERROR: code indent should never use tabs > > #1135: FILE: tcmu/helper.c:626: > > +^I^I}$ > > > > ERROR: code indent should never use tabs > > #1136: FILE: tcmu/helper.c:627: > > +^I} else {$ > > > > ERROR: code indent should never use tabs > > #1137: FILE: tcmu/helper.c:628: > > +^I^Iret = 0;$ > > > > ERROR: code indent should never use tabs > > #1139: FILE: tcmu/helper.c:630: > > +^I^Ifor (i = 0; i < ARRAY_SIZE(modesense_handlers); i++) {$ > > > > ERROR: code indent should never use tabs > > #1140: FILE: tcmu/helper.c:631: > > +^I^I^Iif (page_code == modesense_handlers[i].page &&$ > > > > ERROR: code indent should never use tabs > > #1141: FILE: tcmu/helper.c:632: > > +^I^I^I subpage_code == modesense_handlers[i].subpage) {$ > > > > ERROR: code indent should never use tabs > > #1142: FILE: tcmu/helper.c:633: > > +^I^I^I^Iret = handle_mode_sense(dev,$ > > > > ERROR: code indent should never use tabs > > #1143: FILE: tcmu/helper.c:634: > > +^I^I^I^I^I^I^I&modesense_handlers[i],$ > > > > ERROR: code indent should never use tabs > > #1144: FILE: tcmu/helper.c:635: > > +^I^I^I^I^I^I^I&buf, alloc_len,$ > > > > ERROR: code indent should never use tabs > > #1145: FILE: tcmu/helper.c:636: > > +^I^I^I^I^I^I^I&used_len, sense_ten);$ > > > > ERROR: code indent should never use tabs > > #1146: FILE: tcmu/helper.c:637: > > +^I^I^I^Ibreak;$ > > > > ERROR: code indent should never use tabs > > #1147: FILE: tcmu/helper.c:638: > > +^I^I^I}$ > > > > ERROR: code indent should never use tabs > > #1148: FILE: tcmu/helper.c:639: > > +^I^I}$ > > > > ERROR: code indent should never use tabs > > #1150: FILE: tcmu/helper.c:641: > > +^I^Iif (ret <= 0)$ > > > > ERROR: braces {} are necessary for all arms of this statement > > #1150: FILE: tcmu/helper.c:641: > > + if (ret <= 0) > > [...] > > > > ERROR: code indent should never use tabs > > #1151: FILE: tcmu/helper.c:642: > > +^I^I^Igoto free_buf;$ > > > > ERROR: code indent should never use tabs > > #1152: FILE: tcmu/helper.c:643: > > +^I}$ > > > > ERROR: code indent should never use tabs > > #1154: FILE: tcmu/helper.c:645: > > +^Iif (sense_ten) {$ > > > > ERROR: code indent should never use tabs > > #1155: FILE: tcmu/helper.c:646: > > +^I^Iuint16_t *ptr = (uint16_t*) orig_buf;$ > > > > ERROR: "(foo*)" should be "(foo *)" > > #1155: FILE: tcmu/helper.c:646: > > + uint16_t *ptr = (uint16_t*) orig_buf; > > > > ERROR: code indent should never use tabs > > #1156: FILE: tcmu/helper.c:647: > > +^I^I*ptr = htobe16(used_len - 2);$ > > > > ERROR: code indent should never use tabs > > #1157: FILE: tcmu/helper.c:648: > > +^I}$ > > > > ERROR: code indent should never use tabs > > #1158: FILE: tcmu/helper.c:649: > > +^Ielse {$ > > > > ERROR: else should follow close brace '}' > > #1158: FILE: tcmu/helper.c:649: > > + } > > + else { > > > > ERROR: code indent should never use tabs > > #1159: FILE: tcmu/helper.c:650: > > +^I^Iorig_buf[0] = used_len - 1;$ > > > > ERROR: code indent should never use tabs > > #1160: FILE: tcmu/helper.c:651: > > +^I}$ > > > > ERROR: code indent should never use tabs > > #1162: FILE: tcmu/helper.c:653: > > +^Itcmu_memcpy_into_iovec(iovec, iov_cnt, orig_buf, alloc_len);$ > > > > ERROR: code indent should never use tabs > > #1163: FILE: tcmu/helper.c:654: > > +^Ifree(orig_buf);$ > > > > ERROR: code indent should never use tabs > > #1164: FILE: tcmu/helper.c:655: > > +^Ireturn TCMU_STS_OK;$ > > > > ERROR: code indent should never use tabs > > #1167: FILE: tcmu/helper.c:658: > > +^Ifree(orig_buf);$ > > > > ERROR: code indent should never use tabs > > #1169: FILE: tcmu/helper.c:660: > > +^Ireturn TCMU_STS_INVALID_CDB;$ > > > > ERROR: code indent should never use tabs > > #1178: FILE: tcmu/helper.c:669: > > +^Istruct tcmu_device *dev,$ > > > > ERROR: code indent should never use tabs > > #1179: FILE: tcmu/helper.c:670: > > +^Iuint8_t *cdb,$ > > > > ERROR: code indent should never use tabs > > #1180: FILE: tcmu/helper.c:671: > > +^Istruct iovec *iovec,$ > > > > ERROR: code indent should never use tabs > > #1181: FILE: tcmu/helper.c:672: > > +^Isize_t iov_cnt)$ > > > > ERROR: code indent should never use tabs > > #1183: FILE: tcmu/helper.c:674: > > +^Ibool select_ten = (cdb[0] == MODE_SELECT_10);$ > > > > ERROR: code indent should never use tabs > > #1184: FILE: tcmu/helper.c:675: > > +^Iuint8_t page_code = cdb[2] & 0x3f;$ > > > > ERROR: code indent should never use tabs > > #1185: FILE: tcmu/helper.c:676: > > +^Iuint8_t subpage_code = cdb[3];$ > > > > ERROR: code indent should never use tabs > > #1186: FILE: tcmu/helper.c:677: > > +^Isize_t alloc_len = tcmu_dev_get_max_xfer_len(dev);$ > > > > ERROR: code indent should never use tabs > > #1187: FILE: tcmu/helper.c:678: > > +^Iint i;$ > > > > ERROR: code indent should never use tabs > > #1188: FILE: tcmu/helper.c:679: > > +^Iint ret = 0;$ > > > > ERROR: code indent should never use tabs > > #1189: FILE: tcmu/helper.c:680: > > +^Isize_t hdr_len = select_ten ? 8 : 4;$ > > > > ERROR: code indent should never use tabs > > #1190: FILE: tcmu/helper.c:681: > > +^Iuint8_t buf[512];$ > > > > ERROR: code indent should never use tabs > > #1191: FILE: tcmu/helper.c:682: > > +^Iuint8_t in_buf[512];$ > > > > ERROR: code indent should never use tabs > > #1192: FILE: tcmu/helper.c:683: > > +^Ibool got_sense = false;$ > > > > ERROR: code indent should never use tabs > > #1194: FILE: tcmu/helper.c:685: > > +^Iif (!alloc_len)$ > > > > ERROR: braces {} are necessary for all arms of this statement > > #1194: FILE: tcmu/helper.c:685: > > + if (!alloc_len) > > [...] > > > > ERROR: code indent should never use tabs > > #1195: FILE: tcmu/helper.c:686: > > +^I^Ireturn TCMU_STS_OK;$ > > > > ERROR: line over 90 characters > > #1197: FILE: tcmu/helper.c:688: > > + if (tcmu_memcpy_from_iovec(in_buf, sizeof(in_buf), iovec, iov_cnt) >= sizeof(in_buf)) > > > > ERROR: code indent should never use tabs > > #1197: FILE: tcmu/helper.c:688: > > +^Iif (tcmu_memcpy_from_iovec(in_buf, sizeof(in_buf), iovec, iov_cnt) >= sizeof(in_buf))$ > > > > ERROR: braces {} are necessary for all arms of this statement > > #1197: FILE: tcmu/helper.c:688: > > + if (tcmu_memcpy_from_iovec(in_buf, sizeof(in_buf), iovec, iov_cnt) >= sizeof(in_buf)) > > [...] > > > > ERROR: code indent should never use tabs > > #1198: FILE: tcmu/helper.c:689: > > +^I^Ireturn TCMU_STS_INVALID_PARAM_LIST_LEN;$ > > > > ERROR: code indent should never use tabs > > #1200: FILE: tcmu/helper.c:691: > > +^I/* Abort if !pf or sp */$ > > > > ERROR: code indent should never use tabs > > #1201: FILE: tcmu/helper.c:692: > > +^Iif (!(cdb[1] & 0x10) || (cdb[1] & 0x01))$ > > > > ERROR: braces {} are necessary for all arms of this statement > > #1201: FILE: tcmu/helper.c:692: > > + if (!(cdb[1] & 0x10) || (cdb[1] & 0x01)) > > [...] > > > > ERROR: code indent should never use tabs > > #1202: FILE: tcmu/helper.c:693: > > +^I^Ireturn TCMU_STS_INVALID_CDB;$ > > > > ERROR: code indent should never use tabs > > #1204: FILE: tcmu/helper.c:695: > > +^Imemset(buf, 0, sizeof(buf));$ > > > > ERROR: code indent should never use tabs > > #1205: FILE: tcmu/helper.c:696: > > +^Ifor (i = 0; i < ARRAY_SIZE(modesense_handlers); i++) {$ > > > > ERROR: code indent should never use tabs > > #1206: FILE: tcmu/helper.c:697: > > +^I^Iif (page_code == modesense_handlers[i].page$ > > > > ERROR: code indent should never use tabs > > #1207: FILE: tcmu/helper.c:698: > > +^I^I && subpage_code == modesense_handlers[i].subpage) {$ > > > > ERROR: code indent should never use tabs > > #1208: FILE: tcmu/helper.c:699: > > +^I^I^Iret = modesense_handlers[i].get(dev, &buf[hdr_len],$ > > > > ERROR: code indent should never use tabs > > #1209: FILE: tcmu/helper.c:700: > > +^I^I^I^I^I^I^Isizeof(buf) - hdr_len);$ > > > > ERROR: code indent should never use tabs > > #1210: FILE: tcmu/helper.c:701: > > +^I^I^Iif (ret <= 0)$ > > > > ERROR: braces {} are necessary for all arms of this statement > > #1210: FILE: tcmu/helper.c:701: > > + if (ret <= 0) > > [...] > > > > ERROR: code indent should never use tabs > > #1211: FILE: tcmu/helper.c:702: > > +^I^I^I^Ireturn TCMU_STS_INVALID_CDB;$ > > > > ERROR: code indent should never use tabs > > #1213: FILE: tcmu/helper.c:704: > > +^I^I^Iif (!select_ten && (hdr_len + ret >= 255))$ > > > > ERROR: braces {} are necessary for all arms of this statement > > #1213: FILE: tcmu/helper.c:704: > > + if (!select_ten && (hdr_len + ret >= 255)) > > [...] > > > > ERROR: code indent should never use tabs > > #1214: FILE: tcmu/helper.c:705: > > +^I^I^I^Ireturn TCMU_STS_INVALID_CDB;$ > > > > ERROR: code indent should never use tabs > > #1216: FILE: tcmu/helper.c:707: > > +^I^I^Igot_sense = true;$ > > > > ERROR: code indent should never use tabs > > #1217: FILE: tcmu/helper.c:708: > > +^I^I^Ibreak;$ > > > > ERROR: code indent should never use tabs > > #1218: FILE: tcmu/helper.c:709: > > +^I^I}$ > > > > ERROR: code indent should never use tabs > > #1219: FILE: tcmu/helper.c:710: > > +^I}$ > > > > ERROR: code indent should never use tabs > > #1221: FILE: tcmu/helper.c:712: > > +^Iif (!got_sense)$ > > > > ERROR: braces {} are necessary for all arms of this statement > > #1221: FILE: tcmu/helper.c:712: > > + if (!got_sense) > > [...] > > > > ERROR: code indent should never use tabs > > #1222: FILE: tcmu/helper.c:713: > > +^I^Ireturn TCMU_STS_INVALID_CDB;$ > > > > ERROR: code indent should never use tabs > > #1224: FILE: tcmu/helper.c:715: > > +^Iif (alloc_len < (hdr_len + ret))$ > > > > ERROR: braces {} are necessary for all arms of this statement > > #1224: FILE: tcmu/helper.c:715: > > + if (alloc_len < (hdr_len + ret)) > > [...] > > > > ERROR: code indent should never use tabs > > #1225: FILE: tcmu/helper.c:716: > > +^I^Ireturn TCMU_STS_INVALID_PARAM_LIST_LEN;$ > > > > ERROR: code indent should never use tabs > > #1227: FILE: tcmu/helper.c:718: > > +^I/* Verify what was selected is identical to what sense returns, since we$ > > > > WARNING: Block comments use a leading /* on a separate line > > #1227: FILE: tcmu/helper.c:718: > > + /* Verify what was selected is identical to what sense returns, since we > > > > ERROR: code indent should never use tabs > > #1228: FILE: tcmu/helper.c:719: > > +^I don't support actually setting anything. */$ > > > > WARNING: Block comments use * on subsequent lines > > #1228: FILE: tcmu/helper.c:719: > > + /* Verify what was selected is identical to what sense returns, since we > > + don't support actually setting anything. */ > > > > WARNING: Block comments use a trailing */ on a separate line > > #1228: FILE: tcmu/helper.c:719: > > + don't support actually setting anything. */ > > > > ERROR: code indent should never use tabs > > #1229: FILE: tcmu/helper.c:720: > > +^Iif (memcmp(&buf[hdr_len], &in_buf[hdr_len], ret))$ > > > > ERROR: braces {} are necessary for all arms of this statement > > #1229: FILE: tcmu/helper.c:720: > > + if (memcmp(&buf[hdr_len], &in_buf[hdr_len], ret)) > > [...] > > > > ERROR: code indent should never use tabs > > #1230: FILE: tcmu/helper.c:721: > > +^I^Ireturn TCMU_STS_INVALID_PARAM_LIST;$ > > > > ERROR: code indent should never use tabs > > #1232: FILE: tcmu/helper.c:723: > > +^Ireturn TCMU_STS_OK;$ > > > > ERROR: code indent should never use tabs > > #1237: FILE: tcmu/helper.c:728: > > +^Iif ((cdb[4] >> 4) & 0xf)$ > > > > ERROR: braces {} are necessary for all arms of this statement > > #1237: FILE: tcmu/helper.c:728: > > + if ((cdb[4] >> 4) & 0xf) > > [...] > > > > ERROR: code indent should never use tabs > > #1238: FILE: tcmu/helper.c:729: > > +^I^Ireturn TCMU_STS_INVALID_CDB;$ > > > > ERROR: code indent should never use tabs > > #1240: FILE: tcmu/helper.c:731: > > +^I/* Currently, we don't allow ejecting the medium, so we're$ > > > > WARNING: Block comments use a leading /* on a separate line > > #1240: FILE: tcmu/helper.c:731: > > + /* Currently, we don't allow ejecting the medium, so we're > > > > ERROR: code indent should never use tabs > > #1241: FILE: tcmu/helper.c:732: > > +^I * ignoring the FBO_PREV_EJECT flag, but it may turn out that$ > > > > ERROR: code indent should never use tabs > > #1242: FILE: tcmu/helper.c:733: > > +^I * initiators do not handle this well, so we may have to change$ > > > > ERROR: code indent should never use tabs > > #1243: FILE: tcmu/helper.c:734: > > +^I * this behavior.$ > > > > ERROR: code indent should never use tabs > > #1244: FILE: tcmu/helper.c:735: > > +^I */$ > > > > ERROR: code indent should never use tabs > > #1246: FILE: tcmu/helper.c:737: > > +^Iif (!(cdb[4] & 0x01))$ > > > > ERROR: braces {} are necessary for all arms of this statement > > #1246: FILE: tcmu/helper.c:737: > > + if (!(cdb[4] & 0x01)) > > [...] > > > > ERROR: code indent should never use tabs > > #1247: FILE: tcmu/helper.c:738: > > +^I^Ireturn TCMU_STS_INVALID_CDB;$ > > > > ERROR: code indent should never use tabs > > #1249: FILE: tcmu/helper.c:740: > > +^Ireturn TCMU_STS_OK;$ > > > > WARNING: architecture specific defines should be avoided > > #1269: FILE: tcmu/helper.h:13: > > +#ifndef __TCMU_HELPER_H > > > > ERROR: line over 90 characters > > #1275: FILE: tcmu/helper.h:19: > > +int tcmu_emulate_inquiry(struct tcmu_device *dev, uint8_t *cdb, struct iovec *iovec, size_t iov_cnt); > > > > WARNING: line over 80 characters > > #1277: FILE: tcmu/helper.h:21: > > +int tcmu_emulate_test_unit_ready(uint8_t *cdb, struct iovec *iovec, size_t iov_cnt); > > > > WARNING: line over 80 characters > > #1278: FILE: tcmu/helper.h:22: > > +int tcmu_emulate_read_capacity_10(uint64_t num_lbas, uint32_t block_size, uint8_t *cdb, > > > > ERROR: code indent should never use tabs > > #1279: FILE: tcmu/helper.h:23: > > +^I^I^I^I struct iovec *iovec, size_t iov_cnt);$ > > > > WARNING: line over 80 characters > > #1280: FILE: tcmu/helper.h:24: > > +int tcmu_emulate_read_capacity_16(uint64_t num_lbas, uint32_t block_size, uint8_t *cdb, > > > > ERROR: code indent should never use tabs > > #1281: FILE: tcmu/helper.h:25: > > +^I^I^I^I struct iovec *iovec, size_t iov_cnt);$ > > > > ERROR: code indent should never use tabs > > #1283: FILE: tcmu/helper.h:27: > > +^I^I^I struct iovec *iovec, size_t iov_cnt);$ > > > > ERROR: code indent should never use tabs > > #1285: FILE: tcmu/helper.h:29: > > +^I^I^I struct iovec *iovec, size_t iov_cnt);$ > > > > WARNING: Block comments use a leading /* on a separate line > > #1514: FILE: tcmu/tcmu.c:221: > > + { /* end of list */ } > > > > WARNING: Block comments use a leading /* on a separate line > > #1523: FILE: tcmu/tcmu.c:230: > > + { /* end of list */ } > > > > ERROR: do not use assignment in if condition > > #1590: FILE: tcmu/tcmu.c:297: > > + if ((aio = qemu_opt_get(common_opts, "aio")) != NULL) { > > > > ERROR: do not use assignment in if condition > > #1602: FILE: tcmu/tcmu.c:309: > > + if ((buf = qemu_opt_get(common_opts, "format")) != NULL) { > > > > ERROR: braces {} are necessary for all arms of this statement > > #1617: FILE: tcmu/tcmu.c:324: > > + if (read_only) > > [...] > > > > WARNING: Block comments use a leading /* on a separate line > > #1620: FILE: tcmu/tcmu.c:327: > > + /* bdrv_open() defaults to the values in bdrv_flags (for compatibility > > > > WARNING: Block comments use a trailing */ on a separate line > > #1622: FILE: tcmu/tcmu.c:329: > > + * Apply the defaults here instead. */ > > > > ERROR: space required before the open parenthesis '(' > > #1712: FILE: tcmu/tcmu.c:419: > > + if(exp) > > > > ERROR: braces {} are necessary for all arms of this statement > > #1712: FILE: tcmu/tcmu.c:419: > > + if(exp) > > [...] > > > > ERROR: code indent should never use tabs > > #1761: FILE: tcmu/tcmu.c:468: > > +^Iid = device;$ > > > > ERROR: code indent should never use tabs > > #1762: FILE: tcmu/tcmu.c:469: > > + ^Iblk = blk_by_name(id);$ > > > > ERROR: code indent should never use tabs > > #1763: FILE: tcmu/tcmu.c:470: > > + ^Iif (!blk) {$ > > > > ERROR: code indent should never use tabs > > #1764: FILE: tcmu/tcmu.c:471: > > + ^Ierror_setg(errp, "TCMU: Device not found: %s", id);$ > > > > ERROR: code indent should never use tabs > > #1765: FILE: tcmu/tcmu.c:472: > > + ^Ireturn false;$ > > > > ERROR: code indent should never use tabs > > #1766: FILE: tcmu/tcmu.c:473: > > + ^I}$ > > > > ERROR: code indent should never use tabs > > #1767: FILE: tcmu/tcmu.c:474: > > + ^Iexp = tcmu_export_lookup(blk);$ > > > > ERROR: code indent should never use tabs > > #1768: FILE: tcmu/tcmu.c:475: > > + ^Iif (!exp) {$ > > > > ERROR: code indent should never use tabs > > #1769: FILE: tcmu/tcmu.c:476: > > + ^Ierror_setg(errp, "TCMU: Device not found: %s", id);$ > > > > ERROR: code indent should never use tabs > > #1770: FILE: tcmu/tcmu.c:477: > > + ^Ireturn false;$ > > > > ERROR: code indent should never use tabs > > #1771: FILE: tcmu/tcmu.c:478: > > + ^I}$ > > > > ERROR: do not use C99 // comments > > #1772: FILE: tcmu/tcmu.c:479: > > + }// TODO: else to check id? > > > > ERROR: code indent should never use tabs > > #1780: FILE: tcmu/tcmu.c:487: > > +^Iif (*opts == '@') {$ > > > > ERROR: braces {} are necessary for all arms of this statement > > #1780: FILE: tcmu/tcmu.c:487: > > + if (*opts == '@') { > > [...] > > + } else > > [...] > > > > ERROR: code indent should never use tabs > > #1781: FILE: tcmu/tcmu.c:488: > > +^I *to = ',';$ > > > > ERROR: code indent should never use tabs > > #1782: FILE: tcmu/tcmu.c:489: > > +^I} else$ > > > > ERROR: code indent should never use tabs > > #1783: FILE: tcmu/tcmu.c:490: > > +^I *to = *opts;$ > > > > ERROR: code indent should never use tabs > > #1785: FILE: tcmu/tcmu.c:492: > > +^Iopts++;$ > > > > ERROR: code indent should never use tabs > > #1786: FILE: tcmu/tcmu.c:493: > > +^Ito++;$ > > > > ERROR: space required before the open parenthesis '(' > > #1789: FILE: tcmu/tcmu.c:496: > > + if(to) > > > > ERROR: braces {} are necessary for all arms of this statement > > #1789: FILE: tcmu/tcmu.c:496: > > + if(to) > > [...] > > > > ERROR: code indent should never use tabs > > #1806: FILE: tcmu/tcmu.c:513: > > + ^Iid = device;$ > > > > ERROR: code indent should never use tabs > > #1807: FILE: tcmu/tcmu.c:514: > > + ^Iexp = tcmu_export_lookup(blk_by_name(id));$ > > > > ERROR: else should follow close brace '}' > > #1809: FILE: tcmu/tcmu.c:516: > > + } > > + else { > > > > ERROR: code indent should never use tabs > > #1810: FILE: tcmu/tcmu.c:517: > > +^IQemuOpts * export_opts;$ > > > > ERROR: "foo * bar" should be "foo *bar" > > #1810: FILE: tcmu/tcmu.c:517: > > + QemuOpts * export_opts; > > > > ERROR: code indent should never use tabs > > #1812: FILE: tcmu/tcmu.c:519: > > +^Inew_device = g_malloc0(strlen(device) + 1);$ > > > > ERROR: code indent should never use tabs > > #1813: FILE: tcmu/tcmu.c:520: > > +^Itcmu_convert_delim(new_device, device);$ > > > > WARNING: Block comments use a leading /* on a separate line > > #1815: FILE: tcmu/tcmu.c:522: > > + /* parse new_device into an QemuOpts and link into > > > > WARNING: Block comments use * on subsequent lines > > #1816: FILE: tcmu/tcmu.c:523: > > + /* parse new_device into an QemuOpts and link into > > + qemu_tcmu_export_opts with QemuOpts->id set while > > > > ERROR: code indent should never use tabs > > #1819: FILE: tcmu/tcmu.c:526: > > +^Iexport_opts = qemu_opts_parse_noisily(&qemu_tcmu_export_opts,$ > > > > ERROR: code indent should never use tabs > > #1820: FILE: tcmu/tcmu.c:527: > > +^I^I^I^I^I new_device, false);$ > > > > ERROR: space required before the open parenthesis '(' > > #1824: FILE: tcmu/tcmu.c:531: > > + if(!export_opts) > > > > ERROR: braces {} are necessary for all arms of this statement > > #1824: FILE: tcmu/tcmu.c:531: > > + if(!export_opts) > > [...] > > > > ERROR: code indent should never use tabs > > #1827: FILE: tcmu/tcmu.c:534: > > +^Iif (export_init_func(NULL, export_opts, NULL))$ > > > > ERROR: braces {} are necessary for all arms of this statement > > #1827: FILE: tcmu/tcmu.c:534: > > + if (export_init_func(NULL, export_opts, NULL)) > > [...] > > > > ERROR: code indent should never use tabs > > #1828: FILE: tcmu/tcmu.c:535: > > +^I goto fail;$ > > > > ERROR: code indent should never use tabs > > #1830: FILE: tcmu/tcmu.c:537: > > +^Iid = qemu_opts_id(export_opts);$ > > > > ERROR: code indent should never use tabs > > #1831: FILE: tcmu/tcmu.c:538: > > +^Iexp = tcmu_export_lookup(blk_by_name(id));$ > > > > total: 620 errors, 26 warnings, 1809 lines checked > > > > Your patch has style problems, please review. If any of these errors > > are false positives report them to the maintainer, see > > CHECKPATCH in MAINTAINERS. > > > > === OUTPUT END === > > > > Test command exited with code: 1 > > > > > > The full log is available at > > http://patchew.org/logs/1545387387-9613-1-git-send-email-baiyaowei@cmss.chinamobile.com/testing.checkpatch/?type=message. > > --- > > Email generated automatically by Patchew [http://patchew.org/]. > > Please send your feedback to patchew-devel@redhat.com From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:46008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gyWAd-0006Vw-UW for qemu-devel@nongnu.org; Tue, 26 Feb 2019 01:24:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gyWAX-0000BX-Nb for qemu-devel@nongnu.org; Tue, 26 Feb 2019 01:24:48 -0500 Received: from mga05.intel.com ([192.55.52.43]:65455) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gyWAV-0008Q5-4d for qemu-devel@nongnu.org; Tue, 26 Feb 2019 01:24:43 -0500 From: Yang Weijiang Date: Mon, 25 Feb 2019 21:18:17 +0800 Message-Id: <20190225131822.6817-1-weijiang.yang@intel.com> Subject: [Qemu-devel] (no subject) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: pbonzini@redhat.com, cdupontd@redhat.com, rkrcmar@redhat.com, qemu-devel@nongnu.org, mst@redhat.com Cc: Yang Weijiang Subject: [Qemu-devel][PATCH v3 0/5] This patch-set is to enable Guest CET support. Control-flow Enforcement Technology (CET) provides protection against return/jump-oriented programming (ROP) attacks. To make kvm Guest OS own the capability, this patch-set is required. It enables CET related CPUID report, xsaves/xrstors and live-migration etc. in Qemu. Changelog: v3: - Add CET MSR save/restore support for live-migration. v2: - In CPUID.(EAX=d, ECX=1), set return ECX[n] = 0 if bit n corresponds to a bit in MSR_IA32_XSS. - In CPUID.(EAX=d, ECX=n), set return ECX = 1 if bit n corresponds to a bit in MSR_IA32_XSS. - Skip Supervisor mode xsave component when calculate User mode xave component size in xsave_area_size() and x86_cpu_reset(). Yang Weijiang (5): Add CET xsaves/xrstors related macros and structures. Add CET SHSTK and IBT CPUID feature-word definitions. Add hepler functions for CPUID xsave area size calculation. Report CPUID xsave area support for CET. Add CET MSR save/restore support for migration target/i386/cpu.c | 73 ++++++++++++++++++++++++++++-- target/i386/cpu.h | 48 +++++++++++++++++++- target/i386/kvm.c | 27 ++++++++++++ target/i386/machine.c | 100 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 244 insertions(+), 4 deletions(-) -- 2.17.1