From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:57764) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SukkZ-0003Ls-PL for qemu-devel@nongnu.org; Fri, 27 Jul 2012 09:38:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SukkS-0000DT-W0 for qemu-devel@nongnu.org; Fri, 27 Jul 2012 09:38:39 -0400 Received: from e8.ny.us.ibm.com ([32.97.182.138]:49379) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SukkS-0008It-Q6 for qemu-devel@nongnu.org; Fri, 27 Jul 2012 09:38:32 -0400 Received: from /spool/local by e8.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 27 Jul 2012 09:37:34 -0400 Received: from d01relay01.pok.ibm.com (d01relay01.pok.ibm.com [9.56.227.233]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 5EB5938C8039 for ; Fri, 27 Jul 2012 09:37:25 -0400 (EDT) Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay01.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q6RDbPXE385638 for ; Fri, 27 Jul 2012 09:37:25 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q6RDbOvQ008986 for ; Fri, 27 Jul 2012 10:37:25 -0300 From: Anthony Liguori Date: Fri, 27 Jul 2012 08:37:12 -0500 Message-Id: <1343396239-19272-1-git-send-email-aliguori@us.ibm.com> Subject: [Qemu-devel] [PATCH 0/7] qapi: add commands to remove the need to parse -help output List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , libvir-list@redhat.com, Alexander Graf , Markus Armbruster , Eric Blake This series implements the necessary commands to implements danpb's idea to remove -help parsing in libvirt. We would introduce all of these commands in 1.2 and then change the -help output starting in 1.3. Here is Dan's plan from a previous thread: Basically I'd sum up my new idea as "just use QMP". * No new command line arguments like -capabilities * libvirt invokes something like $QEMUBINARY -qmp CHARDEV -nodefault -nodefconfig -nographics * libvirt then runs a number of QMP commands to find out what it needs to know. I'd expect the following existing commands would be used - query-version - already supported - query-commands - already supported - query-events - already supported - query-kvm - already supported - qom-{list,list-types,get} - already supported - query-spice/vnc - already supported And add the following new commands - query-devices - new, -device ?, and/or -device NAME,? data in QMP - query-machines - new, -M ? in QMP - query-cpu-types - new, -cpu ? in QMP The above would take care of probably 50% of the current libvirt capabilities probing, including a portion of the -help stuff. Then there is all the rest of the crap we detect from the -help. We could just take the view, that "as of 1.2", we assume everything we previously detected is just available by default, and thus don't need to probe it. For stuff that is QOM based, I expect we'll be able to detect new features in the future using the qom-XXX monitor commands. For stuff that is non-qdev, and non-qom, libvirt can just do a plain version number check, unless we decide there is specific info worth exposing via other new 'query-XXX' monitor commands. Basically I'd sum up my new idea as "just use QMP". * No new command line arguments like -capabilities * libvirt invokes something like $QEMUBINARY -qmp CHARDEV -nodefault -nodefconfig -nographics * libvirt then runs a number of QMP commands to find out what it needs to know. I'd expect the following existing commands would be used - query-version - already supported - query-commands - already supported - query-events - already supported - query-kvm - already supported - qom-{list,list-types,get} - already supported - query-spice/vnc - already supported And add the following new commands - query-devices - new, -device ?, and/or -device NAME,? data in QMP - query-machines - new, -M ? in QMP - query-cpu-types - new, -cpu ? in QMP The above would take care of probably 50% of the current libvirt capabilities probing, including a portion of the -help stuff. Then there is all the rest of the crap we detect from the -help. We could just take the view, that "as of 1.2", we assume everything we previously detected is just available by default, and thus don't need to probe it. For stuff that is QOM based, I expect we'll be able to detect new features in the future using the qom-XXX monitor commands. For stuff that is non-qdev, and non-qom, libvirt can just do a plain version number check, unless we decide there is specific info worth exposing via other new 'query-XXX' monitor commands. The one thing to note is that I didn't add a query-devices command because you can already do: qmp query-devices --implements=device --abstract=False To get the equivalent output of -device ?. Instead, I added a command to list specific properties of a device which is the equivalent of -device FOO,?