[PATCH 05/13] qemuBuildMachineCommandLine: Drop needless check

Michal Privoznik posted 13 patches 5 years, 7 months ago
[PATCH 05/13] qemuBuildMachineCommandLine: Drop needless check
Posted by Michal Privoznik 5 years, 7 months ago
The machine can not be NULL at this point -
qemuDomainDefPostParse() makes sure it isn't.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 src/qemu/qemu_command.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c
index 05e5c19118..c5b0ee231e 100644
--- a/src/qemu/qemu_command.c
+++ b/src/qemu/qemu_command.c
@@ -6722,13 +6722,6 @@ qemuBuildMachineCommandLine(virCommandPtr cmd,
     g_auto(virBuffer) buf = VIR_BUFFER_INITIALIZER;
     size_t i;
 
-    /* This should *never* be NULL, since we always provide
-     * a machine in the capabilities data for QEMU. So this
-     * check is just here as a safety in case the unexpected
-     * happens */
-    if (!def->os.machine)
-        return 0;
-
     virCommandAddArg(cmd, "-machine");
     virBufferAdd(&buf, def->os.machine, -1);
 
-- 
2.26.2

Re: [PATCH 05/13] qemuBuildMachineCommandLine: Drop needless check
Posted by Daniel Henrique Barboza 5 years, 7 months ago

On 6/24/20 10:49 AM, Michal Privoznik wrote:
> The machine can not be NULL at this point -
> qemuDomainDefPostParse() makes sure it isn't.
> 
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---


Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>