[libvirt] [PATCH 07/25] qemu: blockjob: Add string convertors for blockjob type and state enums

Ján Tomko jtomko at redhat.com
Mon Jul 15 13:29:29 UTC 2019


On Fri, Jul 12, 2019 at 06:05:48PM +0200, Peter Krempa wrote:
>Later on we'll format these values into the status XML so the from/to
>string functions will come handy. The implementation also notes that
>these will be used in the status XML to avoid somebody changing the
>values.
>
>Signed-off-by: Peter Krempa <pkrempa at redhat.com>
>---
> src/qemu/qemu_blockjob.c | 9 +++++++++
> src/qemu/qemu_blockjob.h | 4 ++++
> 2 files changed, 13 insertions(+)
>
>diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c
>index 8cbfc556b3..bba1b9d656 100644
>--- a/src/qemu/qemu_blockjob.c
>+++ b/src/qemu/qemu_blockjob.c
>@@ -43,6 +43,15 @@
>
> VIR_LOG_INIT("qemu.qemu_blockjob");
>
>+/* Note that qemuBlockjobState and qemuBlockjobType values are formatted into
>+ * the status XML */
>+VIR_ENUM_IMPL(qemuBlockjobState,
>+              QEMU_BLOCKJOB_STATE_LAST,
>+              "completed", "failed", "cancelled", "ready", "new", "running");

I see we're committing to the british spelling of cancelled.

Splitting this to have just one entry per line would look better.

>+
>+VIR_ENUM_IMPL(qemuBlockjob,
>+              QEMU_BLOCKJOB_TYPE_LAST,
>+              "", "pull", "copy", "commit", "active-commit", "");
>
> static virClassPtr qemuBlockJobDataClass;
>

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190715/ad1300ef/attachment-0001.sig>


More information about the libvir-list mailing list