Commit 09fa35e5 authored by Anthony Liguori's avatar Anthony Liguori
Browse files

Merge remote branch 'kwolf/for-anthony' into staging

parents 9233da78 b76876e6
Loading
Loading
Loading
Loading
+5 −9
Original line number Diff line number Diff line
@@ -146,8 +146,7 @@ static int bmds_aio_inflight(BlkMigDevState *bmds, int64_t sector)
{
    int64_t chunk = sector / (int64_t)BDRV_SECTORS_PER_DIRTY_CHUNK;

    if (bmds->aio_bitmap &&
        (sector << BDRV_SECTOR_BITS) < bdrv_getlength(bmds->bs)) {
    if ((sector << BDRV_SECTOR_BITS) < bdrv_getlength(bmds->bs)) {
        return !!(bmds->aio_bitmap[chunk / (sizeof(unsigned long) * 8)] &
            (1UL << (chunk % (sizeof(unsigned long) * 8))));
    } else {
@@ -169,14 +168,10 @@ static void bmds_set_aio_inflight(BlkMigDevState *bmds, int64_t sector_num,
        bit = start % (sizeof(unsigned long) * 8);
        val = bmds->aio_bitmap[idx];
        if (set) {
            if (!(val & (1UL << bit))) {
            val |= 1UL << bit;
            }
        } else {
            if (val & (1UL << bit)) {
            val &= ~(1UL << bit);
        }
        }
        bmds->aio_bitmap[idx] = val;
    }
}
@@ -385,8 +380,9 @@ static int mig_save_device_dirty(Monitor *mon, QEMUFile *f,
    int nr_sectors;

    for (sector = bmds->cur_dirty; sector < bmds->total_sectors;) {
        if (bmds_aio_inflight(bmds, sector))
        if (bmds_aio_inflight(bmds, sector)) {
            qemu_aio_flush();
        }
        if (bdrv_get_dirty(bmds->bs, sector)) {

            if (total_sectors - sector < BDRV_SECTORS_PER_DIRTY_CHUNK) {
+0 −1
Original line number Diff line number Diff line
@@ -54,7 +54,6 @@ typedef struct QCowHeader {
#define L2_CACHE_SIZE 16

typedef struct BDRVQcowState {
    BlockDriverState *hd;
    int cluster_bits;
    int cluster_size;
    int cluster_sectors;
+0 −1
Original line number Diff line number Diff line
@@ -79,7 +79,6 @@ typedef struct QCowSnapshot {
} QCowSnapshot;

typedef struct BDRVQcowState {
    BlockDriverState *hd;
    int cluster_bits;
    int cluster_size;
    int cluster_sectors;
+1 −1
Original line number Diff line number Diff line
@@ -463,7 +463,7 @@ static int raw_pwrite(BlockDriverState *bs, int64_t offset,
                count -= ret;
                sum += ret;
            }
            /* here, count < 512 because (count & ~sector_mask) == 0 */
            /* here, count < sector_size because (count & ~sector_mask) == 0 */
            if (count) {
                ret = raw_pread_aligned(bs, offset, s->aligned_buf,
                                     bs->buffer_alignment);
+0 −1
Original line number Diff line number Diff line
@@ -186,7 +186,6 @@ typedef struct {
} VdiHeader;

typedef struct {
    BlockDriverState *hd;
    /* The block map entries are little endian (even in memory). */
    uint32_t *bmap;
    /* Size of block (bytes). */
Loading