Commit 915308bc authored by Peter Maydell's avatar Peter Maydell
Browse files

Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging



Block layer patches for 2.11.0-rc3

# gpg: Signature made Wed 29 Nov 2017 15:25:13 GMT
# gpg:                using RSA key 0x7F09B272C88F2FD6
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>"
# Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6

* remotes/kevin/tags/for-upstream:
  block/nfs: fix nfs_client_open for filesize greater than 1TB
  blockjob: reimplement block_job_sleep_ns to allow cancellation
  blockjob: introduce block_job_do_yield
  blockjob: remove clock argument from block_job_sleep_ns
  block: Expect graph changes in bdrv_parent_drained_begin/end
  blockjob: Remove the job from the list earlier in block_job_unref()
  QAPI & interop: Clarify events emitted by 'block-job-cancel'
  qemu-options: Mention locking option of file driver
  docs: Add image locking subsection
  iotests: fix 075 and 078

Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parents 844496f3 5591c001
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -346,9 +346,9 @@ static bool coroutine_fn yield_and_check(BackupBlockJob *job)
        uint64_t delay_ns = ratelimit_calculate_delay(&job->limit,
                                                      job->bytes_read);
        job->bytes_read = 0;
        block_job_sleep_ns(&job->common, QEMU_CLOCK_REALTIME, delay_ns);
        block_job_sleep_ns(&job->common, delay_ns);
    } else {
        block_job_sleep_ns(&job->common, QEMU_CLOCK_REALTIME, 0);
        block_job_sleep_ns(&job->common, 0);
    }

    if (block_job_is_cancelled(&job->common)) {
+1 −1
Original line number Diff line number Diff line
@@ -174,7 +174,7 @@ static void coroutine_fn commit_run(void *opaque)
        /* Note that even when no rate limit is applied we need to yield
         * with no pending I/O here so that bdrv_drain_all() returns.
         */
        block_job_sleep_ns(&s->common, QEMU_CLOCK_REALTIME, delay_ns);
        block_job_sleep_ns(&s->common, delay_ns);
        if (block_job_is_cancelled(&s->common)) {
            break;
        }
+4 −4
Original line number Diff line number Diff line
@@ -42,9 +42,9 @@ static int coroutine_fn bdrv_co_do_pwrite_zeroes(BlockDriverState *bs,

void bdrv_parent_drained_begin(BlockDriverState *bs)
{
    BdrvChild *c;
    BdrvChild *c, *next;

    QLIST_FOREACH(c, &bs->parents, next_parent) {
    QLIST_FOREACH_SAFE(c, &bs->parents, next_parent, next) {
        if (c->role->drained_begin) {
            c->role->drained_begin(c);
        }
@@ -53,9 +53,9 @@ void bdrv_parent_drained_begin(BlockDriverState *bs)

void bdrv_parent_drained_end(BlockDriverState *bs)
{
    BdrvChild *c;
    BdrvChild *c, *next;

    QLIST_FOREACH(c, &bs->parents, next_parent) {
    QLIST_FOREACH_SAFE(c, &bs->parents, next_parent, next) {
        if (c->role->drained_end) {
            c->role->drained_end(c);
        }
+3 −3
Original line number Diff line number Diff line
@@ -598,7 +598,7 @@ static void mirror_throttle(MirrorBlockJob *s)

    if (now - s->last_pause_ns > SLICE_TIME) {
        s->last_pause_ns = now;
        block_job_sleep_ns(&s->common, QEMU_CLOCK_REALTIME, 0);
        block_job_sleep_ns(&s->common, 0);
    } else {
        block_job_pause_point(&s->common);
    }
@@ -870,13 +870,13 @@ static void coroutine_fn mirror_run(void *opaque)
        ret = 0;
        trace_mirror_before_sleep(s, cnt, s->synced, delay_ns);
        if (!s->synced) {
            block_job_sleep_ns(&s->common, QEMU_CLOCK_REALTIME, delay_ns);
            block_job_sleep_ns(&s->common, delay_ns);
            if (block_job_is_cancelled(&s->common)) {
                break;
            }
        } else if (!should_complete) {
            delay_ns = (s->in_flight == 0 && cnt == 0 ? SLICE_TIME : 0);
            block_job_sleep_ns(&s->common, QEMU_CLOCK_REALTIME, delay_ns);
            block_job_sleep_ns(&s->common, delay_ns);
        }
        s->last_pause_ns = qemu_clock_get_ns(QEMU_CLOCK_REALTIME);
    }
+3 −4
Original line number Diff line number Diff line
/*
 * QEMU Block driver for native access to files on NFS shares
 *
 * Copyright (c) 2014-2016 Peter Lieven <pl@kamp.de>
 * Copyright (c) 2014-2017 Peter Lieven <pl@kamp.de>
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
@@ -496,7 +496,7 @@ out:
static int64_t nfs_client_open(NFSClient *client, QDict *options,
                               int flags, int open_flags, Error **errp)
{
    int ret = -EINVAL;
    int64_t ret = -EINVAL;
    QemuOpts *opts = NULL;
    Error *local_err = NULL;
    struct stat st;
@@ -686,8 +686,7 @@ static QemuOptsList nfs_create_opts = {

static int nfs_file_create(const char *url, QemuOpts *opts, Error **errp)
{
    int ret = 0;
    int64_t total_size = 0;
    int64_t ret, total_size;
    NFSClient *client = g_new0(NFSClient, 1);
    QDict *options = NULL;

Loading