mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
virsh: Move 'virshDomainBlockJobToString' to virsh-util
The helper function is used in virshBlockJobInfo and also in the callbacks of cmdEvent. Upcoming patch is going to move out the event code into a helper so this needs to be in a shared place. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
bf9de8cb51
commit
c704d27d4a
@ -2614,25 +2614,6 @@ static const vshCmdOptDef opts_blockjob[] = {
|
||||
{.name = NULL}
|
||||
};
|
||||
|
||||
VIR_ENUM_DECL(virshDomainBlockJob);
|
||||
VIR_ENUM_IMPL(virshDomainBlockJob,
|
||||
VIR_DOMAIN_BLOCK_JOB_TYPE_LAST,
|
||||
N_("Unknown job"),
|
||||
N_("Block Pull"),
|
||||
N_("Block Copy"),
|
||||
N_("Block Commit"),
|
||||
N_("Active Block Commit"),
|
||||
N_("Backup"),
|
||||
);
|
||||
|
||||
static const char *
|
||||
virshDomainBlockJobToString(int type)
|
||||
{
|
||||
const char *str = virshDomainBlockJobTypeToString(type);
|
||||
return str ? _(str) : _("Unknown job");
|
||||
}
|
||||
|
||||
|
||||
static bool
|
||||
virshBlockJobInfo(vshControl *ctl,
|
||||
virDomainPtr dom,
|
||||
|
@ -418,3 +418,22 @@ virshDomainGetXML(vshControl *ctl,
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
VIR_ENUM_IMPL(virshDomainBlockJob,
|
||||
VIR_DOMAIN_BLOCK_JOB_TYPE_LAST,
|
||||
N_("Unknown job"),
|
||||
N_("Block Pull"),
|
||||
N_("Block Copy"),
|
||||
N_("Block Commit"),
|
||||
N_("Active Block Commit"),
|
||||
N_("Backup"),
|
||||
);
|
||||
|
||||
|
||||
const char *
|
||||
virshDomainBlockJobToString(int type)
|
||||
{
|
||||
const char *str = virshDomainBlockJobTypeToString(type);
|
||||
return str ? _(str) : _("Unknown job");
|
||||
}
|
||||
|
@ -151,3 +151,8 @@ virshDomainGetXML(vshControl *ctl,
|
||||
xmlXPathContextPtr *ctxt)
|
||||
ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(4)
|
||||
ATTRIBUTE_NONNULL(5) G_GNUC_WARN_UNUSED_RESULT;
|
||||
|
||||
VIR_ENUM_DECL(virshDomainBlockJob);
|
||||
|
||||
const char *
|
||||
virshDomainBlockJobToString(int type);
|
||||
|
Loading…
Reference in New Issue
Block a user