1
The following changes since commit b38df311c174c98ef8cce7dec9f46603b083018e:
1
The following changes since commit ca61fa4b803e5d0abaf6f1ceb690f23bb78a4def:
2
2
3
Merge remote-tracking branch 'remotes/dgibson/tags/ppc-for-2.10-20170809' into staging (2017-08-10 11:12:36 +0100)
3
Merge remote-tracking branch 'remotes/quic/tags/pull-hex-20211006' into staging (2021-10-06 12:11:14 -0700)
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://gitlab.com/stefanha/qemu.git tags/block-pull-request
8
8
9
for you to fetch changes up to 17d0bc01bfcce0ad4fb5105d4502595224569ff0:
9
for you to fetch changes up to 1cc7eada97914f090125e588497986f6f7900514:
10
10
11
virtio-blk: handle blk_getlength() errors (2017-08-10 14:33:43 +0100)
11
iothread: use IOThreadParamInfo in iothread_[set|get]_param() (2021-10-07 15:29:50 +0100)
12
13
----------------------------------------------------------------
14
Pull request
12
15
13
----------------------------------------------------------------
16
----------------------------------------------------------------
14
17
15
----------------------------------------------------------------
18
Stefano Garzarella (2):
19
iothread: rename PollParamInfo to IOThreadParamInfo
20
iothread: use IOThreadParamInfo in iothread_[set|get]_param()
16
21
17
Kevin Wolf (1):
22
iothread.c | 28 +++++++++++++++-------------
18
IDE: test flush on empty CDROM
23
1 file changed, 15 insertions(+), 13 deletions(-)
19
20
Stefan Hajnoczi (2):
21
IDE: Do not flush empty CDROM drives
22
virtio-blk: handle blk_getlength() errors
23
24
hw/block/virtio-blk.c | 4 +++-
25
hw/ide/core.c | 10 +++++++++-
26
tests/ide-test.c | 19 +++++++++++++++++++
27
3 files changed, 31 insertions(+), 2 deletions(-)
28
24
29
--
25
--
30
2.13.4
26
2.31.1
31
27
32
28
29
diff view generated by jsdifflib
Deleted patch
1
The block backend changed in a way that flushing empty CDROM drives now
2
crashes. Amend IDE to avoid doing so until the root problem can be
3
addressed for 2.11.
4
1
5
Original patch by John Snow <jsnow@redhat.com>.
6
7
Reported-by: Kieron Shorrock <kshorrock@paloaltonetworks.com>
8
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
9
Reviewed-by: Eric Blake <eblake@redhat.com>
10
Message-id: 20170809160212.29976-2-stefanha@redhat.com
11
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
12
---
13
hw/ide/core.c | 10 +++++++++-
14
1 file changed, 9 insertions(+), 1 deletion(-)
15
16
diff --git a/hw/ide/core.c b/hw/ide/core.c
17
index XXXXXXX..XXXXXXX 100644
18
--- a/hw/ide/core.c
19
+++ b/hw/ide/core.c
20
@@ -XXX,XX +XXX,XX @@ static void ide_flush_cache(IDEState *s)
21
s->status |= BUSY_STAT;
22
ide_set_retry(s);
23
block_acct_start(blk_get_stats(s->blk), &s->acct, 0, BLOCK_ACCT_FLUSH);
24
- s->pio_aiocb = blk_aio_flush(s->blk, ide_flush_cb, s);
25
+
26
+ if (blk_bs(s->blk)) {
27
+ s->pio_aiocb = blk_aio_flush(s->blk, ide_flush_cb, s);
28
+ } else {
29
+ /* XXX blk_aio_flush() crashes when blk_bs(blk) is NULL, remove this
30
+ * temporary workaround when blk_aio_*() functions handle NULL blk_bs.
31
+ */
32
+ ide_flush_cb(s, 0);
33
+ }
34
}
35
36
static void ide_cfata_metadata_inquiry(IDEState *s)
37
--
38
2.13.4
39
40
diff view generated by jsdifflib
1
If blk_getlength() fails in virtio_blk_update_config() consider the disk
1
From: Stefano Garzarella <sgarzare@redhat.com>
2
image length to be 0 bytes.
3
2
4
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
3
Commit 1793ad0247 ("iothread: add aio-max-batch parameter") added
5
Reviewed-by: Fam Zheng <famz@redhat.com>
4
a new parameter (aio-max-batch) to IOThread and used PollParamInfo
6
Message-id: 20170808122251.29815-1-stefanha@redhat.com
5
structure to handle it.
6
7
Since it is not a parameter of the polling mechanism, we rename the
8
structure to a more generic IOThreadParamInfo.
9
10
Suggested-by: Kevin Wolf <kwolf@redhat.com>
11
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
12
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
13
Message-id: 20210727145936.147032-2-sgarzare@redhat.com
7
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
14
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
8
---
15
---
9
hw/block/virtio-blk.c | 4 +++-
16
iothread.c | 14 +++++++-------
10
1 file changed, 3 insertions(+), 1 deletion(-)
17
1 file changed, 7 insertions(+), 7 deletions(-)
11
18
12
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
19
diff --git a/iothread.c b/iothread.c
13
index XXXXXXX..XXXXXXX 100644
20
index XXXXXXX..XXXXXXX 100644
14
--- a/hw/block/virtio-blk.c
21
--- a/iothread.c
15
+++ b/hw/block/virtio-blk.c
22
+++ b/iothread.c
16
@@ -XXX,XX +XXX,XX @@ static void virtio_blk_update_config(VirtIODevice *vdev, uint8_t *config)
23
@@ -XXX,XX +XXX,XX @@ static void iothread_complete(UserCreatable *obj, Error **errp)
17
BlockConf *conf = &s->conf.conf;
24
typedef struct {
18
struct virtio_blk_config blkcfg;
25
const char *name;
19
uint64_t capacity;
26
ptrdiff_t offset; /* field's byte offset in IOThread struct */
20
+ int64_t length;
27
-} PollParamInfo;
21
int blk_size = conf->logical_block_size;
28
+} IOThreadParamInfo;
22
29
23
blk_get_geometry(s->blk, &capacity);
30
-static PollParamInfo poll_max_ns_info = {
24
@@ -XXX,XX +XXX,XX @@ static void virtio_blk_update_config(VirtIODevice *vdev, uint8_t *config)
31
+static IOThreadParamInfo poll_max_ns_info = {
25
* divided by 512 - instead it is the amount of blk_size blocks
32
"poll-max-ns", offsetof(IOThread, poll_max_ns),
26
* per track (cylinder).
33
};
27
*/
34
-static PollParamInfo poll_grow_info = {
28
- if (blk_getlength(s->blk) / conf->heads / conf->secs % blk_size) {
35
+static IOThreadParamInfo poll_grow_info = {
29
+ length = blk_getlength(s->blk);
36
"poll-grow", offsetof(IOThread, poll_grow),
30
+ if (length > 0 && length / conf->heads / conf->secs % blk_size) {
37
};
31
blkcfg.geometry.sectors = conf->secs & ~s->sector_mask;
38
-static PollParamInfo poll_shrink_info = {
32
} else {
39
+static IOThreadParamInfo poll_shrink_info = {
33
blkcfg.geometry.sectors = conf->secs;
40
"poll-shrink", offsetof(IOThread, poll_shrink),
41
};
42
-static PollParamInfo aio_max_batch_info = {
43
+static IOThreadParamInfo aio_max_batch_info = {
44
"aio-max-batch", offsetof(IOThread, aio_max_batch),
45
};
46
47
@@ -XXX,XX +XXX,XX @@ static void iothread_get_param(Object *obj, Visitor *v,
48
const char *name, void *opaque, Error **errp)
49
{
50
IOThread *iothread = IOTHREAD(obj);
51
- PollParamInfo *info = opaque;
52
+ IOThreadParamInfo *info = opaque;
53
int64_t *field = (void *)iothread + info->offset;
54
55
visit_type_int64(v, name, field, errp);
56
@@ -XXX,XX +XXX,XX @@ static bool iothread_set_param(Object *obj, Visitor *v,
57
const char *name, void *opaque, Error **errp)
58
{
59
IOThread *iothread = IOTHREAD(obj);
60
- PollParamInfo *info = opaque;
61
+ IOThreadParamInfo *info = opaque;
62
int64_t *field = (void *)iothread + info->offset;
63
int64_t value;
64
34
--
65
--
35
2.13.4
66
2.31.1
36
67
37
68
diff view generated by jsdifflib
1
From: Kevin Wolf <kwolf@redhat.com>
1
From: Stefano Garzarella <sgarzare@redhat.com>
2
2
3
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
3
Commit 0445409d74 ("iothread: generalize
4
Signed-off-by: John Snow <jsnow@redhat.com>
4
iothread_set_param/iothread_get_param") moved common code to set and
5
Reviewed-by: Eric Blake <eblake@redhat.com>
5
get IOThread parameters in two new functions.
6
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
6
7
Message-id: 20170809160212.29976-3-stefanha@redhat.com
7
These functions are called inside callbacks, so we don't need to use an
8
opaque pointer. Let's replace `void *opaque` parameter with
9
`IOThreadParamInfo *info`.
10
11
Suggested-by: Kevin Wolf <kwolf@redhat.com>
12
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
13
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
14
Message-id: 20210727145936.147032-3-sgarzare@redhat.com
8
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
15
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
9
---
16
---
10
tests/ide-test.c | 19 +++++++++++++++++++
17
iothread.c | 18 ++++++++++--------
11
1 file changed, 19 insertions(+)
18
1 file changed, 10 insertions(+), 8 deletions(-)
12
19
13
diff --git a/tests/ide-test.c b/tests/ide-test.c
20
diff --git a/iothread.c b/iothread.c
14
index XXXXXXX..XXXXXXX 100644
21
index XXXXXXX..XXXXXXX 100644
15
--- a/tests/ide-test.c
22
--- a/iothread.c
16
+++ b/tests/ide-test.c
23
+++ b/iothread.c
17
@@ -XXX,XX +XXX,XX @@ static void test_flush_nodev(void)
24
@@ -XXX,XX +XXX,XX @@ static IOThreadParamInfo aio_max_batch_info = {
18
ide_test_quit();
25
};
26
27
static void iothread_get_param(Object *obj, Visitor *v,
28
- const char *name, void *opaque, Error **errp)
29
+ const char *name, IOThreadParamInfo *info, Error **errp)
30
{
31
IOThread *iothread = IOTHREAD(obj);
32
- IOThreadParamInfo *info = opaque;
33
int64_t *field = (void *)iothread + info->offset;
34
35
visit_type_int64(v, name, field, errp);
19
}
36
}
20
37
21
+static void test_flush_empty_drive(void)
38
static bool iothread_set_param(Object *obj, Visitor *v,
22
+{
39
- const char *name, void *opaque, Error **errp)
23
+ QPCIDevice *dev;
40
+ const char *name, IOThreadParamInfo *info, Error **errp)
24
+ QPCIBar bmdma_bar, ide_bar;
25
+
26
+ ide_test_start("-device ide-cd,bus=ide.0");
27
+ dev = get_pci_device(&bmdma_bar, &ide_bar);
28
+
29
+ /* FLUSH CACHE command on device 0 */
30
+ qpci_io_writeb(dev, ide_bar, reg_device, 0);
31
+ qpci_io_writeb(dev, ide_bar, reg_command, CMD_FLUSH_CACHE);
32
+
33
+ /* Just testing that qemu doesn't crash... */
34
+
35
+ free_pci_device(dev);
36
+ ide_test_quit();
37
+}
38
+
39
static void test_pci_retry_flush(void)
40
{
41
{
41
test_retry_flush("pc");
42
IOThread *iothread = IOTHREAD(obj);
42
@@ -XXX,XX +XXX,XX @@ int main(int argc, char **argv)
43
- IOThreadParamInfo *info = opaque;
43
44
int64_t *field = (void *)iothread + info->offset;
44
qtest_add_func("/ide/flush", test_flush);
45
int64_t value;
45
qtest_add_func("/ide/flush/nodev", test_flush_nodev);
46
46
+ qtest_add_func("/ide/flush/empty_drive", test_flush_empty_drive);
47
@@ -XXX,XX +XXX,XX @@ static bool iothread_set_param(Object *obj, Visitor *v,
47
qtest_add_func("/ide/flush/retry_pci", test_pci_retry_flush);
48
static void iothread_get_poll_param(Object *obj, Visitor *v,
48
qtest_add_func("/ide/flush/retry_isa", test_isa_retry_flush);
49
const char *name, void *opaque, Error **errp)
50
{
51
+ IOThreadParamInfo *info = opaque;
52
53
- iothread_get_param(obj, v, name, opaque, errp);
54
+ iothread_get_param(obj, v, name, info, errp);
55
}
56
57
static void iothread_set_poll_param(Object *obj, Visitor *v,
58
const char *name, void *opaque, Error **errp)
59
{
60
IOThread *iothread = IOTHREAD(obj);
61
+ IOThreadParamInfo *info = opaque;
62
63
- if (!iothread_set_param(obj, v, name, opaque, errp)) {
64
+ if (!iothread_set_param(obj, v, name, info, errp)) {
65
return;
66
}
67
68
@@ -XXX,XX +XXX,XX @@ static void iothread_set_poll_param(Object *obj, Visitor *v,
69
static void iothread_get_aio_param(Object *obj, Visitor *v,
70
const char *name, void *opaque, Error **errp)
71
{
72
+ IOThreadParamInfo *info = opaque;
73
74
- iothread_get_param(obj, v, name, opaque, errp);
75
+ iothread_get_param(obj, v, name, info, errp);
76
}
77
78
static void iothread_set_aio_param(Object *obj, Visitor *v,
79
const char *name, void *opaque, Error **errp)
80
{
81
IOThread *iothread = IOTHREAD(obj);
82
+ IOThreadParamInfo *info = opaque;
83
84
- if (!iothread_set_param(obj, v, name, opaque, errp)) {
85
+ if (!iothread_set_param(obj, v, name, info, errp)) {
86
return;
87
}
49
88
50
--
89
--
51
2.13.4
90
2.31.1
52
91
53
92
diff view generated by jsdifflib