1
The following changes since commit e5cd695266c5709308aa95b1baae499e4b5d4544:
1
The following changes since commit aceeaa69d28e6f08a24395d0aa6915b687d0a681:
2
2
3
Merge remote-tracking branch 'remotes/cody/tags/block-pull-request' into staging (2018-05-08 17:05:58 +0100)
3
Merge remote-tracking branch 'remotes/huth-gitlab/tags/pull-request-2019-12-17' into staging (2019-12-17 15:55:20 +0000)
4
4
5
are available in the Git repository at:
5
are available in the Git repository at:
6
6
7
git://github.com/stefanha/qemu.git tags/block-pull-request
7
https://github.com/stefanha/qemu.git tags/block-pull-request
8
8
9
for you to fetch changes up to 31be8a2a97ecba7d31a82932286489cac318e9e9:
9
for you to fetch changes up to 725fe5d10dbd4259b1853b7d253cef83a3c0d22a:
10
10
11
block/file-posix: add x-check-page-cache=on|off option (2018-05-11 16:43:05 +0100)
11
virtio-blk: fix out-of-bounds access to bitmap in notify_guest_bh (2019-12-19 16:20:25 +0000)
12
12
13
----------------------------------------------------------------
13
----------------------------------------------------------------
14
Block pull request
14
Pull request
15
16
* Support -drive cache.direct=off live migration for POSIX files
17
15
18
----------------------------------------------------------------
16
----------------------------------------------------------------
19
17
20
Joe Perches (4):
18
Li Hangjing (1):
21
checkpatch: add a --strict check for utf-8 in commit logs
19
virtio-blk: fix out-of-bounds access to bitmap in notify_guest_bh
22
checkpatch: ignore email headers better
23
checkpatch: emit a warning on file add/move/delete
24
checkpatch: reduce MAINTAINERS update message frequency
25
20
26
Pasi Savanainen (1):
21
Stefan Hajnoczi (2):
27
checkpatch: check utf-8 content from a commit log when it's missing
22
virtio-blk: deprecate SCSI passthrough
28
from charset
23
docs: fix rst syntax errors in unbuilt docs
29
24
30
Stefan Hajnoczi (3):
25
docs/arm-cpu-features.rst | 6 +++---
31
blockjob: drop block_job_pause/resume_all()
26
docs/virtio-net-failover.rst | 4 ++--
32
block/file-posix: implement bdrv_co_invalidate_cache() on Linux
27
docs/virtio-pmem.rst | 19 ++++++++++---------
33
block/file-posix: add x-check-page-cache=on|off option
28
hw/block/dataplane/virtio-blk.c | 2 +-
34
29
qemu-deprecated.texi | 11 +++++++++++
35
qapi/block-core.json | 7 +-
30
5 files changed, 27 insertions(+), 15 deletions(-)
36
include/block/blockjob_int.h | 14 ----
37
block/file-posix.c | 146 ++++++++++++++++++++++++++++++++++-
38
blockjob.c | 27 -------
39
scripts/checkpatch.pl | 56 +++++++++++++-
40
5 files changed, 202 insertions(+), 48 deletions(-)
41
31
42
--
32
--
43
2.17.0
33
2.23.0
44
34
35
--
36
libvir-list mailing list
37
libvir-list@redhat.com
38
https://www.redhat.com/mailman/listinfo/libvir-list
45
39
diff view generated by jsdifflib
Deleted patch
1
Commit 8119334918e86f45877cfc139192d54f2449a239 ("block: Don't
2
block_job_pause_all() in bdrv_drain_all()") removed the only callers of
3
block_job_pause/resume_all().
4
1
5
Pausing and resuming now happens in child_job_drained_begin/end() so
6
it's no longer necessary to globally pause/resume jobs.
7
8
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
9
Reviewed-by: John Snow <jsnow@redhat.com>
10
Reviewed-by: Alberto Garcia <berto@igalia.com>
11
Message-id: 20180424085240.5798-1-stefanha@redhat.com
12
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
13
---
14
include/block/blockjob_int.h | 14 --------------
15
blockjob.c | 27 ---------------------------
16
2 files changed, 41 deletions(-)
17
18
diff --git a/include/block/blockjob_int.h b/include/block/blockjob_int.h
19
index XXXXXXX..XXXXXXX 100644
20
--- a/include/block/blockjob_int.h
21
+++ b/include/block/blockjob_int.h
22
@@ -XXX,XX +XXX,XX @@ void block_job_sleep_ns(BlockJob *job, int64_t ns);
23
*/
24
void block_job_yield(BlockJob *job);
25
26
-/**
27
- * block_job_pause_all:
28
- *
29
- * Asynchronously pause all jobs.
30
- */
31
-void block_job_pause_all(void);
32
-
33
-/**
34
- * block_job_resume_all:
35
- *
36
- * Resume all block jobs. Must be paired with a preceding block_job_pause_all.
37
- */
38
-void block_job_resume_all(void);
39
-
40
/**
41
* block_job_early_fail:
42
* @bs: The block device.
43
diff --git a/blockjob.c b/blockjob.c
44
index XXXXXXX..XXXXXXX 100644
45
--- a/blockjob.c
46
+++ b/blockjob.c
47
@@ -XXX,XX +XXX,XX @@ void *block_job_create(const char *job_id, const BlockJobDriver *driver,
48
return job;
49
}
50
51
-void block_job_pause_all(void)
52
-{
53
- BlockJob *job = NULL;
54
- while ((job = block_job_next(job))) {
55
- AioContext *aio_context = blk_get_aio_context(job->blk);
56
-
57
- aio_context_acquire(aio_context);
58
- block_job_ref(job);
59
- block_job_pause(job);
60
- aio_context_release(aio_context);
61
- }
62
-}
63
-
64
void block_job_early_fail(BlockJob *job)
65
{
66
assert(job->status == BLOCK_JOB_STATUS_CREATED);
67
@@ -XXX,XX +XXX,XX @@ void coroutine_fn block_job_pause_point(BlockJob *job)
68
}
69
}
70
71
-void block_job_resume_all(void)
72
-{
73
- BlockJob *job, *next;
74
-
75
- QLIST_FOREACH_SAFE(job, &block_jobs, job_list, next) {
76
- AioContext *aio_context = blk_get_aio_context(job->blk);
77
-
78
- aio_context_acquire(aio_context);
79
- block_job_resume(job);
80
- block_job_unref(job);
81
- aio_context_release(aio_context);
82
- }
83
-}
84
-
85
/*
86
* Conditionally enter a block_job pending a call to fn() while
87
* under the block_job_lock critical section.
88
--
89
2.17.0
90
91
diff view generated by jsdifflib
Deleted patch
1
From: Joe Perches <joe@perches.com>
2
1
3
Some find using utf-8 in commit logs inappropriate.
4
5
Some patch commit logs contain unintended utf-8 characters when doing
6
things like copy/pasting compilation output.
7
8
Look for the start of any commit log by skipping initial lines that look
9
like email headers and "From: " lines.
10
11
Stop looking for utf-8 at the first signature line.
12
13
Signed-off-by: Joe Perches <joe@perches.com>
14
Reviewed-by: Markus Armbruster <armbru@redhat.com>
15
Reviewed-by: Thomas Huth <thuth@redhat.com>
16
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
17
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
18
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
19
Message-id: 20180430124651.10340-2-stefanha@redhat.com
20
Suggested-by: Andrew Morton <akpm@linux-foundation.org>
21
Cc: Andy Whitcroft <apw@shadowen.org>
22
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
23
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
24
(cherry picked from commit 15662b3e8644905032c2e26808401a487d4e90c1)
25
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
26
27
Conflicts:
28
QEMU does not have CHK(), use WARN() instead.
29
30
QEMU WARN() only takes one argument, drop the 'type' value in the
31
first argument.
32
33
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
34
---
35
scripts/checkpatch.pl | 30 ++++++++++++++++++++++++++----
36
1 file changed, 26 insertions(+), 4 deletions(-)
37
38
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
39
index XXXXXXX..XXXXXXX 100755
40
--- a/scripts/checkpatch.pl
41
+++ b/scripts/checkpatch.pl
42
@@ -XXX,XX +XXX,XX @@ our $NonptrType;
43
our $Type;
44
our $Declare;
45
46
-our $UTF8    = qr {
47
-    [\x09\x0A\x0D\x20-\x7E] # ASCII
48
-    | [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte
49
+our $NON_ASCII_UTF8    = qr{
50
+    [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte
51
    | \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs
52
    | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte
53
    | \xED[\x80-\x9F][\x80-\xBF] # excluding surrogates
54
@@ -XXX,XX +XXX,XX @@ our $UTF8    = qr {
55
    | \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16
56
}x;
57
58
+our $UTF8    = qr{
59
+    [\x09\x0A\x0D\x20-\x7E] # ASCII
60
+    | $NON_ASCII_UTF8
61
+}x;
62
+
63
# There are still some false positives, but this catches most
64
# common cases.
65
our $typeTypedefs = qr{(?x:
66
@@ -XXX,XX +XXX,XX @@ sub process {
67
    my $signoff = 0;
68
    my $is_patch = 0;
69
70
+    my $in_header_lines = 1;
71
+    my $in_commit_log = 0;        #Scanning lines before patch
72
+
73
    our @report = ();
74
    our $cnt_lines = 0;
75
    our $cnt_error = 0;
76
@@ -XXX,XX +XXX,XX @@ sub process {
77
        if ($line =~ /^diff --git.*?(\S+)$/) {
78
            $realfile = $1;
79
            $realfile =~ s@^([^/]*)/@@;
80
-
81
        } elsif ($line =~ /^\+\+\+\s+(\S+)/) {
82
            $realfile = $1;
83
            $realfile =~ s@^([^/]*)/@@;
84
@@ -XXX,XX +XXX,XX @@ sub process {
85
        if ($line =~ /^\s*signed-off-by:/i) {
86
            # This is a signoff, if ugly, so do not double report.
87
            $signoff++;
88
+            $in_commit_log = 0;
89
+
90
            if (!($line =~ /^\s*Signed-off-by:/)) {
91
                ERROR("The correct form is \"Signed-off-by\"\n" .
92
                    $herecurr);
93
@@ -XXX,XX +XXX,XX @@ sub process {
94
            ERROR("Invalid UTF-8, patch and commit message should be encoded in UTF-8\n" . $hereptr);
95
        }
96
97
+# Check if it's the start of a commit log
98
+# (not a header line and we haven't seen the patch filename)
99
+        if ($in_header_lines && $realfile =~ /^$/ &&
100
+         $rawline !~ /^(commit\b|from\b|\w+:).+$/i) {
101
+            $in_header_lines = 0;
102
+            $in_commit_log = 1;
103
+        }
104
+
105
+# Still not yet in a patch, check for any UTF-8
106
+        if ($in_commit_log && $realfile =~ /^$/ &&
107
+         $rawline =~ /$NON_ASCII_UTF8/) {
108
+            WARN("8-bit UTF-8 used in possible commit log\n" . $herecurr);
109
+        }
110
+
111
# ignore non-hunk lines and lines being removed
112
        next if (!$hunk_line || $line =~ /^-/);
113
114
--
115
2.17.0
116
117
diff view generated by jsdifflib
Deleted patch
1
From: Pasi Savanainen <pasi.savanainen@nixu.com>
2
1
3
Check that a commit log doesn't contain UTF-8 when a mail header
4
explicitly defines a different charset, like
5
6
'Content-Type: text/plain; charset="us-ascii"'
7
8
Signed-off-by: Pasi Savanainen <pasi.savanainen@nixu.com>
9
Reviewed-by: Markus Armbruster <armbru@redhat.com>
10
Reviewed-by: Thomas Huth <thuth@redhat.com>
11
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
12
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
13
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14
Message-id: 20180430124651.10340-3-stefanha@redhat.com
15
Cc: Joe Perches <joe@perches.com>
16
Cc: Andy Whitcroft <apw@canonical.com>
17
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
18
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
19
(cherry picked from commit fa64205df9dfd7b7662cc64a7e82115c00e428e5)
20
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
21
Reviewed-by: Thomas Huth <thuth@redhat.com>
22
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
23
---
24
scripts/checkpatch.pl | 13 +++++++++++--
25
1 file changed, 11 insertions(+), 2 deletions(-)
26
27
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
28
index XXXXXXX..XXXXXXX 100755
29
--- a/scripts/checkpatch.pl
30
+++ b/scripts/checkpatch.pl
31
@@ -XXX,XX +XXX,XX @@ sub process {
32
    my $in_header_lines = 1;
33
    my $in_commit_log = 0;        #Scanning lines before patch
34
35
+    my $non_utf8_charset = 0;
36
+
37
    our @report = ();
38
    our $cnt_lines = 0;
39
    our $cnt_error = 0;
40
@@ -XXX,XX +XXX,XX @@ sub process {
41
            $in_commit_log = 1;
42
        }
43
44
-# Still not yet in a patch, check for any UTF-8
45
-        if ($in_commit_log && $realfile =~ /^$/ &&
46
+# Check if there is UTF-8 in a commit log when a mail header has explicitly
47
+# declined it, i.e defined some charset where it is missing.
48
+        if ($in_header_lines &&
49
+         $rawline =~ /^Content-Type:.+charset="(.+)".*$/ &&
50
+         $1 !~ /utf-8/i) {
51
+            $non_utf8_charset = 1;
52
+        }
53
+
54
+        if ($in_commit_log && $non_utf8_charset && $realfile =~ /^$/ &&
55
         $rawline =~ /$NON_ASCII_UTF8/) {
56
            WARN("8-bit UTF-8 used in possible commit log\n" . $herecurr);
57
        }
58
--
59
2.17.0
60
61
diff view generated by jsdifflib
Deleted patch
1
From: Joe Perches <joe@perches.com>
2
1
3
There are some patches created by git format-patch that when scanned by
4
checkpatch report errors on lines like
5
6
To:    address.tld
7
8
This is a checkpatch false positive.
9
10
Improve the logic a bit to ignore folded email headers to avoid emitting
11
these messages.
12
13
Signed-off-by: Joe Perches <joe@perches.com>
14
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
15
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16
Reviewed-by: Markus Armbruster <armbru@redhat.com>
17
Reviewed-by: Thomas Huth <thuth@redhat.com>
18
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
19
Message-id: 20180430124651.10340-4-stefanha@redhat.com
20
(cherry picked from commit 29ee1b0c67e0dd7dea8dd718e8326076bce5b6fe)
21
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
22
Reviewed-by: Thomas Huth <thuth@redhat.com>
23
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
24
---
25
scripts/checkpatch.pl | 5 +++--
26
1 file changed, 3 insertions(+), 2 deletions(-)
27
28
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
29
index XXXXXXX..XXXXXXX 100755
30
--- a/scripts/checkpatch.pl
31
+++ b/scripts/checkpatch.pl
32
@@ -XXX,XX +XXX,XX @@ sub process {
33
    my $signoff = 0;
34
    my $is_patch = 0;
35
36
-    my $in_header_lines = 1;
37
+    my $in_header_lines = $file ? 0 : 1;
38
    my $in_commit_log = 0;        #Scanning lines before patch
39
40
    my $non_utf8_charset = 0;
41
@@ -XXX,XX +XXX,XX @@ sub process {
42
# Check if it's the start of a commit log
43
# (not a header line and we haven't seen the patch filename)
44
        if ($in_header_lines && $realfile =~ /^$/ &&
45
-         $rawline !~ /^(commit\b|from\b|\w+:).+$/i) {
46
+         !($rawline =~ /^\s+\S/ ||
47
+         $rawline =~ /^(commit\b|from\b|[\w-]+:).*$/i)) {
48
            $in_header_lines = 0;
49
            $in_commit_log = 1;
50
        }
51
--
52
2.17.0
53
54
diff view generated by jsdifflib
Deleted patch
1
From: Joe Perches <joe@perches.com>
2
1
3
Whenever files are added, moved, or deleted, the MAINTAINERS file
4
patterns can be out of sync or outdated.
5
6
To try to keep MAINTAINERS more up-to-date, add a one-time warning
7
whenever a patch does any of those.
8
9
Signed-off-by: Joe Perches <joe@perches.com>
10
Acked-by: Andy Whitcroft <apw@canonical.com>
11
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
12
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13
Reviewed-by: Markus Armbruster <armbru@redhat.com>
14
Reviewed-by: Thomas Huth <thuth@redhat.com>
15
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
16
Message-id: 20180430124651.10340-5-stefanha@redhat.com
17
(cherry picked from commit 13f1937ef33950b1112049972249e6191b82e6c9)
18
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
19
Reviewed-by: Thomas Huth <thuth@redhat.com>
20
21
Conflicts:
22
QEMU WARN() only takes one argument, drop the 'type' value in the
23
first argument.
24
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
25
---
26
scripts/checkpatch.pl | 12 +++++++++++-
27
1 file changed, 11 insertions(+), 1 deletion(-)
28
29
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
30
index XXXXXXX..XXXXXXX 100755
31
--- a/scripts/checkpatch.pl
32
+++ b/scripts/checkpatch.pl
33
@@ -XXX,XX +XXX,XX @@ sub process {
34
35
    my $in_header_lines = $file ? 0 : 1;
36
    my $in_commit_log = 0;        #Scanning lines before patch
37
-
38
+    my $reported_maintainer_file = 0;
39
    my $non_utf8_charset = 0;
40
41
    our @report = ();
42
@@ -XXX,XX +XXX,XX @@ sub process {
43
            }
44
        }
45
46
+# Check for added, moved or deleted files
47
+        if (!$reported_maintainer_file && !$in_commit_log &&
48
+         ($line =~ /^(?:new|deleted) file mode\s*\d+\s*$/ ||
49
+         $line =~ /^rename (?:from|to) [\w\/\.\-]+\s*$/ ||
50
+         ($line =~ /\{\s*([\w\/\.\-]*)\s*\=\>\s*([\w\/\.\-]*)\s*\}/ &&
51
+         (defined($1) || defined($2))))) {
52
+            $reported_maintainer_file = 1;
53
+            WARN("added, moved or deleted file(s), does MAINTAINERS need updating?\n" . $herecurr);
54
+        }
55
+
56
# Check for wrappage within a valid hunk of the file
57
        if ($realcnt != 0 && $line !~ m{^(?:\+|-| |\\ No newline|$)}) {
58
            ERROR("patch seems to be corrupt (line wrapped?)\n" .
59
--
60
2.17.0
61
62
diff view generated by jsdifflib
1
mincore(2) checks whether pages are resident. Use it to verify that
1
The Linux virtio_blk.ko guest driver is removing legacy SCSI passthrough
2
page cache has been dropped.
2
support. Deprecate this feature in QEMU too.
3
4
You can trigger a verification failure by mmapping the image file from
5
another process that loads a byte from a page, forcing it to become
6
resident. bdrv_co_invalidate_cache() will fail while that process is
7
alive.
8
3
9
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
4
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10
Reviewed-by: Fam Zheng <famz@redhat.com>
5
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
11
Message-id: 20180427162312.18583-3-stefanha@redhat.com
6
Reviewed-by: Christoph Hellwig <hch@lst.de>
7
Reviewed-by: Thomas Huth <thuth@redhat.com>
8
Message-id: 20191213144626.1208237-1-stefanha@redhat.com
9
Message-Id: <20191213144626.1208237-1-stefanha@redhat.com>
12
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
10
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
13
---
11
---
14
qapi/block-core.json | 7 ++-
12
qemu-deprecated.texi | 11 +++++++++++
15
block/file-posix.c | 100 ++++++++++++++++++++++++++++++++++++++++++-
13
1 file changed, 11 insertions(+)
16
2 files changed, 104 insertions(+), 3 deletions(-)
17
14
18
diff --git a/qapi/block-core.json b/qapi/block-core.json
15
diff --git a/qemu-deprecated.texi b/qemu-deprecated.texi
19
index XXXXXXX..XXXXXXX 100644
16
index XXXXXXX..XXXXXXX 100644
20
--- a/qapi/block-core.json
17
--- a/qemu-deprecated.texi
21
+++ b/qapi/block-core.json
18
+++ b/qemu-deprecated.texi
22
@@ -XXX,XX +XXX,XX @@
19
@@ -XXX,XX +XXX,XX @@ spec you can use the ``-cpu rv64gcsu,priv_spec=v1.9.1`` command line argument.
23
# @locking: whether to enable file locking. If set to 'auto', only enable
20
24
# when Open File Descriptor (OFD) locking API is available
21
@section Device options
25
# (default: auto, since 2.10)
22
26
+# @x-check-cache-dropped: whether to check that page cache was dropped on live
23
+@subsection Emulated device options
27
+# migration. May cause noticeable delays if the image
28
+# file is large, do not use in production.
29
+# (default: off) (since: 2.13)
30
#
31
# Since: 2.9
32
##
33
@@ -XXX,XX +XXX,XX @@
34
'data': { 'filename': 'str',
35
'*pr-manager': 'str',
36
'*locking': 'OnOffAuto',
37
- '*aio': 'BlockdevAioOptions' } }
38
+ '*aio': 'BlockdevAioOptions',
39
+ '*x-check-cache-dropped': 'bool' } }
40
41
##
42
# @BlockdevOptionsNull:
43
diff --git a/block/file-posix.c b/block/file-posix.c
44
index XXXXXXX..XXXXXXX 100644
45
--- a/block/file-posix.c
46
+++ b/block/file-posix.c
47
@@ -XXX,XX +XXX,XX @@ typedef struct BDRVRawState {
48
bool page_cache_inconsistent:1;
49
bool has_fallocate;
50
bool needs_alignment;
51
+ bool check_cache_dropped;
52
53
PRManager *pr_mgr;
54
} BDRVRawState;
55
@@ -XXX,XX +XXX,XX @@ typedef struct BDRVRawState {
56
typedef struct BDRVRawReopenState {
57
int fd;
58
int open_flags;
59
+ bool check_cache_dropped;
60
} BDRVRawReopenState;
61
62
static int fd_open(BlockDriverState *bs);
63
@@ -XXX,XX +XXX,XX @@ static QemuOptsList raw_runtime_opts = {
64
.type = QEMU_OPT_STRING,
65
.help = "id of persistent reservation manager object (default: none)",
66
},
67
+ {
68
+ .name = "x-check-cache-dropped",
69
+ .type = QEMU_OPT_BOOL,
70
+ .help = "check that page cache was dropped on live migration (default: off)"
71
+ },
72
{ /* end of list */ }
73
},
74
};
75
@@ -XXX,XX +XXX,XX @@ static int raw_open_common(BlockDriverState *bs, QDict *options,
76
}
77
}
78
79
+ s->check_cache_dropped = qemu_opt_get_bool(opts, "x-check-cache-dropped",
80
+ false);
81
+
24
+
82
s->open_flags = open_flags;
25
+@subsubsection -device virtio-blk,scsi=on|off (since 5.0.0)
83
raw_parse_flags(bdrv_flags, &s->open_flags);
84
85
@@ -XXX,XX +XXX,XX @@ static int raw_reopen_prepare(BDRVReopenState *state,
86
{
87
BDRVRawState *s;
88
BDRVRawReopenState *rs;
89
+ QemuOpts *opts;
90
int ret = 0;
91
Error *local_err = NULL;
92
93
@@ -XXX,XX +XXX,XX @@ static int raw_reopen_prepare(BDRVReopenState *state,
94
95
state->opaque = g_new0(BDRVRawReopenState, 1);
96
rs = state->opaque;
97
+ rs->fd = -1;
98
+
26
+
99
+ /* Handle options changes */
27
+The virtio-blk SCSI passthrough feature is a legacy VIRTIO feature. VIRTIO 1.0
100
+ opts = qemu_opts_create(&raw_runtime_opts, NULL, 0, &error_abort);
28
+and later do not support it because the virtio-scsi device was introduced for
101
+ qemu_opts_absorb_qdict(opts, state->options, &local_err);
29
+full SCSI support. Use virtio-scsi instead when SCSI passthrough is required.
102
+ if (local_err) {
103
+ error_propagate(errp, local_err);
104
+ ret = -EINVAL;
105
+ goto out;
106
+ }
107
+
30
+
108
+ rs->check_cache_dropped = qemu_opt_get_bool(opts, "x-check-cache-dropped",
31
+Note this also applies to ``-device virtio-blk-pci,scsi=on|off'', which is an
109
+ s->check_cache_dropped);
32
+alias.
110
111
if (s->type == FTYPE_CD) {
112
rs->open_flags |= O_NONBLOCK;
113
@@ -XXX,XX +XXX,XX @@ static int raw_reopen_prepare(BDRVReopenState *state,
114
115
raw_parse_flags(state->flags, &rs->open_flags);
116
117
- rs->fd = -1;
118
-
119
int fcntl_flags = O_APPEND | O_NONBLOCK;
120
#ifdef O_NOATIME
121
fcntl_flags |= O_NOATIME;
122
@@ -XXX,XX +XXX,XX @@ static int raw_reopen_prepare(BDRVReopenState *state,
123
}
124
}
125
126
+out:
127
+ qemu_opts_del(opts);
128
return ret;
129
}
130
131
@@ -XXX,XX +XXX,XX @@ static void raw_reopen_commit(BDRVReopenState *state)
132
BDRVRawReopenState *rs = state->opaque;
133
BDRVRawState *s = state->bs->opaque;
134
135
+ s->check_cache_dropped = rs->check_cache_dropped;
136
s->open_flags = rs->open_flags;
137
138
qemu_close(s->fd);
139
@@ -XXX,XX +XXX,XX @@ static int coroutine_fn raw_co_block_status(BlockDriverState *bs,
140
return ret | BDRV_BLOCK_OFFSET_VALID;
141
}
142
143
+#if defined(__linux__)
144
+/* Verify that the file is not in the page cache */
145
+static void check_cache_dropped(BlockDriverState *bs, Error **errp)
146
+{
147
+ const size_t window_size = 128 * 1024 * 1024;
148
+ BDRVRawState *s = bs->opaque;
149
+ void *window = NULL;
150
+ size_t length = 0;
151
+ unsigned char *vec;
152
+ size_t page_size;
153
+ off_t offset;
154
+ off_t end;
155
+
33
+
156
+ /* mincore(2) page status information requires 1 byte per page */
34
@subsection Block device options
157
+ page_size = sysconf(_SC_PAGESIZE);
35
158
+ vec = g_malloc(DIV_ROUND_UP(window_size, page_size));
36
@subsubsection "backing": "" (since 2.12.0)
159
+
160
+ end = raw_getlength(bs);
161
+
162
+ for (offset = 0; offset < end; offset += window_size) {
163
+ void *new_window;
164
+ size_t new_length;
165
+ size_t vec_end;
166
+ size_t i;
167
+ int ret;
168
+
169
+ /* Unmap previous window if size has changed */
170
+ new_length = MIN(end - offset, window_size);
171
+ if (new_length != length) {
172
+ munmap(window, length);
173
+ window = NULL;
174
+ length = 0;
175
+ }
176
+
177
+ new_window = mmap(window, new_length, PROT_NONE, MAP_PRIVATE,
178
+ s->fd, offset);
179
+ if (new_window == MAP_FAILED) {
180
+ error_setg_errno(errp, errno, "mmap failed");
181
+ break;
182
+ }
183
+
184
+ window = new_window;
185
+ length = new_length;
186
+
187
+ ret = mincore(window, length, vec);
188
+ if (ret < 0) {
189
+ error_setg_errno(errp, errno, "mincore failed");
190
+ break;
191
+ }
192
+
193
+ vec_end = DIV_ROUND_UP(length, page_size);
194
+ for (i = 0; i < vec_end; i++) {
195
+ if (vec[i] & 0x1) {
196
+ error_setg(errp, "page cache still in use!");
197
+ break;
198
+ }
199
+ }
200
+ }
201
+
202
+ if (window) {
203
+ munmap(window, length);
204
+ }
205
+
206
+ g_free(vec);
207
+}
208
+#endif /* __linux__ */
209
+
210
static void coroutine_fn raw_co_invalidate_cache(BlockDriverState *bs,
211
Error **errp)
212
{
213
@@ -XXX,XX +XXX,XX @@ static void coroutine_fn raw_co_invalidate_cache(BlockDriverState *bs,
214
error_setg_errno(errp, ret, "fadvise failed");
215
return;
216
}
217
+
218
+ if (s->check_cache_dropped) {
219
+ check_cache_dropped(bs, errp);
220
+ }
221
#else /* __linux__ */
222
/* Do nothing. Live migration to a remote host with cache.direct=off is
223
* unsupported on other host operating systems. Cache consistency issues
224
--
37
--
225
2.17.0
38
2.23.0
226
39
40
--
41
libvir-list mailing list
42
libvir-list@redhat.com
43
https://www.redhat.com/mailman/listinfo/libvir-list
227
44
diff view generated by jsdifflib
1
On Linux posix_fadvise(POSIX_FADV_DONTNEED) invalidates pages*. Use
1
The .rst files outside docs/{devel,interop,specs} aren't built yet and
2
this to drop page cache on the destination host during shared storage
2
therefore a few syntax errors have slipped through. Fix them.
3
migration. This way the destination host will read the latest copy of
4
the data and will not use stale data from the page cache.
5
6
The flow is as follows:
7
8
1. Source host writes out all dirty pages and inactivates drives.
9
2. QEMU_VM_EOF is sent on migration stream.
10
3. Destination host invalidates caches before accessing drives.
11
12
This patch enables live migration even with -drive cache.direct=off.
13
14
* Terms and conditions may apply, please see patch for details.
15
3
16
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
4
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
17
Reviewed-by: Fam Zheng <famz@redhat.com>
5
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
18
Message-id: 20180427162312.18583-2-stefanha@redhat.com
6
Message-Id: <20191111094411.427174-1-stefanha@redhat.com>
19
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
7
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
20
---
8
---
21
block/file-posix.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
9
docs/arm-cpu-features.rst | 6 +++---
22
1 file changed, 46 insertions(+)
10
docs/virtio-net-failover.rst | 4 ++--
11
docs/virtio-pmem.rst | 19 ++++++++++---------
12
3 files changed, 15 insertions(+), 14 deletions(-)
23
13
24
diff --git a/block/file-posix.c b/block/file-posix.c
14
diff --git a/docs/arm-cpu-features.rst b/docs/arm-cpu-features.rst
25
index XXXXXXX..XXXXXXX 100644
15
index XXXXXXX..XXXXXXX 100644
26
--- a/block/file-posix.c
16
--- a/docs/arm-cpu-features.rst
27
+++ b/block/file-posix.c
17
+++ b/docs/arm-cpu-features.rst
28
@@ -XXX,XX +XXX,XX @@ static int coroutine_fn raw_co_block_status(BlockDriverState *bs,
18
@@ -XXX,XX +XXX,XX @@ CPU type is possible with the `query-cpu-model-expansion` QMP command.
29
return ret | BDRV_BLOCK_OFFSET_VALID;
19
Below are some examples where `scripts/qmp/qmp-shell` (see the top comment
30
}
20
block in the script for usage) is used to issue the QMP commands.
31
21
32
+static void coroutine_fn raw_co_invalidate_cache(BlockDriverState *bs,
22
-(1) Determine which CPU features are available for the `max` CPU type
33
+ Error **errp)
23
- (Note, we started QEMU with qemu-system-aarch64, so `max` is
34
+{
24
- implementing the ARMv8-A reference manual in this case)::
35
+ BDRVRawState *s = bs->opaque;
25
+1. Determine which CPU features are available for the `max` CPU type
36
+ int ret;
26
+ (Note, we started QEMU with qemu-system-aarch64, so `max` is
27
+ implementing the ARMv8-A reference manual in this case)::
28
29
(QEMU) query-cpu-model-expansion type=full model={"name":"max"}
30
{ "return": {
31
diff --git a/docs/virtio-net-failover.rst b/docs/virtio-net-failover.rst
32
index XXXXXXX..XXXXXXX 100644
33
--- a/docs/virtio-net-failover.rst
34
+++ b/docs/virtio-net-failover.rst
35
@@ -XXX,XX +XXX,XX @@
36
-========================
37
+======================================
38
QEMU virtio-net standby (net_failover)
39
-========================
40
+======================================
41
42
This document explains the setup and usage of virtio-net standby feature which
43
is used to create a net_failover pair of devices.
44
diff --git a/docs/virtio-pmem.rst b/docs/virtio-pmem.rst
45
index XXXXXXX..XXXXXXX 100644
46
--- a/docs/virtio-pmem.rst
47
+++ b/docs/virtio-pmem.rst
48
@@ -XXX,XX +XXX,XX @@ virtio pmem usage
49
-----------------
50
51
A virtio pmem device backed by a memory-backend-file can be created on
52
- the QEMU command line as in the following example:
53
+ the QEMU command line as in the following example::
54
55
- -object memory-backend-file,id=mem1,share,mem-path=./virtio_pmem.img,size=4G
56
- -device virtio-pmem-pci,memdev=mem1,id=nv1
57
+ -object memory-backend-file,id=mem1,share,mem-path=./virtio_pmem.img,size=4G
58
+ -device virtio-pmem-pci,memdev=mem1,id=nv1
59
60
- where:
61
- - "object memory-backend-file,id=mem1,share,mem-path=<image>, size=<image size>"
62
- creates a backend file with the specified size.
63
+ where:
64
65
- - "device virtio-pmem-pci,id=nvdimm1,memdev=mem1" creates a virtio pmem
66
- pci device whose storage is provided by above memory backend device.
67
+ - "object memory-backend-file,id=mem1,share,mem-path=<image>, size=<image size>"
68
+ creates a backend file with the specified size.
37
+
69
+
38
+ ret = fd_open(bs);
70
+ - "device virtio-pmem-pci,id=nvdimm1,memdev=mem1" creates a virtio pmem
39
+ if (ret < 0) {
71
+ pci device whose storage is provided by above memory backend device.
40
+ error_setg_errno(errp, -ret, "The file descriptor is not open");
72
41
+ return;
73
Multiple virtio pmem devices can be created if multiple pairs of "-object"
42
+ }
74
and "-device" are provided.
43
+
75
@@ -XXX,XX +XXX,XX @@ memory backing has to be added via 'object_add'; afterwards, the virtio
44
+ if (s->open_flags & O_DIRECT) {
76
pmem device can be added via 'device_add'.
45
+ return; /* No host kernel page cache */
77
46
+ }
78
For example, the following commands add another 4GB virtio pmem device to
47
+
79
-the guest:
48
+#if defined(__linux__)
80
+the guest::
49
+ /* This sets the scene for the next syscall... */
81
50
+ ret = bdrv_co_flush(bs);
82
(qemu) object_add memory-backend-file,id=mem2,share=on,mem-path=virtio_pmem2.img,size=4G
51
+ if (ret < 0) {
83
(qemu) device_add virtio-pmem-pci,id=virtio_pmem2,memdev=mem2
52
+ error_setg_errno(errp, -ret, "flush failed");
53
+ return;
54
+ }
55
+
56
+ /* Linux does not invalidate pages that are dirty, locked, or mmapped by a
57
+ * process. These limitations are okay because we just fsynced the file,
58
+ * we don't use mmap, and the file should not be in use by other processes.
59
+ */
60
+ ret = posix_fadvise(s->fd, 0, 0, POSIX_FADV_DONTNEED);
61
+ if (ret != 0) { /* the return value is a positive errno */
62
+ error_setg_errno(errp, ret, "fadvise failed");
63
+ return;
64
+ }
65
+#else /* __linux__ */
66
+ /* Do nothing. Live migration to a remote host with cache.direct=off is
67
+ * unsupported on other host operating systems. Cache consistency issues
68
+ * may occur but no error is reported here, partly because that's the
69
+ * historical behavior and partly because it's hard to differentiate valid
70
+ * configurations that should not cause errors.
71
+ */
72
+#endif /* !__linux__ */
73
+}
74
+
75
static coroutine_fn BlockAIOCB *raw_aio_pdiscard(BlockDriverState *bs,
76
int64_t offset, int bytes,
77
BlockCompletionFunc *cb, void *opaque)
78
@@ -XXX,XX +XXX,XX @@ BlockDriver bdrv_file = {
79
.bdrv_co_create_opts = raw_co_create_opts,
80
.bdrv_has_zero_init = bdrv_has_zero_init_1,
81
.bdrv_co_block_status = raw_co_block_status,
82
+ .bdrv_co_invalidate_cache = raw_co_invalidate_cache,
83
.bdrv_co_pwrite_zeroes = raw_co_pwrite_zeroes,
84
85
.bdrv_co_preadv = raw_co_preadv,
86
@@ -XXX,XX +XXX,XX @@ static BlockDriver bdrv_host_device = {
87
.bdrv_reopen_abort = raw_reopen_abort,
88
.bdrv_co_create_opts = hdev_co_create_opts,
89
.create_opts = &raw_create_opts,
90
+ .bdrv_co_invalidate_cache = raw_co_invalidate_cache,
91
.bdrv_co_pwrite_zeroes = hdev_co_pwrite_zeroes,
92
93
.bdrv_co_preadv = raw_co_preadv,
94
@@ -XXX,XX +XXX,XX @@ static BlockDriver bdrv_host_cdrom = {
95
.bdrv_reopen_abort = raw_reopen_abort,
96
.bdrv_co_create_opts = hdev_co_create_opts,
97
.create_opts = &raw_create_opts,
98
+ .bdrv_co_invalidate_cache = raw_co_invalidate_cache,
99
100
101
.bdrv_co_preadv = raw_co_preadv,
102
--
84
--
103
2.17.0
85
2.23.0
104
86
105
87
--
88
libvir-list mailing list
89
libvir-list@redhat.com
90
https://www.redhat.com/mailman/listinfo/libvir-list
diff view generated by jsdifflib
1
From: Joe Perches <joe@perches.com>
1
From: Li Hangjing <lihangjing@baidu.com>
2
2
3
When files are being added/moved/deleted and a patch contains an update to
3
When the number of a virtio-blk device's virtqueues is larger than
4
the MAINTAINERS file, assume it's to update the MAINTAINERS file correctly
4
BITS_PER_LONG, the out-of-bounds access to bitmap[ ] will occur.
5
and do not emit the "does MAINTAINERS need updating?" message.
6
5
7
Reported by many people.
6
Fixes: e21737ab15 ("virtio-blk: multiqueue batch notify")
8
7
Cc: qemu-stable@nongnu.org
9
Signed-off-by: Joe Perches <joe@perches.com>
8
Cc: Stefan Hajnoczi <stefanha@redhat.com>
10
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
9
Signed-off-by: Li Hangjing <lihangjing@baidu.com>
11
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
10
Reviewed-by: Xie Yongji <xieyongji@baidu.com>
12
Reviewed-by: Markus Armbruster <armbru@redhat.com>
11
Reviewed-by: Chai Wen <chaiwen@baidu.com>
13
Reviewed-by: Thomas Huth <thuth@redhat.com>
12
Message-id: 20191216023050.48620-1-lihangjing@baidu.com
14
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
13
Message-Id: <20191216023050.48620-1-lihangjing@baidu.com>
15
Message-id: 20180430124651.10340-6-stefanha@redhat.com
16
(cherry picked from e0d975b1b439c4fef58fbc306c542c94f48bb849)
17
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
18
Reviewed-by: Thomas Huth <thuth@redhat.com>
19
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
14
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
20
---
15
---
21
scripts/checkpatch.pl | 6 ++++++
16
hw/block/dataplane/virtio-blk.c | 2 +-
22
1 file changed, 6 insertions(+)
17
1 file changed, 1 insertion(+), 1 deletion(-)
23
18
24
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
19
diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c
25
index XXXXXXX..XXXXXXX 100755
20
index XXXXXXX..XXXXXXX 100644
26
--- a/scripts/checkpatch.pl
21
--- a/hw/block/dataplane/virtio-blk.c
27
+++ b/scripts/checkpatch.pl
22
+++ b/hw/block/dataplane/virtio-blk.c
28
@@ -XXX,XX +XXX,XX @@ sub process {
23
@@ -XXX,XX +XXX,XX @@ static void notify_guest_bh(void *opaque)
29
            }
24
memset(s->batch_notify_vqs, 0, sizeof(bitmap));
30
        }
25
31
26
for (j = 0; j < nvqs; j += BITS_PER_LONG) {
32
+# Check if MAINTAINERS is being updated. If so, there's probably no need to
27
- unsigned long bits = bitmap[j];
33
+# emit the "does MAINTAINERS need updating?" message on file add/move/delete
28
+ unsigned long bits = bitmap[j / BITS_PER_LONG];
34
+        if ($line =~ /^\s*MAINTAINERS\s*\|/) {
29
35
+            $reported_maintainer_file = 1;
30
while (bits != 0) {
36
+        }
31
unsigned i = j + ctzl(bits);
37
+
38
# Check for added, moved or deleted files
39
        if (!$reported_maintainer_file && !$in_commit_log &&
40
         ($line =~ /^(?:new|deleted) file mode\s*\d+\s*$/ ||
41
--
32
--
42
2.17.0
33
2.23.0
43
34
35
--
36
libvir-list mailing list
37
libvir-list@redhat.com
38
https://www.redhat.com/mailman/listinfo/libvir-list
44
39
diff view generated by jsdifflib