Skip to contentSkip to conversation

Tree broken by nbd: support feature negotiation commit.

Qemu-devel Brad 3 participants 6 messages Sep 21, 2011

lore
Share & tools
lore

Brad

author
#0 lore raw

The following commit..

nbd: support feature negotiation

nbd supports writing flags in bytes 24...27 of the header, and uses that for the read-only flag. Add support for it in qemu-nbd.

breaks the tree on what looks like anything but Linux.

Besides the obvious issue..

nbd.c:443: error: conflicting types for 'nbd_init' nbd.h:71: error: previous declaration of 'nbd_init' was here

The changing of #ifndef _WIN32 to #ifdef __linux__ in nbd.c also looks questionable to me.

Signature · 3 lines
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
#1 lore raw
Quoted 4 lines · Brad

Besides the obvious issue..

nbd.c:443: error: conflicting types for 'nbd_init' nbd.h:71: error: previous declaration of 'nbd_init' was here

Oops, thanks for pointing it out to me.

Quoted 2 lines

The changing of #ifndef _WIN32 to #ifdef __linux__ in nbd.c also looks questionable to me.

It is not portable code, and (unlike the rest of qemu-nbd and the block/nbd.c protocol) not meant to be portable. Are BLKROSET (defined in linux/fs.h) and the whole set of NBD ioctls available under OpenBSD?

Paolo

#2 lore raw

Am 21.09.2011 09:32, schrieb Paolo Bonzini:

Quoted 7 lines · Brad
Quoted 4 lines

Besides the obvious issue..

nbd.c:443: error: conflicting types for 'nbd_init' nbd.h:71: error: previous declaration of 'nbd_init' was here

Oops, thanks for pointing it out to me.

Can you please send a fix? I'll do another pull request today then.

And maybe I should really run a mingw build each time. Or get a BSD VM.

Kevin

author
#3 lore raw
In reply to Paolo Bonzini
Quoted 6 lines · Paolo Bonzini
Quoted 4 lines · Brad

Besides the obvious issue..

nbd.c:443: error: conflicting types for 'nbd_init' nbd.h:71: error: previous declaration of 'nbd_init' was here

Quoted 8 lines

Oops, thanks for pointing it out to me.

Quoted 2 lines

The changing of #ifndef _WIN32 to #ifdef __linux__ in nbd.c also looks questionable to me.

It is not portable code, and (unlike the rest of qemu-nbd and the block/nbd.c protocol) not meant to be portable. Are BLKROSET (defined in linux/fs.h) and the whole set of NBD ioctls available under OpenBSD?

Ok. What confused me a bit is that particular code path before your commit was being built on anything but Windows but is now Linux only. No we don't have BLKROSET. So am I to understand that even before this
particular commit that this code was only supported on Linux? I honestly
have no familiarity with NBD.

Signature · 3 lines
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
#4 lore raw
Quoted 8 lines · Brad
Quoted 3 lines

It is not portable code, and (unlike the rest of qemu-nbd and the block/nbd.c protocol) not meant to be portable. Are BLKROSET (defined in linux/fs.h) and the whole set of NBD ioctls available under OpenBSD?

Ok. What confused me a bit is that particular code path before your commit was being built on anything but Windows but is now Linux only. No we don't have BLKROSET. So am I to understand that even before this particular commit that this code was only supported on Linux?

Yes.

Here's a fix.

Paolo

----------------------- 8< -----------------------

From: Paolo Bonzini <[email protected]>
Date: Wed, 21 Sep 2011 09:34:12 +0200
Subject: [PATCH] nbd: fix non-Linux build failure

---
 nbd.c |   29 ++++++++++++-----------------
 1 files changed, 12 insertions(+), 17 deletions(-)
nbd.c +1 -1
index 595f4d8..9810f99 100644
@@ -437,7 +447,7 @@ int nbd_client(int fd)
     return ret;
 }
 #else
-int nbd_init(int fd, int csock, off_t size, size_t blocksize)
+int nbd_init(int fd, int csock, uint32_t flags, off_t size, size_t blocksize)
 {
     errno = ENOTSUP;
     return -1;
Signature · 1 line
1.7.6
author
#5 lore raw
Quoted 5 lines · Paolo Bonzini
Quoted 4 lines · Brad
Quoted 3 lines

It is not portable code, and (unlike the rest of qemu-nbd and the block/nbd.c protocol) not meant to be portable. Are BLKROSET (defined in linux/fs.h) and the whole set of NBD ioctls available under OpenBSD?

Quoted 8 lines
Quoted 4 lines

Ok. What confused me a bit is that particular code path before your commit was being built on anything but Windows but is now Linux only. No we don't have BLKROSET. So am I to understand that even before this particular commit that this code was only supported on Linux?

Yes.

Here's a fix.

Yes, this is what I also came up with to get the tree to build for me.

Quoted 26 lines

Paolo

----------------------- 8< -----------------------

From: Paolo Bonzini<[email protected]>
Date: Wed, 21 Sep 2011 09:34:12 +0200
Subject: [PATCH] nbd: fix non-Linux build failure

---
  nbd.c |   29 ++++++++++++-----------------
  1 files changed, 12 insertions(+), 17 deletions(-)
nbd.c +1 -1
index 595f4d8..9810f99 100644
@@ -437,7 +447,7 @@ int nbd_client(int fd)
      return ret;
  }
  #else
-int nbd_init(int fd, int csock, off_t size, size_t blocksize)
+int nbd_init(int fd, int csock, uint32_t flags, off_t size, size_t blocksize)
  {
      errno = ENOTSUP;
      return -1;
Signature · 3 lines
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.