qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] da888d: block/raw-posix: detect readonly Linu


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] da888d: block/raw-posix: detect readonly Linux block devic...
Date: Tue, 12 Feb 2013 15:30:20 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: da888d37b0b85fc23e4ea55ab8b0c482d4918afb
      
https://github.com/qemu/qemu/commit/da888d37b0b85fc23e4ea55ab8b0c482d4918afb
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2013-02-12 (Tue, 12 Feb 2013)

  Changed paths:
    M block/raw-posix.c

  Log Message:
  -----------
  block/raw-posix: detect readonly Linux block devices using BLKROGET

Linux block devices can be set read-only with "blockdev --setro
<device>".  The same thing can be done for LVM volumes using "lvchange
--permission r <volume>".  This read-only setting is independent of
device node permissions.  Therefore the device can still be opened
O_RDWR but actual writes will fail.

This results in odd behavior for QEMU.  bdrv_open() is supposed to fail
if a read-only image is being opened with BDRV_O_RDWR.  By not failing
for Linux block devices, the guest boots up but every write produces an
I/O error.

This patch checks whether the block device is read-only so that Linux
block devices behave like regular files.

Reported-by: Sibiao Luo <address@hidden>
Suggested-by: Paolo Bonzini <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>


  Commit: 33ccf6675faa3c56f30399e184064fd126904515
      
https://github.com/qemu/qemu/commit/33ccf6675faa3c56f30399e184064fd126904515
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2013-02-12 (Tue, 12 Feb 2013)

  Changed paths:
    M block/vpc.c

  Log Message:
  -----------
  Revert "block/vpc: Fix size calculation"

This reverts commit f880defbb06708d30a38ce9f2667067626acdd38.

Jeff Cody's testing revealed that the interpretation of size differs
even between VirtualPC and HyperV.  Revert this so there is time to
consider the impact of any backwards incompatible behavior this change
creates.

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


  Commit: 30d940875dcd1adfbfd7fe7ccd3e543408519662
      
https://github.com/qemu/qemu/commit/30d940875dcd1adfbfd7fe7ccd3e543408519662
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2013-02-12 (Tue, 12 Feb 2013)

  Changed paths:
    M trace/simple.c

  Log Message:
  -----------
  trace: use glib atomic int types

Juan reported that RHEL 6.4 hosts give compiler warnings because we use
unsigned int while glib prototypes use volatile gint in trace/simple.c.

  trace/simple.c:223: error: pointer targets in passing argument 1 of 
'g_atomic_int_compare_and_exchange' differ in signedness

These variables are only accessed with glib atomic int functions so
let's play it by the book and use volatile gint.

Reported-by: Juan Quintela <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
Message-id: address@hidden
Signed-off-by: Anthony Liguori <address@hidden>


  Commit: 4a0e6714b06453078e02029e1432fab052927691
      
https://github.com/qemu/qemu/commit/4a0e6714b06453078e02029e1432fab052927691
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2013-02-12 (Tue, 12 Feb 2013)

  Changed paths:
    M trace/simple.c

  Log Message:
  -----------
  trace: deal with deprecated glib thread functions

g_thread_create() was deprecated in favor of g_thread_new() and
g_cond_new() was deprecated in favor of GCond initialization.  If the
host has glib 2.31 or newer, avoid using the deprecated functions.

This patch solves compiler warnings that are generated when glib's
deprecated functions are used.

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


  Commit: ad55ab42d494c5f4ebc5199c5c9db473b7d5fbf9
      
https://github.com/qemu/qemu/commit/ad55ab42d494c5f4ebc5199c5c9db473b7d5fbf9
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2013-02-12 (Tue, 12 Feb 2013)

  Changed paths:
    M include/migration/qemu-file.h
    M savevm.c

  Log Message:
  -----------
  migration: make qemu_ftell() public and support writable files

Migration .save_live_iterate() functions return the number of bytes
transferred.  The easiest way of doing this is by calling qemu_ftell(f)
at the beginning and end of the function to calculate the difference.

Make qemu_ftell() public so that block-migration will be able to use it.
Also adjust the ftell calculation for writable files where buf_offset
does not include buf_size.

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Message-id: address@hidden
Signed-off-by: Anthony Liguori <address@hidden>


  Commit: 6aaa9dae8059633d52ddcd0622de1a2700fc58a8
      
https://github.com/qemu/qemu/commit/6aaa9dae8059633d52ddcd0622de1a2700fc58a8
  Author: Stefan Hajnoczi <address@hidden>
  Date:   2013-02-12 (Tue, 12 Feb 2013)

  Changed paths:
    M block-migration.c

  Log Message:
  -----------
  block-migration: fix pending() and iterate() return values

The return value of .save_live_pending() is the number of bytes
remaining.  This is just an estimate because we do not know how many
blocks will be dirtied by the running guest.

Currently our return value for .save_live_pending() is wrong because it
includes dirty blocks but not in-flight bdrv_aio_readv() requests or
unsent blocks.  Crucially, it also doesn't include the bulk phase where
the entire device is transferred - therefore we risk completing block
migration before all blocks have been transferred!

The return value of .save_live_iterate() is the number of bytes
transferred this iteration.  Currently we return whether there are bytes
remaining, which is incorrect.

Move the bytes remaining calculation into .save_live_pending() and
really return the number of bytes transferred this iteration in
.save_live_iterate().

Also fix the %ld format specifier which was used for a uint64_t
argument.  PRIu64 must be use to avoid warnings on 32-bit hosts.

Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Juan Quintela <address@hidden>
Message-id: address@hidden
Signed-off-by: Anthony Liguori <address@hidden>


  Commit: 0231ed4f22dd67844d8bbc027eaa5b713cb25ba2
      
https://github.com/qemu/qemu/commit/0231ed4f22dd67844d8bbc027eaa5b713cb25ba2
  Author: Anthony Liguori <address@hidden>
  Date:   2013-02-12 (Tue, 12 Feb 2013)

  Changed paths:
    M block/raw-posix.c
    M block/vpc.c

  Log Message:
  -----------
  Merge remote-tracking branch 'stefanha/block' into staging

* stefanha/block:
  Revert "block/vpc: Fix size calculation"
  block/raw-posix: detect readonly Linux block devices using BLKROGET


Compare: https://github.com/qemu/qemu/compare/03ec2f83087d...0231ed4f22dd

reply via email to

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