<feed xmlns='http://www.w3.org/2005/Atom'>
<title>bwlp/qemu.git/block/vvfat.c, branch spice_video_codecs</title>
<subtitle>Experimental fork of QEMU with video encoding patches</subtitle>
<id>https://git.openslx.org/bwlp/qemu.git/atom/block/vvfat.c?h=spice_video_codecs</id>
<link rel='self' href='https://git.openslx.org/bwlp/qemu.git/atom/block/vvfat.c?h=spice_video_codecs'/>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/'/>
<updated>2022-10-31T20:37:58+00:00</updated>
<entry>
<title>block/vvfat: Unify the mkdir() call</title>
<updated>2022-10-31T20:37:58+00:00</updated>
<author>
<name>Bin Meng</name>
</author>
<published>2022-10-27T18:36:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=c2632994e93eee2f165113f1c78775b113f99926'/>
<id>urn:sha1:c2632994e93eee2f165113f1c78775b113f99926</id>
<content type='text'>
There is a difference in the mkdir() call for win32 and non-win32
platforms, and currently is handled in the codes with #ifdefs.

glib provides a portable g_mkdir() API and we can use it to unify
the codes without #ifdefs.

Signed-off-by: Bin Meng &lt;bin.meng@windriver.com&gt;
Reviewed-by: Marc-André Lureau &lt;marcandre.lureau@redhat.com&gt;
Signed-off-by: Alex Bennée &lt;alex.bennee@linaro.org&gt;
Reviewed-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
Reviewed-by: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
Message-Id: &lt;20221006151927.2079583-6-bmeng.cn@gmail.com&gt;
Message-Id: &lt;20221027183637.2772968-14-alex.bennee@linaro.org&gt;
</content>
</entry>
<entry>
<title>vvfat: allow spaces in file names</title>
<updated>2022-10-27T18:14:11+00:00</updated>
<author>
<name>Hervé Poussineau</name>
</author>
<published>2022-10-10T17:55:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=1e85c7259b7f5b5b7f9a360e2327b1baff723c79'/>
<id>urn:sha1:1e85c7259b7f5b5b7f9a360e2327b1baff723c79</id>
<content type='text'>
In R/W mode, files with spaces were never created on host side.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1176
Fixes: c79e243ed67683d6d06692bd7040f7394da178b0
Signed-off-by: Hervé Poussineau &lt;hpoussin@reactos.org&gt;
Reviewed-by: Philippe Mathieu-Daudé &lt;f4bug@amsat.org&gt;
Reviewed-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
Message-Id: &lt;20221010175511.3414357-3-hpoussin@reactos.org&gt;
Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
</content>
</entry>
<entry>
<title>vvfat: allow some writes to bootsector</title>
<updated>2022-10-27T18:14:11+00:00</updated>
<author>
<name>Hervé Poussineau</name>
</author>
<published>2022-10-10T17:55:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=d0f95b6ca0241b14d6cc0f366d162684909370a9'/>
<id>urn:sha1:d0f95b6ca0241b14d6cc0f366d162684909370a9</id>
<content type='text'>
'reserved1' field in bootsector is used to mark volume dirty, or need to verify.
Allow writes to bootsector which only changes the 'reserved1' field.

This fixes I/O errors on Windows guests.

Resolves: https://bugs.launchpad.net/qemu/+bug/1889421
Signed-off-by: Hervé Poussineau &lt;hpoussin@reactos.org&gt;
Message-Id: &lt;20221010175511.3414357-2-hpoussin@reactos.org&gt;
Reviewed-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
</content>
</entry>
<entry>
<title>block: Refactor get_tmp_filename()</title>
<updated>2022-10-27T18:13:32+00:00</updated>
<author>
<name>Bin Meng</name>
</author>
<published>2022-10-10T04:04:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=69fbfff95e849156985cf95e2010ffc8762e34e6'/>
<id>urn:sha1:69fbfff95e849156985cf95e2010ffc8762e34e6</id>
<content type='text'>
At present there are two callers of get_tmp_filename() and they are
inconsistent.

One does:

    /* TODO: extra byte is a hack to ensure MAX_PATH space on Windows. */
    char *tmp_filename = g_malloc0(PATH_MAX + 1);
    ...
    ret = get_tmp_filename(tmp_filename, PATH_MAX + 1);

while the other does:

    s-&gt;qcow_filename = g_malloc(PATH_MAX);
    ret = get_tmp_filename(s-&gt;qcow_filename, PATH_MAX);

As we can see different 'size' arguments are passed. There are also
platform specific implementations inside the function, and the use
of snprintf is really undesirable.

The function name is also misleading. It creates a temporary file,
not just a filename.

Refactor this routine by changing its name and signature to:

    char *create_tmp_file(Error **errp)

and use g_get_tmp_dir() / g_mkstemp() for a consistent implementation.

While we are here, add some comments to mention that /var/tmp is
preferred over /tmp on non-win32 hosts.

Signed-off-by: Bin Meng &lt;bin.meng@windriver.com&gt;
Message-Id: &lt;20221010040432.3380478-2-bin.meng@windriver.com&gt;
[kwolf: Fixed incorrect errno negation and iotest 051]
Reviewed-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
</content>
</entry>
<entry>
<title>block: Change bdrv_{pread,pwrite,pwrite_sync}() param order</title>
<updated>2022-07-12T10:14:55+00:00</updated>
<author>
<name>Alberto Faria</name>
</author>
<published>2022-06-09T15:27:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=32cc71def9e3885f9527af713e6d8dc7521ddc08'/>
<id>urn:sha1:32cc71def9e3885f9527af713e6d8dc7521ddc08</id>
<content type='text'>
Swap 'buf' and 'bytes' around for consistency with
bdrv_co_{pread,pwrite}(), and in preparation to implement these
functions using generated_co_wrapper.

Callers were updated using this Coccinelle script:

    @@ expression child, offset, buf, bytes, flags; @@
    - bdrv_pread(child, offset, buf, bytes, flags)
    + bdrv_pread(child, offset, bytes, buf, flags)

    @@ expression child, offset, buf, bytes, flags; @@
    - bdrv_pwrite(child, offset, buf, bytes, flags)
    + bdrv_pwrite(child, offset, bytes, buf, flags)

    @@ expression child, offset, buf, bytes, flags; @@
    - bdrv_pwrite_sync(child, offset, buf, bytes, flags)
    + bdrv_pwrite_sync(child, offset, bytes, buf, flags)

Resulting overly-long lines were then fixed by hand.

Signed-off-by: Alberto Faria &lt;afaria@redhat.com&gt;
Reviewed-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Reviewed-by: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
Reviewed-by: Vladimir Sementsov-Ogievskiy &lt;vsementsov@yandex-team.ru&gt;
Message-Id: &lt;20220609152744.3891847-3-afaria@redhat.com&gt;
Reviewed-by: Hanna Reitz &lt;hreitz@redhat.com&gt;
Signed-off-by: Hanna Reitz &lt;hreitz@redhat.com&gt;
</content>
</entry>
<entry>
<title>block: Add a 'flags' param to bdrv_{pread,pwrite,pwrite_sync}()</title>
<updated>2022-07-12T10:14:55+00:00</updated>
<author>
<name>Alberto Faria</name>
</author>
<published>2022-06-09T15:27:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=53fb7844f03241a0e6de2c342c9e1b89df12da4d'/>
<id>urn:sha1:53fb7844f03241a0e6de2c342c9e1b89df12da4d</id>
<content type='text'>
For consistency with other I/O functions, and in preparation to
implement them using generated_co_wrapper.

Callers were updated using this Coccinelle script:

    @@ expression child, offset, buf, bytes; @@
    - bdrv_pread(child, offset, buf, bytes)
    + bdrv_pread(child, offset, buf, bytes, 0)

    @@ expression child, offset, buf, bytes; @@
    - bdrv_pwrite(child, offset, buf, bytes)
    + bdrv_pwrite(child, offset, buf, bytes, 0)

    @@ expression child, offset, buf, bytes; @@
    - bdrv_pwrite_sync(child, offset, buf, bytes)
    + bdrv_pwrite_sync(child, offset, buf, bytes, 0)

Resulting overly-long lines were then fixed by hand.

Signed-off-by: Alberto Faria &lt;afaria@redhat.com&gt;
Reviewed-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Reviewed-by: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
Reviewed-by: Vladimir Sementsov-Ogievskiy &lt;vsementsov@yandex-team.ru&gt;
Message-Id: &lt;20220609152744.3891847-2-afaria@redhat.com&gt;
Reviewed-by: Hanna Reitz &lt;hreitz@redhat.com&gt;
Signed-off-by: Hanna Reitz &lt;hreitz@redhat.com&gt;
</content>
</entry>
<entry>
<title>vvfat: Fix vvfat_write() for writes before the root directory</title>
<updated>2022-01-14T11:03:16+00:00</updated>
<author>
<name>Kevin Wolf</name>
</author>
<published>2021-12-09T15:22:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=b9b8860d24676ec59c878d5206ea6bcfc87af798'/>
<id>urn:sha1:b9b8860d24676ec59c878d5206ea6bcfc87af798</id>
<content type='text'>
The calculation in sector2cluster() is done relative to the offset of
the root directory. Any writes to blocks before the start of the root
directory (in particular, writes to the FAT) result in negative values,
which are not handled correctly in vvfat_write().

This changes sector2cluster() to return a signed value, and makes sure
that vvfat_write() doesn't try to find mappings for negative cluster
number. It clarifies the code in vvfat_write() to make it more obvious
that the cluster numbers can be negative.

Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
Message-Id: &lt;20211209152231.23756-1-kwolf@redhat.com&gt;
Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
</content>
</entry>
<entry>
<title>vvfat: Fix size of temporary qcow file</title>
<updated>2022-01-14T11:03:16+00:00</updated>
<author>
<name>Kevin Wolf</name>
</author>
<published>2021-12-09T15:18:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=2db9b9e96f0b57ceaa49666d9b8a573290114fdf'/>
<id>urn:sha1:2db9b9e96f0b57ceaa49666d9b8a573290114fdf</id>
<content type='text'>
The size of the qcow size was calculated so that only the FAT partition
would fit on it, but not the whole disk. However, offsets relative to
the whole disk are used to access it, so increase its size to be large
enough for that.

Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
Message-Id: &lt;20211209151815.23495-1-kwolf@redhat.com&gt;
Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
</content>
</entry>
<entry>
<title>block/vvfat.c fix leak when failure occurs</title>
<updated>2021-11-23T14:39:12+00:00</updated>
<author>
<name>Daniella Lee</name>
</author>
<published>2021-11-19T11:25:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=22c36b75c8a07f34a6516a8d79f38c74530727a1'/>
<id>urn:sha1:22c36b75c8a07f34a6516a8d79f38c74530727a1</id>
<content type='text'>
Function vvfat_open called function enable_write_target and init_directories,
and these functions malloc new memory for BDRVVVFATState::qcow_filename,
BDRVVVFATState::used_clusters, and BDRVVVFATState::cluster_buff.

When the specified folder does not exist ,it may contains memory leak.
After init_directories function is executed, the vvfat_open return -EIO,
and bdrv_open_driver goto label open_failed,
the program use g_free(bs-&gt;opaque) to release BDRVVVFATState struct
without members mentioned.

command line:
qemu-system-x86_64 -hdb &lt;vdisk qcow file&gt;  -usb -device usb-storage,drive=fat16
-drive file=fat:rw:fat-type=16:"&lt;path of a host folder does not exist&gt;",
id=fat16,format=raw,if=none

enable_write_target called:
(gdb) bt
    at ../block/vvfat.c:3114
    flags=155650, errp=0x7fffffffd780) at ../block/vvfat.c:1236
    node_name=0x0, options=0x555556fa45d0, open_flags=155650,
    errp=0x7fffffffd890) at ../block.c:1558
    errp=0x7fffffffd890) at ../block.c:1852
    reference=0x0, options=0x555556fa45d0, flags=40962, parent=0x555556f98cd0,
    child_class=0x555556b1d6a0 &lt;child_of_bds&gt;, child_role=19,
    errp=0x7fffffffda90) at ../block.c:3779
    options=0x555556f9cfc0, bdref_key=0x555556239bb8 "file",
    parent=0x555556f98cd0, child_class=0x555556b1d6a0 &lt;child_of_bds&gt;,
    child_role=19, allow_none=true, errp=0x7fffffffda90) at ../block.c:3419
    reference=0x0, options=0x555556f9cfc0, flags=8194, parent=0x0,
    child_class=0x0, child_role=0, errp=0x555556c98c40 &lt;error_fatal&gt;)
    at ../block.c:3726
    options=0x555556f757b0, flags=0, errp=0x555556c98c40 &lt;error_fatal&gt;)
    at ../block.c:3872
    options=0x555556f757b0, flags=0, errp=0x555556c98c40 &lt;error_fatal&gt;)
    at ../block/block-backend.c:436
    bs_opts=0x555556f757b0, errp=0x555556c98c40 &lt;error_fatal&gt;)
    at ../blockdev.c:608
    errp=0x555556c98c40 &lt;error_fatal&gt;) at ../blockdev.c:992
......

Signed-off-by: Daniella Lee &lt;daniellalee111@gmail.com&gt;
Message-Id: &lt;20211119112553.352222-1-daniellalee111@gmail.com&gt;
[hreitz: Took commit message from v1]
Signed-off-by: Hanna Reitz &lt;hreitz@redhat.com&gt;
</content>
</entry>
<entry>
<title>block: use int64_t instead of uint64_t in driver write handlers</title>
<updated>2021-09-29T18:46:31+00:00</updated>
<author>
<name>Vladimir Sementsov-Ogievskiy</name>
</author>
<published>2021-09-03T10:28:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.openslx.org/bwlp/qemu.git/commit/?id=e75abedab7e10043ed81b1cbc3033409aff0159e'/>
<id>urn:sha1:e75abedab7e10043ed81b1cbc3033409aff0159e</id>
<content type='text'>
We are generally moving to int64_t for both offset and bytes parameters
on all io paths.

Main motivation is realization of 64-bit write_zeroes operation for
fast zeroing large disk chunks, up to the whole disk.

We chose signed type, to be consistent with off_t (which is signed) and
with possibility for signed return type (where negative value means
error).

So, convert driver write handlers parameters which are already 64bit to
signed type.

While being here, convert also flags parameter to be BdrvRequestFlags.

Now let's consider all callers. Simple

  git grep '\-&gt;bdrv_\(aio\|co\)_pwritev\(_part\)\?'

shows that's there three callers of driver function:

 bdrv_driver_pwritev() and bdrv_driver_pwritev_compressed() in
 block/io.c, both pass int64_t, checked by bdrv_check_qiov_request() to
 be non-negative.

 qcow2_save_vmstate() does bdrv_check_qiov_request().

Still, the functions may be called directly, not only by drv-&gt;...
Let's check:

git grep '\.bdrv_\(aio\|co\)_pwritev\(_part\)\?\s*=' | \
awk '{print $4}' | sed 's/,//' | sed 's/&amp;//' | sort | uniq | \
while read func; do git grep "$func(" | \
grep -v "$func(BlockDriverState"; done

shows several callers:

qcow2:
  qcow2_co_truncate() write at most up to @offset, which is checked in
    generic qcow2_co_truncate() by bdrv_check_request().
  qcow2_co_pwritev_compressed_task() pass the request (or part of the
    request) that already went through normal write path, so it should
    be OK

qcow:
  qcow_co_pwritev_compressed() pass int64_t, it's updated by this patch

quorum:
  quorum_co_pwrite_zeroes() pass int64_t and int - OK

throttle:
  throttle_co_pwritev_compressed() pass int64_t, it's updated by this
  patch

vmdk:
  vmdk_co_pwritev_compressed() pass int64_t, it's updated by this
  patch

Signed-off-by: Vladimir Sementsov-Ogievskiy &lt;vsementsov@virtuozzo.com&gt;
Message-Id: &lt;20210903102807.27127-5-vsementsov@virtuozzo.com&gt;
Reviewed-by: Eric Blake &lt;eblake@redhat.com&gt;
Signed-off-by: Eric Blake &lt;eblake@redhat.com&gt;
</content>
</entry>
</feed>
