Commit aa348082 authored by Aurelien Jarno's avatar Aurelien Jarno
Browse files

Merge branch 'for-anthony' of git://repo.or.cz/qemu/kevin

* 'for-anthony' of git://repo.or.cz/qemu/kevin:
  Remove obsolete 'enabled' variable from progress state
  Add dd-style SIGUSR1 progress reporting
  qed: Fix consistency check on 32-bit hosts
  ide/atapi: Introduce CHECK_READY flag for commands
  ide/atapi: Replace bdrv_get_geometry calls by s->nb_sectors
  ide/atapi: Use table instead of switch for commands
  ide/atapi: Factor commands out
  ide: Split atapi.c out
  Improve accuracy of block migration bandwidth calculation
  atapi: Add 'medium ready' to 'medium not ready' transition on cd change
  qemu-img: allow rebase to a NULL backing file when unsafe
parents c6a0487b df6e008a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -242,7 +242,7 @@ hw-obj-$(CONFIG_LAN9118) += lan9118.o
hw-obj-$(CONFIG_NE2000_ISA) += ne2000-isa.o

# IDE
hw-obj-$(CONFIG_IDE_CORE) += ide/core.o
hw-obj-$(CONFIG_IDE_CORE) += ide/core.o ide/atapi.o
hw-obj-$(CONFIG_IDE_QDEV) += ide/qdev.o
hw-obj-$(CONFIG_IDE_PCI) += ide/pci.o
hw-obj-$(CONFIG_IDE_ISA) += ide/isa.o
+11 −12
Original line number Diff line number Diff line
@@ -62,7 +62,6 @@ typedef struct BlkMigBlock {
    QEMUIOVector qiov;
    BlockDriverAIOCB *aiocb;
    int ret;
    int64_t time;
    QSIMPLEQ_ENTRY(BlkMigBlock) entry;
} BlkMigBlock;

@@ -78,6 +77,7 @@ typedef struct BlkMigState {
    int prev_progress;
    int bulk_completed;
    long double total_time;
    long double prev_time_offset;
    int reads;
} BlkMigState;

@@ -131,12 +131,6 @@ uint64_t blk_mig_bytes_total(void)
    return sum << BDRV_SECTOR_BITS;
}

static inline void add_avg_read_time(int64_t time)
{
    block_mig_state.reads++;
    block_mig_state.total_time += time;
}

static inline long double compute_read_bwidth(void)
{
    assert(block_mig_state.total_time != 0);
@@ -191,13 +185,14 @@ static void alloc_aio_bitmap(BlkMigDevState *bmds)

static void blk_mig_read_cb(void *opaque, int ret)
{
    long double curr_time = qemu_get_clock_ns(rt_clock);
    BlkMigBlock *blk = opaque;

    blk->ret = ret;

    blk->time = qemu_get_clock_ns(rt_clock) - blk->time;

    add_avg_read_time(blk->time);
    block_mig_state.reads++;
    block_mig_state.total_time += (curr_time - block_mig_state.prev_time_offset);
    block_mig_state.prev_time_offset = curr_time;

    QSIMPLEQ_INSERT_TAIL(&block_mig_state.blk_list, blk, entry);
    bmds_set_aio_inflight(blk->bmds, blk->sector, blk->nr_sectors, 0);
@@ -250,7 +245,9 @@ static int mig_save_device_bulk(Monitor *mon, QEMUFile *f,
    blk->iov.iov_len = nr_sectors * BDRV_SECTOR_SIZE;
    qemu_iovec_init_external(&blk->qiov, &blk->iov, 1);

    blk->time = qemu_get_clock_ns(rt_clock);
    if (block_mig_state.submitted == 0) {
        block_mig_state.prev_time_offset = qemu_get_clock_ns(rt_clock);
    }

    blk->aiocb = bdrv_aio_readv(bs, cur_sector, &blk->qiov,
                                nr_sectors, blk_mig_read_cb, blk);
@@ -409,7 +406,9 @@ static int mig_save_device_dirty(Monitor *mon, QEMUFile *f,
                blk->iov.iov_len = nr_sectors * BDRV_SECTOR_SIZE;
                qemu_iovec_init_external(&blk->qiov, &blk->iov, 1);

                blk->time = qemu_get_clock_ns(rt_clock);
                if (block_mig_state.submitted == 0) {
                    block_mig_state.prev_time_offset = qemu_get_clock_ns(rt_clock);
                }

                blk->aiocb = bdrv_aio_readv(bmds->bs, sector, &blk->qiov,
                                            nr_sectors, blk_mig_read_cb, blk);
+2 −2
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ typedef struct {
    BdrvCheckResult *result;
    bool fix;                           /* whether to fix invalid offsets */

    size_t nclusters;
    uint64_t nclusters;
    uint32_t *used_clusters;            /* referenced cluster bitmap */

    QEDRequest request;
@@ -177,7 +177,7 @@ static int qed_check_l1_table(QEDCheck *check, QEDTable *table)
static void qed_check_for_leaks(QEDCheck *check)
{
    BDRVQEDState *s = check->s;
    size_t i;
    uint64_t i;

    for (i = s->header.header_size; i < check->nclusters; i++) {
        if (!qed_test_bit(check->used_clusters, i)) {
+1 −1
Original line number Diff line number Diff line
@@ -252,7 +252,7 @@ static inline uint64_t qed_offset_into_cluster(BDRVQEDState *s, uint64_t offset)
    return offset & (s->header.cluster_size - 1);
}

static inline unsigned int qed_bytes_to_clusters(BDRVQEDState *s, size_t bytes)
static inline uint64_t qed_bytes_to_clusters(BDRVQEDState *s, uint64_t bytes)
{
    return qed_start_of_cluster(s, bytes + (s->header.cluster_size - 1)) /
           (s->header.cluster_size - 1);

hw/ide/atapi.c

0 → 100644
+1134 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading