qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] b47c7d: dmg: Fixing wrong dmg block type valu


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] b47c7d: dmg: Fixing wrong dmg block type value for block t...
Date: Fri, 04 Jan 2019 06:28:48 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: b47c7d53252d46811c555bc08aeb9918fd7dbd24
      
https://github.com/qemu/qemu/commit/b47c7d53252d46811c555bc08aeb9918fd7dbd24
  Author: Julio Faracco <address@hidden>
  Date:   2019-01-04 (Fri, 04 Jan 2019)

  Changed paths:
    M block/dmg.c

  Log Message:
  -----------
  dmg: Fixing wrong dmg block type value for block terminator.

This is a trivial patch to fix a wrong value for block terminator.
The old value was 0x7fffffff which is wrong. It was not affecting the
code because QEMU dmg block is not handling block terminator right now.
Neverthless, it should be fixed.

Signed-off-by: Julio Faracco <address@hidden>
Reviewed-by: yuchenlin <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 5ef40828baafc27dc3e52320c3125f2bd3f44886
      
https://github.com/qemu/qemu/commit/5ef40828baafc27dc3e52320c3125f2bd3f44886
  Author: yuchenlin <address@hidden>
  Date:   2019-01-04 (Fri, 04 Jan 2019)

  Changed paths:
    M block/dmg.c

  Log Message:
  -----------
  dmg: fix binary search

There is a possible hang in original binary search implementation. That is
if chunk1 = 4, chunk2 = 5, chunk3 = 4, and we go else case.

The chunk1 will be still 4, and so on.

Signed-off-by: yuchenlin <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: e80fcf590e5612c901f7f16b6907ece18e7933df
      
https://github.com/qemu/qemu/commit/e80fcf590e5612c901f7f16b6907ece18e7933df
  Author: yuchenlin <address@hidden>
  Date:   2019-01-04 (Fri, 04 Jan 2019)

  Changed paths:
    M block/dmg.c

  Log Message:
  -----------
  dmg: use enumeration type instead of hard coding number

Signed-off-by: yuchenlin <address@hidden>
Reviewed-by: Julio Faracco <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 39a0408e768cd00142f5b57d27ab234282bf4df5
      
https://github.com/qemu/qemu/commit/39a0408e768cd00142f5b57d27ab234282bf4df5
  Author: yuchenlin <address@hidden>
  Date:   2019-01-04 (Fri, 04 Jan 2019)

  Changed paths:
    M block/dmg.c

  Log Message:
  -----------
  dmg: don't skip zero chunk

The dmg file has many tables which describe: "start from sector XXX to
sector XXX, the compression method is XXX and where the compressed data
resides on".

Each sector in the expanded file should be covered by a table. The table
will describe the offset of compressed data (or raw depends on the type)
in the dmg.

For example:

[-----------The expanded file------------]
[---bzip table ---]/* zeros */[---zlib---]
    ^
    | if we want to read this sector.

we will find bzip table which contains this sector, and get the
compressed data offset, read it from dmg, uncompress it, finally write to
expanded file.

If we skip zero chunk (table), some sector cannot find the table which
will cause search_chunk() return s->n_chunks, dmg_read_chunk() return -1
and finally causing dmg_co_preadv() return EIO.

See:

[-----------The expanded file------------]
[---bzip table ---]/* zeros */[---zlib---]
              ^
              | if we want to read this sector.

Oops, we cannot find the table contains it...

In the original implementation, we don't have zero table. When we try to
read sector inside the zero chunk. We will get EIO, and skip reading.

After this patch, we treat zero chunk the same as ignore chunk, it will
directly write zero and avoid some sector may not find the table.

After this patch:

[-----------The expanded file------------]
[---bzip table ---][--zeros--][---zlib---]

Signed-off-by: yuchenlin <address@hidden>
Reviewed-by: Julio Faracco <address@hidden>
Reviewed-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>


  Commit: 6395fe0c2c7d9f336d87960a7c9924b630c57c91
      
https://github.com/qemu/qemu/commit/6395fe0c2c7d9f336d87960a7c9924b630c57c91
  Author: Peter Maydell <address@hidden>
  Date:   2019-01-04 (Fri, 04 Jan 2019)

  Changed paths:
    M block/dmg.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/stefanha/tags/block-pull-request' into 
staging

Pull request

Bug fixes for the .dmg image file format.

# gpg: Signature made Fri 04 Jan 2019 11:21:18 GMT
# gpg:                using RSA key 9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <address@hidden>"
# gpg:                 aka "Stefan Hajnoczi <address@hidden>"
# Primary key fingerprint: 8695 A8BF D3F9 7CDA AC35  775A 9CA4 ABB3 81AB 73C8

* remotes/stefanha/tags/block-pull-request:
  dmg: don't skip zero chunk
  dmg: use enumeration type instead of hard coding number
  dmg: fix binary search
  dmg: Fixing wrong dmg block type value for block terminator.

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/8ecede468190...6395fe0c2c7d
      **NOTE:** This service has been marked for deprecation: 
https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]