Re: [Qemu-devel] [PATCH 1/1] NBD isn't used by qemu-img, so don't link qemu-img against NBD objects
Jes Sorensen jes.soren...@redhat.com writes: On 11/22/10 16:20, Anthony Liguori wrote: On 11/22/2010 09:10 AM, Jes Sorensen wrote: On 11/22/10 16:08, Anthony Liguori wrote: On 11/22/2010 08:58 AM, Jes Sorensen wrote: Right, the right solution is probably to create a block driver list argument for configure, similar to what we have for the sound drivers. --block-drv-whitelist= Any idea what the difference is between 'whitelist' and 'list' in this context? Everything is built, but only the formats that are in the whitelist are usable. Kinda defeats the purpose IMHO. It would be useful to be able to strip out the formats one doesn't want to get a slimmed down binary. There are two different purposes here: 1. You want to remove support for a format from QEMU and all the tools. That's what you have in mind, I think. 2. You want to distinguish between good for production and not so good for production formats. That's what the whitelist is for. Formats need to be whitelisted to be usable with QEMU proper. Tools normally ignore the whitelist. Lets you attempt offline format conversion for non-whitelisted formats, which is useful. Both are legitimate, in my opinion.
Re: [Qemu-devel] [PATCH 1/1] NBD isn't used by qemu-img, so don't link qemu-img against NBD objects
Am 19.11.2010 17:30, schrieb jes.soren...@redhat.com: From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com You're compiling the nbd block driver out here. This is certainly not what you were attempting. (However, it's the only way to make it work, because otherwise qemu-img will need the top-level nbd.o) qemu-img -help before this change shows: Supported formats: raw cow qcow vdi vmdk cloop dmg bochs vpc vvfat qcow2 parallels nbd blkdebug sheepdog blkverify host_cdrom host_floppy host_device file tftp ftps ftp https http Afterwards: Supported formats: raw cow qcow vdi vmdk cloop dmg bochs vpc vvfat qcow2 parallels blkdebug sheepdog blkverify host_cdrom host_floppy host_device file tftp ftps ftp https http Kevin --- Makefile |2 +- Makefile.objs | 12 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 747e47c..a503c1c 100644 --- a/Makefile +++ b/Makefile @@ -154,7 +154,7 @@ qemu-img.o qemu-tool.o qemu-nbd.o qemu-io.o: $(GENERATED_HEADERS) qemu-img$(EXESUF): qemu-img.o qemu-tool.o qemu-error.o $(oslib-obj-y) $(trace-obj-y) $(block-obj-y) $(qobject-obj-y) $(version-obj-y) qemu-timer-common.o -qemu-nbd$(EXESUF): qemu-nbd.o qemu-tool.o qemu-error.o $(oslib-obj-y) $(trace-obj-y) $(block-obj-y) $(qobject-obj-y) $(version-obj-y) qemu-timer-common.o +qemu-nbd$(EXESUF): qemu-nbd.o qemu-tool.o qemu-error.o $(oslib-obj-y) $(trace-obj-y) $(block-obj-y) $(nbd-obj-y) $(qobject-obj-y) $(version-obj-y) qemu-timer-common.o qemu-io$(EXESUF): qemu-io.o cmd.o qemu-tool.o qemu-error.o $(oslib-obj-y) $(trace-obj-y) $(block-obj-y) $(qobject-obj-y) $(version-obj-y) qemu-timer-common.o diff --git a/Makefile.objs b/Makefile.objs index 23b17ce..5120e88 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -14,13 +14,13 @@ oslib-obj-$(CONFIG_POSIX) += oslib-posix.o # block-obj-y is code used by both qemu system emulation and qemu-img block-obj-y = cutils.o cache-utils.o qemu-malloc.o qemu-option.o module.o -block-obj-y += nbd.o block.o aio.o aes.o qemu-config.o +block-obj-y += block.o aio.o aes.o qemu-config.o block-obj-$(CONFIG_POSIX) += posix-aio-compat.o block-obj-$(CONFIG_LINUX_AIO) += linux-aio.o block-nested-y += raw.o cow.o qcow.o vdi.o vmdk.o cloop.o dmg.o bochs.o vpc.o vvfat.o block-nested-y += qcow2.o qcow2-refcount.o qcow2-cluster.o qcow2-snapshot.o -block-nested-y += parallels.o nbd.o blkdebug.o sheepdog.o blkverify.o +block-nested-y += parallels.o blkdebug.o sheepdog.o blkverify.o block-nested-$(CONFIG_WIN32) += raw-win32.o block-nested-$(CONFIG_POSIX) += raw-posix.o block-nested-$(CONFIG_CURL) += curl.o @@ -45,6 +45,13 @@ net-obj-y += $(addprefix net/, $(net-nested-y)) fsdev-nested-$(CONFIG_VIRTFS) = qemu-fsdev.o fsdev-obj-$(CONFIG_VIRTFS) += $(addprefix fsdev/, $(fsdev-nested-y)) +### +# nbd-obj-y is code used by both qemu and qemu-nbd + +nbd-obj-y = nbd.o +nbd-nested-y = nbd.o +nbd-obj-y += $(addprefix block/, $(nbd-nested-y)) + ## # libqemu_common.a: Target independent part of system emulation. The # long term path is to suppress *all* target specific code in case of @@ -53,6 +60,7 @@ fsdev-obj-$(CONFIG_VIRTFS) += $(addprefix fsdev/, $(fsdev-nested-y)) common-obj-y = $(block-obj-y) blockdev.o common-obj-y += $(net-obj-y) +common-obj-y += $(nbd-obj-y) common-obj-y += $(qobject-obj-y) common-obj-$(CONFIG_LINUX) += $(fsdev-obj-$(CONFIG_LINUX)) common-obj-y += readline.o console.o cursor.o async.o qemu-error.o
Re: [Qemu-devel] [PATCH 1/1] NBD isn't used by qemu-img, so don't link qemu-img against NBD objects
On 11/22/2010 08:38 AM, Kevin Wolf wrote: You're free to dislike NBD as much as you want. Just compiling it out unconditionally and calling it a cleanup is a bit too much. ;-) A configure option for disabling NBD sounds reasonable, though I'm not sure what you're trying to achieve with it. It doesn't have any external dependencies that you could avoid this way, does it? Using block format whitelisting should be enough to disable nbd. I don't see a need for an explicit --disable-nbd option. Regards, Anthony Liguori Kevin
Re: [Qemu-devel] [PATCH 1/1] NBD isn't used by qemu-img, so don't link qemu-img against NBD objects
On 11/22/10 15:54, Anthony Liguori wrote: On 11/22/2010 08:38 AM, Kevin Wolf wrote: You're free to dislike NBD as much as you want. Just compiling it out unconditionally and calling it a cleanup is a bit too much. ;-) A configure option for disabling NBD sounds reasonable, though I'm not sure what you're trying to achieve with it. It doesn't have any external dependencies that you could avoid this way, does it? Using block format whitelisting should be enough to disable nbd. I don't see a need for an explicit --disable-nbd option. Right, the right solution is probably to create a block driver list argument for configure, similar to what we have for the sound drivers. Ignore my patch. Cheers, Jes
Re: [Qemu-devel] [PATCH 1/1] NBD isn't used by qemu-img, so don't link qemu-img against NBD objects
On 11/22/2010 08:58 AM, Jes Sorensen wrote: On 11/22/10 15:54, Anthony Liguori wrote: On 11/22/2010 08:38 AM, Kevin Wolf wrote: You're free to dislike NBD as much as you want. Just compiling it out unconditionally and calling it a cleanup is a bit too much. ;-) A configure option for disabling NBD sounds reasonable, though I'm not sure what you're trying to achieve with it. It doesn't have any external dependencies that you could avoid this way, does it? Using block format whitelisting should be enough to disable nbd. I don't see a need for an explicit --disable-nbd option. Right, the right solution is probably to create a block driver list argument for configure, similar to what we have for the sound drivers. --block-drv-whitelist= Regards, Anthony Liguori Ignore my patch. Cheers, Jes
Re: [Qemu-devel] [PATCH 1/1] NBD isn't used by qemu-img, so don't link qemu-img against NBD objects
On 11/22/10 16:08, Anthony Liguori wrote: On 11/22/2010 08:58 AM, Jes Sorensen wrote: On 11/22/10 15:54, Anthony Liguori wrote: Using block format whitelisting should be enough to disable nbd. I don't see a need for an explicit --disable-nbd option. Right, the right solution is probably to create a block driver list argument for configure, similar to what we have for the sound drivers. --block-drv-whitelist= Any idea what the difference is between 'whitelist' and 'list' in this context? Jes
Re: [Qemu-devel] [PATCH 1/1] NBD isn't used by qemu-img, so don't link qemu-img against NBD objects
On 11/22/2010 09:10 AM, Jes Sorensen wrote: On 11/22/10 16:08, Anthony Liguori wrote: On 11/22/2010 08:58 AM, Jes Sorensen wrote: On 11/22/10 15:54, Anthony Liguori wrote: Using block format whitelisting should be enough to disable nbd. I don't see a need for an explicit --disable-nbd option. Right, the right solution is probably to create a block driver list argument for configure, similar to what we have for the sound drivers. --block-drv-whitelist= Any idea what the difference is between 'whitelist' and 'list' in this context? Everything is built, but only the formats that are in the whitelist are usable. Regards, Anthony Liguori Jes
Re: [Qemu-devel] [PATCH 1/1] NBD isn't used by qemu-img, so don't link qemu-img against NBD objects
On 11/22/10 16:20, Anthony Liguori wrote: On 11/22/2010 09:10 AM, Jes Sorensen wrote: On 11/22/10 16:08, Anthony Liguori wrote: On 11/22/2010 08:58 AM, Jes Sorensen wrote: Right, the right solution is probably to create a block driver list argument for configure, similar to what we have for the sound drivers. --block-drv-whitelist= Any idea what the difference is between 'whitelist' and 'list' in this context? Everything is built, but only the formats that are in the whitelist are usable. Kinda defeats the purpose IMHO. It would be useful to be able to strip out the formats one doesn't want to get a slimmed down binary. Cheers, Jes
Re: [Qemu-devel] [PATCH 1/1] NBD isn't used by qemu-img, so don't link qemu-img against NBD objects
On 11/20/10 19:31, Stefan Hajnoczi wrote: On Sat, Nov 20, 2010 at 6:04 PM, Andreas Färber andreas.faer...@web.de wrote: http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man3/daemon.3.html Deprecated in favor of using launchd. Removing qemu-nbd from the build because there is warning isn't a good strategy. You may not use qemu-io either but it is always built. That's important because otherwise it could bitrot, no one would notice, and one day qemu-tools wouldn't work on Mac OSX at all anymore. Instead we should fix the code that causes a warning. Is it cheating much to daemonize manually in qemu-nbd? ;) Maybe it would be feasible to write an os_daemonize() implementation based on launchd() on OSX?
Re: [Qemu-devel] [PATCH 1/1] NBD isn't used by qemu-img, so don't link qemu-img against NBD objects
On 11/20/10 18:22, Andreas Färber wrote: Am 19.11.2010 um 17:30 schrieb jes.soren...@redhat.com: From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- Makefile |2 +- Makefile.objs | 12 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) Tested-by: Andreas Färber andreas.faer...@web.de Looks good to me and a clean build works okay. Any plans for a way to disable NBD build completely? There are warnings about use of daemon() on Mac OS X and possibly Solaris, and there's little point in building qemu-nbd if one does not use it. I think it would be worth adding as an option, however letting it default to 'on' to make sure it gets at least build tested unless a user explicitly disables it. Cheers, Jes
Re: [Qemu-devel] [PATCH 1/1] NBD isn't used by qemu-img, so don't link qemu-img against NBD objects
Am 19.11.2010 um 17:30 schrieb jes.soren...@redhat.com: From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- Makefile |2 +- Makefile.objs | 12 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) Tested-by: Andreas Färber andreas.faer...@web.de Looks good to me and a clean build works okay. Any plans for a way to disable NBD build completely? There are warnings about use of daemon() on Mac OS X and possibly Solaris, and there's little point in building qemu-nbd if one does not use it. Andreas
Re: [Qemu-devel] [PATCH 1/1] NBD isn't used by qemu-img, so don't link qemu-img against NBD objects
On Sat, Nov 20, 2010 at 6:04 PM, Andreas Färber andreas.faer...@web.de wrote: Am 20.11.2010 um 18:39 schrieb Stefan Hajnoczi: On Sat, Nov 20, 2010 at 5:22 PM, Andreas Färber andreas.faer...@web.de wrote: Any plans for a way to disable NBD build completely? There are warnings about use of daemon() on Mac OS X and possibly Solaris, and there's little point in building qemu-nbd if one does not use it. daemon() could be replaced by sharing os_daemonize(). What is the warning message that you get? CC qemu-nbd.o /Users/andreas/QEMU/qemu/qemu-nbd.c: In function ‘main’: /Users/andreas/QEMU/qemu/qemu-nbd.c:364: warning: ‘daemon’ is deprecated (declared at /usr/include/stdlib.h:283) http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man3/daemon.3.html Deprecated in favor of using launchd. Removing qemu-nbd from the build because there is warning isn't a good strategy. You may not use qemu-io either but it is always built. That's important because otherwise it could bitrot, no one would notice, and one day qemu-tools wouldn't work on Mac OSX at all anymore. Instead we should fix the code that causes a warning. Is it cheating much to daemonize manually in qemu-nbd? ;) Stefan
[Qemu-devel] [PATCH 1/1] NBD isn't used by qemu-img, so don't link qemu-img against NBD objects
From: Jes Sorensen jes.soren...@redhat.com Signed-off-by: Jes Sorensen jes.soren...@redhat.com --- Makefile |2 +- Makefile.objs | 12 ++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 747e47c..a503c1c 100644 --- a/Makefile +++ b/Makefile @@ -154,7 +154,7 @@ qemu-img.o qemu-tool.o qemu-nbd.o qemu-io.o: $(GENERATED_HEADERS) qemu-img$(EXESUF): qemu-img.o qemu-tool.o qemu-error.o $(oslib-obj-y) $(trace-obj-y) $(block-obj-y) $(qobject-obj-y) $(version-obj-y) qemu-timer-common.o -qemu-nbd$(EXESUF): qemu-nbd.o qemu-tool.o qemu-error.o $(oslib-obj-y) $(trace-obj-y) $(block-obj-y) $(qobject-obj-y) $(version-obj-y) qemu-timer-common.o +qemu-nbd$(EXESUF): qemu-nbd.o qemu-tool.o qemu-error.o $(oslib-obj-y) $(trace-obj-y) $(block-obj-y) $(nbd-obj-y) $(qobject-obj-y) $(version-obj-y) qemu-timer-common.o qemu-io$(EXESUF): qemu-io.o cmd.o qemu-tool.o qemu-error.o $(oslib-obj-y) $(trace-obj-y) $(block-obj-y) $(qobject-obj-y) $(version-obj-y) qemu-timer-common.o diff --git a/Makefile.objs b/Makefile.objs index 23b17ce..5120e88 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -14,13 +14,13 @@ oslib-obj-$(CONFIG_POSIX) += oslib-posix.o # block-obj-y is code used by both qemu system emulation and qemu-img block-obj-y = cutils.o cache-utils.o qemu-malloc.o qemu-option.o module.o -block-obj-y += nbd.o block.o aio.o aes.o qemu-config.o +block-obj-y += block.o aio.o aes.o qemu-config.o block-obj-$(CONFIG_POSIX) += posix-aio-compat.o block-obj-$(CONFIG_LINUX_AIO) += linux-aio.o block-nested-y += raw.o cow.o qcow.o vdi.o vmdk.o cloop.o dmg.o bochs.o vpc.o vvfat.o block-nested-y += qcow2.o qcow2-refcount.o qcow2-cluster.o qcow2-snapshot.o -block-nested-y += parallels.o nbd.o blkdebug.o sheepdog.o blkverify.o +block-nested-y += parallels.o blkdebug.o sheepdog.o blkverify.o block-nested-$(CONFIG_WIN32) += raw-win32.o block-nested-$(CONFIG_POSIX) += raw-posix.o block-nested-$(CONFIG_CURL) += curl.o @@ -45,6 +45,13 @@ net-obj-y += $(addprefix net/, $(net-nested-y)) fsdev-nested-$(CONFIG_VIRTFS) = qemu-fsdev.o fsdev-obj-$(CONFIG_VIRTFS) += $(addprefix fsdev/, $(fsdev-nested-y)) +### +# nbd-obj-y is code used by both qemu and qemu-nbd + +nbd-obj-y = nbd.o +nbd-nested-y = nbd.o +nbd-obj-y += $(addprefix block/, $(nbd-nested-y)) + ## # libqemu_common.a: Target independent part of system emulation. The # long term path is to suppress *all* target specific code in case of @@ -53,6 +60,7 @@ fsdev-obj-$(CONFIG_VIRTFS) += $(addprefix fsdev/, $(fsdev-nested-y)) common-obj-y = $(block-obj-y) blockdev.o common-obj-y += $(net-obj-y) +common-obj-y += $(nbd-obj-y) common-obj-y += $(qobject-obj-y) common-obj-$(CONFIG_LINUX) += $(fsdev-obj-$(CONFIG_LINUX)) common-obj-y += readline.o console.o cursor.o async.o qemu-error.o -- 1.7.3.2