]> git.proxmox.com Git - qemu.git/blobdiff - nbd.c
net: Fix VM start with '-net none'
[qemu.git] / nbd.c
diff --git a/nbd.c b/nbd.c
index 1586ea7553dcf7262afe9287870e3d5e9dbf6210..a9f295f2bbbc20e58802b1ed0d76420490537114 100644 (file)
--- a/nbd.c
+++ b/nbd.c
@@ -13,8 +13,7 @@
  *  GNU General Public License for more details.
  *
  *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA  02110-1301 USA
+ *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
 #include "nbd.h"
@@ -169,7 +168,8 @@ int tcp_socket_incoming(const char *address, uint16_t port)
     memcpy(&addr.sin_addr.s_addr, &in, sizeof(in));
 
     opt = 1;
-    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &opt, sizeof(opt)) == -1) {
+    if (setsockopt(s, SOL_SOCKET, SO_REUSEADDR,
+                   (const void *) &opt, sizeof(opt)) == -1) {
         goto error;
     }
 
@@ -353,8 +353,7 @@ int nbd_init(int fd, int csock, off_t size, size_t blocksize)
                return -1;
        }
 
-       TRACE("Setting size to %llu block(s)",
-             (unsigned long long)(size / blocksize));
+        TRACE("Setting size to %zd block(s)", (size_t)(size / blocksize));
 
        if (ioctl(fd, NBD_SET_SIZE_BLOCKS, size / blocksize) == -1) {
                int serrno = errno;