[libvirt] [PATCH] show compiled in options in virsh --version

Eric Blake eblake at redhat.com
Thu Oct 28 17:21:16 UTC 2010


On 10/28/2010 07:00 AM, Daniel Veillard wrote:
>   To ease debugging this trivial patch allows to find what was compiled
> in in the local version of libvirt, this doesn't work for remote access
> but that's probably sufficient. With the patch I get on my machine:
> 
> paphio:~/libvirt/tools -> ./virsh --version
> Virsh command line tool of libvirt 0.8.4
> See web site at http://libvirt.org/
> 
> Compiled with support for:
>  Hypervisors: Xen QEmu/KVM UML OpenVZ LXC ESX PHYP Test 
>  Networking: Remote Daemon Network Bridging Netcf Nwfilter 
>  Storage: Dir Disk Filesystem SCSI Multipath iSCSI LVM 
>  Miscellaneous: SELinux Secrets Debug Readline 
> paphio:~/libvirt/tools -> 
> 
>  instead of just "0.8.4"

> +    vshPrint(ctl, _(" Hypervisors: "));
> +#ifdef WITH_XEN
> +    vshPrint(ctl, "Xen ");
> +#endif
...
> +    vshPrint(ctl, "\n");

Rather than printing a trailing space, why not:

    vshPrint(ctl, _(" Hypervisors:"));
#ifdef WITH_XEN
    vshPrint(ctl, " Xen");
#endif
...
    vshPrint(ctl, "\n");

> +
> +    vshPrint(ctl, _(" Networking: "));
> +#ifdef WITH_REMOTE
> +    vshPrint(ctl, "Remote ");
> +#endif

Likewise for each category.

> @@ -11521,8 +11644,7 @@ vshParseArgv(vshControl *ctl, int argc, char **argv)
>              ctl->name = vshStrdup(ctl, optarg);
>              break;
>          case 'v':
> -            /* FIXME - list a copyright blurb, as in GNU programs?  */
> -            puts(VERSION);
> +            vshShowVersion(ctl);
>              exit(EXIT_SUCCESS);

Pre-existing bug - we don't detect write failure to stdout to exit with
non-zero status.  Unchanged by your patch.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20101028/86943308/attachment-0001.sig>


More information about the libvir-list mailing list