- 22 12月, 2011 5 次提交
-
-
由 Paolo Bonzini 提交于
This patch sets up the fd handler in nbd.c instead of qemu-nbd.c. It introduces NBDClient, which wraps the arguments to nbd_trip in a single structure, so that we can add a notifier to it. This way, qemu-nbd can know about disconnections. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Paolo Bonzini 提交于
Using a single main loop for sockets will help yielding from the socket coroutine back to the main loop, and later reentering it. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Paolo Bonzini 提交于
Wrap the common parameters of nbd_trip and nbd_negotiate in a single opaque struct. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Paolo Bonzini 提交于
The size of the buffer is in practice part of the protocol. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
由 Paolo Bonzini 提交于
The argument is write-only. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
-
- 11 11月, 2011 6 次提交
-
-
由 Paolo Bonzini 提交于
This is cleaner, because we do not need to close the block device when there is an error opening /dev/nbdX. It was done this way only to print errors before daemonizing. At the same time, use atexit to ensure that the block device is closed whenever we exit. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
由 Paolo Bonzini 提交于
Now that the client and server are in the same process, there is no need to race on the creation of the socket. We can open the listening socket before starting the client thread. This avoids that "qemu-nbd -v -c" prints this once before connecting successfully to the socket: connect(unix:/var/lock/qemu-nbd-nbd0): No such file or directory Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
由 Paolo Bonzini 提交于
In order to get nice error messages, keep the qemu-nbd process running until before issuing NBD_DO_IT and connected to the daemon with a pipe. This lets the qemu-nbd process relay error messages from the daemon and exit with a nonzero status if appropriate. Suggested-by: NKevin Wolf <kwolf@redhat.com> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
由 Paolo Bonzini 提交于
This avoids that qemu-nbd uses both forking and threads, which do not behave well together. qemu-nbd is already Unix only, and there is no qemu_thread_join, so for now use pthreads. Since the parent and child no longer have separate file descriptors, we can open the NBD device before daemonizing, instead of checking with access(2) and restricting the open to the client only. Reported-by: NPierre Riteau <pierre.riteau@irisa.fr> Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
由 Paolo Bonzini 提交于
It will be moved to a global variable by the next patch, and it would conflict with the socket function. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
由 Paolo Bonzini 提交于
The client process right now uses SIGTERM to interrupt the server side. This does not affect the exit status of "qemu-nbd -v -c" because the server is a child process. This will change when both sides will be in the same process, and anyway cleaning up things nicely upon SIGTERM is good practice. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
- 19 9月, 2011 1 次提交
-
-
由 Paolo Bonzini 提交于
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. Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
- 09 9月, 2011 1 次提交
-
-
由 Stefan Weil 提交于
* qemu-common.h is not a system include file, so it should be included with "" instead of <>. Otherwise incremental builds might fail because only local include files are checked for changes. * linux-user/syscall.c included the file twice. Cc: Riku Voipio <riku.voipio@iki.fi> Cc: Jan Kiszka <jan.kiszka@siemens.com> Acked-by: NKevin Wolf <kwolf@redhat.com> Signed-off-by: NStefan Weil <weil@mail.berlios.de> Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
-
- 21 8月, 2011 1 次提交
-
-
由 Anthony Liguori 提交于
qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 14 6月, 2011 1 次提交
-
-
由 Alexandre Raymond 提交于
Changes since v1: create a wrapper function named qemu_daemon() in oslib-posix.c instead of putting the OS specific workaround in qemu-nbd.c directly. On OSX >= 10.5, daemon() is deprecated, resulting in the following warning: ----8<---- qemu-nbd.c: In function ‘main’: qemu-nbd.c:371: warning: ‘daemon’ is deprecated (declared at /usr/include/stdlib.h:289) ----8<---- The following trick, used in mDNSResponder, takes care of this warning: http://www.opensource.apple.com/source/mDNSResponder/mDNSResponder-258.18/mDNSPosix/PosixDaemon.c On OSX, it temporarily renames the daemon() function before including stdlib.h and declares it manually as an extern function. This way, the compiler does not see the declaration from stdlib.h and thus does not display the warning. Signed-off-by: NAlexandre Raymond <cerbere@gmail.com> Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: NAndreas Färber <andreas.faerber@web.de>
-
- 08 6月, 2011 1 次提交
-
-
由 Christoph Hellwig 提交于
Change BDRV_O_NOCACHE to only imply bypassing the host OS file cache, but no writeback semantics. All existing callers are changed to also specify BDRV_O_CACHE_WB to give them writeback semantics. Signed-off-by: NChristoph Hellwig <hch@lst.de> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
- 17 12月, 2010 1 次提交
-
-
由 Kevin Wolf 提交于
It's an indirect call to qemu_malloc, which never returns an error. Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
- 21 9月, 2010 2 次提交
-
-
由 Laurent Vivier 提交于
block/nbd.c: use default port number when none is specified qemu-nbd.c: use IANA-assigned port number: 10809 Signed-off-by: NLaurent Vivier <laurent@vivier.eu> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
由 Christoph Hellwig 提交于
Use qemu_blockalign for all allocations in the block layer. This allows increasing the required alignment, which is need to support O_DIRECT on devices with large block sizes. Signed-off-by: NChristoph Hellwig <hch@lst.de> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
- 04 9月, 2010 2 次提交
-
-
由 Jes Sorensen 提交于
Signed-off-by: NJes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
-
由 Jes Sorensen 提交于
Signed-off-by: NJes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
-
- 31 8月, 2010 1 次提交
-
-
由 Laurent Vivier 提交于
This patch allows to connect Qemu using NBD protocol to an nbd-server using named exports. For instance, if on the host "isoserver", in /etc/nbd-server/config, you have: [generic] [debian-500-ppc-netinst] exportname = /ISO/debian-500-powerpc-netinst.iso [Fedora-10-ppc-netinst] exportname = /ISO/Fedora-10-ppc-netinst.iso You can connect to it, using: qemu -cdrom nbd:isoserver:exportname=debian-500-ppc-netinst qemu -cdrom nbd:isoserver:exportname=Fedora-10-ppc-netinst NOTE: you need at least nbd-server 2.9.18 Signed-off-by: NLaurent Vivier <laurent@vivier.eu> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
- 17 5月, 2010 1 次提交
-
-
由 Ryota Ozaki 提交于
- use err(3) instead of errx(3) if errno is available to report why failed - let fail prior to daemon(3) if opening a nbd file is likely to fail after daemonizing to avoid silent failure exit - add missing 'ret = 1' when unix_socket_outgoing failed Signed-off-by: NRyota Ozaki <ozaki.ryota@gmail.com> Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
- 23 4月, 2010 1 次提交
-
-
由 Kevin Wolf 提交于
What is known today as bdrv_open2 becomes the new bdrv_open. All remaining callers of the old function are converted to the new one. In some places they even know the right format, so they should have used bdrv_open2 from the beginning. Signed-off-by: NKevin Wolf <kwolf@redhat.com>
-
- 27 3月, 2010 2 次提交
-
-
由 Ryota Ozaki 提交于
errx takes the exit status of a process as the first argument. Passing errno to it is wrong. Instead the patch lets errx take EXIT_FAILURE. Signed-off-by: NRyota Ozaki <ozaki.ryota@gmail.com> Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
-
由 Ryota Ozaki 提交于
bdrv_open may return -errno so we have to check if the return value is '< 0', not '== -1'. Signed-off-by: NRyota Ozaki <ozaki.ryota@gmail.com> Signed-off-by: NAurelien Jarno <aurelien@aurel32.net>
-
- 18 3月, 2010 1 次提交
-
-
由 Naphtali Sprei 提交于
Really use read-only flags for opening the file when asked for read-only Signed-off-by: NNaphtali Sprei <nsprei@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 27 1月, 2010 1 次提交
-
-
由 Herve Poussineau 提交于
Win32 suffers from a very big memory leak when dealing with SCSI devices. Each read/write request allocates memory with qemu_memalign (ie VirtualAlloc) but frees it with qemu_free (ie free). Pair all qemu_memalign() calls with qemu_vfree() to prevent such leaks. Signed-off-by: NHerve Poussineau <hpoussin@reactos.org> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 20 1月, 2010 1 次提交
-
-
由 Naphtali Sprei 提交于
Clean-up a little bit the RW related bits of BDRV_O_FLAGS. BDRV_O_RDONLY gone (and so is BDRV_O_ACCESS). Default value for bdrv_flags (0/zero) is READ-ONLY. Need to explicitly request READ-WRITE. Instead of using the field 'readonly' of the BlockDriverState struct for passing the request, pass the request in the flags parameter to the function. Signed-off-by: NNaphtali Sprei <nsprei@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 23 12月, 2009 2 次提交
-
-
由 Blue Swirl 提交于
Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
-
由 Blue Swirl 提交于
basename() needs #include <libgen.h>. No prototype for daemon() is available on Solaris, but link succeeds. Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
-
- 01 8月, 2009 1 次提交
-
-
由 Blue Swirl 提交于
Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
-
- 17 7月, 2009 1 次提交
-
-
由 Blue Swirl 提交于
Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
-
- 16 6月, 2009 1 次提交
-
-
由 Anthony Liguori 提交于
qemu-nbd.c:349: error: ignoring return value of 'daemon', declared with attribute warn_unused_result Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
-
- 06 2月, 2009 1 次提交
-
-
由 aliguori 提交于
Signed-off-by: NAvi Kivity <avi@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6531 c046a42c-6fe2-441c-8c8c-71466251a162
-
- 09 1月, 2009 1 次提交
-
-
由 aliguori 提交于
Rebased for qemu tree. Signed-off-by: Uri Lublin <uril@redhat.com> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6246 c046a42c-6fe2-441c-8c8c-71466251a162
-
- 05 1月, 2009 1 次提交
-
-
由 aurel32 提交于
The attached patch updates the FSF address in the GPL/LGPL boilerplate in most GPL/LGPLed files, and also in COPYING.LIB. Signed-off-by: NStuart Brady <stuart.brady@gmail.com> Signed-off-by: NAurelien Jarno <aurelien@aurel32.net> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6162 c046a42c-6fe2-441c-8c8c-71466251a162
-
- 26 10月, 2008 1 次提交
-
-
由 blueswir1 提交于
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5539 c046a42c-6fe2-441c-8c8c-71466251a162
-
- 14 10月, 2008 1 次提交
-
-
由 aliguori 提交于
This patch changes the cache= option to accept none, writeback, or writethough to control the host page cache behavior. By default, writethrough caching is now used which internally is implemented by using O_DSYNC to open the disk images. When using -snapshot, writeback is used by default since data integrity it not at all an issue. cache=none has the same behavior as cache=off previously. The later syntax is still supported by now deprecated. I also cleaned up the O_DIRECT implementation to avoid many of the #ifdefs. Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5485 c046a42c-6fe2-441c-8c8c-71466251a162
-
- 10 9月, 2008 1 次提交
-
-
由 aliguori 提交于
This patch removes "BlockDriverState *bs" from nbd_negotiate() because it is not used. Signed-off-by: NLaurent Vivier <Laurent.Vivier@bull.fr> Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com> git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5186 c046a42c-6fe2-441c-8c8c-71466251a162
-