
# HG changeset patch # User Dan Smith <danms@us.ibm.com> # Date 1199480010 28800 # Node ID 2cdaa36e4a78c8013ca4a8b58d4796d5e2012a68 # Parent ff56b87755fa9608a7d046976ef011cf48ce92f1 Extend xml_parse_test for KVM Also allow specification of a URI as the second argument on the command-line to allow connecting to libvirt for KVM. Signed-off-by: Dan Smith <danms@us.ibm.com> diff -r ff56b87755fa -r 2cdaa36e4a78 libxkutil/xml_parse_test.c --- a/libxkutil/xml_parse_test.c Fri Jan 04 12:28:09 2008 -0800 +++ b/libxkutil/xml_parse_test.c Fri Jan 04 12:53:30 2008 -0800 @@ -26,6 +26,12 @@ static void print_os(struct domain *dom, print_value(d, "Args", dom->os_info.pv.cmdline); } else if (dom->type == DOMAIN_XENFV) { print_value(d, "Domain Type", "Xen FV"); + print_value(d, "Type", dom->os_info.fv.type); + print_value(d, "Loader", dom->os_info.fv.loader); + print_value(d, "Boot", dom->os_info.fv.boot); + + } else if (dom->type == DOMAIN_KVM) { + print_value(d, "Domain Type", "KVM/QEMU"); print_value(d, "Type", dom->os_info.fv.type); print_value(d, "Loader", dom->os_info.fv.loader); print_value(d, "Boot", dom->os_info.fv.boot); @@ -130,12 +136,15 @@ int main(int argc, char **argv) virDomainPtr dom; struct domain *dominfo; - if (argc != 2) { + if (argc < 2) { printf("Usage: %s domain\n", argv[0]); return 1; } - conn = virConnectOpen("xen:///"); + if (argc > 2) + conn = virConnectOpen(argv[2]); + else + conn = virConnectOpen("xen:///"); if (conn == NULL) { printf("Unable to connect to libvirt\n"); return 2;