vvfat fixes for 2.6.0-rc4
[Qemu-devel] [PULL 1/2] vvfat: Fix volume name assertion
In reply to Kevin WolfCommit d5941dd made the volume name configurable, but it didn't consider that the rw code compares the volume name string to assert that the first directory entry is the volume name. This made vvfat crash in rw mode.
This fixes the assertion to compare with the configured volume name instead of a literal string.
--- block/vvfat.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
block/vvfat.c +6 -1
@@ -2283,12 +2283,17 @@ DLOG(fprintf(stderr, "commit_direntries for %s, parent_mapping_index %d\n", mapp factor * (old_cluster_count - new_cluster_count));for (c = first_cluster; !fat_eof (s, c); c =modified_fat_get (s, c)) { +direntry_t *first_direntry;void * direntry =array_get (&(s->directory), current_dir_index);int ret =vvfat_read (s->bs,cluster2sector (s, c), direntry, s->sectors_per_cluster);if (ret)return ret; -assert (!strncmp (s->directory.pointer,"QEMU" ,4 )); + +/* The first directory entry on the filesystem is the volume name */ + first_direntry = (direntry_t *) s->directory.pointer; +assert (!memcmp (first_direntry->name, s->volume_label,11 )); + current_dir_index += factor; }
Signature · 1 line
1.8.3.1
The following changes since commit 0d48dfedc5c2beb418ad4c08b78de14e794bb199:
slirp: fix guest network access with darwin host (2016-04-28 18:12:08 +0100)
are available in the git repository at:
git://repo.or.cz/qemu/kevin.git tags/for-upstream
for you to fetch changes up to d208c50d9dbf98c0eca337723cd6497653ceb743:
vvfat: Fix default volume label (2016-04-29 11:14:13 +0200)
----------------------------------------------------------------
vvfat fixes for 2.6.0-rc4
----------------------------------------------------------------
Kevin Wolf (2):
vvfat: Fix volume name assertion
vvfat: Fix default volume label
block/vvfat.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
[Qemu-devel] [PULL 2/2] vvfat: Fix default volume label
Commit d5941dd documented that it leaves the default volume name as it was ("QEMU VVFAT"), but it doesn't actually implement this. You get an empty name (eleven space characters) instead.
This fixes the implementation to apply the advertised default.
--- block/vvfat.c | 2 ++ 1 file changed, 2 insertions(+)
block/vvfat.c +2 -0
@@ -1109,6 +1109,8 @@ static int vvfat_open(BlockDriverState *bs, QDict *options, int flags, goto fail; }memcpy (s->volume_label, label, label_length); + }else { +memcpy (s->volume_label,"QEMU VVFAT" ,10 ); }if (floppy) {
Signature · 1 line
1.8.3.1
Peter Maydell
AppliedQuoted 15 lines · Kevin Wolf
The following changes since commit
0d48dfedc5c2beb418ad4c08b78de14e794bb199:slirp: fix guest network access with darwin host (2016-04-28 18:12:08 +0100)
are available in the git repository at:
git://repo.or.cz/qemu/kevin.gittags/for-upstreamfor you to fetch changes up to
d208c50d9dbf98c0eca337723cd6497653ceb743:vvfat: Fix default volume label (2016-04-29 11:14:13 +0200)
----------------------------------------------------------------
vvfat fixes for 2.6.0-rc4
Quoted 7 lines
----------------------------------------------------------------
Kevin Wolf (2):
vvfat: Fix volume name assertion
vvfat: Fix default volume labelblock/vvfat.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
Applied, thanks.
-- PMM