The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/5811

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Signed-off-by: Thomas Hipp <[email protected]>
From 9eb14d0c2393d3a3c8bd1bdd6818b26fae256ecd Mon Sep 17 00:00:00 2001
From: Thomas Hipp <[email protected]>
Date: Mon, 3 Jun 2019 18:08:14 +0200
Subject: [PATCH] lxd: Satisfy static analysis

Signed-off-by: Thomas Hipp <[email protected]>
---
 lxd/patches.go            | 8 ++++----
 lxd/proxy_device_utils.go | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lxd/patches.go b/lxd/patches.go
index 084bd11133..54bd9eaad5 100644
--- a/lxd/patches.go
+++ b/lxd/patches.go
@@ -498,7 +498,7 @@ func upgradeFromStorageTypeBtrfs(name string, d *Daemon, 
defaultPoolName string,
                return err
        }
 
-       poolID := int64(-1)
+       var poolID int64
        pools, err := d.cluster.StoragePools()
        if err == nil { // Already exist valid storage pools.
                // Check if the storage pool already has a db entry.
@@ -795,7 +795,7 @@ func upgradeFromStorageTypeDir(name string, d *Daemon, 
defaultPoolName string, d
                return err
        }
 
-       poolID := int64(-1)
+       var poolID int64
        pools, err := d.cluster.StoragePools()
        if err == nil { // Already exist valid storage pools.
                // Check if the storage pool already has a db entry.
@@ -1094,7 +1094,7 @@ func upgradeFromStorageTypeLvm(name string, d *Daemon, 
defaultPoolName string, d
        // Peek into the storage pool database to see whether any storage pools
        // are already configured. If so, we can assume that a partial upgrade
        // has been performed and can skip the next steps.
-       poolID := int64(-1)
+       var poolID int64
        pools, err := d.cluster.StoragePools()
        if err == nil { // Already exist valid storage pools.
                // Check if the storage pool already has a db entry.
@@ -1594,7 +1594,7 @@ func upgradeFromStorageTypeZfs(name string, d *Daemon, 
defaultPoolName string, d
        // Peek into the storage pool database to see whether any storage pools
        // are already configured. If so, we can assume that a partial upgrade
        // has been performed and can skip the next steps.
-       poolID := int64(-1)
+       var poolID int64
        pools, err := d.cluster.StoragePools()
        if err == nil { // Already exist valid storage pools.
                // Check if the storage pool already has a db entry.
diff --git a/lxd/proxy_device_utils.go b/lxd/proxy_device_utils.go
index 2d84f9a269..b4b2ba16dd 100644
--- a/lxd/proxy_device_utils.go
+++ b/lxd/proxy_device_utils.go
@@ -55,8 +55,8 @@ func setupProxyProcInfo(c container, device 
map[string]string) (*proxyProcInfo,
                return nil, fmt.Errorf("Proxy device doesn't support the 
listener type: %s", proto)
        }
 
-       listenPid := "-1"
-       connectPid := "-1"
+       var listenPid string
+       var connectPid string
 
        bindVal, exists := device["bind"]
        if !exists {
_______________________________________________
lxc-devel mailing list
[email protected]
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to