qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Introduce a -libvirt-caps flag as a stop-gap
@ 2010-07-27 15:55 Anthony Liguori
  2010-07-27 16:09 ` [Qemu-devel] " Daniel P. Berrange
  2010-07-28  8:57 ` [Qemu-devel] " Amit Shah
  0 siblings, 2 replies; 10+ messages in thread
From: Anthony Liguori @ 2010-07-27 15:55 UTC (permalink / raw)
  To: qemu-devel; +Cc: Chris Wright, Anthony Liguori, libvirt-list, Cole Robinson

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 <aliguori@us.ibm.com>

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);
             }
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-07-28 13:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-27 15:55 [Qemu-devel] [PATCH] Introduce a -libvirt-caps flag as a stop-gap Anthony Liguori
2010-07-27 16:09 ` [Qemu-devel] " Daniel P. Berrange
2010-07-27 16:38   ` Anthony Liguori
2010-07-27 17:00     ` Daniel P. Berrange
2010-07-27 17:20       ` Anthony Liguori
2010-07-28  9:53         ` Daniel P. Berrange
2010-07-28 13:44           ` Anthony Liguori
2010-07-27 17:41     ` Chris Wright
2010-07-28  4:52     ` Avi Kivity
2010-07-28  8:57 ` [Qemu-devel] " Amit Shah

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).