[PATCH 03/13] qemuDomainBlockRebase: Replace ternary operator with if/else

Peter Krempa posted 13 patches 4 years, 2 months ago
[PATCH 03/13] qemuDomainBlockRebase: Replace ternary operator with if/else
Posted by Peter Krempa 4 years, 2 months ago
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/qemu/qemu_driver.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 9b5ff3a65c..40d11aced6 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -15292,8 +15292,10 @@ qemuDomainBlockRebase(virDomainPtr dom, const char *path, const char *base,

     /* If we got here, we are doing a block copy rebase. */
     dest = virStorageSourceNew();
-    dest->type = (flags & VIR_DOMAIN_BLOCK_REBASE_COPY_DEV) ?
-        VIR_STORAGE_TYPE_BLOCK : VIR_STORAGE_TYPE_FILE;
+    if (flags & VIR_DOMAIN_BLOCK_REBASE_COPY_DEV)
+        dest->type = VIR_STORAGE_TYPE_BLOCK;
+    else
+        dest->type = VIR_STORAGE_TYPE_FILE;
     dest->path = g_strdup(base);
     if (flags & VIR_DOMAIN_BLOCK_REBASE_COPY_RAW)
         dest->format = VIR_STORAGE_FILE_RAW;
-- 
2.26.2

Re: [PATCH 03/13] qemuDomainBlockRebase: Replace ternary operator with if/else
Posted by Ján Tomko 4 years, 2 months ago
On a Wednesday in 2020, Peter Krempa wrote:
>Signed-off-by: Peter Krempa <pkrempa@redhat.com>
>---
> src/qemu/qemu_driver.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>

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

Jano