3 Commits

Author SHA1 Message Date
Nir Soffer
186e0057f2 qemu_nbd: Select cache and aio automatically
Previously we use --cache=writeback and --aio=threads so we can access
images on file system that does not support direct I/O. This is
sometimes faster than --cache=none and --aio=native, but typically give
less consistent results, and pollute the page cache with image data,
which is mostly likely will never be used.

When uploading and downloading images on a hypervisor, using the page
cache can be harmful and cause sanlock timeouts when the kernel try to
flush huge images to the underlying storage.

Future qemu-img and qemu-nbd are expected to implement "auto" cache and
aio modes, selecting --cache=none and --aio=native if possible. This
change implements this in our qemu_nbd wrapper so we can use this now
with current qemu version.

When starting qemu_nbd.Server(), if cache was not specified, we select
cache="none" if the image can be opened with direct I/O. If aio was not
specified, we select it based on the cache value.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
2022-03-13 16:34:23 +02:00
Nir Soffer
c12ae66be2 handlers: Gather request handlers in handlers package
Keep the http request handler modules in a special package. This makes
it easier to understand the structure of the program and free names
in the _internal package namespace that will be useful for cleaning up
the backends package.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
2022-01-19 13:51:28 +01:00
Nir Soffer
3fc44d98fc pypi: Eliminate the daemon directory
This make it easier to work with the project and to improve packaging.
For example, README.md is now at the expected location, so it is
packaged automatically for pypi.

Change-Id: Ib1a456054de34146bf2a4f39a69ccf1756b99e41
Signed-off-by: Nir Soffer <nsoffer@redhat.com>
2021-10-21 19:39:45 +03:00