From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Blake Subject: Re: [RFC QEMU PATCH 8/8] qmp: add a qmp command 'query-nvdimms' to get plugged NVDIMM devices Date: Mon, 10 Oct 2016 14:16:00 -0500 Message-ID: <091ebe9c-70d3-e352-dbc3-8bd05905fa77@redhat.com> References: <20161010003423.4333-1-haozhong.zhang@intel.com> <20161010003423.4333-9-haozhong.zhang@intel.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="jmo0ehNr4aj0JB86euf9PekvCEHlpQi51" Return-path: In-Reply-To: <20161010003423.4333-9-haozhong.zhang@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+gceq-qemu-devel=gmane.org@nongnu.org Sender: "Qemu-devel" To: Haozhong Zhang , qemu-devel@nongnu.org, xen-devel@lists.xensource.com Cc: Igor Mammedov , "Michael S. Tsirkin" , Xiao Guangrong , Markus Armbruster , Konrad Rzeszutek Wilk List-Id: xen-devel@lists.xenproject.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --jmo0ehNr4aj0JB86euf9PekvCEHlpQi51 From: Eric Blake To: Haozhong Zhang , qemu-devel@nongnu.org, xen-devel@lists.xensource.com Cc: Xiao Guangrong , Konrad Rzeszutek Wilk , Markus Armbruster , "Michael S. Tsirkin" , Igor Mammedov Message-ID: <091ebe9c-70d3-e352-dbc3-8bd05905fa77@redhat.com> Subject: Re: [RFC QEMU PATCH 8/8] qmp: add a qmp command 'query-nvdimms' to get plugged NVDIMM devices References: <20161010003423.4333-1-haozhong.zhang@intel.com> <20161010003423.4333-9-haozhong.zhang@intel.com> In-Reply-To: <20161010003423.4333-9-haozhong.zhang@intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/09/2016 07:34 PM, Haozhong Zhang wrote: > Xen uses this command to get the backend resource, guest SPA and size o= f > NVDIMM devices so as to map them to guest. >=20 > Signed-off-by: Haozhong Zhang > --- > Cc: Markus Armbruster > +++ b/docs/qmp-commands.txt > @@ -3800,3 +3800,39 @@ Example for pc machine type started with > "props": {"core-id": 0, "socket-id": 0, "thread-id": 0} > } > ]} > + > +EQMP > + > + { > + .name =3D "query-nvdimms", > + .args_type =3D "", > + .mhandler.cmd_new =3D qmp_marshal_query_nvdimms, Needs rebasing - we no longer need SQMP/EQMP sections or callouts to the initializers, now that commit bd6092e4 has automated the mapping of QAPI to command registration. > + }, > + > +SQMP > +Show plugged NVDIMM devices > +--------------------------- > + > +Arguments: None. > + > +Example for pc machine type started with > +-object memory-backend-file,id=3Dmem1,mem-path=3D/path/to/nvm1,size=3D= 4G > +-device nvdimm,id=3Dnvdimm1,memdev=3Dmem1 > +-object memory-backend-file,id=3Dmem2,mem-path=3D/path/to/nvm2,size=3D= 8G > +-device nvdimm,id=3Dnvdimm2,memdev=3Dmem2: > + > +-> { "execute": "query-nvdimms" } > +<- { "returns": [ > + { > + "mem-path": "/path/to/nvm1", > + "slot": 0, TAB damage; please fix. > + "spa": 17179869184, > + "length": 4294967296 > + }, > + { > + "mem-path": "/path/to/nvm2", > + "slot": 1, > + "spa": 21474836480, > + "length": 8589934592 > + } > + ]} > +++ b/qapi-schema.json > @@ -4646,3 +4646,32 @@ > # Since: 2.7 > ## > { 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU']= } > + > +## > +# @NvdimmInfo > +# > +# Information about an NVDIMM device. > +# > +# @mem-path: the backend file of the NVDIMM device > +# > +# @slot: the slot index of the NVDIMM device > +# > +# @spa: the 64-bit SPA base address of the NVDIMM device > +# > +# @length: the 64-bit size in bytes of the NVDIMM device > +# > +# Since 2.8 > +## > +{ 'struct': 'NvdimmInfo', > + 'data': {'mem-path' : 'str', 'slot': 'int', 'spa': 'int', 'length': = 'int'} } > + > +## > +# @query-nvdimms: > +# > +# Returns information about each NVDIMM device > +# > +# Returns: a list of @NvdimmInfo for each device > +# > +# Since: 2.8 > +## > +{ 'command': 'query-nvdimms', 'returns': ['NvdimmInfo'] } >=20 Is this something that can be added to the existing query-memdev or query-memory-devices command, instead of needing a new command? --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --jmo0ehNr4aj0JB86euf9PekvCEHlpQi51 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/ iQEcBAEBCAAGBQJX++jwAAoJEKeha0olJ0NqxZkH/3GjG18dM2XxJ/GHSU8ER4Bx ekD5cYpklJYWe7lT1RAMYgQuWWS+/BQi4b1F88K+blGmus7eQ1mPfJP1MtAi51Qn 1bpdd77JBYa/mgBCGOhtGXg+w4tXRuyZN7AbiPXU8asH0DC+mOqKr/AzBty1w7nC yOyV76VbWZqCeBKO8fC4c8obi1jt+E8mnXuzC7ck0dv9nkwaa6o9OVzPJOhgc818 OU2vP6ADoi/iDpMLxbV/p/aiTLNkjORzW2OJClM3gociXYqC1/yGoCrKya4O0Zth +WcyiJdj/4BEh+80501EOiqLvKh2mfF2eYLSuxFXTlN2ui2W3n2rtzdS/aQMfpQ= =EXoW -----END PGP SIGNATURE----- --jmo0ehNr4aj0JB86euf9PekvCEHlpQi51--