From patchwork Tue Jul 27 15:55:03 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Liguori X-Patchwork-Id: 60010 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id EA34EB6EEC for ; Wed, 28 Jul 2010 01:57:43 +1000 (EST) Received: from localhost ([127.0.0.1]:35792 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OdmXE-0007aX-MV for incoming@patchwork.ozlabs.org; Tue, 27 Jul 2010 11:57:40 -0400 Received: from [140.186.70.92] (port=47788 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OdmVF-0006df-Ba for qemu-devel@nongnu.org; Tue, 27 Jul 2010 11:55:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OdmVE-0000QO-34 for qemu-devel@nongnu.org; Tue, 27 Jul 2010 11:55:37 -0400 Received: from e37.co.us.ibm.com ([32.97.110.158]:51274) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OdmVD-0000Pt-K7 for qemu-devel@nongnu.org; Tue, 27 Jul 2010 11:55:36 -0400 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by e37.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id o6RFrZgh032263 for ; Tue, 27 Jul 2010 09:53:35 -0600 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id o6RFtJsA092534 for ; Tue, 27 Jul 2010 09:55:23 -0600 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id o6RFt71C013578 for ; Tue, 27 Jul 2010 09:55:07 -0600 Received: from localhost.localdomain (sig-9-65-53-143.mts.ibm.com [9.65.53.143]) by d03av03.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id o6RFt6fN013201; Tue, 27 Jul 2010 09:55:06 -0600 From: Anthony Liguori To: qemu-devel@nongnu.org Date: Tue, 27 Jul 2010 10:55:03 -0500 Message-Id: <1280246103-6636-1-git-send-email-aliguori@us.ibm.com> X-Mailer: git-send-email 1.7.0.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Cc: Chris Wright , Anthony Liguori , libvirt-list@redhat.com, Cole Robinson Subject: [Qemu-devel] [PATCH] Introduce a -libvirt-caps flag as a stop-gap X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Today libvirt parses -help output to attempt to enumerate capabilities. This is very broken and has led to multiple failures. Since libvirt is an important management interface to QEMU, we need to do a better job giving them the ability to detect what a QEMU executable supports. Right now, we keep fixing up help output to appease it's parsing code but this is undesirable. The Right Solution is to introduce a robust capabilities advertisement that enumerates every feature we have. As with most Right Solutions, we don't have mergable code today and it's unclear that we'll get there by the next release. This patch introduces an incremental solution of just spitting out the handful of capabilities libvirt is probing for today. This interface will need to remain forever but can stop being updated once we have a Right Solution. Signed-off-by: Anthony Liguori diff --git a/qemu-options.hx b/qemu-options.hx index 40cee70..a618914 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -2235,7 +2235,26 @@ Normally QEMU loads a configuration file from @var{sysconfdir}/qemu.conf and option will prevent QEMU from loading these configuration files at startup. ETEXI +DEF("libvirt-caps", 0, QEMU_OPTION_libvirt_caps, + "-libvirt-caps output libvirt-specific capabilities\n", + QEMU_ARCH_ALL) +STEXI +@item -libvirt-caps +@findex -libvirt-caps +Output a common separate list of capabilities that this version of QEMU +supports and exit. This interface specifically exists for libvirt's use as an +intermediate solution until we support a full capabilities system. One this +capabilities system exist, this option's output should never change. + +The format out this command is: + +version: VERSION +package: PACKAGE +caps: CAP1[,CAP2...] +ETEXI + HXCOMM This is the last statement. Insert new options before this line! STEXI @end table ETEXI + diff --git a/vl.c b/vl.c index ba6ee11..8fe354d 100644 --- a/vl.c +++ b/vl.c @@ -2616,6 +2616,14 @@ int main(int argc, char **argv, char **envp) fclose(fp); break; } + case QEMU_OPTION_libvirt_caps: + printf("version: " QEMU_VERSION "\n" + "package: " QEMU_PKGVERSION "\n" + "caps: name,enable-kvm,no-reboot,uuid,xen-domid,drive" + ",cache-v2,format,vga,serial,mem-path,chardev,balloon" + ",device,rtc,netdev,sdl,topology\n"); + exit(0); + break; default: os_parse_cmd_args(popt->index, optarg); }