diff --git a/debian/patches/extra/0036-kvm-nbd-make-it-thread-safe-fix-qcow2-over-nbd.patch b/debian/patches/extra/0036-nbd-make-it-thread-safe-fix-qcow2-over-nbd.patch similarity index 84% rename from debian/patches/extra/0036-kvm-nbd-make-it-thread-safe-fix-qcow2-over-nbd.patch rename to debian/patches/extra/0036-nbd-make-it-thread-safe-fix-qcow2-over-nbd.patch index e44cec8..b6edf9b 100644 --- a/debian/patches/extra/0036-kvm-nbd-make-it-thread-safe-fix-qcow2-over-nbd.patch +++ b/debian/patches/extra/0036-nbd-make-it-thread-safe-fix-qcow2-over-nbd.patch @@ -1,18 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Eric Blake -Date: Sun, 11 Jun 2017 03:30:07 +0200 -Subject: [PATCH] nbd: make it thread-safe, fix qcow2 over nbd - -RH-Author: Eric Blake -Message-id: <20170611033007.399-1-eblake@redhat.com> -Patchwork-id: 75581 -O-Subject: [RHEV-7.4 qemu-kvm-rhev PATCH] nbd: make it thread-safe, fix qcow2 over nbd -Bugzilla: 1454582 -RH-Acked-by: Laurent Vivier -RH-Acked-by: Max Reitz -RH-Acked-by: Jeffrey Cody - From: Paolo Bonzini +Date: Thu, 1 Jun 2017 12:44:56 +0200 +Subject: [PATCH] nbd: make it thread-safe, fix qcow2 over nbd NBD is not thread safe, because it accesses s->in_flight without a CoMutex. Fixing this will be required for multiqueue. @@ -28,16 +17,12 @@ served over NBD (i.e. qemu-nbd --format=raw, and QEMU's -drive option has -format=qcow2). This patch fixes that issue too. Signed-off-by: Paolo Bonzini -(cherry picked from commit 6bdcc018a6ed760b9dfe43539124e420aed83092) -Signed-off-by: Eric Blake -Upstream-status: v6 pull request https://lists.gnu.org/archive/html/qemu-devel/2017-06/msg01841.html -Signed-off-by: Miroslav Rezanina --- block/nbd-client.c | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/block/nbd-client.c b/block/nbd-client.c -index 1e2952f..43e0292 100644 +index 56eb0e2e16..282679b4f8 100644 --- a/block/nbd-client.c +++ b/block/nbd-client.c @@ -114,6 +114,10 @@ static int nbd_co_send_request(BlockDriverState *bs, @@ -132,5 +117,5 @@ index 1e2952f..43e0292 100644 if (ret < 0) { reply.error = -ret; -- -1.8.3.1 +2.11.0 diff --git a/debian/patches/extra/0037-kvm-nbd-strict-nbd_wr_syncv.patch b/debian/patches/extra/0037-nbd-strict-nbd_wr_syncv.patch similarity index 73% rename from debian/patches/extra/0037-kvm-nbd-strict-nbd_wr_syncv.patch rename to debian/patches/extra/0037-nbd-strict-nbd_wr_syncv.patch index f8245df..c149913 100644 --- a/debian/patches/extra/0037-kvm-nbd-strict-nbd_wr_syncv.patch +++ b/debian/patches/extra/0037-nbd-strict-nbd_wr_syncv.patch @@ -1,18 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Eric Blake -Date: Wed, 19 Jul 2017 18:01:59 +0200 -Subject: [PATCH] nbd: strict nbd_wr_syncv - -RH-Author: Eric Blake -Message-id: <20170719180202.23329-2-eblake@redhat.com> -Patchwork-id: 75817 -O-Subject: [RHEV-7.4.z qemu-kvm-rhev PATCH 1/4] nbd: strict nbd_wr_syncv -Bugzilla: 1467509 -RH-Acked-by: Stefan Hajnoczi -RH-Acked-by: Paolo Bonzini -RH-Acked-by: Jeffrey Cody - From: Vladimir Sementsov-Ogievskiy +Date: Tue, 16 May 2017 12:45:29 +0300 +Subject: [PATCH] nbd: strict nbd_wr_syncv nbd_wr_syncv is called either from coroutine or from client negotiation code, when socket is in blocking mode. So, -EAGAIN is impossible. @@ -25,15 +14,12 @@ communication is broken. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20170516094533.6160-2-vsementsov@virtuozzo.com> Signed-off-by: Paolo Bonzini -(cherry picked from commit f250a42ddaee042ad2eb02022a3ebd18fcf987de) -Signed-off-by: Eric Blake -Signed-off-by: Miroslav Rezanina --- nbd/common.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/nbd/common.c b/nbd/common.c -index dccbb8e..4db45b3 100644 +index dccbb8e9de..4db45b3ede 100644 --- a/nbd/common.c +++ b/nbd/common.c @@ -20,6 +20,10 @@ @@ -62,5 +48,5 @@ index dccbb8e..4db45b3 100644 } if (len < 0) { -- -1.8.3.1 +2.11.0 diff --git a/debian/patches/extra/0038-kvm-nbd-read_sync-and-friends-return-0-on-success.patch b/debian/patches/extra/0038-nbd-read_sync-and-friends-return-0-on-success.patch similarity index 94% rename from debian/patches/extra/0038-kvm-nbd-read_sync-and-friends-return-0-on-success.patch rename to debian/patches/extra/0038-nbd-read_sync-and-friends-return-0-on-success.patch index 3b635b0..91d5205 100644 --- a/debian/patches/extra/0038-kvm-nbd-read_sync-and-friends-return-0-on-success.patch +++ b/debian/patches/extra/0038-nbd-read_sync-and-friends-return-0-on-success.patch @@ -1,18 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Eric Blake -Date: Wed, 19 Jul 2017 18:02:00 +0200 -Subject: [PATCH] nbd: read_sync and friends: return 0 on success - -RH-Author: Eric Blake -Message-id: <20170719180202.23329-3-eblake@redhat.com> -Patchwork-id: 75818 -O-Subject: [RHEV-7.4.z qemu-kvm-rhev PATCH 2/4] nbd: read_sync and friends: return 0 on success -Bugzilla: 1467509 -RH-Acked-by: Stefan Hajnoczi -RH-Acked-by: Paolo Bonzini -RH-Acked-by: Jeffrey Cody - From: Vladimir Sementsov-Ogievskiy +Date: Tue, 16 May 2017 12:45:30 +0300 +Subject: [PATCH] nbd: read_sync and friends: return 0 on success functions read_sync, drop_sync, write_sync, and also nbd_negotiate_write, nbd_negotiate_read, nbd_negotiate_drop_sync @@ -52,9 +41,6 @@ separate helper for this case - read_sync_eof. Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20170516094533.6160-3-vsementsov@virtuozzo.com> Signed-off-by: Paolo Bonzini -(cherry picked from commit f5d406fe86bb28da85824b6581e58980cc1a07f3) -Signed-off-by: Eric Blake -Signed-off-by: Miroslav Rezanina --- nbd/client.c | 63 ++++++++++++++++------------------------ nbd/nbd-internal.h | 34 +++++++++++++++++++--- @@ -62,7 +48,7 @@ Signed-off-by: Miroslav Rezanina 3 files changed, 88 insertions(+), 93 deletions(-) diff --git a/nbd/client.c b/nbd/client.c -index a58fb02..6b74a62 100644 +index a58fb02cb4..6b74a628f1 100644 --- a/nbd/client.c +++ b/nbd/client.c @@ -86,9 +86,9 @@ static QTAILQ_HEAD(, NBDExport) exports = QTAILQ_HEAD_INITIALIZER(exports); @@ -280,7 +266,7 @@ index a58fb02..6b74a62 100644 return ret; } diff --git a/nbd/nbd-internal.h b/nbd/nbd-internal.h -index f43d990..e6bbc7c 100644 +index f43d990a05..e6bbc7c4b4 100644 --- a/nbd/nbd-internal.h +++ b/nbd/nbd-internal.h @@ -94,7 +94,13 @@ @@ -335,7 +321,7 @@ index f43d990..e6bbc7c 100644 struct NBDTLSHandshakeData { diff --git a/nbd/server.c b/nbd/server.c -index a98bb21..b44cbe6 100644 +index 4d6da8ac06..c2a5909ad6 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -112,7 +112,7 @@ static gboolean nbd_negotiate_continue(QIOChannel *ioc, @@ -508,7 +494,7 @@ index a98bb21..b44cbe6 100644 LOG("read failed"); return -EINVAL; } -@@ -513,7 +510,7 @@ static int nbd_negotiate_options(NBDClient *client) +@@ -519,7 +516,7 @@ static int nbd_negotiate_options(NBDClient *client) return -EINVAL; default: @@ -517,7 +503,7 @@ index a98bb21..b44cbe6 100644 return -EIO; } ret = nbd_negotiate_send_rep_err(client->ioc, -@@ -551,7 +548,7 @@ static int nbd_negotiate_options(NBDClient *client) +@@ -557,7 +554,7 @@ static int nbd_negotiate_options(NBDClient *client) return nbd_negotiate_handle_export_name(client, length); case NBD_OPT_STARTTLS: @@ -526,7 +512,7 @@ index a98bb21..b44cbe6 100644 return -EIO; } if (client->tlscreds) { -@@ -570,7 +567,7 @@ static int nbd_negotiate_options(NBDClient *client) +@@ -576,7 +573,7 @@ static int nbd_negotiate_options(NBDClient *client) } break; default: @@ -535,7 +521,7 @@ index a98bb21..b44cbe6 100644 return -EIO; } ret = nbd_negotiate_send_rep_err(client->ioc, -@@ -659,12 +656,12 @@ static coroutine_fn int nbd_negotiate(NBDClientNewData *data) +@@ -665,12 +662,12 @@ static coroutine_fn int nbd_negotiate(NBDClientNewData *data) TRACE("TLS cannot be enabled with oldstyle protocol"); goto fail; } @@ -550,7 +536,7 @@ index a98bb21..b44cbe6 100644 LOG("write failed"); goto fail; } -@@ -679,7 +676,7 @@ static coroutine_fn int nbd_negotiate(NBDClientNewData *data) +@@ -685,7 +682,7 @@ static coroutine_fn int nbd_negotiate(NBDClientNewData *data) stq_be_p(buf + 18, client->exp->size); stw_be_p(buf + 26, client->exp->nbdflags | myflags); len = client->no_zeroes ? 10 : sizeof(buf) - 18; @@ -559,7 +545,7 @@ index a98bb21..b44cbe6 100644 LOG("write failed"); goto fail; } -@@ -702,11 +699,6 @@ static ssize_t nbd_receive_request(QIOChannel *ioc, NBDRequest *request) +@@ -708,11 +705,6 @@ static ssize_t nbd_receive_request(QIOChannel *ioc, NBDRequest *request) return ret; } @@ -571,7 +557,7 @@ index a98bb21..b44cbe6 100644 /* Request [ 0 .. 3] magic (NBD_REQUEST_MAGIC) [ 4 .. 5] flags (NBD_CMD_FLAG_FUA, ...) -@@ -737,7 +729,6 @@ static ssize_t nbd_receive_request(QIOChannel *ioc, NBDRequest *request) +@@ -743,7 +735,6 @@ static ssize_t nbd_receive_request(QIOChannel *ioc, NBDRequest *request) static ssize_t nbd_send_reply(QIOChannel *ioc, NBDReply *reply) { uint8_t buf[NBD_REPLY_SIZE]; @@ -579,7 +565,7 @@ index a98bb21..b44cbe6 100644 reply->error = system_errno_to_nbd_errno(reply->error); -@@ -754,16 +745,7 @@ static ssize_t nbd_send_reply(QIOChannel *ioc, NBDReply *reply) +@@ -760,16 +751,7 @@ static ssize_t nbd_send_reply(QIOChannel *ioc, NBDReply *reply) stl_be_p(buf + 4, reply->error); stq_be_p(buf + 8, reply->handle); @@ -597,7 +583,7 @@ index a98bb21..b44cbe6 100644 } #define MAX_NBD_REQUESTS 16 -@@ -1067,7 +1049,7 @@ static ssize_t nbd_co_send_reply(NBDRequestData *req, NBDReply *reply, +@@ -1073,7 +1055,7 @@ static ssize_t nbd_co_send_reply(NBDRequestData *req, NBDReply *reply, rc = nbd_send_reply(client->ioc, reply); if (rc >= 0) { ret = write_sync(client->ioc, req->data, len); @@ -606,7 +592,7 @@ index a98bb21..b44cbe6 100644 rc = -EIO; } } -@@ -1141,7 +1123,7 @@ static ssize_t nbd_co_receive_request(NBDRequestData *req, +@@ -1147,7 +1129,7 @@ static ssize_t nbd_co_receive_request(NBDRequestData *req, if (request->type == NBD_CMD_WRITE) { TRACE("Reading %" PRIu32 " byte(s)", request->len); @@ -616,5 +602,5 @@ index a98bb21..b44cbe6 100644 rc = -EIO; goto out; -- -1.8.3.1 +2.11.0 diff --git a/debian/patches/extra/0039-kvm-nbd-make-nbd_drop-public.patch b/debian/patches/extra/0039-nbd-make-nbd_drop-public.patch similarity index 97% rename from debian/patches/extra/0039-kvm-nbd-make-nbd_drop-public.patch rename to debian/patches/extra/0039-nbd-make-nbd_drop-public.patch index 0790170..03bc7cf 100644 --- a/debian/patches/extra/0039-kvm-nbd-make-nbd_drop-public.patch +++ b/debian/patches/extra/0039-nbd-make-nbd_drop-public.patch @@ -35,7 +35,7 @@ Signed-off-by: Miroslav Rezanina 3 files changed, 31 insertions(+), 29 deletions(-) diff --git a/nbd/client.c b/nbd/client.c -index 6b74a62..1652f28 100644 +index 6b74a628f1..1652f28e9f 100644 --- a/nbd/client.c +++ b/nbd/client.c @@ -86,32 +86,6 @@ static QTAILQ_HEAD(, NBDExport) exports = QTAILQ_HEAD_INITIALIZER(exports); @@ -99,7 +99,7 @@ index 6b74a62..1652f28 100644 goto fail; } diff --git a/nbd/common.c b/nbd/common.c -index 4db45b3..9a54010 100644 +index 4db45b3ede..9a54010c25 100644 --- a/nbd/common.c +++ b/nbd/common.c @@ -71,6 +71,32 @@ ssize_t nbd_wr_syncv(QIOChannel *ioc, @@ -136,7 +136,7 @@ index 4db45b3..9a54010 100644 void nbd_tls_handshake(QIOTask *task, void *opaque) diff --git a/nbd/nbd-internal.h b/nbd/nbd-internal.h -index e6bbc7c..c02378c 100644 +index e6bbc7c4b4..c02378c553 100644 --- a/nbd/nbd-internal.h +++ b/nbd/nbd-internal.h @@ -149,4 +149,6 @@ struct NBDTLSHandshakeData { @@ -147,5 +147,5 @@ index e6bbc7c..c02378c 100644 + #endif -- -1.8.3.1 +2.11.0 diff --git a/debian/patches/extra/0040-kvm-nbd-server-get-rid-of-nbd_negotiate_read-and-friends.patch b/debian/patches/extra/0040-nbd-server-get-rid-of-nbd_negotiate_read-and-friends.patch similarity index 96% rename from debian/patches/extra/0040-kvm-nbd-server-get-rid-of-nbd_negotiate_read-and-friends.patch rename to debian/patches/extra/0040-nbd-server-get-rid-of-nbd_negotiate_read-and-friends.patch index 594b020..638e22f 100644 --- a/debian/patches/extra/0040-kvm-nbd-server-get-rid-of-nbd_negotiate_read-and-friends.patch +++ b/debian/patches/extra/0040-nbd-server-get-rid-of-nbd_negotiate_read-and-friends.patch @@ -45,7 +45,7 @@ Signed-off-by: Eric Blake 1 file changed, 21 insertions(+), 85 deletions(-) diff --git a/nbd/server.c b/nbd/server.c -index b44cbe6..8e3b8e5 100644 +index c2a5909ad6..ddf93d4717 100644 --- a/nbd/server.c +++ b/nbd/server.c @@ -104,69 +104,6 @@ struct NBDClient { @@ -236,7 +236,7 @@ index b44cbe6..8e3b8e5 100644 LOG("read failed"); return -EINVAL; } -@@ -510,7 +446,7 @@ static int nbd_negotiate_options(NBDClient *client) +@@ -516,7 +452,7 @@ static int nbd_negotiate_options(NBDClient *client) return -EINVAL; default: @@ -245,7 +245,7 @@ index b44cbe6..8e3b8e5 100644 return -EIO; } ret = nbd_negotiate_send_rep_err(client->ioc, -@@ -548,7 +484,7 @@ static int nbd_negotiate_options(NBDClient *client) +@@ -554,7 +490,7 @@ static int nbd_negotiate_options(NBDClient *client) return nbd_negotiate_handle_export_name(client, length); case NBD_OPT_STARTTLS: @@ -254,7 +254,7 @@ index b44cbe6..8e3b8e5 100644 return -EIO; } if (client->tlscreds) { -@@ -567,7 +503,7 @@ static int nbd_negotiate_options(NBDClient *client) +@@ -573,7 +509,7 @@ static int nbd_negotiate_options(NBDClient *client) } break; default: @@ -263,7 +263,7 @@ index b44cbe6..8e3b8e5 100644 return -EIO; } ret = nbd_negotiate_send_rep_err(client->ioc, -@@ -656,12 +592,12 @@ static coroutine_fn int nbd_negotiate(NBDClientNewData *data) +@@ -662,12 +598,12 @@ static coroutine_fn int nbd_negotiate(NBDClientNewData *data) TRACE("TLS cannot be enabled with oldstyle protocol"); goto fail; } @@ -278,7 +278,7 @@ index b44cbe6..8e3b8e5 100644 LOG("write failed"); goto fail; } -@@ -676,7 +612,7 @@ static coroutine_fn int nbd_negotiate(NBDClientNewData *data) +@@ -682,7 +618,7 @@ static coroutine_fn int nbd_negotiate(NBDClientNewData *data) stq_be_p(buf + 18, client->exp->size); stw_be_p(buf + 26, client->exp->nbdflags | myflags); len = client->no_zeroes ? 10 : sizeof(buf) - 18; @@ -288,5 +288,5 @@ index b44cbe6..8e3b8e5 100644 goto fail; } -- -1.8.3.1 +2.11.0 diff --git a/debian/patches/extra/0041-kvm-nbd-client-Fix-regression-when-server-sends-garbage.patch b/debian/patches/extra/0041-nbd-client-Fix-regression-when-server-sends-garbage.patch similarity index 98% rename from debian/patches/extra/0041-kvm-nbd-client-Fix-regression-when-server-sends-garbage.patch rename to debian/patches/extra/0041-nbd-client-Fix-regression-when-server-sends-garbage.patch index 1d2c689..2d7560d 100644 --- a/debian/patches/extra/0041-kvm-nbd-client-Fix-regression-when-server-sends-garbage.patch +++ b/debian/patches/extra/0041-nbd-client-Fix-regression-when-server-sends-garbage.patch @@ -74,7 +74,7 @@ Conflicts: 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/block/nbd-client.c b/block/nbd-client.c -index 282679b..701b4ce 100644 +index 282679b4f8..701b4ce2eb 100644 --- a/block/nbd-client.c +++ b/block/nbd-client.c @@ -71,7 +71,7 @@ static coroutine_fn void nbd_read_reply_entry(void *opaque) @@ -137,7 +137,7 @@ index 282679b..701b4ce 100644 } else { if (qiov && reply->error == 0) { diff --git a/block/nbd-client.h b/block/nbd-client.h -index 891ba44..9774a8e 100644 +index 891ba44a20..9774a8ebbb 100644 --- a/block/nbd-client.h +++ b/block/nbd-client.h @@ -30,6 +30,7 @@ typedef struct NBDClientSession { @@ -149,5 +149,5 @@ index 891ba44..9774a8e 100644 NBDClientSession *nbd_get_client_session(BlockDriverState *bs); -- -1.8.3.1 +2.11.0 diff --git a/debian/patches/extra/0042-kvm-fix-build-failure-in-nbd_read_reply_entry.patch b/debian/patches/extra/0042-fix-build-failure-in-nbd_read_reply_entry.patch similarity index 97% rename from debian/patches/extra/0042-kvm-fix-build-failure-in-nbd_read_reply_entry.patch rename to debian/patches/extra/0042-fix-build-failure-in-nbd_read_reply_entry.patch index a64f863..27421cd 100644 --- a/debian/patches/extra/0042-kvm-fix-build-failure-in-nbd_read_reply_entry.patch +++ b/debian/patches/extra/0042-fix-build-failure-in-nbd_read_reply_entry.patch @@ -38,7 +38,7 @@ Conflicts: 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/nbd-client.c b/block/nbd-client.c -index 701b4ce..256dabe 100644 +index 701b4ce2eb..256dabeeef 100644 --- a/block/nbd-client.c +++ b/block/nbd-client.c @@ -69,7 +69,7 @@ static coroutine_fn void nbd_read_reply_entry(void *opaque) @@ -51,5 +51,5 @@ index 701b4ce..256dabe 100644 while (!s->quit) { assert(s->reply.handle == 0); -- -1.8.3.1 +2.11.0 diff --git a/debian/patches/extra/0043-kvm-nbd-client-avoid-spurious-qio_channel_yield-re-entry.patch b/debian/patches/extra/0043-nbd-client-avoid-spurious-qio_channel_yield-re-entry.patch similarity index 98% rename from debian/patches/extra/0043-kvm-nbd-client-avoid-spurious-qio_channel_yield-re-entry.patch rename to debian/patches/extra/0043-nbd-client-avoid-spurious-qio_channel_yield-re-entry.patch index 86ac8ac..ec3c61e 100644 --- a/debian/patches/extra/0043-kvm-nbd-client-avoid-spurious-qio_channel_yield-re-entry.patch +++ b/debian/patches/extra/0043-nbd-client-avoid-spurious-qio_channel_yield-re-entry.patch @@ -50,7 +50,7 @@ Signed-off-by: Miroslav Rezanina 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/block/nbd-client.c b/block/nbd-client.c -index 256dabe..f7bca3f 100644 +index 256dabeeef..f7bca3f996 100644 --- a/block/nbd-client.c +++ b/block/nbd-client.c @@ -38,8 +38,10 @@ static void nbd_recv_coroutines_enter_all(NBDClientSession *s) @@ -155,7 +155,7 @@ index 256dabe..f7bca3f 100644 /* Kick the read_reply_co to get the next reply. */ if (s->read_reply_co) { diff --git a/block/nbd-client.h b/block/nbd-client.h -index 9774a8e..f97792f 100644 +index 9774a8ebbb..f97792ff49 100644 --- a/block/nbd-client.h +++ b/block/nbd-client.h @@ -17,6 +17,11 @@ @@ -180,5 +180,5 @@ index 9774a8e..f97792f 100644 bool quit; } NBDClientSession; -- -1.8.3.1 +2.11.0 diff --git a/debian/patches/extra/0044-kvm-nbd-client-avoid-read_reply_co-entry-if-send-failed.patch b/debian/patches/extra/0044-nbd-client-avoid-read_reply_co-entry-if-send-failed.patch similarity index 99% rename from debian/patches/extra/0044-kvm-nbd-client-avoid-read_reply_co-entry-if-send-failed.patch rename to debian/patches/extra/0044-nbd-client-avoid-read_reply_co-entry-if-send-failed.patch index 30af881..17baf21 100644 --- a/debian/patches/extra/0044-kvm-nbd-client-avoid-read_reply_co-entry-if-send-failed.patch +++ b/debian/patches/extra/0044-nbd-client-avoid-read_reply_co-entry-if-send-failed.patch @@ -67,7 +67,7 @@ Signed-off-by: Miroslav Rezanina 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/block/nbd-client.c b/block/nbd-client.c -index f7bca3f..434acf6 100644 +index f7bca3f996..434acf647f 100644 --- a/block/nbd-client.c +++ b/block/nbd-client.c @@ -139,12 +139,12 @@ static int nbd_co_send_request(BlockDriverState *bs, @@ -156,5 +156,5 @@ index f7bca3f..434acf6 100644 } -- -1.8.3.1 +2.11.0 diff --git a/debian/patches/extra/0045-kvm-qemu-iotests-improve-nbd-fault-injector.py-startup-p.patch b/debian/patches/extra/0045-qemu-iotests-improve-nbd-fault-injector.py-startup-p.patch similarity index 97% rename from debian/patches/extra/0045-kvm-qemu-iotests-improve-nbd-fault-injector.py-startup-p.patch rename to debian/patches/extra/0045-qemu-iotests-improve-nbd-fault-injector.py-startup-p.patch index d91cd7e..1053a7f 100644 --- a/debian/patches/extra/0045-kvm-qemu-iotests-improve-nbd-fault-injector.py-startup-p.patch +++ b/debian/patches/extra/0045-qemu-iotests-improve-nbd-fault-injector.py-startup-p.patch @@ -1,8 +1,7 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Wed, 27 Sep 2017 17:57:23 +0200 -Subject: [PATCH] qemu-iotests: improve nbd-fault-injector.py startup - protocol +Subject: [PATCH] qemu-iotests: improve nbd-fault-injector.py startup protocol RH-Author: Eric Blake Message-id: <20170927175725.20023-6-eblake@redhat.com> @@ -37,7 +36,7 @@ Signed-off-by: Miroslav Rezanina 1 file changed, 4 insertions(+) diff --git a/tests/qemu-iotests/nbd-fault-injector.py b/tests/qemu-iotests/nbd-fault-injector.py -index 6c07191..1c10dcb 100755 +index 6c07191a5a..1c10dcb51c 100755 --- a/tests/qemu-iotests/nbd-fault-injector.py +++ b/tests/qemu-iotests/nbd-fault-injector.py @@ -235,11 +235,15 @@ def open_socket(path): @@ -57,5 +56,5 @@ index 6c07191..1c10dcb 100755 def usage(args): -- -1.8.3.1 +2.11.0 diff --git a/debian/patches/extra/0046-kvm-qemu-iotests-test-NBD-over-UNIX-domain-sockets-in-08.patch b/debian/patches/extra/0046-qemu-iotests-test-NBD-over-UNIX-domain-sockets-in-08.patch similarity index 98% rename from debian/patches/extra/0046-kvm-qemu-iotests-test-NBD-over-UNIX-domain-sockets-in-08.patch rename to debian/patches/extra/0046-qemu-iotests-test-NBD-over-UNIX-domain-sockets-in-08.patch index 995f238..4c4d618 100644 --- a/debian/patches/extra/0046-kvm-qemu-iotests-test-NBD-over-UNIX-domain-sockets-in-08.patch +++ b/debian/patches/extra/0046-qemu-iotests-test-NBD-over-UNIX-domain-sockets-in-08.patch @@ -47,7 +47,7 @@ Signed-off-by: Eric Blake 3 files changed, 212 insertions(+), 71 deletions(-) diff --git a/tests/qemu-iotests/083 b/tests/qemu-iotests/083 -index bff9360..0306f11 100755 +index bff9360048..0306f112da 100755 --- a/tests/qemu-iotests/083 +++ b/tests/qemu-iotests/083 @@ -27,6 +27,14 @@ echo "QA output created by $seq" @@ -224,7 +224,7 @@ index bff9360..0306f11 100755 # success, all done diff --git a/tests/qemu-iotests/083.out b/tests/qemu-iotests/083.out -index 0c13888..7419722 100644 +index 0c13888ba1..7419722cd7 100644 --- a/tests/qemu-iotests/083.out +++ b/tests/qemu-iotests/083.out @@ -1,43 +1,43 @@ @@ -434,10 +434,10 @@ index 0c13888..7419722 100644 === Check disconnect after neg-classic === diff --git a/tests/qemu-iotests/common.filter b/tests/qemu-iotests/common.filter -index c9a2d5c..f06d4dc 100644 +index 104001358b..65ec315f25 100644 --- a/tests/qemu-iotests/common.filter +++ b/tests/qemu-iotests/common.filter -@@ -154,9 +154,9 @@ _filter_nbd() +@@ -153,9 +153,9 @@ _filter_nbd() # # Filter out the TCP port number since this changes between runs. sed -e '/nbd\/.*\.c:/d' \ @@ -450,5 +450,5 @@ index c9a2d5c..f06d4dc 100644 # make sure this script returns success -- -1.8.3.1 +2.11.0 diff --git a/debian/patches/extra/0047-kvm-block-nbd-client-nbd_co_send_request-fix-return-code.patch b/debian/patches/extra/0047-block-nbd-client-nbd_co_send_request-fix-return-code.patch similarity index 97% rename from debian/patches/extra/0047-kvm-block-nbd-client-nbd_co_send_request-fix-return-code.patch rename to debian/patches/extra/0047-block-nbd-client-nbd_co_send_request-fix-return-code.patch index 952cd07..84b7815 100644 --- a/debian/patches/extra/0047-kvm-block-nbd-client-nbd_co_send_request-fix-return-code.patch +++ b/debian/patches/extra/0047-block-nbd-client-nbd_co_send_request-fix-return-code.patch @@ -28,7 +28,7 @@ Signed-off-by: Miroslav Rezanina 1 file changed, 2 insertions(+) diff --git a/block/nbd-client.c b/block/nbd-client.c -index 434acf6..76789c1 100644 +index 434acf647f..76789c1829 100644 --- a/block/nbd-client.c +++ b/block/nbd-client.c @@ -156,6 +156,8 @@ static int nbd_co_send_request(BlockDriverState *bs, @@ -41,5 +41,5 @@ index 434acf6..76789c1 100644 qio_channel_set_cork(s->ioc, false); } else { -- -1.8.3.1 +2.11.0 diff --git a/debian/patches/extra/0048-target-i386-cpu-Add-new-EPYC-CPU-model.patch b/debian/patches/extra/0048-target-i386-cpu-Add-new-EPYC-CPU-model.patch new file mode 100644 index 0000000..8a20217 --- /dev/null +++ b/debian/patches/extra/0048-target-i386-cpu-Add-new-EPYC-CPU-model.patch @@ -0,0 +1,86 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Brijesh Singh +Date: Tue, 15 Aug 2017 12:00:51 -0500 +Subject: [PATCH] target-i386/cpu: Add new EPYC CPU model + +Add a new base CPU model called 'EPYC' to model processors from AMD EPYC +family (which includes EPYC 76xx,75xx,74xx, 73xx and 72xx). + +The following features bits have been added/removed compare to Opteron_G5 + +Added: monitor, movbe, rdrand, mmxext, ffxsr, rdtscp, cr8legacy, osvw, + fsgsbase, bmi1, avx2, smep, bmi2, rdseed, adx, smap, clfshopt, sha + xsaveopt, xsavec, xgetbv1, arat + +Removed: xop, fma4, tbm + +Cc: Paolo Bonzini +Cc: Richard Henderson +Cc: Eduardo Habkost +Cc: Tom Lendacky +Signed-off-by: Brijesh Singh +Message-Id: <20170815170051.127257-1-brijesh.singh@amd.com> +Reviewed-by: Eduardo Habkost +Signed-off-by: Eduardo Habkost +--- + target/i386/cpu.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 44 insertions(+) + +diff --git a/target/i386/cpu.c b/target/i386/cpu.c +index e4a2d5a012..e977c6c616 100644 +--- a/target/i386/cpu.c ++++ b/target/i386/cpu.c +@@ -1923,6 +1923,50 @@ static X86CPUDefinition builtin_x86_defs[] = { + .xlevel = 0x8000001A, + .model_id = "AMD Opteron 63xx class CPU", + }, ++ { ++ .name = "EPYC", ++ .level = 0xd, ++ .vendor = CPUID_VENDOR_AMD, ++ .family = 23, ++ .model = 1, ++ .stepping = 2, ++ .features[FEAT_1_EDX] = ++ CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX | CPUID_CLFLUSH | ++ CPUID_PSE36 | CPUID_PAT | CPUID_CMOV | CPUID_MCA | CPUID_PGE | ++ CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 | CPUID_MCE | ++ CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE | CPUID_DE | ++ CPUID_VME | CPUID_FP87, ++ .features[FEAT_1_ECX] = ++ CPUID_EXT_RDRAND | CPUID_EXT_F16C | CPUID_EXT_AVX | ++ CPUID_EXT_XSAVE | CPUID_EXT_AES | CPUID_EXT_POPCNT | ++ CPUID_EXT_MOVBE | CPUID_EXT_SSE42 | CPUID_EXT_SSE41 | ++ CPUID_EXT_CX16 | CPUID_EXT_FMA | CPUID_EXT_SSSE3 | ++ CPUID_EXT_MONITOR | CPUID_EXT_PCLMULQDQ | CPUID_EXT_SSE3, ++ .features[FEAT_8000_0001_EDX] = ++ CPUID_EXT2_LM | CPUID_EXT2_RDTSCP | CPUID_EXT2_PDPE1GB | ++ CPUID_EXT2_FFXSR | CPUID_EXT2_MMXEXT | CPUID_EXT2_NX | ++ CPUID_EXT2_SYSCALL, ++ .features[FEAT_8000_0001_ECX] = ++ CPUID_EXT3_OSVW | CPUID_EXT3_3DNOWPREFETCH | ++ CPUID_EXT3_MISALIGNSSE | CPUID_EXT3_SSE4A | CPUID_EXT3_ABM | ++ CPUID_EXT3_CR8LEG | CPUID_EXT3_SVM | CPUID_EXT3_LAHF_LM, ++ .features[FEAT_7_0_EBX] = ++ CPUID_7_0_EBX_FSGSBASE | CPUID_7_0_EBX_BMI1 | CPUID_7_0_EBX_AVX2 | ++ CPUID_7_0_EBX_SMEP | CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_RDSEED | ++ CPUID_7_0_EBX_ADX | CPUID_7_0_EBX_SMAP | CPUID_7_0_EBX_CLFLUSHOPT | ++ CPUID_7_0_EBX_SHA_NI, ++ /* Missing: XSAVES (not supported by some Linux versions, ++ * including v4.1 to v4.12). ++ * KVM doesn't yet expose any XSAVES state save component. ++ */ ++ .features[FEAT_XSAVE] = ++ CPUID_XSAVE_XSAVEOPT | CPUID_XSAVE_XSAVEC | ++ CPUID_XSAVE_XGETBV1, ++ .features[FEAT_6_EAX] = ++ CPUID_6_EAX_ARAT, ++ .xlevel = 0x8000000A, ++ .model_id = "AMD EPYC Processor", ++ }, + }; + + typedef struct PropValue { +-- +2.11.0 + diff --git a/debian/patches/extra/0049-i386-Add-EPYC-IBPB-CPU-model.patch b/debian/patches/extra/0049-i386-Add-EPYC-IBPB-CPU-model.patch new file mode 100644 index 0000000..665aefe --- /dev/null +++ b/debian/patches/extra/0049-i386-Add-EPYC-IBPB-CPU-model.patch @@ -0,0 +1,78 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Eduardo Habkost +Date: Tue, 9 Jan 2018 13:45:18 -0200 +Subject: [PATCH] i386: Add EPYC-IBPB CPU model + +EPYC-IBPB is a copy of the EPYC CPU model with +just CPUID_8000_0008_EBX_IBPB added. + +Cc: Jiri Denemark +Cc: Tom Lendacky +Cc: Brijesh Singh +Signed-off-by: Eduardo Habkost +Message-Id: <20180109154519.25634-7-ehabkost@redhat.com> +Signed-off-by: Eduardo Habkost +--- + target/i386/cpu.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 46 insertions(+) + +diff --git a/target/i386/cpu.c b/target/i386/cpu.c +index e977c6c616..95e6a1f122 100644 +--- a/target/i386/cpu.c ++++ b/target/i386/cpu.c +@@ -1967,6 +1967,52 @@ static X86CPUDefinition builtin_x86_defs[] = { + .xlevel = 0x8000000A, + .model_id = "AMD EPYC Processor", + }, ++ { ++ .name = "EPYC-IBPB", ++ .level = 0xd, ++ .vendor = CPUID_VENDOR_AMD, ++ .family = 23, ++ .model = 1, ++ .stepping = 2, ++ .features[FEAT_1_EDX] = ++ CPUID_SSE2 | CPUID_SSE | CPUID_FXSR | CPUID_MMX | CPUID_CLFLUSH | ++ CPUID_PSE36 | CPUID_PAT | CPUID_CMOV | CPUID_MCA | CPUID_PGE | ++ CPUID_MTRR | CPUID_SEP | CPUID_APIC | CPUID_CX8 | CPUID_MCE | ++ CPUID_PAE | CPUID_MSR | CPUID_TSC | CPUID_PSE | CPUID_DE | ++ CPUID_VME | CPUID_FP87, ++ .features[FEAT_1_ECX] = ++ CPUID_EXT_RDRAND | CPUID_EXT_F16C | CPUID_EXT_AVX | ++ CPUID_EXT_XSAVE | CPUID_EXT_AES | CPUID_EXT_POPCNT | ++ CPUID_EXT_MOVBE | CPUID_EXT_SSE42 | CPUID_EXT_SSE41 | ++ CPUID_EXT_CX16 | CPUID_EXT_FMA | CPUID_EXT_SSSE3 | ++ CPUID_EXT_MONITOR | CPUID_EXT_PCLMULQDQ | CPUID_EXT_SSE3, ++ .features[FEAT_8000_0001_EDX] = ++ CPUID_EXT2_LM | CPUID_EXT2_RDTSCP | CPUID_EXT2_PDPE1GB | ++ CPUID_EXT2_FFXSR | CPUID_EXT2_MMXEXT | CPUID_EXT2_NX | ++ CPUID_EXT2_SYSCALL, ++ .features[FEAT_8000_0001_ECX] = ++ CPUID_EXT3_OSVW | CPUID_EXT3_3DNOWPREFETCH | ++ CPUID_EXT3_MISALIGNSSE | CPUID_EXT3_SSE4A | CPUID_EXT3_ABM | ++ CPUID_EXT3_CR8LEG | CPUID_EXT3_SVM | CPUID_EXT3_LAHF_LM, ++ .features[FEAT_8000_0008_EBX] = ++ CPUID_8000_0008_EBX_IBPB, ++ .features[FEAT_7_0_EBX] = ++ CPUID_7_0_EBX_FSGSBASE | CPUID_7_0_EBX_BMI1 | CPUID_7_0_EBX_AVX2 | ++ CPUID_7_0_EBX_SMEP | CPUID_7_0_EBX_BMI2 | CPUID_7_0_EBX_RDSEED | ++ CPUID_7_0_EBX_ADX | CPUID_7_0_EBX_SMAP | CPUID_7_0_EBX_CLFLUSHOPT | ++ CPUID_7_0_EBX_SHA_NI, ++ /* Missing: XSAVES (not supported by some Linux versions, ++ * including v4.1 to v4.12). ++ * KVM doesn't yet expose any XSAVES state save component. ++ */ ++ .features[FEAT_XSAVE] = ++ CPUID_XSAVE_XSAVEOPT | CPUID_XSAVE_XSAVEC | ++ CPUID_XSAVE_XGETBV1, ++ .features[FEAT_6_EAX] = ++ CPUID_6_EAX_ARAT, ++ .xlevel = 0x8000000A, ++ .model_id = "AMD EPYC Processor (with IBPB)", ++ }, + }; + + typedef struct PropValue { +-- +2.11.0 + diff --git a/debian/patches/series b/debian/patches/series index eb0e7d5..c49ca96 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -63,15 +63,17 @@ extra/0032-i386-Add-spec-ctrl-CPUID-bit.patch extra/0033-i386-Add-FEAT_8000_0008_EBX-CPUID-feature-word.patch extra/0034-i386-Add-new-IBRS-versions-of-Intel-CPU-models.patch extra/0035-ratelimit-don-t-align-wait-time-with-slices.patch -extra/0036-kvm-nbd-make-it-thread-safe-fix-qcow2-over-nbd.patch -extra/0037-kvm-nbd-strict-nbd_wr_syncv.patch -extra/0038-kvm-nbd-read_sync-and-friends-return-0-on-success.patch -extra/0039-kvm-nbd-make-nbd_drop-public.patch -extra/0040-kvm-nbd-server-get-rid-of-nbd_negotiate_read-and-friends.patch -extra/0041-kvm-nbd-client-Fix-regression-when-server-sends-garbage.patch -extra/0042-kvm-fix-build-failure-in-nbd_read_reply_entry.patch -extra/0043-kvm-nbd-client-avoid-spurious-qio_channel_yield-re-entry.patch -extra/0044-kvm-nbd-client-avoid-read_reply_co-entry-if-send-failed.patch -extra/0045-kvm-qemu-iotests-improve-nbd-fault-injector.py-startup-p.patch -extra/0046-kvm-qemu-iotests-test-NBD-over-UNIX-domain-sockets-in-08.patch -extra/0047-kvm-block-nbd-client-nbd_co_send_request-fix-return-code.patch +extra/0036-nbd-make-it-thread-safe-fix-qcow2-over-nbd.patch +extra/0037-nbd-strict-nbd_wr_syncv.patch +extra/0038-nbd-read_sync-and-friends-return-0-on-success.patch +extra/0039-nbd-make-nbd_drop-public.patch +extra/0040-nbd-server-get-rid-of-nbd_negotiate_read-and-friends.patch +extra/0041-nbd-client-Fix-regression-when-server-sends-garbage.patch +extra/0042-fix-build-failure-in-nbd_read_reply_entry.patch +extra/0043-nbd-client-avoid-spurious-qio_channel_yield-re-entry.patch +extra/0044-nbd-client-avoid-read_reply_co-entry-if-send-failed.patch +extra/0045-qemu-iotests-improve-nbd-fault-injector.py-startup-p.patch +extra/0046-qemu-iotests-test-NBD-over-UNIX-domain-sockets-in-08.patch +extra/0047-block-nbd-client-nbd_co_send_request-fix-return-code.patch +extra/0048-target-i386-cpu-Add-new-EPYC-CPU-model.patch +extra/0049-i386-Add-EPYC-IBPB-CPU-model.patch