All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PULL 0/2] vvfat fixes for 2.6.0-rc4
@ 2016-04-29  9:55 Kevin Wolf
  2016-04-29  9:55 ` [Qemu-devel] [PULL 1/2] vvfat: Fix volume name assertion Kevin Wolf
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Kevin Wolf @ 2016-04-29  9:55 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, peter.maydell, qemu-devel

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(-)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PULL 1/2] vvfat: Fix volume name assertion
  2016-04-29  9:55 [Qemu-devel] [PULL 0/2] vvfat fixes for 2.6.0-rc4 Kevin Wolf
@ 2016-04-29  9:55 ` Kevin Wolf
  2016-04-29  9:55 ` [Qemu-devel] [PULL 2/2] vvfat: Fix default volume label Kevin Wolf
  2016-04-29 12:01 ` [Qemu-devel] [PULL 0/2] vvfat fixes for 2.6.0-rc4 Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Kevin Wolf @ 2016-04-29  9:55 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, peter.maydell, qemu-devel

Commit 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.

Cc: qemu-stable@nongnu.org
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 block/vvfat.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/block/vvfat.c b/block/vvfat.c
index 6b85314..ff3df35 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -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;
     }
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PULL 2/2] vvfat: Fix default volume label
  2016-04-29  9:55 [Qemu-devel] [PULL 0/2] vvfat fixes for 2.6.0-rc4 Kevin Wolf
  2016-04-29  9:55 ` [Qemu-devel] [PULL 1/2] vvfat: Fix volume name assertion Kevin Wolf
@ 2016-04-29  9:55 ` Kevin Wolf
  2016-04-29 12:01 ` [Qemu-devel] [PULL 0/2] vvfat fixes for 2.6.0-rc4 Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Kevin Wolf @ 2016-04-29  9:55 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, peter.maydell, qemu-devel

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.

Cc: qemu-stable@nongnu.org
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
---
 block/vvfat.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/block/vvfat.c b/block/vvfat.c
index ff3df35..183fc4f 100644
--- a/block/vvfat.c
+++ b/block/vvfat.c
@@ -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) {
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PULL 0/2] vvfat fixes for 2.6.0-rc4
  2016-04-29  9:55 [Qemu-devel] [PULL 0/2] vvfat fixes for 2.6.0-rc4 Kevin Wolf
  2016-04-29  9:55 ` [Qemu-devel] [PULL 1/2] vvfat: Fix volume name assertion Kevin Wolf
  2016-04-29  9:55 ` [Qemu-devel] [PULL 2/2] vvfat: Fix default volume label Kevin Wolf
@ 2016-04-29 12:01 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2016-04-29 12:01 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: Qemu-block, QEMU Developers

On 29 April 2016 at 10:55, Kevin Wolf <kwolf@redhat.com> wrote:
> 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(-)

Applied, thanks.

-- PMM

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-04-29 12:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-29  9:55 [Qemu-devel] [PULL 0/2] vvfat fixes for 2.6.0-rc4 Kevin Wolf
2016-04-29  9:55 ` [Qemu-devel] [PULL 1/2] vvfat: Fix volume name assertion Kevin Wolf
2016-04-29  9:55 ` [Qemu-devel] [PULL 2/2] vvfat: Fix default volume label Kevin Wolf
2016-04-29 12:01 ` [Qemu-devel] [PULL 0/2] vvfat fixes for 2.6.0-rc4 Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.