[libvirt] [PATCH 00/13] Yet another c99 struct initialization conversion

I wonder if there's any syntax-check rule that we could use to enforce this style. Michal Privoznik (13): virsh: Switch to c99 initialization of vshCmdDef virsh.c: Switch to c99 initialization of vshCmdInfo virsh-domain-monitor.c: Switch to c99 initialization of vshCmdInfo virsh-domain.c: Switch to c99 initialization of vshCmdInfo virsh-host.c: Switch to c99 initialization of vshCmdInfo virsh-interface.c: Switch to c99 initialization of vshCmdInfo virsh-network.c: Switch to c99 initialization of vshCmdInfo virsh-nodedev.c: Switch to c99 initialization of vshCmdInfo virsh-nwfilter.c: Switch to c99 initialization of vshCmdInfo virsh-pool.c: Switch to c99 initialization of vshCmdInfo virsh-secret.c: Switch to c99 initialization of vshCmdInfo virsh-snapshot.c: Switch to c99 initialization of vshCmdInfo virsh-volume.c: Switch to c99 initialization of vshCmdInfo tools/virsh-domain-monitor.c | 198 ++++-- tools/virsh-domain.c | 1409 +++++++++++++++++++++++++++++++----------- tools/virsh-host.c | 222 +++++-- tools/virsh-interface.c | 256 +++++--- tools/virsh-network.c | 230 +++++-- tools/virsh-nodedev.c | 144 +++-- tools/virsh-nwfilter.c | 92 ++- tools/virsh-pool.c | 331 +++++++--- tools/virsh-secret.c | 109 +++- tools/virsh-snapshot.c | 182 ++++-- tools/virsh-volume.c | 276 +++++++-- tools/virsh.c | 97 ++- 12 files changed, 2631 insertions(+), 915 deletions(-) -- 1.8.0.2

--- tools/virsh-domain-monitor.c | 86 ++++++- tools/virsh-domain.c | 581 +++++++++++++++++++++++++++++++++++-------- tools/virsh-host.c | 95 +++++-- tools/virsh-interface.c | 114 ++++++--- tools/virsh-network.c | 99 ++++++-- tools/virsh-nodedev.c | 66 +++-- tools/virsh-nwfilter.c | 42 +++- tools/virsh-pool.c | 139 +++++++++-- tools/virsh-secret.c | 49 +++- tools/virsh-snapshot.c | 82 ++++-- tools/virsh-volume.c | 116 +++++++-- tools/virsh.c | 44 +++- 12 files changed, 1224 insertions(+), 289 deletions(-) diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index b519f88..0993ae7 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -1812,17 +1812,77 @@ cleanup: #undef FILTER const vshCmdDef domMonitoringCmds[] = { - {"domblkerror", cmdDomBlkError, opts_domblkerror, info_domblkerror, 0}, - {"domblkinfo", cmdDomblkinfo, opts_domblkinfo, info_domblkinfo, 0}, - {"domblklist", cmdDomblklist, opts_domblklist, info_domblklist, 0}, - {"domblkstat", cmdDomblkstat, opts_domblkstat, info_domblkstat, 0}, - {"domcontrol", cmdDomControl, opts_domcontrol, info_domcontrol, 0}, - {"domif-getlink", cmdDomIfGetLink, opts_domif_getlink, info_domif_getlink, 0}, - {"domiflist", cmdDomiflist, opts_domiflist, info_domiflist, 0}, - {"domifstat", cmdDomIfstat, opts_domifstat, info_domifstat, 0}, - {"dominfo", cmdDominfo, opts_dominfo, info_dominfo, 0}, - {"dommemstat", cmdDomMemStat, opts_dommemstat, info_dommemstat, 0}, - {"domstate", cmdDomstate, opts_domstate, info_domstate, 0}, - {"list", cmdList, opts_list, info_list, 0}, - {NULL, NULL, NULL, NULL, 0} + {.name = "domblkerror", + .handler = cmdDomBlkError, + .opts = opts_domblkerror, + .info = info_domblkerror, + .flags = 0 + }, + {.name = "domblkinfo", + .handler = cmdDomblkinfo, + .opts = opts_domblkinfo, + .info = info_domblkinfo, + .flags = 0 + }, + {.name = "domblklist", + .handler = cmdDomblklist, + .opts = opts_domblklist, + .info = info_domblklist, + .flags = 0 + }, + {.name = "domblkstat", + .handler = cmdDomblkstat, + .opts = opts_domblkstat, + .info = info_domblkstat, + .flags = 0 + }, + {.name = "domcontrol", + .handler = cmdDomControl, + .opts = opts_domcontrol, + .info = info_domcontrol, + .flags = 0 + }, + {.name = "domif-getlink", + .handler = cmdDomIfGetLink, + .opts = opts_domif_getlink, + .info = info_domif_getlink, + .flags = 0 + }, + {.name = "domiflist", + .handler = cmdDomiflist, + .opts = opts_domiflist, + .info = info_domiflist, + .flags = 0 + }, + {.name = "domifstat", + .handler = cmdDomIfstat, + .opts = opts_domifstat, + .info = info_domifstat, + .flags = 0 + }, + {.name = "dominfo", + .handler = cmdDominfo, + .opts = opts_dominfo, + .info = info_dominfo, + .flags = 0 + }, + {.name = "dommemstat", + .handler = cmdDomMemStat, + .opts = opts_dommemstat, + .info = info_dommemstat, + .flags = 0 + }, + {.name = "domstate", + .handler = cmdDomstate, + .opts = opts_domstate, + .info = info_domstate, + .flags = 0 + }, + {.name = "list", + .handler = cmdList, + .opts = opts_list, + .info = info_list, + .flags = 0 + }, + {.name = NULL} }; diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index fe1ea96..65765bd 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -9930,106 +9930,487 @@ cleanup: } const vshCmdDef domManagementCmds[] = { - {"attach-device", cmdAttachDevice, opts_attach_device, - info_attach_device, 0}, - {"attach-disk", cmdAttachDisk, opts_attach_disk, - info_attach_disk, 0}, - {"attach-interface", cmdAttachInterface, opts_attach_interface, - info_attach_interface, 0}, - {"autostart", cmdAutostart, opts_autostart, info_autostart, 0}, - {"blkdeviotune", cmdBlkdeviotune, opts_blkdeviotune, info_blkdeviotune, 0}, - {"blkiotune", cmdBlkiotune, opts_blkiotune, info_blkiotune, 0}, - {"blockcommit", cmdBlockCommit, opts_block_commit, info_block_commit, 0}, - {"blockcopy", cmdBlockCopy, opts_block_copy, info_block_copy, 0}, - {"blockjob", cmdBlockJob, opts_block_job, info_block_job, 0}, - {"blockpull", cmdBlockPull, opts_block_pull, info_block_pull, 0}, - {"blockresize", cmdBlockResize, opts_block_resize, info_block_resize, 0}, - {"change-media", cmdChangeMedia, opts_change_media, info_change_media, 0}, + {.name = "attach-device", + .handler = cmdAttachDevice, + .opts = opts_attach_device, + .info = info_attach_device, + .flags = 0 + }, + {.name = "attach-disk", + .handler = cmdAttachDisk, + .opts = opts_attach_disk, + .info = info_attach_disk, + .flags = 0 + }, + {.name = "attach-interface", + .handler = cmdAttachInterface, + .opts = opts_attach_interface, + .info = info_attach_interface, + .flags = 0 + }, + {.name = "autostart", + .handler = cmdAutostart, + .opts = opts_autostart, + .info = info_autostart, + .flags = 0 + }, + {.name = "blkdeviotune", + .handler = cmdBlkdeviotune, + .opts = opts_blkdeviotune, + .info = info_blkdeviotune, + .flags = 0 + }, + {.name = "blkiotune", + .handler = cmdBlkiotune, + .opts = opts_blkiotune, + .info = info_blkiotune, + .flags = 0 + }, + {.name = "blockcommit", + .handler = cmdBlockCommit, + .opts = opts_block_commit, + .info = info_block_commit, + .flags = 0 + }, + {.name = "blockcopy", + .handler = cmdBlockCopy, + .opts = opts_block_copy, + .info = info_block_copy, + .flags = 0 + }, + {.name = "blockjob", + .handler = cmdBlockJob, + .opts = opts_block_job, + .info = info_block_job, + .flags = 0 + }, + {.name = "blockpull", + .handler = cmdBlockPull, + .opts = opts_block_pull, + .info = info_block_pull, + .flags = 0 + }, + {.name = "blockresize", + .handler = cmdBlockResize, + .opts = opts_block_resize, + .info = info_block_resize, + .flags = 0 + }, + {.name = "change-media", + .handler = cmdChangeMedia, + .opts = opts_change_media, + .info = info_change_media, + .flags = 0 + }, #ifndef WIN32 - {"console", cmdConsole, opts_console, info_console, 0}, + {.name = "console", + .handler = cmdConsole, + .opts = opts_console, + .info = info_console, + .flags = 0 + }, #endif - {"cpu-baseline", cmdCPUBaseline, opts_cpu_baseline, info_cpu_baseline, 0}, - {"cpu-compare", cmdCPUCompare, opts_cpu_compare, info_cpu_compare, 0}, - {"cpu-stats", cmdCPUStats, opts_cpu_stats, info_cpu_stats, 0}, - {"create", cmdCreate, opts_create, info_create, 0}, - {"define", cmdDefine, opts_define, info_define, 0}, - {"desc", cmdDesc, opts_desc, info_desc, 0}, - {"destroy", cmdDestroy, opts_destroy, info_destroy, 0}, - {"detach-device", cmdDetachDevice, opts_detach_device, - info_detach_device, 0}, - {"detach-disk", cmdDetachDisk, opts_detach_disk, info_detach_disk, 0}, - {"detach-interface", cmdDetachInterface, opts_detach_interface, - info_detach_interface, 0}, - {"domdisplay", cmdDomDisplay, opts_domdisplay, info_domdisplay, 0}, - {"domfstrim", cmdDomFSTrim, opts_domfstrim, info_domfstrim, 0}, - {"domhostname", cmdDomHostname, opts_domhostname, info_domhostname, 0}, - {"domid", cmdDomid, opts_domid, info_domid, 0}, - {"domif-setlink", cmdDomIfSetLink, opts_domif_setlink, info_domif_setlink, 0}, - {"domiftune", cmdDomIftune, opts_domiftune, info_domiftune, 0}, - {"domjobabort", cmdDomjobabort, opts_domjobabort, info_domjobabort, 0}, - {"domjobinfo", cmdDomjobinfo, opts_domjobinfo, info_domjobinfo, 0}, - {"domname", cmdDomname, opts_domname, info_domname, 0}, - {"dompmsuspend", cmdDomPMSuspend, - opts_dom_pm_suspend, info_dom_pm_suspend, 0}, - {"dompmwakeup", cmdDomPMWakeup, - opts_dom_pm_wakeup, info_dom_pm_wakeup, 0}, - {"domuuid", cmdDomuuid, opts_domuuid, info_domuuid, 0}, - {"domxml-from-native", cmdDomXMLFromNative, opts_domxmlfromnative, - info_domxmlfromnative, 0}, - {"domxml-to-native", cmdDomXMLToNative, opts_domxmltonative, - info_domxmltonative, 0}, - {"dump", cmdDump, opts_dump, info_dump, 0}, - {"dumpxml", cmdDumpXML, opts_dumpxml, info_dumpxml, 0}, - {"edit", cmdEdit, opts_edit, info_edit, 0}, - {"inject-nmi", cmdInjectNMI, opts_inject_nmi, info_inject_nmi, 0}, - {"send-key", cmdSendKey, opts_send_key, info_send_key, 0}, - {"send-process-signal", cmdSendProcessSignal, opts_send_process_signal, info_send_process_signal, 0}, - {"lxc-enter-namespace", cmdLxcEnterNamespace, opts_lxc_enter_namespace, info_lxc_enter_namespace, 0}, - {"managedsave", cmdManagedSave, opts_managedsave, info_managedsave, 0}, - {"managedsave-remove", cmdManagedSaveRemove, opts_managedsaveremove, - info_managedsaveremove, 0}, - {"maxvcpus", cmdMaxvcpus, opts_maxvcpus, info_maxvcpus, 0}, - {"memtune", cmdMemtune, opts_memtune, info_memtune, 0}, - {"migrate", cmdMigrate, opts_migrate, info_migrate, 0}, - {"migrate-setmaxdowntime", cmdMigrateSetMaxDowntime, - opts_migrate_setmaxdowntime, info_migrate_setmaxdowntime, 0}, - {"migrate-setspeed", cmdMigrateSetMaxSpeed, - opts_migrate_setspeed, info_migrate_setspeed, 0}, - {"migrate-getspeed", cmdMigrateGetMaxSpeed, - opts_migrate_getspeed, info_migrate_getspeed, 0}, - {"numatune", cmdNumatune, opts_numatune, info_numatune, 0}, - {"qemu-attach", cmdQemuAttach, opts_qemu_attach, info_qemu_attach, 0}, - {"qemu-monitor-command", cmdQemuMonitorCommand, opts_qemu_monitor_command, - info_qemu_monitor_command, 0}, - {"qemu-agent-command", cmdQemuAgentCommand, opts_qemu_agent_command, - info_qemu_agent_command, 0}, - {"reboot", cmdReboot, opts_reboot, info_reboot, 0}, - {"reset", cmdReset, opts_reset, info_reset, 0}, - {"restore", cmdRestore, opts_restore, info_restore, 0}, - {"resume", cmdResume, opts_resume, info_resume, 0}, - {"save", cmdSave, opts_save, info_save, 0}, - {"save-image-define", cmdSaveImageDefine, opts_save_image_define, - info_save_image_define, 0}, - {"save-image-dumpxml", cmdSaveImageDumpxml, opts_save_image_dumpxml, - info_save_image_dumpxml, 0}, - {"save-image-edit", cmdSaveImageEdit, opts_save_image_edit, - info_save_image_edit, 0}, - {"schedinfo", cmdSchedinfo, opts_schedinfo, info_schedinfo, 0}, - {"screenshot", cmdScreenshot, opts_screenshot, info_screenshot, 0}, - {"setmaxmem", cmdSetmaxmem, opts_setmaxmem, info_setmaxmem, 0}, - {"setmem", cmdSetmem, opts_setmem, info_setmem, 0}, - {"setvcpus", cmdSetvcpus, opts_setvcpus, info_setvcpus, 0}, - {"shutdown", cmdShutdown, opts_shutdown, info_shutdown, 0}, - {"start", cmdStart, opts_start, info_start, 0}, - {"suspend", cmdSuspend, opts_suspend, info_suspend, 0}, - {"ttyconsole", cmdTTYConsole, opts_ttyconsole, info_ttyconsole, 0}, - {"undefine", cmdUndefine, opts_undefine, info_undefine, 0}, - {"update-device", cmdUpdateDevice, opts_update_device, - info_update_device, 0}, - {"vcpucount", cmdVcpucount, opts_vcpucount, info_vcpucount, 0}, - {"vcpuinfo", cmdVcpuinfo, opts_vcpuinfo, info_vcpuinfo, 0}, - {"vcpupin", cmdVcpuPin, opts_vcpupin, info_vcpupin, 0}, - {"emulatorpin", cmdEmulatorPin, opts_emulatorpin, info_emulatorpin, 0}, - {"vncdisplay", cmdVNCDisplay, opts_vncdisplay, info_vncdisplay, 0}, - {NULL, NULL, NULL, NULL, 0} + {.name = "cpu-baseline", + .handler = cmdCPUBaseline, + .opts = opts_cpu_baseline, + .info = info_cpu_baseline, + .flags = 0 + }, + {.name = "cpu-compare", + .handler = cmdCPUCompare, + .opts = opts_cpu_compare, + .info = info_cpu_compare, + .flags = 0 + }, + {.name = "cpu-stats", + .handler = cmdCPUStats, + .opts = opts_cpu_stats, + .info = info_cpu_stats, + .flags = 0 + }, + {.name = "create", + .handler = cmdCreate, + .opts = opts_create, + .info = info_create, + .flags = 0 + }, + {.name = "define", + .handler = cmdDefine, + .opts = opts_define, + .info = info_define, + .flags = 0 + }, + {.name = "desc", + .handler = cmdDesc, + .opts = opts_desc, + .info = info_desc, + .flags = 0 + }, + {.name = "destroy", + .handler = cmdDestroy, + .opts = opts_destroy, + .info = info_destroy, + .flags = 0 + }, + {.name = "detach-device", + .handler = cmdDetachDevice, + .opts = opts_detach_device, + .info = info_detach_device, + .flags = 0 + }, + {.name = "detach-disk", + .handler = cmdDetachDisk, + .opts = opts_detach_disk, + .info = info_detach_disk, + .flags = 0 + }, + {.name = "detach-interface", + .handler = cmdDetachInterface, + .opts = opts_detach_interface, + .info = info_detach_interface, + .flags = 0 + }, + {.name = "domdisplay", + .handler = cmdDomDisplay, + .opts = opts_domdisplay, + .info = info_domdisplay, + .flags = 0 + }, + {.name = "domfstrim", + .handler = cmdDomFSTrim, + .opts = opts_domfstrim, + .info = info_domfstrim, + .flags = 0 + }, + {.name = "domhostname", + .handler = cmdDomHostname, + .opts = opts_domhostname, + .info = info_domhostname, + .flags = 0 + }, + {.name = "domid", + .handler = cmdDomid, + .opts = opts_domid, + .info = info_domid, + .flags = 0 + }, + {.name = "domif-setlink", + .handler = cmdDomIfSetLink, + .opts = opts_domif_setlink, + .info = info_domif_setlink, + .flags = 0 + }, + {.name = "domiftune", + .handler = cmdDomIftune, + .opts = opts_domiftune, + .info = info_domiftune, + .flags = 0 + }, + {.name = "domjobabort", + .handler = cmdDomjobabort, + .opts = opts_domjobabort, + .info = info_domjobabort, + .flags = 0 + }, + {.name = "domjobinfo", + .handler = cmdDomjobinfo, + .opts = opts_domjobinfo, + .info = info_domjobinfo, + .flags = 0 + }, + {.name = "domname", + .handler = cmdDomname, + .opts = opts_domname, + .info = info_domname, + .flags = 0 + }, + {.name = "dompmsuspend", + .handler = cmdDomPMSuspend, + .opts = opts_dom_pm_suspend, + .info = info_dom_pm_suspend, + .flags = 0 + }, + {.name = "dompmwakeup", + .handler = cmdDomPMWakeup, + .opts = opts_dom_pm_wakeup, + .info = info_dom_pm_wakeup, + .flags = 0 + }, + {.name = "domuuid", + .handler = cmdDomuuid, + .opts = opts_domuuid, + .info = info_domuuid, + .flags = 0 + }, + {.name = "domxml-from-native", + .handler = cmdDomXMLFromNative, + .opts = opts_domxmlfromnative, + .info = info_domxmlfromnative, + .flags = 0 + }, + {.name = "domxml-to-native", + .handler = cmdDomXMLToNative, + .opts = opts_domxmltonative, + .info = info_domxmltonative, + .flags = 0 + }, + {.name = "dump", + .handler = cmdDump, + .opts = opts_dump, + .info = info_dump, + .flags = 0 + }, + {.name = "dumpxml", + .handler = cmdDumpXML, + .opts = opts_dumpxml, + .info = info_dumpxml, + .flags = 0 + }, + {.name = "edit", + .handler = cmdEdit, + .opts = opts_edit, + .info = info_edit, + .flags = 0 + }, + {.name = "inject-nmi", + .handler = cmdInjectNMI, + .opts = opts_inject_nmi, + .info = info_inject_nmi, + .flags = 0 + }, + {.name = "send-key", + .handler = cmdSendKey, + .opts = opts_send_key, + .info = info_send_key, + .flags = 0 + }, + {.name = "send-process-signal", + .handler = cmdSendProcessSignal, + .opts = opts_send_process_signal, + .info = info_send_process_signal, + .flags = 0 + }, + {.name = "lxc-enter-namespace", + .handler = cmdLxcEnterNamespace, + .opts = opts_lxc_enter_namespace, + .info = info_lxc_enter_namespace, + .flags = 0 + }, + {.name = "managedsave", + .handler = cmdManagedSave, + .opts = opts_managedsave, + .info = info_managedsave, + .flags = 0 + }, + {.name = "managedsave-remove", + .handler = cmdManagedSaveRemove, + .opts = opts_managedsaveremove, + .info = info_managedsaveremove, + .flags = 0 + }, + {.name = "maxvcpus", + .handler = cmdMaxvcpus, + .opts = opts_maxvcpus, + .info = info_maxvcpus, + .flags = 0 + }, + {.name = "memtune", + .handler = cmdMemtune, + .opts = opts_memtune, + .info = info_memtune, + .flags = 0 + }, + {.name = "migrate", + .handler = cmdMigrate, + .opts = opts_migrate, + .info = info_migrate, + .flags = 0 + }, + {.name = "migrate-setmaxdowntime", + .handler = cmdMigrateSetMaxDowntime, + .opts = opts_migrate_setmaxdowntime, + .info = info_migrate_setmaxdowntime, + .flags = 0 + }, + {.name = "migrate-setspeed", + .handler = cmdMigrateSetMaxSpeed, + .opts = opts_migrate_setspeed, + .info = info_migrate_setspeed, + .flags = 0 + }, + {.name = "migrate-getspeed", + .handler = cmdMigrateGetMaxSpeed, + .opts = opts_migrate_getspeed, + .info = info_migrate_getspeed, + .flags = 0 + }, + {.name = "numatune", + .handler = cmdNumatune, + .opts = opts_numatune, + .info = info_numatune, + .flags = 0 + }, + {.name = "qemu-attach", + .handler = cmdQemuAttach, + .opts = opts_qemu_attach, + .info = info_qemu_attach, + .flags = 0 + }, + {.name = "qemu-monitor-command", + .handler = cmdQemuMonitorCommand, + .opts = opts_qemu_monitor_command, + .info = info_qemu_monitor_command, + .flags = 0 + }, + {.name = "qemu-agent-command", + .handler = cmdQemuAgentCommand, + .opts = opts_qemu_agent_command, + .info = info_qemu_agent_command, + .flags = 0 + }, + {.name = "reboot", + .handler = cmdReboot, + .opts = opts_reboot, + .info = info_reboot, + .flags = 0 + }, + {.name = "reset", + .handler = cmdReset, + .opts = opts_reset, + .info = info_reset, + .flags = 0 + }, + {.name = "restore", + .handler = cmdRestore, + .opts = opts_restore, + .info = info_restore, + .flags = 0 + }, + {.name = "resume", + .handler = cmdResume, + .opts = opts_resume, + .info = info_resume, + .flags = 0 + }, + {.name = "save", + .handler = cmdSave, + .opts = opts_save, + .info = info_save, + .flags = 0 + }, + {.name = "save-image-define", + .handler = cmdSaveImageDefine, + .opts = opts_save_image_define, + .info = info_save_image_define, + .flags = 0 + }, + {.name = "save-image-dumpxml", + .handler = cmdSaveImageDumpxml, + .opts = opts_save_image_dumpxml, + .info = info_save_image_dumpxml, + .flags = 0 + }, + {.name = "save-image-edit", + .handler = cmdSaveImageEdit, + .opts = opts_save_image_edit, + .info = info_save_image_edit, + .flags = 0 + }, + {.name = "schedinfo", + .handler = cmdSchedinfo, + .opts = opts_schedinfo, + .info = info_schedinfo, + .flags = 0 + }, + {.name = "screenshot", + .handler = cmdScreenshot, + .opts = opts_screenshot, + .info = info_screenshot, + .flags = 0 + }, + {.name = "setmaxmem", + .handler = cmdSetmaxmem, + .opts = opts_setmaxmem, + .info = info_setmaxmem, + .flags = 0 + }, + {.name = "setmem", + .handler = cmdSetmem, + .opts = opts_setmem, + .info = info_setmem, + .flags = 0 + }, + {.name = "setvcpus", + .handler = cmdSetvcpus, + .opts = opts_setvcpus, + .info = info_setvcpus, + .flags = 0 + }, + {.name = "shutdown", + .handler = cmdShutdown, + .opts = opts_shutdown, + .info = info_shutdown, + .flags = 0 + }, + {.name = "start", + .handler = cmdStart, + .opts = opts_start, + .info = info_start, + .flags = 0 + }, + {.name = "suspend", + .handler = cmdSuspend, + .opts = opts_suspend, + .info = info_suspend, + .flags = 0 + }, + {.name = "ttyconsole", + .handler = cmdTTYConsole, + .opts = opts_ttyconsole, + .info = info_ttyconsole, + .flags = 0 + }, + {.name = "undefine", + .handler = cmdUndefine, + .opts = opts_undefine, + .info = info_undefine, + .flags = 0 + }, + {.name = "update-device", + .handler = cmdUpdateDevice, + .opts = opts_update_device, + .info = info_update_device, + .flags = 0 + }, + {.name = "vcpucount", + .handler = cmdVcpucount, + .opts = opts_vcpucount, + .info = info_vcpucount, + .flags = 0 + }, + {.name = "vcpuinfo", + .handler = cmdVcpuinfo, + .opts = opts_vcpuinfo, + .info = info_vcpuinfo, + .flags = 0 + }, + {.name = "vcpupin", + .handler = cmdVcpuPin, + .opts = opts_vcpupin, + .info = info_vcpupin, + .flags = 0 + }, + {.name = "emulatorpin", + .handler = cmdEmulatorPin, + .opts = opts_emulatorpin, + .info = info_emulatorpin, + .flags = 0 + }, + {.name = "vncdisplay", + .handler = cmdVNCDisplay, + .opts = opts_vncdisplay, + .info = info_vncdisplay, + .flags = 0 + }, + {.name = NULL} }; diff --git a/tools/virsh-host.c b/tools/virsh-host.c index cfed65c..165657b 100644 --- a/tools/virsh-host.c +++ b/tools/virsh-host.c @@ -878,20 +878,83 @@ error: } const vshCmdDef hostAndHypervisorCmds[] = { - {"capabilities", cmdCapabilities, NULL, info_capabilities, 0}, - {"connect", cmdConnect, opts_connect, info_connect, - VSH_CMD_FLAG_NOCONNECT}, - {"freecell", cmdFreecell, opts_freecell, info_freecell, 0}, - {"hostname", cmdHostname, NULL, info_hostname, 0}, - {"node-memory-tune", cmdNodeMemoryTune, - opts_node_memory_tune, info_node_memory_tune, 0}, - {"nodecpumap", cmdNodeCpuMap, NULL, info_node_cpumap, 0}, - {"nodecpustats", cmdNodeCpuStats, opts_node_cpustats, info_nodecpustats, 0}, - {"nodeinfo", cmdNodeinfo, NULL, info_nodeinfo, 0}, - {"nodememstats", cmdNodeMemStats, opts_node_memstats, info_nodememstats, 0}, - {"nodesuspend", cmdNodeSuspend, opts_node_suspend, info_nodesuspend, 0}, - {"sysinfo", cmdSysinfo, NULL, info_sysinfo, 0}, - {"uri", cmdURI, NULL, info_uri, 0}, - {"version", cmdVersion, opts_version, info_version, 0}, - {NULL, NULL, NULL, NULL, 0} + {.name = "capabilities", + .handler = cmdCapabilities, + .opts = NULL, + .info = info_capabilities, + .flags = 0 + }, + {.name = "connect", + .handler = cmdConnect, + .opts = opts_connect, + .info = info_connect, + .flags = VSH_CMD_FLAG_NOCONNECT + }, + {.name = "freecell", + .handler = cmdFreecell, + .opts = opts_freecell, + .info = info_freecell, + .flags = 0 + }, + {.name = "hostname", + .handler = cmdHostname, + .opts = NULL, + .info = info_hostname, + .flags = 0 + }, + {.name = "node-memory-tune", + .handler = cmdNodeMemoryTune, + .opts = opts_node_memory_tune, + .info = info_node_memory_tune, + .flags = 0 + }, + {.name = "nodecpumap", + .handler = cmdNodeCpuMap, + .opts = NULL, + .info = info_node_cpumap, + .flags = 0 + }, + {.name = "nodecpustats", + .handler = cmdNodeCpuStats, + .opts = opts_node_cpustats, + .info = info_nodecpustats, + .flags = 0 + }, + {.name = "nodeinfo", + .handler = cmdNodeinfo, + .opts = NULL, + .info = info_nodeinfo, + .flags = 0 + }, + {.name = "nodememstats", + .handler = cmdNodeMemStats, + .opts = opts_node_memstats, + .info = info_nodememstats, + .flags = 0 + }, + {.name = "nodesuspend", + .handler = cmdNodeSuspend, + .opts = opts_node_suspend, + .info = info_nodesuspend, + .flags = 0 + }, + {.name = "sysinfo", + .handler = cmdSysinfo, + .opts = NULL, + .info = info_sysinfo, + .flags = 0 + }, + {.name = "uri", + .handler = cmdURI, + .opts = NULL, + .info = info_uri, + .flags = 0 + }, + {.name = "version", + .handler = cmdVersion, + .opts = opts_version, + .info = info_version, + .flags = 0 + }, + {.name = NULL} }; diff --git a/tools/virsh-interface.c b/tools/virsh-interface.c index 5337f5e..3a6eb95 100644 --- a/tools/virsh-interface.c +++ b/tools/virsh-interface.c @@ -1149,33 +1149,89 @@ cmdInterfaceUnbridge(vshControl *ctl, const vshCmd *cmd) } const vshCmdDef ifaceCmds[] = { - {"iface-begin", cmdInterfaceBegin, opts_interface_begin, - info_interface_begin, 0}, - {"iface-bridge", cmdInterfaceBridge, opts_interface_bridge, - info_interface_bridge, 0}, - {"iface-commit", cmdInterfaceCommit, opts_interface_commit, - info_interface_commit, 0}, - {"iface-define", cmdInterfaceDefine, opts_interface_define, - info_interface_define, 0}, - {"iface-destroy", cmdInterfaceDestroy, opts_interface_destroy, - info_interface_destroy, 0}, - {"iface-dumpxml", cmdInterfaceDumpXML, opts_interface_dumpxml, - info_interface_dumpxml, 0}, - {"iface-edit", cmdInterfaceEdit, opts_interface_edit, - info_interface_edit, 0}, - {"iface-list", cmdInterfaceList, opts_interface_list, - info_interface_list, 0}, - {"iface-mac", cmdInterfaceMAC, opts_interface_mac, - info_interface_mac, 0}, - {"iface-name", cmdInterfaceName, opts_interface_name, - info_interface_name, 0}, - {"iface-rollback", cmdInterfaceRollback, opts_interface_rollback, - info_interface_rollback, 0}, - {"iface-start", cmdInterfaceStart, opts_interface_start, - info_interface_start, 0}, - {"iface-unbridge", cmdInterfaceUnbridge, opts_interface_unbridge, - info_interface_unbridge, 0}, - {"iface-undefine", cmdInterfaceUndefine, opts_interface_undefine, - info_interface_undefine, 0}, - {NULL, NULL, NULL, NULL, 0} + {.name = "iface-begin", + .handler = cmdInterfaceBegin, + .opts = opts_interface_begin, + .info = info_interface_begin, + .flags = 0 + }, + {.name = "iface-bridge", + .handler = cmdInterfaceBridge, + .opts = opts_interface_bridge, + .info = info_interface_bridge, + .flags = 0 + }, + {.name = "iface-commit", + .handler = cmdInterfaceCommit, + .opts = opts_interface_commit, + .info = info_interface_commit, + .flags = 0 + }, + {.name = "iface-define", + .handler = cmdInterfaceDefine, + .opts = opts_interface_define, + .info = info_interface_define, + .flags = 0 + }, + {.name = "iface-destroy", + .handler = cmdInterfaceDestroy, + .opts = opts_interface_destroy, + .info = info_interface_destroy, + .flags = 0 + }, + {.name = "iface-dumpxml", + .handler = cmdInterfaceDumpXML, + .opts = opts_interface_dumpxml, + .info = info_interface_dumpxml, + .flags = 0 + }, + {.name = "iface-edit", + .handler = cmdInterfaceEdit, + .opts = opts_interface_edit, + .info = info_interface_edit, + .flags = 0 + }, + {.name = "iface-list", + .handler = cmdInterfaceList, + .opts = opts_interface_list, + .info = info_interface_list, + .flags = 0 + }, + {.name = "iface-mac", + .handler = cmdInterfaceMAC, + .opts = opts_interface_mac, + .info = info_interface_mac, + .flags = 0 + }, + {.name = "iface-name", + .handler = cmdInterfaceName, + .opts = opts_interface_name, + .info = info_interface_name, + .flags = 0 + }, + {.name = "iface-rollback", + .handler = cmdInterfaceRollback, + .opts = opts_interface_rollback, + .info = info_interface_rollback, + .flags = 0 + }, + {.name = "iface-start", + .handler = cmdInterfaceStart, + .opts = opts_interface_start, + .info = info_interface_start, + .flags = 0 + }, + {.name = "iface-unbridge", + .handler = cmdInterfaceUnbridge, + .opts = opts_interface_unbridge, + .info = info_interface_unbridge, + .flags = 0 + }, + {.name = "iface-undefine", + .handler = cmdInterfaceUndefine, + .opts = opts_interface_undefine, + .info = info_interface_undefine, + .flags = 0 + }, + {.name = NULL} }; diff --git a/tools/virsh-network.c b/tools/virsh-network.c index 0843a6b..16578aa 100644 --- a/tools/virsh-network.c +++ b/tools/virsh-network.c @@ -1092,24 +1092,83 @@ cmdNetworkEdit(vshControl *ctl, const vshCmd *cmd) } const vshCmdDef networkCmds[] = { - {"net-autostart", cmdNetworkAutostart, opts_network_autostart, - info_network_autostart, 0}, - {"net-create", cmdNetworkCreate, opts_network_create, - info_network_create, 0}, - {"net-define", cmdNetworkDefine, opts_network_define, - info_network_define, 0}, - {"net-destroy", cmdNetworkDestroy, opts_network_destroy, - info_network_destroy, 0}, - {"net-dumpxml", cmdNetworkDumpXML, opts_network_dumpxml, - info_network_dumpxml, 0}, - {"net-edit", cmdNetworkEdit, opts_network_edit, info_network_edit, 0}, - {"net-info", cmdNetworkInfo, opts_network_info, info_network_info, 0}, - {"net-list", cmdNetworkList, opts_network_list, info_network_list, 0}, - {"net-name", cmdNetworkName, opts_network_name, info_network_name, 0}, - {"net-start", cmdNetworkStart, opts_network_start, info_network_start, 0}, - {"net-undefine", cmdNetworkUndefine, opts_network_undefine, - info_network_undefine, 0}, - {"net-update", cmdNetworkUpdate, opts_network_update, info_network_update, 0}, - {"net-uuid", cmdNetworkUuid, opts_network_uuid, info_network_uuid, 0}, - {NULL, NULL, NULL, NULL, 0} + {.name = "net-autostart", + .handler = cmdNetworkAutostart, + .opts = opts_network_autostart, + .info = info_network_autostart, + .flags = 0 + }, + {.name = "net-create", + .handler = cmdNetworkCreate, + .opts = opts_network_create, + .info = info_network_create, + .flags = 0 + }, + {.name = "net-define", + .handler = cmdNetworkDefine, + .opts = opts_network_define, + .info = info_network_define, + .flags = 0 + }, + {.name = "net-destroy", + .handler = cmdNetworkDestroy, + .opts = opts_network_destroy, + .info = info_network_destroy, + .flags = 0 + }, + {.name = "net-dumpxml", + .handler = cmdNetworkDumpXML, + .opts = opts_network_dumpxml, + .info = info_network_dumpxml, + .flags = 0 + }, + {.name = "net-edit", + .handler = cmdNetworkEdit, + .opts = opts_network_edit, + .info = info_network_edit, + .flags = 0 + }, + {.name = "net-info", + .handler = cmdNetworkInfo, + .opts = opts_network_info, + .info = info_network_info, + .flags = 0 + }, + {.name = "net-list", + .handler = cmdNetworkList, + .opts = opts_network_list, + .info = info_network_list, + .flags = 0 + }, + {.name = "net-name", + .handler = cmdNetworkName, + .opts = opts_network_name, + .info = info_network_name, + .flags = 0 + }, + {.name = "net-start", + .handler = cmdNetworkStart, + .opts = opts_network_start, + .info = info_network_start, + .flags = 0 + }, + {.name = "net-undefine", + .handler = cmdNetworkUndefine, + .opts = opts_network_undefine, + .info = info_network_undefine, + .flags = 0 + }, + {.name = "net-update", + .handler = cmdNetworkUpdate, + .opts = opts_network_update, + .info = info_network_update, + .flags = 0 + }, + {.name = "net-uuid", + .handler = cmdNetworkUuid, + .opts = opts_network_uuid, + .info = info_network_uuid, + .flags = 0 + }, + {.name = NULL} }; diff --git a/tools/virsh-nodedev.c b/tools/virsh-nodedev.c index f85bded..686a07b 100644 --- a/tools/virsh-nodedev.c +++ b/tools/virsh-nodedev.c @@ -647,21 +647,53 @@ cmdNodeDeviceReset(vshControl *ctl, const vshCmd *cmd) } const vshCmdDef nodedevCmds[] = { - {"nodedev-create", cmdNodeDeviceCreate, opts_node_device_create, - info_node_device_create, 0}, - {"nodedev-destroy", cmdNodeDeviceDestroy, opts_node_device_destroy, - info_node_device_destroy, 0}, - {"nodedev-detach", cmdNodeDeviceDetach, opts_node_device_detach, - info_node_device_detach, 0}, - {"nodedev-dettach", cmdNodeDeviceDetach, opts_node_device_detach, - info_node_device_detach, VSH_CMD_FLAG_ALIAS}, - {"nodedev-dumpxml", cmdNodeDeviceDumpXML, opts_node_device_dumpxml, - info_node_device_dumpxml, 0}, - {"nodedev-list", cmdNodeListDevices, opts_node_list_devices, - info_node_list_devices, 0}, - {"nodedev-reattach", cmdNodeDeviceReAttach, opts_node_device_reattach, - info_node_device_reattach, 0}, - {"nodedev-reset", cmdNodeDeviceReset, opts_node_device_reset, - info_node_device_reset, 0}, - {NULL, NULL, NULL, NULL, 0} + {.name = "nodedev-create", + .handler = cmdNodeDeviceCreate, + .opts = opts_node_device_create, + .info = info_node_device_create, + .flags = 0 + }, + {.name = "nodedev-destroy", + .handler = cmdNodeDeviceDestroy, + .opts = opts_node_device_destroy, + .info = info_node_device_destroy, + .flags = 0 + }, + {.name = "nodedev-detach", + .handler = cmdNodeDeviceDetach, + .opts = opts_node_device_detach, + .info = info_node_device_detach, + .flags = 0 + }, + {.name = "nodedev-dettach", + .handler = cmdNodeDeviceDetach, + .opts = opts_node_device_detach, + .info = info_node_device_detach, + .flags = VSH_CMD_FLAG_ALIAS + }, + {.name = "nodedev-dumpxml", + .handler = cmdNodeDeviceDumpXML, + .opts = opts_node_device_dumpxml, + .info = info_node_device_dumpxml, + .flags = 0 + }, + {.name = "nodedev-list", + .handler = cmdNodeListDevices, + .opts = opts_node_list_devices, + .info = info_node_list_devices, + .flags = 0 + }, + {.name = "nodedev-reattach", + .handler = cmdNodeDeviceReAttach, + .opts = opts_node_device_reattach, + .info = info_node_device_reattach, + .flags = 0 + }, + {.name = "nodedev-reset", + .handler = cmdNodeDeviceReset, + .opts = opts_node_device_reset, + .info = info_node_device_reset, + .flags = 0 + }, + {.name = NULL} }; diff --git a/tools/virsh-nwfilter.c b/tools/virsh-nwfilter.c index 9407d38..20a3557 100644 --- a/tools/virsh-nwfilter.c +++ b/tools/virsh-nwfilter.c @@ -427,15 +427,35 @@ cleanup: } const vshCmdDef nwfilterCmds[] = { - {"nwfilter-define", cmdNWFilterDefine, opts_nwfilter_define, - info_nwfilter_define, 0}, - {"nwfilter-dumpxml", cmdNWFilterDumpXML, opts_nwfilter_dumpxml, - info_nwfilter_dumpxml, 0}, - {"nwfilter-edit", cmdNWFilterEdit, opts_nwfilter_edit, - info_nwfilter_edit, 0}, - {"nwfilter-list", cmdNWFilterList, opts_nwfilter_list, - info_nwfilter_list, 0}, - {"nwfilter-undefine", cmdNWFilterUndefine, opts_nwfilter_undefine, - info_nwfilter_undefine, 0}, - {NULL, NULL, NULL, NULL, 0} + {.name = "nwfilter-define", + .handler = cmdNWFilterDefine, + .opts = opts_nwfilter_define, + .info = info_nwfilter_define, + .flags = 0 + }, + {.name = "nwfilter-dumpxml", + .handler = cmdNWFilterDumpXML, + .opts = opts_nwfilter_dumpxml, + .info = info_nwfilter_dumpxml, + .flags = 0 + }, + {.name = "nwfilter-edit", + .handler = cmdNWFilterEdit, + .opts = opts_nwfilter_edit, + .info = info_nwfilter_edit, + .flags = 0 + }, + {.name = "nwfilter-list", + .handler = cmdNWFilterList, + .opts = opts_nwfilter_list, + .info = info_nwfilter_list, + .flags = 0 + }, + {.name = "nwfilter-undefine", + .handler = cmdNWFilterUndefine, + .opts = opts_nwfilter_undefine, + .info = info_nwfilter_undefine, + .flags = 0 + }, + {.name = NULL} }; diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c index 09070f2..e5de189 100644 --- a/tools/virsh-pool.c +++ b/tools/virsh-pool.c @@ -1761,28 +1761,119 @@ cmdPoolEdit(vshControl *ctl, const vshCmd *cmd) } const vshCmdDef storagePoolCmds[] = { - {"find-storage-pool-sources-as", cmdPoolDiscoverSourcesAs, - opts_find_storage_pool_sources_as, info_find_storage_pool_sources_as, 0}, - {"find-storage-pool-sources", cmdPoolDiscoverSources, - opts_find_storage_pool_sources, info_find_storage_pool_sources, 0}, - {"pool-autostart", cmdPoolAutostart, opts_pool_autostart, - info_pool_autostart, 0}, - {"pool-build", cmdPoolBuild, opts_pool_build, info_pool_build, 0}, - {"pool-create-as", cmdPoolCreateAs, opts_pool_X_as, info_pool_create_as, 0}, - {"pool-create", cmdPoolCreate, opts_pool_create, info_pool_create, 0}, - {"pool-define-as", cmdPoolDefineAs, opts_pool_X_as, info_pool_define_as, 0}, - {"pool-define", cmdPoolDefine, opts_pool_define, info_pool_define, 0}, - {"pool-delete", cmdPoolDelete, opts_pool_delete, info_pool_delete, 0}, - {"pool-destroy", cmdPoolDestroy, opts_pool_destroy, info_pool_destroy, 0}, - {"pool-dumpxml", cmdPoolDumpXML, opts_pool_dumpxml, info_pool_dumpxml, 0}, - {"pool-edit", cmdPoolEdit, opts_pool_edit, info_pool_edit, 0}, - {"pool-info", cmdPoolInfo, opts_pool_info, info_pool_info, 0}, - {"pool-list", cmdPoolList, opts_pool_list, info_pool_list, 0}, - {"pool-name", cmdPoolName, opts_pool_name, info_pool_name, 0}, - {"pool-refresh", cmdPoolRefresh, opts_pool_refresh, info_pool_refresh, 0}, - {"pool-start", cmdPoolStart, opts_pool_start, info_pool_start, 0}, - {"pool-undefine", cmdPoolUndefine, opts_pool_undefine, - info_pool_undefine, 0}, - {"pool-uuid", cmdPoolUuid, opts_pool_uuid, info_pool_uuid, 0}, - {NULL, NULL, NULL, NULL, 0} + {.name = "find-storage-pool-sources-as", + .handler = cmdPoolDiscoverSourcesAs, + .opts = opts_find_storage_pool_sources_as, + .info = info_find_storage_pool_sources_as, + .flags = 0 + }, + {.name = "find-storage-pool-sources", + .handler = cmdPoolDiscoverSources, + .opts = opts_find_storage_pool_sources, + .info = info_find_storage_pool_sources, + .flags = 0 + }, + {.name = "pool-autostart", + .handler = cmdPoolAutostart, + .opts = opts_pool_autostart, + .info = info_pool_autostart, + .flags = 0 + }, + {.name = "pool-build", + .handler = cmdPoolBuild, + .opts = opts_pool_build, + .info = info_pool_build, + .flags = 0 + }, + {.name = "pool-create-as", + .handler = cmdPoolCreateAs, + .opts = opts_pool_X_as, + .info = info_pool_create_as, + .flags = 0 + }, + {.name = "pool-create", + .handler = cmdPoolCreate, + .opts = opts_pool_create, + .info = info_pool_create, + .flags = 0 + }, + {.name = "pool-define-as", + .handler = cmdPoolDefineAs, + .opts = opts_pool_X_as, + .info = info_pool_define_as, + .flags = 0 + }, + {.name = "pool-define", + .handler = cmdPoolDefine, + .opts = opts_pool_define, + .info = info_pool_define, + .flags = 0 + }, + {.name = "pool-delete", + .handler = cmdPoolDelete, + .opts = opts_pool_delete, + .info = info_pool_delete, + .flags = 0 + }, + {.name = "pool-destroy", + .handler = cmdPoolDestroy, + .opts = opts_pool_destroy, + .info = info_pool_destroy, + .flags = 0 + }, + {.name = "pool-dumpxml", + .handler = cmdPoolDumpXML, + .opts = opts_pool_dumpxml, + .info = info_pool_dumpxml, + .flags = 0 + }, + {.name = "pool-edit", + .handler = cmdPoolEdit, + .opts = opts_pool_edit, + .info = info_pool_edit, + .flags = 0 + }, + {.name = "pool-info", + .handler = cmdPoolInfo, + .opts = opts_pool_info, + .info = info_pool_info, + .flags = 0 + }, + {.name = "pool-list", + .handler = cmdPoolList, + .opts = opts_pool_list, + .info = info_pool_list, + .flags = 0 + }, + {.name = "pool-name", + .handler = cmdPoolName, + .opts = opts_pool_name, + .info = info_pool_name, + .flags = 0 + }, + {.name = "pool-refresh", + .handler = cmdPoolRefresh, + .opts = opts_pool_refresh, + .info = info_pool_refresh, + .flags = 0 + }, + {.name = "pool-start", + .handler = cmdPoolStart, + .opts = opts_pool_start, + .info = info_pool_start, + .flags = 0 + }, + {.name = "pool-undefine", + .handler = cmdPoolUndefine, + .opts = opts_pool_undefine, + .info = info_pool_undefine, + .flags = 0 + }, + {.name = "pool-uuid", + .handler = cmdPoolUuid, + .opts = opts_pool_uuid, + .info = info_pool_uuid, + .flags = 0 + }, + {.name = NULL} }; diff --git a/tools/virsh-secret.c b/tools/virsh-secret.c index a735498..3e9129e 100644 --- a/tools/virsh-secret.c +++ b/tools/virsh-secret.c @@ -544,16 +544,41 @@ cleanup: } const vshCmdDef secretCmds[] = { - {"secret-define", cmdSecretDefine, opts_secret_define, - info_secret_define, 0}, - {"secret-dumpxml", cmdSecretDumpXML, opts_secret_dumpxml, - info_secret_dumpxml, 0}, - {"secret-get-value", cmdSecretGetValue, opts_secret_get_value, - info_secret_get_value, 0}, - {"secret-list", cmdSecretList, opts_secret_list, info_secret_list, 0}, - {"secret-set-value", cmdSecretSetValue, opts_secret_set_value, - info_secret_set_value, 0}, - {"secret-undefine", cmdSecretUndefine, opts_secret_undefine, - info_secret_undefine, 0}, - {NULL, NULL, NULL, NULL, 0} + {.name = "secret-define", + .handler = cmdSecretDefine, + .opts = opts_secret_define, + .info = info_secret_define, + .flags = 0 + }, + {.name = "secret-dumpxml", + .handler = cmdSecretDumpXML, + .opts = opts_secret_dumpxml, + .info = info_secret_dumpxml, + .flags = 0 + }, + {.name = "secret-get-value", + .handler = cmdSecretGetValue, + .opts = opts_secret_get_value, + .info = info_secret_get_value, + .flags = 0 + }, + {.name = "secret-list", + .handler = cmdSecretList, + .opts = opts_secret_list, + .info = info_secret_list, + .flags = 0 + }, + {.name = "secret-set-value", + .handler = cmdSecretSetValue, + .opts = opts_secret_set_value, + .info = info_secret_set_value, + .flags = 0 + }, + {.name = "secret-undefine", + .handler = cmdSecretUndefine, + .opts = opts_secret_undefine, + .info = info_secret_undefine, + .flags = 0 + }, + {.name = NULL} }; diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c index ba57059..3d6fa91 100644 --- a/tools/virsh-snapshot.c +++ b/tools/virsh-snapshot.c @@ -2044,25 +2044,65 @@ cleanup: } const vshCmdDef snapshotCmds[] = { - {"snapshot-create", cmdSnapshotCreate, opts_snapshot_create, - info_snapshot_create, 0}, - {"snapshot-create-as", cmdSnapshotCreateAs, opts_snapshot_create_as, - info_snapshot_create_as, 0}, - {"snapshot-current", cmdSnapshotCurrent, opts_snapshot_current, - info_snapshot_current, 0}, - {"snapshot-delete", cmdSnapshotDelete, opts_snapshot_delete, - info_snapshot_delete, 0}, - {"snapshot-dumpxml", cmdSnapshotDumpXML, opts_snapshot_dumpxml, - info_snapshot_dumpxml, 0}, - {"snapshot-edit", cmdSnapshotEdit, opts_snapshot_edit, - info_snapshot_edit, 0}, - {"snapshot-info", cmdSnapshotInfo, opts_snapshot_info, - info_snapshot_info, 0}, - {"snapshot-list", cmdSnapshotList, opts_snapshot_list, - info_snapshot_list, 0}, - {"snapshot-parent", cmdSnapshotParent, opts_snapshot_parent, - info_snapshot_parent, 0}, - {"snapshot-revert", cmdDomainSnapshotRevert, opts_snapshot_revert, - info_snapshot_revert, 0}, - {NULL, NULL, NULL, NULL, 0} + {.name = "snapshot-create", + .handler = cmdSnapshotCreate, + .opts = opts_snapshot_create, + .info = info_snapshot_create, + .flags = 0 + }, + {.name = "snapshot-create-as", + .handler = cmdSnapshotCreateAs, + .opts = opts_snapshot_create_as, + .info = info_snapshot_create_as, + .flags = 0 + }, + {.name = "snapshot-current", + .handler = cmdSnapshotCurrent, + .opts = opts_snapshot_current, + .info = info_snapshot_current, + .flags = 0 + }, + {.name = "snapshot-delete", + .handler = cmdSnapshotDelete, + .opts = opts_snapshot_delete, + .info = info_snapshot_delete, + .flags = 0 + }, + {.name = "snapshot-dumpxml", + .handler = cmdSnapshotDumpXML, + .opts = opts_snapshot_dumpxml, + .info = info_snapshot_dumpxml, + .flags = 0 + }, + {.name = "snapshot-edit", + .handler = cmdSnapshotEdit, + .opts = opts_snapshot_edit, + .info = info_snapshot_edit, + .flags = 0 + }, + {.name = "snapshot-info", + .handler = cmdSnapshotInfo, + .opts = opts_snapshot_info, + .info = info_snapshot_info, + .flags = 0 + }, + {.name = "snapshot-list", + .handler = cmdSnapshotList, + .opts = opts_snapshot_list, + .info = info_snapshot_list, + .flags = 0 + }, + {.name = "snapshot-parent", + .handler = cmdSnapshotParent, + .opts = opts_snapshot_parent, + .info = info_snapshot_parent, + .flags = 0 + }, + {.name = "snapshot-revert", + .handler = cmdDomainSnapshotRevert, + .opts = opts_snapshot_revert, + .info = info_snapshot_revert, + .flags = 0 + }, + {.name = NULL} }; diff --git a/tools/virsh-volume.c b/tools/virsh-volume.c index 0575166..8487670 100644 --- a/tools/virsh-volume.c +++ b/tools/virsh-volume.c @@ -1717,23 +1717,101 @@ cmdVolPath(vshControl *ctl, const vshCmd *cmd) } const vshCmdDef storageVolCmds[] = { - {"vol-clone", cmdVolClone, opts_vol_clone, info_vol_clone, 0}, - {"vol-create-as", cmdVolCreateAs, opts_vol_create_as, - info_vol_create_as, 0}, - {"vol-create", cmdVolCreate, opts_vol_create, info_vol_create, 0}, - {"vol-create-from", cmdVolCreateFrom, opts_vol_create_from, - info_vol_create_from, 0}, - {"vol-delete", cmdVolDelete, opts_vol_delete, info_vol_delete, 0}, - {"vol-download", cmdVolDownload, opts_vol_download, info_vol_download, 0}, - {"vol-dumpxml", cmdVolDumpXML, opts_vol_dumpxml, info_vol_dumpxml, 0}, - {"vol-info", cmdVolInfo, opts_vol_info, info_vol_info, 0}, - {"vol-key", cmdVolKey, opts_vol_key, info_vol_key, 0}, - {"vol-list", cmdVolList, opts_vol_list, info_vol_list, 0}, - {"vol-name", cmdVolName, opts_vol_name, info_vol_name, 0}, - {"vol-path", cmdVolPath, opts_vol_path, info_vol_path, 0}, - {"vol-pool", cmdVolPool, opts_vol_pool, info_vol_pool, 0}, - {"vol-resize", cmdVolResize, opts_vol_resize, info_vol_resize, 0}, - {"vol-upload", cmdVolUpload, opts_vol_upload, info_vol_upload, 0}, - {"vol-wipe", cmdVolWipe, opts_vol_wipe, info_vol_wipe, 0}, - {NULL, NULL, NULL, NULL, 0} + {.name = "vol-clone", + .handler = cmdVolClone, + .opts = opts_vol_clone, + .info = info_vol_clone, + .flags = 0 + }, + {.name = "vol-create-as", + .handler = cmdVolCreateAs, + .opts = opts_vol_create_as, + .info = info_vol_create_as, + .flags = 0 + }, + {.name = "vol-create", + .handler = cmdVolCreate, + .opts = opts_vol_create, + .info = info_vol_create, + .flags = 0 + }, + {.name = "vol-create-from", + .handler = cmdVolCreateFrom, + .opts = opts_vol_create_from, + .info = info_vol_create_from, + .flags = 0 + }, + {.name = "vol-delete", + .handler = cmdVolDelete, + .opts = opts_vol_delete, + .info = info_vol_delete, + .flags = 0 + }, + {.name = "vol-download", + .handler = cmdVolDownload, + .opts = opts_vol_download, + .info = info_vol_download, + .flags = 0 + }, + {.name = "vol-dumpxml", + .handler = cmdVolDumpXML, + .opts = opts_vol_dumpxml, + .info = info_vol_dumpxml, + .flags = 0 + }, + {.name = "vol-info", + .handler = cmdVolInfo, + .opts = opts_vol_info, + .info = info_vol_info, + .flags = 0 + }, + {.name = "vol-key", + .handler = cmdVolKey, + .opts = opts_vol_key, + .info = info_vol_key, + .flags = 0 + }, + {.name = "vol-list", + .handler = cmdVolList, + .opts = opts_vol_list, + .info = info_vol_list, + .flags = 0 + }, + {.name = "vol-name", + .handler = cmdVolName, + .opts = opts_vol_name, + .info = info_vol_name, + .flags = 0 + }, + {.name = "vol-path", + .handler = cmdVolPath, + .opts = opts_vol_path, + .info = info_vol_path, + .flags = 0 + }, + {.name = "vol-pool", + .handler = cmdVolPool, + .opts = opts_vol_pool, + .info = info_vol_pool, + .flags = 0 + }, + {.name = "vol-resize", + .handler = cmdVolResize, + .opts = opts_vol_resize, + .info = info_vol_resize, + .flags = 0 + }, + {.name = "vol-upload", + .handler = cmdVolUpload, + .opts = opts_vol_upload, + .info = info_vol_upload, + .flags = 0 + }, + {.name = "vol-wipe", + .handler = cmdVolWipe, + .opts = opts_vol_wipe, + .info = info_vol_wipe, + .flags = 0 + }, + {.name = NULL} }; diff --git a/tools/virsh.c b/tools/virsh.c index e5322f0..7ca0c18 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -2974,13 +2974,43 @@ vshParseArgv(vshControl *ctl, int argc, char **argv) } static const vshCmdDef virshCmds[] = { - {"cd", cmdCd, opts_cd, info_cd, VSH_CMD_FLAG_NOCONNECT}, - {"echo", cmdEcho, opts_echo, info_echo, VSH_CMD_FLAG_NOCONNECT}, - {"exit", cmdQuit, NULL, info_quit, VSH_CMD_FLAG_NOCONNECT}, - {"help", cmdHelp, opts_help, info_help, VSH_CMD_FLAG_NOCONNECT}, - {"pwd", cmdPwd, NULL, info_pwd, VSH_CMD_FLAG_NOCONNECT}, - {"quit", cmdQuit, NULL, info_quit, VSH_CMD_FLAG_NOCONNECT}, - {NULL, NULL, NULL, NULL, 0} + {.name = "cd", + .handler = cmdCd, + .opts = opts_cd, + .info = info_cd, + .flags = VSH_CMD_FLAG_NOCONNECT + }, + {.name = "echo", + .handler = cmdEcho, + .opts = opts_echo, + .info = info_echo, + .flags = VSH_CMD_FLAG_NOCONNECT + }, + {.name = "exit", + .handler = cmdQuit, + .opts = NULL, + .info = info_quit, + .flags = VSH_CMD_FLAG_NOCONNECT + }, + {.name = "help", + .handler = cmdHelp, + .opts = opts_help, + .info = info_help, + .flags = VSH_CMD_FLAG_NOCONNECT + }, + {.name = "pwd", + .handler = cmdPwd, + .opts = NULL, + .info = info_pwd, + .flags = VSH_CMD_FLAG_NOCONNECT + }, + {.name = "quit", + .handler = cmdQuit, + .opts = NULL, + .info = info_quit, + .flags = VSH_CMD_FLAG_NOCONNECT + }, + {.name = NULL} }; static const vshCmdGrp cmdGroups[] = { -- 1.8.0.2

On 02/07/2013 05:51 PM, Michal Privoznik wrote:
--- tools/virsh-domain-monitor.c | 86 ++++++- tools/virsh-domain.c | 581 +++++++++++++++++++++++++++++++++++-------- tools/virsh-host.c | 95 +++++-- tools/virsh-interface.c | 114 ++++++--- tools/virsh-network.c | 99 ++++++-- tools/virsh-nodedev.c | 66 +++-- tools/virsh-nwfilter.c | 42 +++- tools/virsh-pool.c | 139 +++++++++-- tools/virsh-secret.c | 49 +++- tools/virsh-snapshot.c | 82 ++++-- tools/virsh-volume.c | 116 +++++++-- tools/virsh.c | 44 +++- 12 files changed, 1224 insertions(+), 289 deletions(-)
ACK, Martin

--- tools/virsh.c | 53 ++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 17 deletions(-) diff --git a/tools/virsh.c b/tools/virsh.c index 7ca0c18..4f75e8e 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -440,11 +440,14 @@ int vshStreamSink(virStreamPtr st ATTRIBUTE_UNUSED, * "help" command */ static const vshCmdInfo info_help[] = { - {"help", N_("print help")}, - {"desc", N_("Prints global help, command specific help, or help for a\n" - " group of related commands")}, - - {NULL, NULL} + {.name = "help", + .data = N_("print help") + }, + {.name = "desc", + .data = N_("Prints global help, command specific help, or help for a\n" + " group of related commands") + }, + {.name = NULL} }; static const vshCmdOptDef opts_help[] = { @@ -702,9 +705,13 @@ vshEditReadBackFile(vshControl *ctl, const char *filename) * "cd" command */ static const vshCmdInfo info_cd[] = { - {"help", N_("change the current directory")}, - {"desc", N_("Change the current directory.")}, - {NULL, NULL} + {.name = "help", + .data = N_("change the current directory") + }, + {.name = "desc", + .data = N_("Change the current directory.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_cd[] = { @@ -749,9 +756,13 @@ cmdCd(vshControl *ctl, const vshCmd *cmd) * "pwd" command */ static const vshCmdInfo info_pwd[] = { - {"help", N_("print the current directory")}, - {"desc", N_("Print the current directory.")}, - {NULL, NULL} + {.name = "help", + .data = N_("print the current directory") + }, + {.name = "desc", + .data = N_("Print the current directory.") + }, + {.name = NULL} }; static bool @@ -778,9 +789,13 @@ cmdPwd(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) * "echo" command */ static const vshCmdInfo info_echo[] = { - {"help", N_("echo arguments")}, - {"desc", N_("Echo back arguments, possibly with quoting.")}, - {NULL, NULL} + {.name = "help", + .data = N_("echo arguments") + }, + {.name = "desc", + .data = N_("Echo back arguments, possibly with quoting.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_echo[] = { @@ -868,9 +883,13 @@ cmdEcho(vshControl *ctl, const vshCmd *cmd) * "quit" command */ static const vshCmdInfo info_quit[] = { - {"help", N_("quit this interactive terminal")}, - {"desc", ""}, - {NULL, NULL} + {.name = "help", + .data = N_("quit this interactive terminal") + }, + {.name = "desc", + .data = "" + }, + {.name = NULL} }; static bool -- 1.8.0.2

--- tools/virsh-domain-monitor.c | 112 ++++++++++++++++++++++++++++++------------- 1 file changed, 78 insertions(+), 34 deletions(-) diff --git a/tools/virsh-domain-monitor.c b/tools/virsh-domain-monitor.c index 0993ae7..074b578 100644 --- a/tools/virsh-domain-monitor.c +++ b/tools/virsh-domain-monitor.c @@ -290,9 +290,13 @@ vshDomainStateReasonToString(int state, int reason) * "dommemstat" command */ static const vshCmdInfo info_dommemstat[] = { - {"help", N_("get memory statistics for a domain")}, - {"desc", N_("Get memory statistics for a running domain.")}, - {NULL,NULL} + {.name = "help", + .data = N_("get memory statistics for a domain") + }, + {.name = "desc", + .data = N_("Get memory statistics for a running domain.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_dommemstat[] = { @@ -349,9 +353,13 @@ cmdDomMemStat(vshControl *ctl, const vshCmd *cmd) * "domblkinfo" command */ static const vshCmdInfo info_domblkinfo[] = { - {"help", N_("domain block device size information")}, - {"desc", N_("Get block device size info for a domain.")}, - {NULL, NULL} + {.name = "help", + .data = N_("domain block device size information") + }, + {.name = "desc", + .data = N_("Get block device size info for a domain.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_domblkinfo[] = { @@ -400,9 +408,13 @@ cleanup: * "domblklist" command */ static const vshCmdInfo info_domblklist[] = { - {"help", N_("list all domain blocks")}, - {"desc", N_("Get the summary of block devices for a domain.")}, - {NULL, NULL} + {.name = "help", + .data = N_("list all domain blocks") + }, + {.name = "desc", + .data = N_("Get the summary of block devices for a domain.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_domblklist[] = { @@ -618,9 +630,13 @@ cleanup: * "domif-getlink" command */ static const vshCmdInfo info_domif_getlink[] = { - {"help", N_("get link state of a virtual interface")}, - {"desc", N_("Get link state of a domain's virtual interface.")}, - {NULL,NULL} + {.name = "help", + .data = N_("get link state of a virtual interface") + }, + {.name = "desc", + .data = N_("Get link state of a domain's virtual interface.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_domif_getlink[] = { @@ -757,9 +773,13 @@ cleanup: * "domcontrol" command */ static const vshCmdInfo info_domcontrol[] = { - {"help", N_("domain control interface state")}, - {"desc", N_("Returns state of a control interface to the domain.")}, - {NULL, NULL} + {.name = "help", + .data = N_("domain control interface state") + }, + {.name = "desc", + .data = N_("Returns state of a control interface to the domain.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_domcontrol[] = { @@ -805,10 +825,14 @@ cleanup: * "domblkstat" command */ static const vshCmdInfo info_domblkstat[] = { - {"help", N_("get device block stats for a domain")}, - {"desc", N_("Get device block stats for a running domain. See man page or " - "use --human for explanation of fields")}, - {NULL,NULL} + {.name = "help", + .data = N_("get device block stats for a domain") + }, + {.name = "desc", + .data = N_("Get device block stats for a running domain. See man page or " + "use --human for explanation of fields") + }, + {.name = NULL} }; static const vshCmdOptDef opts_domblkstat[] = { @@ -986,9 +1010,13 @@ cleanup: * "domifstat" command */ static const vshCmdInfo info_domifstat[] = { - {"help", N_("get network interface stats for a domain")}, - {"desc", N_("Get network interface stats for a running domain.")}, - {NULL,NULL} + {.name = "help", + .data = N_("get network interface stats for a domain") + }, + {.name = "desc", + .data = N_("Get network interface stats for a running domain.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_domifstat[] = { @@ -1059,9 +1087,13 @@ cleanup: * "domblkerror" command */ static const vshCmdInfo info_domblkerror[] = { - {"help", N_("Show errors on block devices")}, - {"desc", N_("Show block device errors")}, - {NULL, NULL} + {.name = "help", + .data = N_("Show errors on block devices") + }, + {.name = "desc", + .data = N_("Show block device errors") + }, + {.name = NULL} }; static const vshCmdOptDef opts_domblkerror[] = { @@ -1120,9 +1152,13 @@ cleanup: * "dominfo" command */ static const vshCmdInfo info_dominfo[] = { - {"help", N_("domain information")}, - {"desc", N_("Returns basic information about the domain.")}, - {NULL, NULL} + {.name = "help", + .data = N_("domain information") + }, + {.name = "desc", + .data = N_("Returns basic information about the domain.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_dominfo[] = { @@ -1258,9 +1294,13 @@ cmdDominfo(vshControl *ctl, const vshCmd *cmd) * "domstate" command */ static const vshCmdInfo info_domstate[] = { - {"help", N_("domain state")}, - {"desc", N_("Returns state about a domain.")}, - {NULL, NULL} + {.name = "help", + .data = N_("domain state") + }, + {.name = "desc", + .data = N_("Returns state about a domain.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_domstate[] = { @@ -1311,9 +1351,13 @@ cleanup: * "list" command */ static const vshCmdInfo info_list[] = { - {"help", N_("list domains")}, - {"desc", N_("Returns list of domains.")}, - {NULL, NULL} + {.name = "help", + .data = N_("list domains") + }, + {.name = "desc", + .data = N_("Returns list of domains.") + }, + {.name = NULL} }; /* compare domains, pack NULLed ones at the end*/ -- 1.8.0.2

--- tools/virsh-domain.c | 828 +++++++++++++++++++++++++++++++++++---------------- 1 file changed, 571 insertions(+), 257 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 65765bd..3e4be89 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -153,9 +153,13 @@ vshNodeGetCPUCount(virConnectPtr conn) * "attach-device" command */ static const vshCmdInfo info_attach_device[] = { - {"help", N_("attach device from an XML file")}, - {"desc", N_("Attach device from an XML <file>.")}, - {NULL, NULL} + {.name = "help", + .data = N_("attach device from an XML file") + }, + {.name = "desc", + .data = N_("Attach device from an XML <file>.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_attach_device[] = { @@ -230,9 +234,13 @@ cleanup: * "attach-disk" command */ static const vshCmdInfo info_attach_disk[] = { - {"help", N_("attach disk device")}, - {"desc", N_("Attach new disk device.")}, - {NULL, NULL} + {.name = "help", + .data = N_("attach disk device") + }, + {.name = "desc", + .data = N_("Attach new disk device.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_attach_disk[] = { @@ -648,9 +656,13 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd) * "attach-interface" command */ static const vshCmdInfo info_attach_interface[] = { - {"help", N_("attach network interface")}, - {"desc", N_("Attach new network interface.")}, - {NULL, NULL} + {.name = "help", + .data = N_("attach network interface") + }, + {.name = "desc", + .data = N_("Attach new network interface.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_attach_interface[] = { @@ -885,10 +897,13 @@ cmdAttachInterface(vshControl *ctl, const vshCmd *cmd) * "autostart" command */ static const vshCmdInfo info_autostart[] = { - {"help", N_("autostart a domain")}, - {"desc", - N_("Configure a domain to be automatically started at boot.")}, - {NULL, NULL} + {.name = "help", + .data = N_("autostart a domain") + }, + {.name = "desc", + .data = N_("Configure a domain to be automatically started at boot.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_autostart[] = { @@ -939,9 +954,13 @@ cmdAutostart(vshControl *ctl, const vshCmd *cmd) * "blkdeviotune" command */ static const vshCmdInfo info_blkdeviotune[] = { - {"help", N_("Set or query a block device I/O tuning parameters.")}, - {"desc", N_("Set or query disk I/O parameters such as block throttling.")}, - {NULL, NULL} + {.name = "help", + .data = N_("Set or query a block device I/O tuning parameters.") + }, + {.name = "desc", + .data = N_("Set or query disk I/O parameters such as block throttling.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_blkdeviotune[] = { @@ -1174,12 +1193,16 @@ interror: * "blkiotune" command */ static const vshCmdInfo info_blkiotune[] = { - {"help", N_("Get or set blkio parameters")}, - {"desc", N_("Get or set the current blkio parameters for a guest" + {.name = "help", + .data = N_("Get or set blkio parameters") + }, + {.name = "desc", + .data = N_("Get or set the current blkio parameters for a guest" " domain.\n" " To get the blkio parameters use following command: \n\n" - " virsh # blkiotune <domain>")}, - {NULL, NULL} + " virsh # blkiotune <domain>") + }, + {.name = NULL} }; static const vshCmdOptDef opts_blkiotune[] = { @@ -1446,9 +1469,13 @@ static void vshCatchInt(int sig ATTRIBUTE_UNUSED, * "blockcommit" command */ static const vshCmdInfo info_block_commit[] = { - {"help", N_("Start a block commit operation.")}, - {"desc", N_("Commit changes from a snapshot down to its backing image.")}, - {NULL, NULL} + {.name = "help", + .data = N_("Start a block commit operation.") + }, + {.name = "desc", + .data = N_("Commit changes from a snapshot down to its backing image.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_block_commit[] = { @@ -1625,9 +1652,13 @@ cleanup: * "blockcopy" command */ static const vshCmdInfo info_block_copy[] = { - {"help", N_("Start a block copy operation.")}, - {"desc", N_("Populate a disk from its backing image.")}, - {NULL, NULL} + {.name = "help", + .data = N_("Start a block copy operation.") + }, + {.name = "desc", + .data = N_("Populate a disk from its backing image.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_block_copy[] = { @@ -1833,9 +1864,13 @@ cleanup: * "blockjob" command */ static const vshCmdInfo info_block_job[] = { - {"help", N_("Manage active block operations")}, - {"desc", N_("Query, adjust speed, or cancel active block operations.")}, - {NULL, NULL} + {.name = "help", + .data = N_("Manage active block operations") + }, + {.name = "desc", + .data = N_("Query, adjust speed, or cancel active block operations.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_block_job[] = { @@ -1932,9 +1967,13 @@ cmdBlockJob(vshControl *ctl, const vshCmd *cmd) * "blockpull" command */ static const vshCmdInfo info_block_pull[] = { - {"help", N_("Populate a disk from its backing image.")}, - {"desc", N_("Populate a disk from its backing image.")}, - {NULL, NULL} + {.name = "help", + .data = N_("Populate a disk from its backing image.") + }, + {.name = "desc", + .data = N_("Populate a disk from its backing image.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_block_pull[] = { @@ -2100,9 +2139,13 @@ cleanup: * "blockresize" command */ static const vshCmdInfo info_block_resize[] = { - {"help", N_("Resize block device of domain.")}, - {"desc", N_("Resize block device of domain.")}, - {NULL, NULL} + {.name = "help", + .data = N_("Resize block device of domain.") + }, + {.name = "desc", + .data = N_("Resize block device of domain.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_block_resize[] = { @@ -2166,10 +2209,13 @@ cmdBlockResize(vshControl *ctl, const vshCmd *cmd) * "console" command */ static const vshCmdInfo info_console[] = { - {"help", N_("connect to the guest console")}, - {"desc", - N_("Connect the virtual serial console for the guest")}, - {NULL, NULL} + {.name = "help", + .data = N_("connect to the guest console") + }, + {.name = "desc", + .data = N_("Connect the virtual serial console for the guest") + }, + {.name = NULL} }; static const vshCmdOptDef opts_console[] = { @@ -2262,9 +2308,14 @@ cleanup: /* "domif-setlink" command */ static const vshCmdInfo info_domif_setlink[] = { - {"help", N_("set link state of a virtual interface")}, - {"desc", N_("Set link state of a domain's virtual interface. This command wraps usage of update-device command.")}, - {NULL,NULL} + {.name = "help", + .data = N_("set link state of a virtual interface") + }, + {.name = "desc", + .data = N_("Set link state of a domain's virtual interface. This command " + "wraps usage of update-device command.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_domif_setlink[] = { @@ -2454,9 +2505,13 @@ cleanup: /* "domiftune" command */ static const vshCmdInfo info_domiftune[] = { - {"help", N_("get/set parameters of a virtual interface")}, - {"desc", N_("Get/set parameters of a domain's virtual interface.")}, - {NULL,NULL} + {.name = "help", + .data = N_("get/set parameters of a virtual interface") + }, + {.name = "desc", + .data = N_("Get/set parameters of a domain's virtual interface.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_domiftune[] = { @@ -2647,9 +2702,13 @@ error: * "suspend" command */ static const vshCmdInfo info_suspend[] = { - {"help", N_("suspend a domain")}, - {"desc", N_("Suspend a running domain.")}, - {NULL, NULL} + {.name = "help", + .data = N_("suspend a domain") + }, + {.name = "desc", + .data = N_("Suspend a running domain.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_suspend[] = { @@ -2686,12 +2745,16 @@ cmdSuspend(vshControl *ctl, const vshCmd *cmd) * "dompmsuspend" command */ static const vshCmdInfo info_dom_pm_suspend[] = { - {"help", N_("suspend a domain gracefully using power management " - "functions")}, - {"desc", N_("Suspends a running domain using guest OS's power management. " + {.name = "help", + .data = N_("suspend a domain gracefully using power management " + "functions") + }, + {.name = "desc", + .data = N_("Suspends a running domain using guest OS's power management. " "(Note: This requires a guest agent configured and running in " - "the guest OS).")}, - {NULL, NULL} + "the guest OS).") + }, + {.name = NULL} }; static const vshCmdOptDef opts_dom_pm_suspend[] = { @@ -2768,10 +2831,14 @@ cleanup: */ static const vshCmdInfo info_dom_pm_wakeup[] = { - {"help", N_("wakeup a domain from pmsuspended state")}, - {"desc", N_("Wakeup a domain that was previously suspended " - "by power management.")}, - {NULL, NULL} + {.name = "help", + .data = N_("wakeup a domain from pmsuspended state") + }, + {.name = "desc", + .data = N_("Wakeup a domain that was previously suspended " + "by power management.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_dom_pm_wakeup[] = { @@ -2814,10 +2881,13 @@ cleanup: * "undefine" command */ static const vshCmdInfo info_undefine[] = { - {"help", N_("undefine a domain")}, - {"desc", - N_("Undefine an inactive domain, or convert persistent to transient.")}, - {NULL, NULL} + {.name = "help", + .data = N_("undefine a domain") + }, + {.name = "desc", + .data = N_("Undefine an inactive domain, or convert persistent to transient.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_undefine[] = { @@ -3173,11 +3243,15 @@ error: * "start" command */ static const vshCmdInfo info_start[] = { - {"help", N_("start a (previously defined) inactive domain")}, - {"desc", N_("Start a domain, either from the last managedsave\n" + {.name = "help", + .data = N_("start a (previously defined) inactive domain") + }, + {.name = "desc", + .data = N_("Start a domain, either from the last managedsave\n" " state, or via a fresh boot if no managedsave state\n" - " is present.")}, - {NULL, NULL} + " is present.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_start[] = { @@ -3295,9 +3369,13 @@ cleanup: * "save" command */ static const vshCmdInfo info_save[] = { - {"help", N_("save a domain state to a file")}, - {"desc", N_("Save the RAM state of a running domain.")}, - {NULL, NULL} + {.name = "help", + .data = N_("save a domain state to a file") + }, + {.name = "desc", + .data = N_("Save the RAM state of a running domain.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_save[] = { @@ -3542,10 +3620,13 @@ cleanup: * "save-image-dumpxml" command */ static const vshCmdInfo info_save_image_dumpxml[] = { - {"help", N_("saved state domain information in XML")}, - {"desc", - N_("Dump XML of domain information for a saved state file to stdout.")}, - {NULL, NULL} + {.name = "help", + .data = N_("saved state domain information in XML") + }, + {.name = "desc", + .data = N_("Dump XML of domain information for a saved state file to stdout.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_save_image_dumpxml[] = { @@ -3592,9 +3673,13 @@ cleanup: * "save-image-define" command */ static const vshCmdInfo info_save_image_define[] = { - {"help", N_("redefine the XML for a domain's saved state file")}, - {"desc", N_("Replace the domain XML associated with a saved state file")}, - {NULL, NULL} + {.name = "help", + .data = N_("redefine the XML for a domain's saved state file") + }, + {.name = "desc", + .data = N_("Replace the domain XML associated with a saved state file") + }, + {.name = NULL} }; static const vshCmdOptDef opts_save_image_define[] = { @@ -3661,9 +3746,13 @@ cleanup: * "save-image-edit" command */ static const vshCmdInfo info_save_image_edit[] = { - {"help", N_("edit XML for a domain's saved state file")}, - {"desc", N_("Edit the domain XML associated with a saved state file")}, - {NULL, NULL} + {.name = "help", + .data = N_("edit XML for a domain's saved state file") + }, + {.name = "desc", + .data = N_("Edit the domain XML associated with a saved state file") + }, + {.name = NULL} }; static const vshCmdOptDef opts_save_image_edit[] = { @@ -3732,12 +3821,16 @@ cleanup: * "managedsave" command */ static const vshCmdInfo info_managedsave[] = { - {"help", N_("managed save of a domain state")}, - {"desc", N_("Save and destroy a running domain, so it can be restarted from\n" + {.name = "help", + .data = N_("managed save of a domain state") + }, + {.name = "desc", + .data = N_("Save and destroy a running domain, so it can be restarted from\n" " the same state at a later time. When the virsh 'start'\n" " command is next run for the domain, it will automatically\n" - " be started from this saved state.")}, - {NULL, NULL} + " be started from this saved state.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_managedsave[] = { @@ -3859,9 +3952,13 @@ cleanup: * "managedsave-remove" command */ static const vshCmdInfo info_managedsaveremove[] = { - {"help", N_("Remove managed save of a domain")}, - {"desc", N_("Remove an existing managed save state file from a domain")}, - {NULL, NULL} + {.name = "help", + .data = N_("Remove managed save of a domain") + }, + {.name = "desc", + .data = N_("Remove an existing managed save state file from a domain") + }, + {.name = NULL} }; static const vshCmdOptDef opts_managedsaveremove[] = { @@ -3914,9 +4011,13 @@ cleanup: * "schedinfo" command */ static const vshCmdInfo info_schedinfo[] = { - {"help", N_("show/set scheduler parameters")}, - {"desc", N_("Show/Set scheduler parameters.")}, - {NULL, NULL} + {.name = "help", + .data = N_("show/set scheduler parameters") + }, + {.name = "desc", + .data = N_("Show/Set scheduler parameters.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_schedinfo[] = { @@ -4151,9 +4252,13 @@ cmdSchedinfo(vshControl *ctl, const vshCmd *cmd) * "restore" command */ static const vshCmdInfo info_restore[] = { - {"help", N_("restore a domain from a saved state in a file")}, - {"desc", N_("Restore a domain.")}, - {NULL, NULL} + {.name = "help", + .data = N_("restore a domain from a saved state in a file") + }, + {.name = "desc", + .data = N_("Restore a domain.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_restore[] = { @@ -4230,9 +4335,13 @@ cleanup: * "dump" command */ static const vshCmdInfo info_dump[] = { - {"help", N_("dump the core of a domain to a file for analysis")}, - {"desc", N_("Core dump a domain.")}, - {NULL, NULL} + {.name = "help", + .data = N_("dump the core of a domain to a file for analysis") + }, + {.name = "desc", + .data = N_("Core dump a domain.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_dump[] = { @@ -4377,10 +4486,14 @@ cleanup: } static const vshCmdInfo info_screenshot[] = { - {"help", N_("take a screenshot of a current domain console and store it " - "into a file")}, - {"desc", N_("screenshot of a current domain console")}, - {NULL, NULL} + {.name = "help", + .data = N_("take a screenshot of a current domain console and store it " + "into a file") + }, + {.name = "desc", + .data = N_("screenshot of a current domain console") + }, + {.name = NULL} }; static const vshCmdOptDef opts_screenshot[] = { @@ -4523,9 +4636,13 @@ cleanup: * "resume" command */ static const vshCmdInfo info_resume[] = { - {"help", N_("resume a domain")}, - {"desc", N_("Resume a previously suspended domain.")}, - {NULL, NULL} + {.name = "help", + .data = N_("resume a domain") + }, + {.name = "desc", + .data = N_("Resume a previously suspended domain.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_resume[] = { @@ -4562,9 +4679,13 @@ cmdResume(vshControl *ctl, const vshCmd *cmd) * "shutdown" command */ static const vshCmdInfo info_shutdown[] = { - {"help", N_("gracefully shutdown a domain")}, - {"desc", N_("Run shutdown in the target domain.")}, - {NULL, NULL} + {.name = "help", + .data = N_("gracefully shutdown a domain") + }, + {.name = "desc", + .data = N_("Run shutdown in the target domain.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_shutdown[] = { @@ -4645,9 +4766,13 @@ cleanup: * "reboot" command */ static const vshCmdInfo info_reboot[] = { - {"help", N_("reboot a domain")}, - {"desc", N_("Run a reboot command in the target domain.")}, - {NULL, NULL} + {.name = "help", + .data = N_("reboot a domain") + }, + {.name = "desc", + .data = N_("Run a reboot command in the target domain.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_reboot[] = { @@ -4723,9 +4848,13 @@ cleanup: * "reset" command */ static const vshCmdInfo info_reset[] = { - {"help", N_("reset a domain")}, - {"desc", N_("Reset the target domain as if by power button")}, - {NULL, NULL} + {.name = "help", + .data = N_("reset a domain") + }, + {.name = "desc", + .data = N_("Reset the target domain as if by power button") + }, + {.name = NULL} }; static const vshCmdOptDef opts_reset[] = { @@ -4762,9 +4891,13 @@ cmdReset(vshControl *ctl, const vshCmd *cmd) * "domjobinfo" command */ static const vshCmdInfo info_domjobinfo[] = { - {"help", N_("domain job information")}, - {"desc", N_("Returns information about jobs running on a domain.")}, - {NULL, NULL} + {.name = "help", + .data = N_("domain job information") + }, + {.name = "desc", + .data = N_("Returns information about jobs running on a domain.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_domjobinfo[] = { @@ -4845,9 +4978,13 @@ cleanup: * "domjobabort" command */ static const vshCmdInfo info_domjobabort[] = { - {"help", N_("abort active domain job")}, - {"desc", N_("Aborts the currently running domain job")}, - {NULL, NULL} + {.name = "help", + .data = N_("abort active domain job") + }, + {.name = "desc", + .data = N_("Aborts the currently running domain job") + }, + {.name = NULL} }; static const vshCmdOptDef opts_domjobabort[] = { @@ -4879,9 +5016,13 @@ cmdDomjobabort(vshControl *ctl, const vshCmd *cmd) * "maxvcpus" command */ static const vshCmdInfo info_maxvcpus[] = { - {"help", N_("connection vcpu maximum")}, - {"desc", N_("Show maximum number of virtual CPUs for guests on this connection.")}, - {NULL, NULL} + {.name = "help", + .data = N_("connection vcpu maximum") + }, + {.name = "desc", + .data = N_("Show maximum number of virtual CPUs for guests on this connection.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_maxvcpus[] = { @@ -4914,9 +5055,13 @@ cmdMaxvcpus(vshControl *ctl, const vshCmd *cmd) * "vcpucount" command */ static const vshCmdInfo info_vcpucount[] = { - {"help", N_("domain vcpu counts")}, - {"desc", N_("Returns the number of virtual CPUs used by the domain.")}, - {NULL, NULL} + {.name = "help", + .data = N_("domain vcpu counts") + }, + {.name = "desc", + .data = N_("Returns the number of virtual CPUs used by the domain.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_vcpucount[] = { @@ -5137,9 +5282,13 @@ cmdVcpucount(vshControl *ctl, const vshCmd *cmd) * "vcpuinfo" command */ static const vshCmdInfo info_vcpuinfo[] = { - {"help", N_("detailed domain vcpu information")}, - {"desc", N_("Returns basic information about the domain virtual CPUs.")}, - {NULL, NULL} + {.name = "help", + .data = N_("detailed domain vcpu information") + }, + {.name = "desc", + .data = N_("Returns basic information about the domain virtual CPUs.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_vcpuinfo[] = { @@ -5242,9 +5391,13 @@ cmdVcpuinfo(vshControl *ctl, const vshCmd *cmd) * "vcpupin" command */ static const vshCmdInfo info_vcpupin[] = { - {"help", N_("control or query domain vcpu affinity")}, - {"desc", N_("Pin domain VCPUs to host physical CPUs.")}, - {NULL, NULL} + {.name = "help", + .data = N_("control or query domain vcpu affinity") + }, + {.name = "desc", + .data = N_("Pin domain VCPUs to host physical CPUs.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_vcpupin[] = { @@ -5521,9 +5674,13 @@ parse_error: * "emulatorpin" command */ static const vshCmdInfo info_emulatorpin[] = { - {"help", N_("control or query domain emulator affinity")}, - {"desc", N_("Pin domain emulator threads to host physical CPUs.")}, - {NULL, NULL} + {.name = "help", + .data = N_("control or query domain emulator affinity") + }, + {.name = "desc", + .data = N_("Pin domain emulator threads to host physical CPUs.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_emulatorpin[] = { @@ -5721,9 +5878,13 @@ parse_error: * "setvcpus" command */ static const vshCmdInfo info_setvcpus[] = { - {"help", N_("change number of virtual CPUs")}, - {"desc", N_("Change the number of virtual CPUs in the guest domain.")}, - {NULL, NULL} + {.name = "help", + .data = N_("change number of virtual CPUs") + }, + {.name = "desc", + .data = N_("Change the number of virtual CPUs in the guest domain.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_setvcpus[] = { @@ -5836,9 +5997,13 @@ cmdSetvcpus(vshControl *ctl, const vshCmd *cmd) * "cpu-compare" command */ static const vshCmdInfo info_cpu_compare[] = { - {"help", N_("compare host CPU with a CPU described by an XML file")}, - {"desc", N_("compare CPU with host CPU")}, - {NULL, NULL} + {.name = "help", + .data = N_("compare host CPU with a CPU described by an XML file") + }, + {.name = "desc", + .data = N_("compare CPU with host CPU") + }, + {.name = NULL} }; static const vshCmdOptDef opts_cpu_compare[] = { @@ -5934,9 +6099,13 @@ cleanup: * "cpu-baseline" command */ static const vshCmdInfo info_cpu_baseline[] = { - {"help", N_("compute baseline CPU")}, - {"desc", N_("Compute baseline CPU for a set of given CPUs.")}, - {NULL, NULL} + {.name = "help", + .data = N_("compute baseline CPU") + }, + {.name = "desc", + .data = N_("Compute baseline CPU for a set of given CPUs.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_cpu_baseline[] = { @@ -6039,10 +6208,13 @@ no_memory: * "cpu-stats" command */ static const vshCmdInfo info_cpu_stats[] = { - {"help", N_("show domain cpu statistics")}, - {"desc", - N_("Display per-CPU and total statistics about the domain's CPUs")}, - {NULL, NULL}, + {.name = "help", + .data = N_("show domain cpu statistics") + }, + {.name = "desc", + .data = N_("Display per-CPU and total statistics about the domain's CPUs") + }, + {.name = NULL}, }; static const vshCmdOptDef opts_cpu_stats[] = { @@ -6210,9 +6382,13 @@ failed_stats: * "create" command */ static const vshCmdInfo info_create[] = { - {"help", N_("create a domain from an XML file")}, - {"desc", N_("Create a domain.")}, - {NULL, NULL} + {.name = "help", + .data = N_("create a domain from an XML file") + }, + {.name = "desc", + .data = N_("Create a domain.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_create[] = { @@ -6286,9 +6462,13 @@ cmdCreate(vshControl *ctl, const vshCmd *cmd) * "define" command */ static const vshCmdInfo info_define[] = { - {"help", N_("define (but don't start) a domain from an XML file")}, - {"desc", N_("Define a domain.")}, - {NULL, NULL} + {.name = "help", + .data = N_("define (but don't start) a domain from an XML file") + }, + {.name = "desc", + .data = N_("Define a domain.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_define[] = { @@ -6332,10 +6512,13 @@ cmdDefine(vshControl *ctl, const vshCmd *cmd) * "destroy" command */ static const vshCmdInfo info_destroy[] = { - {"help", N_("destroy (stop) a domain")}, - {"desc", - N_("Forcefully stop a given domain, but leave its resources intact.")}, - {NULL, NULL} + {.name = "help", + .data = N_("destroy (stop) a domain") + }, + {.name = "desc", + .data = N_("Forcefully stop a given domain, but leave its resources intact.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_destroy[] = { @@ -6387,9 +6570,13 @@ cmdDestroy(vshControl *ctl, const vshCmd *cmd) * "desc" command for managing domain description and title */ static const vshCmdInfo info_desc[] = { - {"help", N_("show or set domain's description or title")}, - {"desc", N_("Allows to show or modify description or title of a domain.")}, - {NULL, NULL} + {.name = "help", + .data = N_("show or set domain's description or title") + }, + {.name = "desc", + .data = N_("Allows to show or modify description or title of a domain.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_desc[] = { @@ -6568,9 +6755,13 @@ cleanup: * "inject-nmi" command */ static const vshCmdInfo info_inject_nmi[] = { - {"help", N_("Inject NMI to the guest")}, - {"desc", N_("Inject NMI to the guest domain.")}, - {NULL, NULL} + {.name = "help", + .data = N_("Inject NMI to the guest") + }, + {.name = "desc", + .data = N_("Inject NMI to the guest domain.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_inject_nmi[] = { @@ -6602,9 +6793,13 @@ cmdInjectNMI(vshControl *ctl, const vshCmd *cmd) * "send-key" command */ static const vshCmdInfo info_send_key[] = { - {"help", N_("Send keycodes to the guest")}, - {"desc", N_("Send keycodes (integers or symbolic names) to the guest")}, - {NULL, NULL} + {.name = "help", + .data = N_("Send keycodes to the guest") + }, + {.name = "desc", + .data = N_("Send keycodes (integers or symbolic names) to the guest") + }, + {.name = NULL} }; static const vshCmdOptDef opts_send_key[] = { @@ -6698,9 +6893,13 @@ cleanup: * "send-process-signal" command */ static const vshCmdInfo info_send_process_signal[] = { - {"help", N_("Send signals to processes") }, - {"desc", N_("Send signals to processes in the guest") }, - {NULL, NULL} + {.name = "help", + .data = N_("Send signals to processes") + }, + {.name = "desc", + .data = N_("Send signals to processes in the guest") + }, + {.name = NULL} }; static const vshCmdOptDef opts_send_process_signal[] = { @@ -6809,9 +7008,13 @@ cleanup: * "setmem" command */ static const vshCmdInfo info_setmem[] = { - {"help", N_("change memory allocation")}, - {"desc", N_("Change the current memory allocation in the guest domain.")}, - {NULL, NULL} + {.name = "help", + .data = N_("change memory allocation") + }, + {.name = "desc", + .data = N_("Change the current memory allocation in the guest domain.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_setmem[] = { @@ -6911,9 +7114,13 @@ cmdSetmem(vshControl *ctl, const vshCmd *cmd) * "setmaxmem" command */ static const vshCmdInfo info_setmaxmem[] = { - {"help", N_("change maximum memory limit")}, - {"desc", N_("Change the maximum memory allocation limit in the guest domain.")}, - {NULL, NULL} + {.name = "help", + .data = N_("change maximum memory limit") + }, + {.name = "desc", + .data = N_("Change the maximum memory allocation limit in the guest domain.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_setmaxmem[] = { @@ -7014,12 +7221,16 @@ cmdSetmaxmem(vshControl *ctl, const vshCmd *cmd) * "memtune" command */ static const vshCmdInfo info_memtune[] = { - {"help", N_("Get or set memory parameters")}, - {"desc", N_("Get or set the current memory parameters for a guest" + {.name = "help", + .data = N_("Get or set memory parameters") + }, + {.name = "desc", + .data = N_("Get or set the current memory parameters for a guest" " domain.\n" " To get the memory parameters use following command: \n\n" - " virsh # memtune <domain>")}, - {NULL, NULL} + " virsh # memtune <domain>") + }, + {.name = NULL} }; static const vshCmdOptDef opts_memtune[] = { @@ -7221,13 +7432,16 @@ error: * "numatune" command */ static const vshCmdInfo info_numatune[] = { - {"help", N_("Get or set numa parameters")}, - {"desc", N_("Get or set the current numa parameters for a guest" + {.name = "help", + .data = N_("Get or set numa parameters") + }, + {.name = "desc", + .data = N_("Get or set the current numa parameters for a guest" " domain.\n" " To get the numa parameters use following command: \n\n" - " virsh # numatune <domain>")}, - {NULL, NULL} - + " virsh # numatune <domain>") + }, + {.name = NULL} }; static const vshCmdOptDef opts_numatune[] = { @@ -7378,9 +7592,13 @@ error: * "qemu-monitor-command" command */ static const vshCmdInfo info_qemu_monitor_command[] = { - {"help", N_("QEMU Monitor Command")}, - {"desc", N_("QEMU Monitor Command")}, - {NULL, NULL} + {.name = "help", + .data = N_("QEMU Monitor Command") + }, + {.name = "desc", + .data = N_("QEMU Monitor Command") + }, + {.name = NULL} }; static const vshCmdOptDef opts_qemu_monitor_command[] = { @@ -7475,9 +7693,13 @@ cleanup: * "qemu-attach" command */ static const vshCmdInfo info_qemu_attach[] = { - {"help", N_("QEMU Attach")}, - {"desc", N_("QEMU Attach")}, - {NULL, NULL} + {.name = "help", + .data = N_("QEMU Attach") + }, + {.name = "desc", + .data = N_("QEMU Attach") + }, + {.name = NULL} }; static const vshCmdOptDef opts_qemu_attach[] = { @@ -7522,9 +7744,13 @@ cleanup: * "qemu-agent-command" command */ static const vshCmdInfo info_qemu_agent_command[] = { - {"help", N_("QEMU Guest Agent Command")}, - {"desc", N_("Run an arbitrary qemu guest agent command; use at your own risk")}, - {NULL, NULL} + {.name = "help", + .data = N_("QEMU Guest Agent Command") + }, + {.name = "desc", + .data = N_("Run an arbitrary qemu guest agent command; use at your own risk") + }, + {.name = NULL} }; static const vshCmdOptDef opts_qemu_agent_command[] = { @@ -7630,9 +7856,13 @@ cleanup: * "lxc-enter-namespace" namespace */ static const vshCmdInfo info_lxc_enter_namespace[] = { - {"help", N_("LXC Guest Enter Namespace")}, - {"desc", N_("Run an arbitrary lxc guest enter namespace; use at your own risk")}, - {NULL, NULL} + {.name = "help", + .data = N_("LXC Guest Enter Namespace") + }, + {.name = "desc", + .data = N_("Run an arbitrary lxc guest enter namespace; use at your own risk") + }, + {.name = NULL} }; static const vshCmdOptDef opts_lxc_enter_namespace[] = { @@ -7722,9 +7952,13 @@ cleanup: * "dumpxml" command */ static const vshCmdInfo info_dumpxml[] = { - {"help", N_("domain information in XML")}, - {"desc", N_("Output the domain information as an XML dump to stdout.")}, - {NULL, NULL} + {.name = "help", + .data = N_("domain information in XML") + }, + {.name = "desc", + .data = N_("Output the domain information as an XML dump to stdout.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_dumpxml[] = { @@ -7796,9 +8030,13 @@ cmdDumpXML(vshControl *ctl, const vshCmd *cmd) * "domxml-from-native" command */ static const vshCmdInfo info_domxmlfromnative[] = { - {"help", N_("Convert native config to domain XML")}, - {"desc", N_("Convert native guest configuration format to domain XML format.")}, - {NULL, NULL} + {.name = "help", + .data = N_("Convert native config to domain XML") + }, + {.name = "desc", + .data = N_("Convert native guest configuration format to domain XML format.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_domxmlfromnative[] = { @@ -7848,9 +8086,13 @@ cmdDomXMLFromNative(vshControl *ctl, const vshCmd *cmd) * "domxml-to-native" command */ static const vshCmdInfo info_domxmltonative[] = { - {"help", N_("Convert domain XML to native config")}, - {"desc", N_("Convert domain XML config to a native guest configuration format.")}, - {NULL, NULL} + {.name = "help", + .data = N_("Convert domain XML to native config") + }, + {.name = "desc", + .data = N_("Convert domain XML config to a native guest configuration format.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_domxmltonative[] = { @@ -7900,9 +8142,13 @@ cmdDomXMLToNative(vshControl *ctl, const vshCmd *cmd) * "domname" command */ static const vshCmdInfo info_domname[] = { - {"help", N_("convert a domain id or UUID to domain name")}, - {"desc", ""}, - {NULL, NULL} + {.name = "help", + .data = N_("convert a domain id or UUID to domain name") + }, + {.name = "desc", + .data = "" + }, + {.name = NULL} }; static const vshCmdOptDef opts_domname[] = { @@ -7932,9 +8178,13 @@ cmdDomname(vshControl *ctl, const vshCmd *cmd) * "domid" command */ static const vshCmdInfo info_domid[] = { - {"help", N_("convert a domain name or UUID to domain id")}, - {"desc", ""}, - {NULL, NULL} + {.name = "help", + .data = N_("convert a domain name or UUID to domain id") + }, + {.name = "desc", + .data = "" + }, + {.name = NULL} }; static const vshCmdOptDef opts_domid[] = { @@ -7969,9 +8219,13 @@ cmdDomid(vshControl *ctl, const vshCmd *cmd) * "domuuid" command */ static const vshCmdInfo info_domuuid[] = { - {"help", N_("convert a domain name or id to domain UUID")}, - {"desc", ""}, - {NULL, NULL} + {.name = "help", + .data = N_("convert a domain name or id to domain UUID") + }, + {.name = "desc", + .data = "" + }, + {.name = NULL} }; static const vshCmdOptDef opts_domuuid[] = { @@ -8006,9 +8260,13 @@ cmdDomuuid(vshControl *ctl, const vshCmd *cmd) * "migrate" command */ static const vshCmdInfo info_migrate[] = { - {"help", N_("migrate domain to another host")}, - {"desc", N_("Migrate domain to another host. Add --live for live migration.")}, - {NULL, NULL} + {.name = "help", + .data = N_("migrate domain to another host") + }, + {.name = "desc", + .data = N_("Migrate domain to another host. Add --live for live migration.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_migrate[] = { @@ -8295,9 +8553,13 @@ cleanup: * "migrate-setmaxdowntime" command */ static const vshCmdInfo info_migrate_setmaxdowntime[] = { - {"help", N_("set maximum tolerable downtime")}, - {"desc", N_("Set maximum tolerable downtime of a domain which is being live-migrated to another host.")}, - {NULL, NULL} + {.name = "help", + .data = N_("set maximum tolerable downtime") + }, + {.name = "desc", + .data = N_("Set maximum tolerable downtime of a domain which is being live-migrated to another host.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_migrate_setmaxdowntime[] = { @@ -8344,10 +8606,14 @@ done: * "migrate-setspeed" command */ static const vshCmdInfo info_migrate_setspeed[] = { - {"help", N_("Set the maximum migration bandwidth")}, - {"desc", N_("Set the maximum migration bandwidth (in MiB/s) for a domain " - "which is being migrated to another host.")}, - {NULL, NULL} + {.name = "help", + .data = N_("Set the maximum migration bandwidth") + }, + {.name = "desc", + .data = N_("Set the maximum migration bandwidth (in MiB/s) for a domain " + "which is being migrated to another host.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_migrate_setspeed[] = { @@ -8393,9 +8659,13 @@ done: * "migrate-getspeed" command */ static const vshCmdInfo info_migrate_getspeed[] = { - {"help", N_("Get the maximum migration bandwidth")}, - {"desc", N_("Get the maximum migration bandwidth (in MiB/s) for a domain.")}, - {NULL, NULL} + {.name = "help", + .data = N_("Get the maximum migration bandwidth") + }, + {.name = "desc", + .data = N_("Get the maximum migration bandwidth (in MiB/s) for a domain.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_migrate_getspeed[] = { @@ -8433,9 +8703,13 @@ done: * "domdisplay" command */ static const vshCmdInfo info_domdisplay[] = { - {"help", N_("domain display connection URI")}, - {"desc", N_("Output the IP address and port number for the graphical display.")}, - {NULL, NULL} + {.name = "help", + .data = N_("domain display connection URI") + }, + {.name = "desc", + .data = N_("Output the IP address and port number for the graphical display.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_domdisplay[] = { @@ -8612,9 +8886,13 @@ no_memory: * "vncdisplay" command */ static const vshCmdInfo info_vncdisplay[] = { - {"help", N_("vnc display")}, - {"desc", N_("Output the IP address and port number for the VNC display.")}, - {NULL, NULL} + {.name = "help", + .data = N_("vnc display") + }, + {.name = "desc", + .data = N_("Output the IP address and port number for the VNC display.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_vncdisplay[] = { @@ -8681,9 +8959,13 @@ cmdVNCDisplay(vshControl *ctl, const vshCmd *cmd) * "ttyconsole" command */ static const vshCmdInfo info_ttyconsole[] = { - {"help", N_("tty console")}, - {"desc", N_("Output the device for the TTY console.")}, - {NULL, NULL} + {.name = "help", + .data = N_("tty console") + }, + {.name = "desc", + .data = N_("Output the device for the TTY console.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_ttyconsole[] = { @@ -8737,9 +9019,13 @@ cmdTTYConsole(vshControl *ctl, const vshCmd *cmd) * "domhostname" command */ static const vshCmdInfo info_domhostname[] = { - {"help", N_("print the domain's hostname")}, - {"desc", ""}, - {NULL, NULL} + {.name = "help", + .data = N_("print the domain's hostname") + }, + {.name = "desc", + .data = "" + }, + {.name = NULL} }; static const vshCmdOptDef opts_domhostname[] = { @@ -9026,9 +9312,13 @@ cleanup: * "detach-device" command */ static const vshCmdInfo info_detach_device[] = { - {"help", N_("detach device from an XML file")}, - {"desc", N_("Detach device from an XML <file>")}, - {NULL, NULL} + {.name = "help", + .data = N_("detach device from an XML file") + }, + {.name = "desc", + .data = N_("Detach device from an XML <file>") + }, + {.name = NULL} }; static const vshCmdOptDef opts_detach_device[] = { @@ -9103,9 +9393,13 @@ cleanup: * "update-device" command */ static const vshCmdInfo info_update_device[] = { - {"help", N_("update device from an XML file")}, - {"desc", N_("Update device from an XML <file>.")}, - {NULL, NULL} + {.name = "help", + .data = N_("update device from an XML file") + }, + {.name = "desc", + .data = N_("Update device from an XML <file>.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_update_device[] = { @@ -9186,9 +9480,13 @@ cleanup: * "detach-interface" command */ static const vshCmdInfo info_detach_interface[] = { - {"help", N_("detach network interface")}, - {"desc", N_("Detach network interface.")}, - {NULL, NULL} + {.name = "help", + .data = N_("detach network interface") + }, + {.name = "desc", + .data = N_("Detach network interface.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_detach_interface[] = { @@ -9564,9 +9862,13 @@ error: * "detach-disk" command */ static const vshCmdInfo info_detach_disk[] = { - {"help", N_("detach disk device")}, - {"desc", N_("Detach disk device.")}, - {NULL, NULL} + {.name = "help", + .data = N_("detach disk device") + }, + {.name = "desc", + .data = N_("Detach disk device.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_detach_disk[] = { @@ -9652,9 +9954,13 @@ cmdDetachDisk(vshControl *ctl, const vshCmd *cmd) * "edit" command */ static const vshCmdInfo info_edit[] = { - {"help", N_("edit XML configuration for a domain")}, - {"desc", N_("Edit the XML configuration for a domain.")}, - {NULL, NULL} + {.name = "help", + .data = N_("edit XML configuration for a domain") + }, + {.name = "desc", + .data = N_("Edit the XML configuration for a domain.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_edit[] = { @@ -9708,9 +10014,13 @@ cmdEdit(vshControl *ctl, const vshCmd *cmd) * "change-media" command */ static const vshCmdInfo info_change_media[] = { - {"help", N_("Change media of CD or floppy drive")}, - {"desc", N_("Change media of CD or floppy drive.")}, - {NULL, NULL} + {.name = "help", + .data = N_("Change media of CD or floppy drive") + }, + {.name = "desc", + .data = N_("Change media of CD or floppy drive.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_change_media[] = { @@ -9874,9 +10184,13 @@ cleanup: } static const vshCmdInfo info_domfstrim[] = { - {"help", N_("Invoke fstrim on domain's mounted filesystems.")}, - {"desc", N_("Invoke fstrim on domain's mounted filesystems.")}, - {NULL, NULL} + {.name = "help", + .data = N_("Invoke fstrim on domain's mounted filesystems.") + }, + {.name = "desc", + .data = N_("Invoke fstrim on domain's mounted filesystems.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_domfstrim[] = { -- 1.8.0.2

--- tools/virsh-host.c | 127 ++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 87 insertions(+), 40 deletions(-) diff --git a/tools/virsh-host.c b/tools/virsh-host.c index 165657b..4345839 100644 --- a/tools/virsh-host.c +++ b/tools/virsh-host.c @@ -43,9 +43,13 @@ * "capabilities" command */ static const vshCmdInfo info_capabilities[] = { - {"help", N_("capabilities")}, - {"desc", N_("Returns capabilities of hypervisor/driver.")}, - {NULL, NULL} + {.name = "help", + .data = N_("capabilities") + }, + {.name = "desc", + .data = N_("Returns capabilities of hypervisor/driver.") + }, + {.name = NULL} }; static bool @@ -67,10 +71,14 @@ cmdCapabilities(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) * "connect" command */ static const vshCmdInfo info_connect[] = { - {"help", N_("(re)connect to hypervisor")}, - {"desc", - N_("Connect to local hypervisor. This is built-in command after shell start up.")}, - {NULL, NULL} + {.name = "help", + .data = N_("(re)connect to hypervisor") + }, + {.name = "desc", + .data = N_("Connect to local hypervisor. This is built-in " + "command after shell start up.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_connect[] = { @@ -125,9 +133,13 @@ cmdConnect(vshControl *ctl, const vshCmd *cmd) * "freecell" command */ static const vshCmdInfo info_freecell[] = { - {"help", N_("NUMA free memory")}, - {"desc", N_("display available free memory for the NUMA cell.")}, - {NULL, NULL} + {.name = "help", + .data = N_("NUMA free memory") + }, + {.name = "desc", + .data = N_("display available free memory for the NUMA cell.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_freecell[] = { @@ -257,9 +269,13 @@ cleanup: * "nodeinfo" command */ static const vshCmdInfo info_nodeinfo[] = { - {"help", N_("node information")}, - {"desc", N_("Returns basic information about the node.")}, - {NULL, NULL} + {.name = "help", + .data = N_("node information") + }, + {.name = "desc", + .data = N_("Returns basic information about the node.") + }, + {.name = NULL} }; static bool @@ -287,10 +303,14 @@ cmdNodeinfo(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) * "nodecpumap" command */ static const vshCmdInfo info_node_cpumap[] = { - {"help", N_("node cpu map")}, - {"desc", N_("Displays the node's total number of CPUs, the number of" - " online CPUs and the list of online CPUs.")}, - {NULL, NULL} + {.name = "help", + .data = N_("node cpu map") + }, + {.name = "desc", + .data = N_("Displays the node's total number of CPUs, the number of" + " online CPUs and the list of online CPUs.") + }, + {.name = NULL} }; static bool @@ -326,9 +346,13 @@ cmdNodeCpuMap(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) * "nodecpustats" command */ static const vshCmdInfo info_nodecpustats[] = { - {"help", N_("Prints cpu stats of the node.")}, - {"desc", N_("Returns cpu stats of the node, in nanoseconds.")}, - {NULL, NULL} + {.name = "help", + .data = N_("Prints cpu stats of the node.") + }, + {.name = "desc", + .data = N_("Returns cpu stats of the node, in nanoseconds.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_node_cpustats[] = { @@ -459,9 +483,13 @@ cmdNodeCpuStats(vshControl *ctl, const vshCmd *cmd) * "nodememstats" command */ static const vshCmdInfo info_nodememstats[] = { - {"help", N_("Prints memory stats of the node.")}, - {"desc", N_("Returns memory stats of the node, in kilobytes.")}, - {NULL, NULL} + {.name = "help", + .data = N_("Prints memory stats of the node.") + }, + {.name = "desc", + .data = N_("Returns memory stats of the node, in kilobytes.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_node_memstats[] = { @@ -521,10 +549,14 @@ cmdNodeMemStats(vshControl *ctl, const vshCmd *cmd) * "nodesuspend" command */ static const vshCmdInfo info_nodesuspend[] = { - {"help", N_("suspend the host node for a given time duration")}, - {"desc", N_("Suspend the host node for a given time duration " - "and attempt to resume thereafter.")}, - {NULL, NULL} + {.name = "help", + .data = N_("suspend the host node for a given time duration") + }, + {.name = "desc", + .data = N_("Suspend the host node for a given time duration " + "and attempt to resume thereafter.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_node_suspend[] = { @@ -584,10 +616,13 @@ cmdNodeSuspend(vshControl *ctl, const vshCmd *cmd) * "sysinfo" command */ static const vshCmdInfo info_sysinfo[] = { - {"help", N_("print the hypervisor sysinfo")}, - {"desc", - N_("output an XML string for the hypervisor sysinfo, if available")}, - {NULL, NULL} + {.name = "help", + .data = N_("print the hypervisor sysinfo") + }, + {.name = "desc", + .data = N_("output an XML string for the hypervisor sysinfo, if available") + }, + {.name = NULL} }; static bool @@ -611,9 +646,13 @@ cmdSysinfo(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) * "hostname" command */ static const vshCmdInfo info_hostname[] = { - {"help", N_("print the hypervisor hostname")}, - {"desc", ""}, - {NULL, NULL} + {.name = "help", + .data = N_("print the hypervisor hostname") + }, + {.name = "desc", + .data = "" + }, + {.name = NULL} }; static bool @@ -637,9 +676,13 @@ cmdHostname(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) * "uri" command */ static const vshCmdInfo info_uri[] = { - {"help", N_("print the hypervisor canonical URI")}, - {"desc", ""}, - {NULL, NULL} + {.name = "help", + .data = N_("print the hypervisor canonical URI") + }, + {.name = "desc", + .data = "" + }, + {.name = NULL} }; static bool @@ -663,9 +706,13 @@ cmdURI(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) * "version" command */ static const vshCmdInfo info_version[] = { - {"help", N_("show version")}, - {"desc", N_("Display the system version information.")}, - {NULL, NULL} + {.name = "help", + .data = N_("show version") + }, + {.name = "desc", + .data = N_("Display the system version information.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_version[] = { -- 1.8.0.2

--- tools/virsh-interface.c | 142 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 99 insertions(+), 43 deletions(-) diff --git a/tools/virsh-interface.c b/tools/virsh-interface.c index 3a6eb95..445ca17 100644 --- a/tools/virsh-interface.c +++ b/tools/virsh-interface.c @@ -83,9 +83,13 @@ vshCommandOptInterfaceBy(vshControl *ctl, const vshCmd *cmd, * "iface-edit" command */ static const vshCmdInfo info_interface_edit[] = { - {"help", N_("edit XML configuration for a physical host interface")}, - {"desc", N_("Edit the XML configuration for a physical host interface.")}, - {NULL, NULL} + {.name = "help", + .data = N_("edit XML configuration for a physical host interface") + }, + {.name = "desc", + .data = N_("Edit the XML configuration for a physical host interface.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_interface_edit[] = { @@ -309,9 +313,13 @@ cleanup: * "iface-list" command */ static const vshCmdInfo info_interface_list[] = { - {"help", N_("list physical host interfaces")}, - {"desc", N_("Returns list of physical host interfaces.")}, - {NULL, NULL} + {.name = "help", + .data = N_("list physical host interfaces") + }, + {.name = "desc", + .data = N_("Returns list of physical host interfaces.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_interface_list[] = { @@ -367,9 +375,13 @@ cmdInterfaceList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) * "iface-name" command */ static const vshCmdInfo info_interface_name[] = { - {"help", N_("convert an interface MAC address to interface name")}, - {"desc", ""}, - {NULL, NULL} + {.name = "help", + .data = N_("convert an interface MAC address to interface name") + }, + {.name = "desc", + .data = "" + }, + {.name = NULL} }; static const vshCmdOptDef opts_interface_name[] = { @@ -399,9 +411,13 @@ cmdInterfaceName(vshControl *ctl, const vshCmd *cmd) * "iface-mac" command */ static const vshCmdInfo info_interface_mac[] = { - {"help", N_("convert an interface name to interface MAC address")}, - {"desc", ""}, - {NULL, NULL} + {.name = "help", + .data = N_("convert an interface name to interface MAC address") + }, + {.name = "desc", + .data = "" + }, + {.name = NULL} }; static const vshCmdOptDef opts_interface_mac[] = { @@ -431,9 +447,13 @@ cmdInterfaceMAC(vshControl *ctl, const vshCmd *cmd) * "iface-dumpxml" command */ static const vshCmdInfo info_interface_dumpxml[] = { - {"help", N_("interface information in XML")}, - {"desc", N_("Output the physical host interface information as an XML dump to stdout.")}, - {NULL, NULL} + {.name = "help", + .data = N_("interface information in XML") + }, + {.name = "desc", + .data = N_("Output the physical host interface information as an XML dump to stdout.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_interface_dumpxml[] = { @@ -481,9 +501,13 @@ cmdInterfaceDumpXML(vshControl *ctl, const vshCmd *cmd) * "iface-define" command */ static const vshCmdInfo info_interface_define[] = { - {"help", N_("define (but don't start) a physical host interface from an XML file")}, - {"desc", N_("Define a physical host interface.")}, - {NULL, NULL} + {.name = "help", + .data = N_("define (but don't start) a physical host interface from an XML file") + }, + {.name = "desc", + .data = N_("Define a physical host interface.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_interface_define[] = { @@ -527,9 +551,13 @@ cmdInterfaceDefine(vshControl *ctl, const vshCmd *cmd) * "iface-undefine" command */ static const vshCmdInfo info_interface_undefine[] = { - {"help", N_("undefine a physical host interface (remove it from configuration)")}, - {"desc", N_("undefine an interface.")}, - {NULL, NULL} + {.name = "help", + .data = N_("undefine a physical host interface (remove it from configuration)") + }, + {.name = "desc", + .data = N_("undefine an interface.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_interface_undefine[] = { @@ -566,9 +594,13 @@ cmdInterfaceUndefine(vshControl *ctl, const vshCmd *cmd) * "iface-start" command */ static const vshCmdInfo info_interface_start[] = { - {"help", N_("start a physical host interface (enable it / \"if-up\")")}, - {"desc", N_("start a physical host interface.")}, - {NULL, NULL} + {.name = "help", + .data = N_("start a physical host interface (enable it / \"if-up\")") + }, + {.name = "desc", + .data = N_("start a physical host interface.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_interface_start[] = { @@ -605,9 +637,13 @@ cmdInterfaceStart(vshControl *ctl, const vshCmd *cmd) * "iface-destroy" command */ static const vshCmdInfo info_interface_destroy[] = { - {"help", N_("destroy a physical host interface (disable it / \"if-down\")")}, - {"desc", N_("forcefully stop a physical host interface.")}, - {NULL, NULL} + {.name = "help", + .data = N_("destroy a physical host interface (disable it / \"if-down\")") + }, + {.name = "desc", + .data = N_("forcefully stop a physical host interface.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_interface_destroy[] = { @@ -644,11 +680,15 @@ cmdInterfaceDestroy(vshControl *ctl, const vshCmd *cmd) * "iface-begin" command */ static const vshCmdInfo info_interface_begin[] = { - {"help", N_("create a snapshot of current interfaces settings, " + {.name = "help", + .data = N_("create a snapshot of current interfaces settings, " "which can be later committed (iface-commit) or " - "restored (iface-rollback)")}, - {"desc", N_("Create a restore point for interfaces settings")}, - {NULL, NULL} + "restored (iface-rollback)") + }, + {.name = "desc", + .data = N_("Create a restore point for interfaces settings") + }, + {.name = NULL} }; static const vshCmdOptDef opts_interface_begin[] = { @@ -671,9 +711,13 @@ cmdInterfaceBegin(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) * "iface-commit" command */ static const vshCmdInfo info_interface_commit[] = { - {"help", N_("commit changes made since iface-begin and free restore point")}, - {"desc", N_("commit changes and free restore point")}, - {NULL, NULL} + {.name = "help", + .data = N_("commit changes made since iface-begin and free restore point") + }, + {.name = "desc", + .data = N_("commit changes and free restore point") + }, + {.name = NULL} }; static const vshCmdOptDef opts_interface_commit[] = { @@ -696,9 +740,13 @@ cmdInterfaceCommit(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) * "iface-rollback" command */ static const vshCmdInfo info_interface_rollback[] = { - {"help", N_("rollback to previous saved configuration created via iface-begin")}, - {"desc", N_("rollback to previous restore point")}, - {NULL, NULL} + {.name = "help", + .data = N_("rollback to previous saved configuration created via iface-begin") + }, + {.name = "desc", + .data = N_("rollback to previous restore point") + }, + {.name = NULL} }; static const vshCmdOptDef opts_interface_rollback[] = { @@ -721,9 +769,13 @@ cmdInterfaceRollback(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) * "iface-bridge" command */ static const vshCmdInfo info_interface_bridge[] = { - {"help", N_("create a bridge device and attach an existing network device to it")}, - {"desc", N_("bridge an existing network device")}, - {NULL, NULL} + {.name = "help", + .data = N_("create a bridge device and attach an existing network device to it") + }, + {.name = "desc", + .data = N_("bridge an existing network device") + }, + {.name = NULL} }; static const vshCmdOptDef opts_interface_bridge[] = { @@ -956,9 +1008,13 @@ cmdInterfaceBridge(vshControl *ctl, const vshCmd *cmd) * "iface-unbridge" command */ static const vshCmdInfo info_interface_unbridge[] = { - {"help", N_("undefine a bridge device after detaching its slave device")}, - {"desc", N_("unbridge a network device")}, - {NULL, NULL} + {.name = "help", + .data = N_("undefine a bridge device after detaching its slave device") + }, + {.name = "desc", + .data = N_("unbridge a network device") + }, + {.name = NULL} }; static const vshCmdOptDef opts_interface_unbridge[] = { -- 1.8.0.2

--- tools/virsh-network.c | 131 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 91 insertions(+), 40 deletions(-) diff --git a/tools/virsh-network.c b/tools/virsh-network.c index 16578aa..a62dee3 100644 --- a/tools/virsh-network.c +++ b/tools/virsh-network.c @@ -82,10 +82,13 @@ vshCommandOptNetworkBy(vshControl *ctl, const vshCmd *cmd, * "net-autostart" command */ static const vshCmdInfo info_network_autostart[] = { - {"help", N_("autostart a network")}, - {"desc", - N_("Configure a network to be automatically started at boot.")}, - {NULL, NULL} + {.name = "help", + .data = N_("autostart a network") + }, + {.name = "desc", + .data = N_("Configure a network to be automatically started at boot.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_network_autostart[] = { @@ -136,9 +139,13 @@ cmdNetworkAutostart(vshControl *ctl, const vshCmd *cmd) * "net-create" command */ static const vshCmdInfo info_network_create[] = { - {"help", N_("create a network from an XML file")}, - {"desc", N_("Create a network.")}, - {NULL, NULL} + {.name = "help", + .data = N_("create a network from an XML file") + }, + {.name = "desc", + .data = N_("Create a network.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_network_create[] = { @@ -182,9 +189,13 @@ cmdNetworkCreate(vshControl *ctl, const vshCmd *cmd) * "net-define" command */ static const vshCmdInfo info_network_define[] = { - {"help", N_("define (but don't start) a network from an XML file")}, - {"desc", N_("Define a network.")}, - {NULL, NULL} + {.name = "help", + .data = N_("define (but don't start) a network from an XML file") + }, + {.name = "desc", + .data = N_("Define a network.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_network_define[] = { @@ -228,9 +239,13 @@ cmdNetworkDefine(vshControl *ctl, const vshCmd *cmd) * "net-destroy" command */ static const vshCmdInfo info_network_destroy[] = { - {"help", N_("destroy (stop) a network")}, - {"desc", N_("Forcefully stop a given network.")}, - {NULL, NULL} + {.name = "help", + .data = N_("destroy (stop) a network") + }, + {.name = "desc", + .data = N_("Forcefully stop a given network.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_network_destroy[] = { @@ -267,9 +282,13 @@ cmdNetworkDestroy(vshControl *ctl, const vshCmd *cmd) * "net-dumpxml" command */ static const vshCmdInfo info_network_dumpxml[] = { - {"help", N_("network information in XML")}, - {"desc", N_("Output the network information as an XML dump to stdout.")}, - {NULL, NULL} + {.name = "help", + .data = N_("network information in XML") + }, + {.name = "desc", + .data = N_("Output the network information as an XML dump to stdout.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_network_dumpxml[] = { @@ -319,9 +338,13 @@ cmdNetworkDumpXML(vshControl *ctl, const vshCmd *cmd) * "net-info" command */ static const vshCmdInfo info_network_info[] = { - {"help", N_("network information")}, - {"desc", N_("Returns basic information about the network")}, - {NULL, NULL} + {.name = "help", + .data = N_("network information") + }, + {.name = "desc", + .data = N_("Returns basic information about the network") + }, + {.name = NULL} }; static const vshCmdOptDef opts_network_info[] = { @@ -596,9 +619,13 @@ cleanup: * "net-list" command */ static const vshCmdInfo info_network_list[] = { - {"help", N_("list networks")}, - {"desc", N_("Returns list of networks.")}, - {NULL, NULL} + {.name = "help", + .data = N_("list networks") + }, + {.name = "desc", + .data = N_("Returns list of networks.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_network_list[] = { @@ -700,9 +727,13 @@ cmdNetworkList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) * "net-name" command */ static const vshCmdInfo info_network_name[] = { - {"help", N_("convert a network UUID to network name")}, - {"desc", ""}, - {NULL, NULL} + {.name = "help", + .data = N_("convert a network UUID to network name") + }, + {.name = "desc", + .data = "" + }, + {.name = NULL} }; static const vshCmdOptDef opts_network_name[] = { @@ -732,9 +763,13 @@ cmdNetworkName(vshControl *ctl, const vshCmd *cmd) * "net-start" command */ static const vshCmdInfo info_network_start[] = { - {"help", N_("start a (previously defined) inactive network")}, - {"desc", N_("Start a network.")}, - {NULL, NULL} + {.name = "help", + .data = N_("start a (previously defined) inactive network") + }, + {.name = "desc", + .data = N_("Start a network.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_network_start[] = { @@ -770,9 +805,13 @@ cmdNetworkStart(vshControl *ctl, const vshCmd *cmd) * "net-undefine" command */ static const vshCmdInfo info_network_undefine[] = { - {"help", N_("undefine an inactive network")}, - {"desc", N_("Undefine the configuration for an inactive network.")}, - {NULL, NULL} + {.name = "help", + .data = N_("undefine an inactive network") + }, + {.name = "desc", + .data = N_("Undefine the configuration for an inactive network.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_network_undefine[] = { @@ -809,9 +848,13 @@ cmdNetworkUndefine(vshControl *ctl, const vshCmd *cmd) * "net-update" command */ static const vshCmdInfo info_network_update[] = { - {"help", N_("update parts of an existing network's configuration")}, - {"desc", ""}, - {NULL, NULL} + {.name = "help", + .data = N_("update parts of an existing network's configuration") + }, + {.name = "desc", + .data = "" + }, + {.name = NULL} }; static const vshCmdOptDef opts_network_update[] = { @@ -987,9 +1030,13 @@ cleanup: * "net-uuid" command */ static const vshCmdInfo info_network_uuid[] = { - {"help", N_("convert a network name to network UUID")}, - {"desc", ""}, - {NULL, NULL} + {.name = "help", + .data = N_("convert a network name to network UUID") + }, + {.name = "desc", + .data = "" + }, + {.name = NULL} }; static const vshCmdOptDef opts_network_uuid[] = { @@ -1024,9 +1071,13 @@ cmdNetworkUuid(vshControl *ctl, const vshCmd *cmd) * "net-edit" command */ static const vshCmdInfo info_network_edit[] = { - {"help", N_("edit XML configuration for a network")}, - {"desc", N_("Edit the XML configuration for a network.")}, - {NULL, NULL} + {.name = "help", + .data = N_("edit XML configuration for a network") + }, + {.name = "desc", + .data = N_("Edit the XML configuration for a network.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_network_edit[] = { -- 1.8.0.2

--- tools/virsh-nodedev.c | 78 ++++++++++++++++++++++++++++++++++----------------- 1 file changed, 53 insertions(+), 25 deletions(-) diff --git a/tools/virsh-nodedev.c b/tools/virsh-nodedev.c index 686a07b..8032121 100644 --- a/tools/virsh-nodedev.c +++ b/tools/virsh-nodedev.c @@ -42,12 +42,16 @@ * "nodedev-create" command */ static const vshCmdInfo info_node_device_create[] = { - {"help", N_("create a device defined " - "by an XML file on the node")}, - {"desc", N_("Create a device on the node. Note that this " - "command creates devices on the physical host " - "that can then be assigned to a virtual machine.")}, - {NULL, NULL} + {.name = "help", + .data = N_("create a device defined " + "by an XML file on the node") + }, + {.name = "desc", + .data = N_("Create a device on the node. Note that this " + "command creates devices on the physical host " + "that can then be assigned to a virtual machine.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_node_device_create[] = { @@ -93,10 +97,14 @@ cmdNodeDeviceCreate(vshControl *ctl, const vshCmd *cmd) * "nodedev-destroy" command */ static const vshCmdInfo info_node_device_destroy[] = { - {"help", N_("destroy (stop) a device on the node")}, - {"desc", N_("Destroy a device on the node. Note that this " - "command destroys devices on the physical host")}, - {NULL, NULL} + {.name = "help", + .data = N_("destroy (stop) a device on the node") + }, + {.name = "desc", + .data = N_("Destroy a device on the node. Note that this " + "command destroys devices on the physical host") + }, + {.name = NULL} }; static const vshCmdOptDef opts_node_device_destroy[] = { @@ -330,9 +338,13 @@ cleanup: * "nodedev-list" command */ static const vshCmdInfo info_node_list_devices[] = { - {"help", N_("enumerate devices on this host")}, - {"desc", ""}, - {NULL, NULL} + {.name = "help", + .data = N_("enumerate devices on this host") + }, + {.name = "desc", + .data = "" + }, + {.name = NULL} }; static const vshCmdOptDef opts_node_list_devices[] = { @@ -466,9 +478,13 @@ cleanup: * "nodedev-dumpxml" command */ static const vshCmdInfo info_node_device_dumpxml[] = { - {"help", N_("node device details in XML")}, - {"desc", N_("Output the node device details as an XML dump to stdout.")}, - {NULL, NULL} + {.name = "help", + .data = N_("node device details in XML") + }, + {.name = "desc", + .data = N_("Output the node device details as an XML dump to stdout.") + }, + {.name = NULL} }; @@ -513,9 +529,13 @@ cleanup: * "nodedev-detach" command */ static const vshCmdInfo info_node_device_detach[] = { - {"help", N_("detach node device from its device driver")}, - {"desc", N_("Detach node device from its device driver before assigning to a domain.")}, - {NULL, NULL} + {.name = "help", + .data = N_("detach node device from its device driver") + }, + {.name = "desc", + .data = N_("Detach node device from its device driver before assigning to a domain.") + }, + {.name = NULL} }; @@ -560,9 +580,13 @@ cmdNodeDeviceDetach(vshControl *ctl, const vshCmd *cmd) * "nodedev-reattach" command */ static const vshCmdInfo info_node_device_reattach[] = { - {"help", N_("reattach node device to its device driver")}, - {"desc", N_("Reattach node device to its device driver once released by the domain.")}, - {NULL, NULL} + {.name = "help", + .data = N_("reattach node device to its device driver") + }, + {.name = "desc", + .data = N_("Reattach node device to its device driver once released by the domain.") + }, + {.name = NULL} }; @@ -605,9 +629,13 @@ cmdNodeDeviceReAttach(vshControl *ctl, const vshCmd *cmd) * "nodedev-reset" command */ static const vshCmdInfo info_node_device_reset[] = { - {"help", N_("reset node device")}, - {"desc", N_("Reset node device before or after assigning to a domain.")}, - {NULL, NULL} + {.name = "help", + .data = N_("reset node device") + }, + {.name = "desc", + .data = N_("Reset node device before or after assigning to a domain.") + }, + {.name = NULL} }; -- 1.8.0.2

--- tools/virsh-nwfilter.c | 50 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/tools/virsh-nwfilter.c b/tools/virsh-nwfilter.c index 20a3557..3b1e1e4 100644 --- a/tools/virsh-nwfilter.c +++ b/tools/virsh-nwfilter.c @@ -81,9 +81,13 @@ vshCommandOptNWFilterBy(vshControl *ctl, const vshCmd *cmd, * "nwfilter-define" command */ static const vshCmdInfo info_nwfilter_define[] = { - {"help", N_("define or update a network filter from an XML file")}, - {"desc", N_("Define a new network filter or update an existing one.")}, - {NULL, NULL} + {.name = "help", + .data = N_("define or update a network filter from an XML file") + }, + {.name = "desc", + .data = N_("Define a new network filter or update an existing one.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_nwfilter_define[] = { @@ -127,9 +131,13 @@ cmdNWFilterDefine(vshControl *ctl, const vshCmd *cmd) * "nwfilter-undefine" command */ static const vshCmdInfo info_nwfilter_undefine[] = { - {"help", N_("undefine a network filter")}, - {"desc", N_("Undefine a given network filter.")}, - {NULL, NULL} + {.name = "help", + .data = N_("undefine a network filter") + }, + {.name = "desc", + .data = N_("Undefine a given network filter.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_nwfilter_undefine[] = { @@ -166,9 +174,13 @@ cmdNWFilterUndefine(vshControl *ctl, const vshCmd *cmd) * "nwfilter-dumpxml" command */ static const vshCmdInfo info_nwfilter_dumpxml[] = { - {"help", N_("network filter information in XML")}, - {"desc", N_("Output the network filter information as an XML dump to stdout.")}, - {NULL, NULL} + {.name = "help", + .data = N_("network filter information in XML") + }, + {.name = "desc", + .data = N_("Output the network filter information as an XML dump to stdout.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_nwfilter_dumpxml[] = { @@ -334,9 +346,13 @@ cleanup: * "nwfilter-list" command */ static const vshCmdInfo info_nwfilter_list[] = { - {"help", N_("list network filters")}, - {"desc", N_("Returns list of network filters.")}, - {NULL, NULL} + {.name = "help", + .data = N_("list network filters") + }, + {.name = "desc", + .data = N_("Returns list of network filters.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_nwfilter_list[] = { @@ -374,9 +390,13 @@ cmdNWFilterList(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) * "nwfilter-edit" command */ static const vshCmdInfo info_nwfilter_edit[] = { - {"help", N_("edit XML configuration for a network filter")}, - {"desc", N_("Edit the XML configuration for a network filter.")}, - {NULL, NULL} + {.name = "help", + .data = N_("edit XML configuration for a network filter") + }, + {.name = "desc", + .data = N_("Edit the XML configuration for a network filter.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_nwfilter_edit[] = { -- 1.8.0.2

--- tools/virsh-pool.c | 192 +++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 133 insertions(+), 59 deletions(-) diff --git a/tools/virsh-pool.c b/tools/virsh-pool.c index e5de189..a46cad1 100644 --- a/tools/virsh-pool.c +++ b/tools/virsh-pool.c @@ -78,10 +78,13 @@ vshCommandOptPoolBy(vshControl *ctl, const vshCmd *cmd, const char *optname, * "pool-autostart" command */ static const vshCmdInfo info_pool_autostart[] = { - {"help", N_("autostart a pool")}, - {"desc", - N_("Configure a pool to be automatically started at boot.")}, - {NULL, NULL} + {.name = "help", + .data = N_("autostart a pool") + }, + {.name = "desc", + .data = N_("Configure a pool to be automatically started at boot.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_pool_autostart[] = { @@ -132,9 +135,13 @@ cmdPoolAutostart(vshControl *ctl, const vshCmd *cmd) * "pool-create" command */ static const vshCmdInfo info_pool_create[] = { - {"help", N_("create a pool from an XML file")}, - {"desc", N_("Create a pool.")}, - {NULL, NULL} + {.name = "help", + .data = N_("create a pool from an XML file") + }, + {.name = "desc", + .data = N_("Create a pool.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_pool_create[] = { @@ -293,9 +300,13 @@ cleanup: * "pool-create-as" command */ static const vshCmdInfo info_pool_create_as[] = { - {"help", N_("create a pool from a set of args")}, - {"desc", N_("Create a pool.")}, - {NULL, NULL} + {.name = "help", + .data = N_("create a pool from a set of args") + }, + {.name = "desc", + .data = N_("Create a pool.") + }, + {.name = NULL} }; static bool @@ -331,9 +342,13 @@ cmdPoolCreateAs(vshControl *ctl, const vshCmd *cmd) * "pool-define" command */ static const vshCmdInfo info_pool_define[] = { - {"help", N_("define (but don't start) a pool from an XML file")}, - {"desc", N_("Define a pool.")}, - {NULL, NULL} + {.name = "help", + .data = N_("define (but don't start) a pool from an XML file") + }, + {.name = "desc", + .data = N_("Define a pool.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_pool_define[] = { @@ -377,9 +392,13 @@ cmdPoolDefine(vshControl *ctl, const vshCmd *cmd) * "pool-define-as" command */ static const vshCmdInfo info_pool_define_as[] = { - {"help", N_("define a pool from a set of args")}, - {"desc", N_("Define a pool.")}, - {NULL, NULL} + {.name = "help", + .data = N_("define a pool from a set of args") + }, + {.name = "desc", + .data = N_("Define a pool.") + }, + {.name = NULL} }; static bool @@ -415,9 +434,13 @@ cmdPoolDefineAs(vshControl *ctl, const vshCmd *cmd) * "pool-build" command */ static const vshCmdInfo info_pool_build[] = { - {"help", N_("build a pool")}, - {"desc", N_("Build a given pool.")}, - {NULL, NULL} + {.name = "help", + .data = N_("build a pool") + }, + {.name = "desc", + .data = N_("Build a given pool.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_pool_build[] = { @@ -474,10 +497,13 @@ cmdPoolBuild(vshControl *ctl, const vshCmd *cmd) * "pool-destroy" command */ static const vshCmdInfo info_pool_destroy[] = { - {"help", N_("destroy (stop) a pool")}, - {"desc", - N_("Forcefully stop a given pool. Raw data in the pool is untouched")}, - {NULL, NULL} + {.name = "help", + .data = N_("destroy (stop) a pool") + }, + {.name = "desc", + .data = N_("Forcefully stop a given pool. Raw data in the pool is untouched") + }, + {.name = NULL} }; static const vshCmdOptDef opts_pool_destroy[] = { @@ -514,9 +540,13 @@ cmdPoolDestroy(vshControl *ctl, const vshCmd *cmd) * "pool-delete" command */ static const vshCmdInfo info_pool_delete[] = { - {"help", N_("delete a pool")}, - {"desc", N_("Delete a given pool.")}, - {NULL, NULL} + {.name = "help", + .data = N_("delete a pool") + }, + {.name = "desc", + .data = N_("Delete a given pool.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_pool_delete[] = { @@ -553,9 +583,13 @@ cmdPoolDelete(vshControl *ctl, const vshCmd *cmd) * "pool-refresh" command */ static const vshCmdInfo info_pool_refresh[] = { - {"help", N_("refresh a pool")}, - {"desc", N_("Refresh a given pool.")}, - {NULL, NULL} + {.name = "help", + .data = N_("refresh a pool") + }, + {.name = "desc", + .data = N_("Refresh a given pool.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_pool_refresh[] = { @@ -592,9 +626,13 @@ cmdPoolRefresh(vshControl *ctl, const vshCmd *cmd) * "pool-dumpxml" command */ static const vshCmdInfo info_pool_dumpxml[] = { - {"help", N_("pool information in XML")}, - {"desc", N_("Output the pool information as an XML dump to stdout.")}, - {NULL, NULL} + {.name = "help", + .data = N_("pool information in XML") + }, + {.name = "desc", + .data = N_("Output the pool information as an XML dump to stdout.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_pool_dumpxml[] = { @@ -866,9 +904,13 @@ cleanup: * "pool-list" command */ static const vshCmdInfo info_pool_list[] = { - {"help", N_("list pools")}, - {"desc", N_("Returns list of pools.")}, - {NULL, NULL} + {.name = "help", + .data = N_("list pools") + }, + {.name = "desc", + .data = N_("Returns list of pools.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_pool_list[] = { @@ -1316,9 +1358,13 @@ cleanup: * "find-storage-pool-sources-as" command */ static const vshCmdInfo info_find_storage_pool_sources_as[] = { - {"help", N_("find potential storage pool sources")}, - {"desc", N_("Returns XML <sources> document.")}, - {NULL, NULL} + {.name = "help", + .data = N_("find potential storage pool sources") + }, + {.name = "desc", + .data = N_("Returns XML <sources> document.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_find_storage_pool_sources_as[] = { @@ -1401,9 +1447,13 @@ cmdPoolDiscoverSourcesAs(vshControl * ctl, const vshCmd * cmd ATTRIBUTE_UNUSED) * "find-storage-pool-sources" command */ static const vshCmdInfo info_find_storage_pool_sources[] = { - {"help", N_("discover potential storage pool sources")}, - {"desc", N_("Returns XML <sources> document.")}, - {NULL, NULL} + {.name = "help", + .data = N_("discover potential storage pool sources") + }, + {.name = "desc", + .data = N_("Returns XML <sources> document.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_find_storage_pool_sources[] = { @@ -1452,9 +1502,13 @@ cmdPoolDiscoverSources(vshControl * ctl, const vshCmd * cmd ATTRIBUTE_UNUSED) * "pool-info" command */ static const vshCmdInfo info_pool_info[] = { - {"help", N_("storage pool information")}, - {"desc", N_("Returns basic information about the storage pool.")}, - {NULL, NULL} + {.name = "help", + .data = N_("storage pool information") + }, + {.name = "desc", + .data = N_("Returns basic information about the storage pool.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_pool_info[] = { @@ -1548,9 +1602,13 @@ cmdPoolInfo(vshControl *ctl, const vshCmd *cmd) * "pool-name" command */ static const vshCmdInfo info_pool_name[] = { - {"help", N_("convert a pool UUID to pool name")}, - {"desc", ""}, - {NULL, NULL} + {.name = "help", + .data = N_("convert a pool UUID to pool name") + }, + {.name = "desc", + .data = "" + }, + {.name = NULL} }; static const vshCmdOptDef opts_pool_name[] = { @@ -1580,9 +1638,13 @@ cmdPoolName(vshControl *ctl, const vshCmd *cmd) * "pool-start" command */ static const vshCmdInfo info_pool_start[] = { - {"help", N_("start a (previously defined) inactive pool")}, - {"desc", N_("Start a pool.")}, - {NULL, NULL} + {.name = "help", + .data = N_("start a (previously defined) inactive pool") + }, + {.name = "desc", + .data = N_("Start a pool.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_pool_start[] = { @@ -1619,9 +1681,13 @@ cmdPoolStart(vshControl *ctl, const vshCmd *cmd) * "pool-undefine" command */ static const vshCmdInfo info_pool_undefine[] = { - {"help", N_("undefine an inactive pool")}, - {"desc", N_("Undefine the configuration for an inactive pool.")}, - {NULL, NULL} + {.name = "help", + .data = N_("undefine an inactive pool") + }, + {.name = "desc", + .data = N_("Undefine the configuration for an inactive pool.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_pool_undefine[] = { @@ -1658,9 +1724,13 @@ cmdPoolUndefine(vshControl *ctl, const vshCmd *cmd) * "pool-uuid" command */ static const vshCmdInfo info_pool_uuid[] = { - {"help", N_("convert a pool name to pool UUID")}, - {"desc", ""}, - {NULL, NULL} + {.name = "help", + .data = N_("convert a pool name to pool UUID") + }, + {.name = "desc", + .data = "" + }, + {.name = NULL} }; static const vshCmdOptDef opts_pool_uuid[] = { @@ -1695,9 +1765,13 @@ cmdPoolUuid(vshControl *ctl, const vshCmd *cmd) * "pool-edit" command */ static const vshCmdInfo info_pool_edit[] = { - {"help", N_("edit XML configuration for a storage pool")}, - {"desc", N_("Edit the XML configuration for a storage pool.")}, - {NULL, NULL} + {.name = "help", + .data = N_("edit XML configuration for a storage pool") + }, + {.name = "desc", + .data = N_("Edit the XML configuration for a storage pool.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_pool_edit[] = { -- 1.8.0.2

--- tools/virsh-secret.c | 60 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 42 insertions(+), 18 deletions(-) diff --git a/tools/virsh-secret.c b/tools/virsh-secret.c index 3e9129e..6329110 100644 --- a/tools/virsh-secret.c +++ b/tools/virsh-secret.c @@ -69,9 +69,13 @@ vshCommandOptSecret(vshControl *ctl, const vshCmd *cmd, const char **name) * "secret-define" command */ static const vshCmdInfo info_secret_define[] = { - {"help", N_("define or modify a secret from an XML file")}, - {"desc", N_("Define or modify a secret.")}, - {NULL, NULL} + {.name = "help", + .data = N_("define or modify a secret from an XML file") + }, + {.name = "desc", + .data = N_("Define or modify a secret.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_secret_define[] = { @@ -121,9 +125,13 @@ cleanup: * "secret-dumpxml" command */ static const vshCmdInfo info_secret_dumpxml[] = { - {"help", N_("secret attributes in XML")}, - {"desc", N_("Output attributes of a secret as an XML dump to stdout.")}, - {NULL, NULL} + {.name = "help", + .data = N_("secret attributes in XML") + }, + {.name = "desc", + .data = N_("Output attributes of a secret as an XML dump to stdout.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_secret_dumpxml[] = { @@ -162,9 +170,13 @@ cleanup: * "secret-set-value" command */ static const vshCmdInfo info_secret_set_value[] = { - {"help", N_("set a secret value")}, - {"desc", N_("Set a secret value.")}, - {NULL, NULL} + {.name = "help", + .data = N_("set a secret value") + }, + {.name = "desc", + .data = N_("Set a secret value.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_secret_set_value[] = { @@ -226,9 +238,13 @@ cleanup: * "secret-get-value" command */ static const vshCmdInfo info_secret_get_value[] = { - {"help", N_("Output a secret value")}, - {"desc", N_("Output a secret value to stdout.")}, - {NULL, NULL} + {.name = "help", + .data = N_("Output a secret value") + }, + {.name = "desc", + .data = N_("Output a secret value to stdout.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_secret_get_value[] = { @@ -279,9 +295,13 @@ cleanup: * "secret-undefine" command */ static const vshCmdInfo info_secret_undefine[] = { - {"help", N_("undefine a secret")}, - {"desc", N_("Undefine a secret.")}, - {NULL, NULL} + {.name = "help", + .data = N_("undefine a secret") + }, + {.name = "desc", + .data = N_("Undefine a secret.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_secret_undefine[] = { @@ -455,9 +475,13 @@ cleanup: * "secret-list" command */ static const vshCmdInfo info_secret_list[] = { - {"help", N_("list secrets")}, - {"desc", N_("Returns a list of secrets")}, - {NULL, NULL} + {.name = "help", + .data = N_("list secrets") + }, + {.name = "desc", + .data = N_("Returns a list of secrets") + }, + {.name = NULL} }; static const vshCmdOptDef opts_secret_list[] = { -- 1.8.0.2

--- tools/virsh-snapshot.c | 100 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 70 insertions(+), 30 deletions(-) diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c index 3d6fa91..8ea69dc 100644 --- a/tools/virsh-snapshot.c +++ b/tools/virsh-snapshot.c @@ -112,9 +112,13 @@ cleanup: * "snapshot-create" command */ static const vshCmdInfo info_snapshot_create[] = { - {"help", N_("Create a snapshot from XML")}, - {"desc", N_("Create a snapshot (disk and RAM) from XML")}, - {NULL, NULL} + {.name = "help", + .data = N_("Create a snapshot from XML") + }, + {.name = "desc", + .data = N_("Create a snapshot (disk and RAM) from XML") + }, + {.name = NULL} }; static const vshCmdOptDef opts_snapshot_create[] = { @@ -325,9 +329,13 @@ cleanup: } static const vshCmdInfo info_snapshot_create_as[] = { - {"help", N_("Create a snapshot from a set of args")}, - {"desc", N_("Create a snapshot (disk and RAM) from arguments")}, - {NULL, NULL} + {.name = "help", + .data = N_("Create a snapshot from a set of args") + }, + {.name = "desc", + .data = N_("Create a snapshot (disk and RAM) from arguments") + }, + {.name = NULL} }; static const vshCmdOptDef opts_snapshot_create_as[] = { @@ -521,9 +529,13 @@ vshLookupSnapshot(vshControl *ctl, const vshCmd *cmd, * "snapshot-edit" command */ static const vshCmdInfo info_snapshot_edit[] = { - {"help", N_("edit XML for a snapshot")}, - {"desc", N_("Edit the domain snapshot XML for a named snapshot")}, - {NULL, NULL} + {.name = "help", + .data = N_("edit XML for a snapshot") + }, + {.name = "desc", + .data = N_("Edit the domain snapshot XML for a named snapshot") + }, + {.name = NULL} }; static const vshCmdOptDef opts_snapshot_edit[] = { @@ -649,9 +661,13 @@ cleanup: * "snapshot-current" command */ static const vshCmdInfo info_snapshot_current[] = { - {"help", N_("Get or set the current snapshot")}, - {"desc", N_("Get or set the current snapshot")}, - {NULL, NULL} + {.name = "help", + .data = N_("Get or set the current snapshot") + }, + {.name = "desc", + .data = N_("Get or set the current snapshot") + }, + {.name = NULL} }; static const vshCmdOptDef opts_snapshot_current[] = { @@ -888,9 +904,13 @@ cleanup: * "snapshot-info" command */ static const vshCmdInfo info_snapshot_info[] = { - {"help", N_("snapshot information")}, - {"desc", N_("Returns basic information about a snapshot.")}, - {NULL, NULL} + {.name = "help", + .data = N_("snapshot information") + }, + {.name = "desc", + .data = N_("Returns basic information about a snapshot.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_snapshot_info[] = { @@ -1443,9 +1463,13 @@ vshSnapshotListLookup(int id, bool parent, void *opaque) * "snapshot-list" command */ static const vshCmdInfo info_snapshot_list[] = { - {"help", N_("List snapshots for a domain")}, - {"desc", N_("Snapshot List")}, - {NULL, NULL} + {.name = "help", + .data = N_("List snapshots for a domain") + }, + {.name = "desc", + .data = N_("Snapshot List") + }, + {.name = NULL} }; static const vshCmdOptDef opts_snapshot_list[] = { @@ -1731,9 +1755,13 @@ cleanup: * "snapshot-dumpxml" command */ static const vshCmdInfo info_snapshot_dumpxml[] = { - {"help", N_("Dump XML for a domain snapshot")}, - {"desc", N_("Snapshot Dump XML")}, - {NULL, NULL} + {.name = "help", + .data = N_("Dump XML for a domain snapshot") + }, + {.name = "desc", + .data = N_("Snapshot Dump XML") + }, + {.name = NULL} }; static const vshCmdOptDef opts_snapshot_dumpxml[] = { @@ -1796,9 +1824,13 @@ cleanup: * "snapshot-parent" command */ static const vshCmdInfo info_snapshot_parent[] = { - {"help", N_("Get the name of the parent of a snapshot")}, - {"desc", N_("Extract the snapshot's parent, if any")}, - {NULL, NULL} + {.name = "help", + .data = N_("Get the name of the parent of a snapshot") + }, + {.name = "desc", + .data = N_("Extract the snapshot's parent, if any") + }, + {.name = NULL} }; static const vshCmdOptDef opts_snapshot_parent[] = { @@ -1862,9 +1894,13 @@ cleanup: * "snapshot-revert" command */ static const vshCmdInfo info_snapshot_revert[] = { - {"help", N_("Revert a domain to a snapshot")}, - {"desc", N_("Revert domain to snapshot")}, - {NULL, NULL} + {.name = "help", + .data = N_("Revert a domain to a snapshot") + }, + {.name = "desc", + .data = N_("Revert domain to snapshot") + }, + {.name = NULL} }; static const vshCmdOptDef opts_snapshot_revert[] = { @@ -1956,9 +1992,13 @@ cleanup: * "snapshot-delete" command */ static const vshCmdInfo info_snapshot_delete[] = { - {"help", N_("Delete a domain snapshot")}, - {"desc", N_("Snapshot Delete")}, - {NULL, NULL} + {.name = "help", + .data = N_("Delete a domain snapshot") + }, + {.name = "desc", + .data = N_("Snapshot Delete") + }, + {.name = NULL} }; static const vshCmdOptDef opts_snapshot_delete[] = { -- 1.8.0.2

--- tools/virsh-volume.c | 160 +++++++++++++++++++++++++++++++++++---------------- 1 file changed, 112 insertions(+), 48 deletions(-) diff --git a/tools/virsh-volume.c b/tools/virsh-volume.c index 8487670..4cff391 100644 --- a/tools/virsh-volume.c +++ b/tools/virsh-volume.c @@ -105,9 +105,13 @@ vshCommandOptVolBy(vshControl *ctl, const vshCmd *cmd, * "vol-create-as" command */ static const vshCmdInfo info_vol_create_as[] = { - {"help", N_("create a volume from a set of args")}, - {"desc", N_("Create a vol.")}, - {NULL, NULL} + {.name = "help", + .data = N_("create a volume from a set of args") + }, + {.name = "desc", + .data = N_("Create a vol.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_vol_create_as[] = { @@ -306,9 +310,13 @@ cmdVolCreateAs(vshControl *ctl, const vshCmd *cmd) * "vol-create" command */ static const vshCmdInfo info_vol_create[] = { - {"help", N_("create a vol from an XML file")}, - {"desc", N_("Create a vol.")}, - {NULL, NULL} + {.name = "help", + .data = N_("create a vol from an XML file") + }, + {.name = "desc", + .data = N_("Create a vol.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_vol_create[] = { @@ -373,9 +381,13 @@ cleanup: * "vol-create-from" command */ static const vshCmdInfo info_vol_create_from[] = { - {"help", N_("create a vol, using another volume as input")}, - {"desc", N_("Create a vol from an existing volume.")}, - {NULL, NULL} + {.name = "help", + .data = N_("create a vol, using another volume as input") + }, + {.name = "desc", + .data = N_("Create a vol from an existing volume.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_vol_create_from[] = { @@ -489,9 +501,13 @@ cleanup: * "vol-clone" command */ static const vshCmdInfo info_vol_clone[] = { - {"help", N_("clone a volume.")}, - {"desc", N_("Clone an existing volume.")}, - {NULL, NULL} + {.name = "help", + .data = N_("clone a volume.") + }, + {.name = "desc", + .data = N_("Clone an existing volume.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_vol_clone[] = { @@ -583,9 +599,13 @@ cleanup: * "vol-upload" command */ static const vshCmdInfo info_vol_upload[] = { - {"help", N_("upload a file into a volume")}, - {"desc", N_("Upload a file into a volume")}, - {NULL, NULL} + {.name = "help", + .data = N_("upload a file into a volume") + }, + {.name = "desc", + .data = N_("Upload a file into a volume") + }, + {.name = NULL} }; static const vshCmdOptDef opts_vol_upload[] = { @@ -696,9 +716,13 @@ cleanup: * "vol-download" command */ static const vshCmdInfo info_vol_download[] = { - {"help", N_("Download a volume to a file")}, - {"desc", N_("Download a volume to a file")}, - {NULL, NULL} + {.name = "help", + .data = N_("Download a volume to a file") + }, + {.name = "desc", + .data = N_("Download a volume to a file") + }, + {.name = NULL} }; static const vshCmdOptDef opts_vol_download[] = { @@ -807,9 +831,13 @@ cleanup: * "vol-delete" command */ static const vshCmdInfo info_vol_delete[] = { - {"help", N_("delete a vol")}, - {"desc", N_("Delete a given vol.")}, - {NULL, NULL} + {.name = "help", + .data = N_("delete a vol") + }, + {.name = "desc", + .data = N_("Delete a given vol.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_vol_delete[] = { @@ -852,9 +880,13 @@ cmdVolDelete(vshControl *ctl, const vshCmd *cmd) * "vol-wipe" command */ static const vshCmdInfo info_vol_wipe[] = { - {"help", N_("wipe a vol")}, - {"desc", N_("Ensure data previously on a volume is not accessible to future reads")}, - {NULL, NULL} + {.name = "help", + .data = N_("wipe a vol") + }, + {.name = "desc", + .data = N_("Ensure data previously on a volume is not accessible to future reads") + }, + {.name = NULL} }; static const vshCmdOptDef opts_vol_wipe[] = { @@ -926,9 +958,13 @@ out: * "vol-info" command */ static const vshCmdInfo info_vol_info[] = { - {"help", N_("storage vol information")}, - {"desc", N_("Returns basic information about the storage vol.")}, - {NULL, NULL} + {.name = "help", + .data = N_("storage vol information") + }, + {.name = "desc", + .data = N_("Returns basic information about the storage vol.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_vol_info[] = { @@ -998,9 +1034,13 @@ cmdVolInfo(vshControl *ctl, const vshCmd *cmd) * "vol-resize" command */ static const vshCmdInfo info_vol_resize[] = { - {"help", N_("resize a vol")}, - {"desc", N_("Resizes a storage volume.")}, - {NULL, NULL} + {.name = "help", + .data = N_("resize a vol") + }, + {.name = "desc", + .data = N_("Resizes a storage volume.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_vol_resize[] = { @@ -1101,9 +1141,13 @@ cleanup: * "vol-dumpxml" command */ static const vshCmdInfo info_vol_dumpxml[] = { - {"help", N_("vol information in XML")}, - {"desc", N_("Output the vol information as an XML dump to stdout.")}, - {NULL, NULL} + {.name = "help", + .data = N_("vol information in XML") + }, + {.name = "desc", + .data = N_("Output the vol information as an XML dump to stdout.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_vol_dumpxml[] = { @@ -1271,9 +1315,13 @@ cleanup: * "vol-list" command */ static const vshCmdInfo info_vol_list[] = { - {"help", N_("list vols")}, - {"desc", N_("Returns list of vols by pool.")}, - {NULL, NULL} + {.name = "help", + .data = N_("list vols") + }, + {.name = "desc", + .data = N_("Returns list of vols by pool.") + }, + {.name = NULL} }; static const vshCmdOptDef opts_vol_list[] = { @@ -1548,9 +1596,13 @@ cleanup: * "vol-name" command */ static const vshCmdInfo info_vol_name[] = { - {"help", N_("returns the volume name for a given volume key or path")}, - {"desc", ""}, - {NULL, NULL} + {.name = "help", + .data = N_("returns the volume name for a given volume key or path") + }, + {.name = "desc", + .data = "" + }, + {.name = NULL} }; static const vshCmdOptDef opts_vol_name[] = { @@ -1580,9 +1632,13 @@ cmdVolName(vshControl *ctl, const vshCmd *cmd) * "vol-pool" command */ static const vshCmdInfo info_vol_pool[] = { - {"help", N_("returns the storage pool for a given volume key or path")}, - {"desc", ""}, - {NULL, NULL} + {.name = "help", + .data = N_("returns the storage pool for a given volume key or path") + }, + {.name = "desc", + .data = "" + }, + {.name = NULL} }; static const vshCmdOptDef opts_vol_pool[] = { @@ -1640,9 +1696,13 @@ cmdVolPool(vshControl *ctl, const vshCmd *cmd) * "vol-key" command */ static const vshCmdInfo info_vol_key[] = { - {"help", N_("returns the volume key for a given volume name or path")}, - {"desc", ""}, - {NULL, NULL} + {.name = "help", + .data = N_("returns the volume key for a given volume name or path") + }, + {.name = "desc", + .data = "" + }, + {.name = NULL} }; static const vshCmdOptDef opts_vol_key[] = { @@ -1676,9 +1736,13 @@ cmdVolKey(vshControl *ctl, const vshCmd *cmd) * "vol-path" command */ static const vshCmdInfo info_vol_path[] = { - {"help", N_("returns the volume path for a given volume name or key")}, - {"desc", ""}, - {NULL, NULL} + {.name = "help", + .data = N_("returns the volume path for a given volume name or key") + }, + {.name = "desc", + .data = "" + }, + {.name = NULL} }; static const vshCmdOptDef opts_vol_path[] = { -- 1.8.0.2

On 02/07/2013 05:51 PM, Michal Privoznik wrote:
I wonder if there's any syntax-check rule that we could use to enforce this style.
AFAIK, gcc handles '-Wno-old-initializer', but that's the exact opposite. And 'gcc --help=warnings' doesn't have a clue about that, so nothing else found. Hope that helps you find the solution, though. Martin

On 02/07/2013 05:51 PM, Michal Privoznik wrote:
I wonder if there's any syntax-check rule that we could use to enforce this style.
Michal Privoznik (13): virsh: Switch to c99 initialization of vshCmdDef virsh.c: Switch to c99 initialization of vshCmdInfo virsh-domain-monitor.c: Switch to c99 initialization of vshCmdInfo virsh-domain.c: Switch to c99 initialization of vshCmdInfo virsh-host.c: Switch to c99 initialization of vshCmdInfo virsh-interface.c: Switch to c99 initialization of vshCmdInfo virsh-network.c: Switch to c99 initialization of vshCmdInfo virsh-nodedev.c: Switch to c99 initialization of vshCmdInfo virsh-nwfilter.c: Switch to c99 initialization of vshCmdInfo virsh-pool.c: Switch to c99 initialization of vshCmdInfo virsh-secret.c: Switch to c99 initialization of vshCmdInfo virsh-snapshot.c: Switch to c99 initialization of vshCmdInfo virsh-volume.c: Switch to c99 initialization of vshCmdInfo
tools/virsh-domain-monitor.c | 198 ++++-- tools/virsh-domain.c | 1409 +++++++++++++++++++++++++++++++----------- tools/virsh-host.c | 222 +++++-- tools/virsh-interface.c | 256 +++++--- tools/virsh-network.c | 230 +++++-- tools/virsh-nodedev.c | 144 +++-- tools/virsh-nwfilter.c | 92 ++- tools/virsh-pool.c | 331 +++++++--- tools/virsh-secret.c | 109 +++- tools/virsh-snapshot.c | 182 ++++-- tools/virsh-volume.c | 276 +++++++-- tools/virsh.c | 97 ++- 12 files changed, 2631 insertions(+), 915 deletions(-)
ACK whole series. Martin

On 12.02.2013 16:47, Martin Kletzander wrote:
On 02/07/2013 05:51 PM, Michal Privoznik wrote:
I wonder if there's any syntax-check rule that we could use to enforce this style.
Michal Privoznik (13): virsh: Switch to c99 initialization of vshCmdDef virsh.c: Switch to c99 initialization of vshCmdInfo virsh-domain-monitor.c: Switch to c99 initialization of vshCmdInfo virsh-domain.c: Switch to c99 initialization of vshCmdInfo virsh-host.c: Switch to c99 initialization of vshCmdInfo virsh-interface.c: Switch to c99 initialization of vshCmdInfo virsh-network.c: Switch to c99 initialization of vshCmdInfo virsh-nodedev.c: Switch to c99 initialization of vshCmdInfo virsh-nwfilter.c: Switch to c99 initialization of vshCmdInfo virsh-pool.c: Switch to c99 initialization of vshCmdInfo virsh-secret.c: Switch to c99 initialization of vshCmdInfo virsh-snapshot.c: Switch to c99 initialization of vshCmdInfo virsh-volume.c: Switch to c99 initialization of vshCmdInfo
tools/virsh-domain-monitor.c | 198 ++++-- tools/virsh-domain.c | 1409 +++++++++++++++++++++++++++++++----------- tools/virsh-host.c | 222 +++++-- tools/virsh-interface.c | 256 +++++--- tools/virsh-network.c | 230 +++++-- tools/virsh-nodedev.c | 144 +++-- tools/virsh-nwfilter.c | 92 ++- tools/virsh-pool.c | 331 +++++++--- tools/virsh-secret.c | 109 +++- tools/virsh-snapshot.c | 182 ++++-- tools/virsh-volume.c | 276 +++++++-- tools/virsh.c | 97 ++- 12 files changed, 2631 insertions(+), 915 deletions(-)
ACK whole series.
Martin
Thanks, pushed. Michal
participants (2)
-
Martin Kletzander
-
Michal Privoznik