mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
virsh: Implement managedsave-dumpxml command
Add a simple virsh command handler which makes use of the new API. Signed-off-by: Kothapally Madhu Pavan <kmp@linux.vnet.ibm.com>
This commit is contained in:
parent
fc2c73b565
commit
c79697bbf4
@ -4704,6 +4704,54 @@ cmdManagedSaveRemove(vshControl *ctl, const vshCmd *cmd)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* "managedsave-dumpxml" command
|
||||||
|
*/
|
||||||
|
static const vshCmdInfo info_managed_save_dumpxml[] = {
|
||||||
|
{.name = "help",
|
||||||
|
.data = N_("Domain information of managed save state file in XML")
|
||||||
|
},
|
||||||
|
{.name = "desc",
|
||||||
|
.data = N_("Dump XML of domain information for a managed save state file to stdout.")
|
||||||
|
},
|
||||||
|
{.name = NULL}
|
||||||
|
};
|
||||||
|
|
||||||
|
static const vshCmdOptDef opts_managed_save_dumpxml[] = {
|
||||||
|
VIRSH_COMMON_OPT_DOMAIN_FULL,
|
||||||
|
{.name = "security-info",
|
||||||
|
.type = VSH_OT_BOOL,
|
||||||
|
.help = N_("include security sensitive information in XML dump")
|
||||||
|
},
|
||||||
|
{.name = NULL}
|
||||||
|
};
|
||||||
|
|
||||||
|
static bool
|
||||||
|
cmdManagedSaveDumpxml(vshControl *ctl, const vshCmd *cmd)
|
||||||
|
{
|
||||||
|
bool ret = false;
|
||||||
|
virDomainPtr dom = NULL;
|
||||||
|
unsigned int flags = 0;
|
||||||
|
char *xml = NULL;
|
||||||
|
|
||||||
|
if (vshCommandOptBool(cmd, "security-info"))
|
||||||
|
flags |= VIR_DOMAIN_XML_SECURE;
|
||||||
|
|
||||||
|
if (!(dom = virshCommandOptDomain(ctl, cmd, NULL)))
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
|
if (!(xml = virDomainManagedSaveGetXMLDesc(dom, flags)))
|
||||||
|
goto cleanup;
|
||||||
|
|
||||||
|
vshPrint(ctl, "%s", xml);
|
||||||
|
ret = true;
|
||||||
|
|
||||||
|
cleanup:
|
||||||
|
virshDomainFree(dom);
|
||||||
|
VIR_FREE(xml);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* "managedsave-define" command
|
* "managedsave-define" command
|
||||||
*/
|
*/
|
||||||
@ -13958,6 +14006,12 @@ const vshCmdDef domManagementCmds[] = {
|
|||||||
.info = info_managedsaveremove,
|
.info = info_managedsaveremove,
|
||||||
.flags = 0
|
.flags = 0
|
||||||
},
|
},
|
||||||
|
{.name = "managedsave-dumpxml",
|
||||||
|
.handler = cmdManagedSaveDumpxml,
|
||||||
|
.opts = opts_managed_save_dumpxml,
|
||||||
|
.info = info_managed_save_dumpxml,
|
||||||
|
.flags = 0
|
||||||
|
},
|
||||||
{.name = "managedsave-define",
|
{.name = "managedsave-define",
|
||||||
.handler = cmdManagedSaveDefine,
|
.handler = cmdManagedSaveDefine,
|
||||||
.opts = opts_managed_save_define,
|
.opts = opts_managed_save_define,
|
||||||
|
@ -1642,6 +1642,12 @@ running or paused state. Normally, this command does not alter the
|
|||||||
recorded state; passing either the I<--running> or I<--paused> flag
|
recorded state; passing either the I<--running> or I<--paused> flag
|
||||||
will allow overriding which state the B<start> should use.
|
will allow overriding which state the B<start> should use.
|
||||||
|
|
||||||
|
=item B<managedsave-dumpxml> I<domain> [I<--security-info>]
|
||||||
|
|
||||||
|
Extract the domain XML that was in effect at the time the saved state
|
||||||
|
file I<file> was created with the B<managedsave> command. Using
|
||||||
|
I<--security-info> will also include security sensitive information.
|
||||||
|
|
||||||
=item B<maxvcpus> [I<type>]
|
=item B<maxvcpus> [I<type>]
|
||||||
|
|
||||||
Provide the maximum number of virtual CPUs supported for a guest VM on
|
Provide the maximum number of virtual CPUs supported for a guest VM on
|
||||||
|
Loading…
Reference in New Issue
Block a user