271 Commits

Author SHA1 Message Date
Huawei Technologies Co., Ltd
06391f3674 scsi-disk: Add support for retry on errors
Mark failed requests as to be retried and implement retry_request_cb to
handle these requests.

Signed-off-by: Jiahui Cen <cenjiahui(a)huawei.com>
Signed-off-by: Ying Fang <fangying1(a)huawei.com>
2021-01-30 16:26:59 +08:00
Huawei Technologies Co., Ltd
88c646e68d scsi-bus: Refactor the code that retries requests
Move the code that retries requests from scsi_dma_restart_bh() to its own,
non-static, function. This will allow us to call it from the
retry_request_cb() of scsi-disk in a future patch.

Signed-off-by: Jiahui Cen <cenjiahui(a)huawei.com>
Signed-off-by: Ying Fang <fangying1(a)huawei.com>
2021-01-30 16:26:59 +08:00
openeuler-ci-bot
755f2398af !192 feature: enable spice protocol
From: @yorifang
Reviewed-by: @zhendongchen
Signed-off-by: @zhendongchen
2021-01-21 09:16:22 +08:00
Ying Fang
1f69406f31 feature: enable spice protocol
Enable the spice protocol

Signed-off-by: Ying Fang <fangying1@huawei.com>
2021-01-19 20:14:15 +08:00
Ying Fang
e68cf6bcb7 spec: recoder changelog
Nothing but just reorder the changelog.

Signed-off-by: Ying Fang <fangying1@huawei.com>
2021-01-19 20:11:31 +08:00
openeuler-ci-bot
293311b862 !190 Automatically generate code patches with openeuler !60
From: @zhendongchen
Reviewed-by: @yorifang
Signed-off-by: @yorifang
2021-01-18 10:02:28 +08:00
Euler Robot
d048d2e58f spec: Update release version with !60
increase release verison by one

Signed-off-by: Euler Robot <euler.robot@huawei.com>
2021-01-15 11:27:06 +08:00
Euler Robot
83a95bec06 spec: Update patch and changelog with !60
memory: clamp cached translation in case it points to an MMIO region

Signed-off-by: Alex Chen <alex.chen@huawei.com>
2021-01-15 11:26:50 +08:00
Huawei Technologies Co., Ltd
adf69c7e9f memory: clamp cached translation in case it points to an MMIO region
In using the address_space_translate_internal API, address_space_cache_init
forgot one piece of advice that can be found in the code for
address_space_translate_internal:

    /* MMIO registers can be expected to perform full-width accesses based only
     * on their address, without considering adjacent registers that could
     * decode to completely different MemoryRegions.  When such registers
     * exist (e.g. I/O ports 0xcf8 and 0xcf9 on most PC chipsets), MMIO
     * regions overlap wildly.  For this reason we cannot clamp the accesses
     * here.
     *
     * If the length is small (as is the case for address_space_ldl/stl),
     * everything works fine.  If the incoming length is large, however,
     * the caller really has to do the clamping through memory_access_size.
     */

address_space_cache_init is exactly one such case where "the incoming length
is large", therefore we need to clamp the resulting length---not to
memory_access_size though, since we are not doing an access yet, but to
the size of the resulting section.  This ensures that subsequent accesses
to the cached MemoryRegionSection will be in range.

With this patch, the enclosed testcase notices that the used ring does
not fit into the MSI-X table and prints a "qemu-system-x86_64: Cannot map used"
error.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry-picked from 4bfb024b)
Fix CVE-2020-27821
Signed-off-by: Alex Chen <alex.chen@huawei.com>
2021-01-15 11:26:50 +08:00
openeuler-ci-bot
77ddf84cc1 !186 spec: updating the license info
From: @zhendongchen
Reviewed-by: @yorifang
Signed-off-by: @yorifang
2021-01-12 09:15:26 +08:00
Alex Chen
a650a5c510 spec: updating the license info
Specify the version of CC-BY license

Signed-off-by: Alex Chen <alex.chen@huawei.com>
2021-01-08 14:00:45 +08:00
openeuler-ci-bot
2cf6d11541 !183 Automatically generate code patches with openeuler !56
From: @zhendongchen
Reviewed-by: @yorifang
Signed-off-by: @yorifang
2021-01-06 09:41:47 +08:00
Euler Robot
1710ca191e spec: Update release version with !56
increase release verison by one

Signed-off-by: Euler Robot <euler.robot@huawei.com>
2021-01-04 16:26:46 +08:00
Euler Robot
51ce899440 spec: Update patch and changelog with !56
target/arm: Fix write redundant values to kvm

Signed-off-by: Alex Chen <alex.chen@huawei.com>
2021-01-04 16:26:46 +08:00
Huawei Technologies Co., Ltd
b557041d0a target/arm: Fix write redundant values to kvm
After modifying the value of a ID register, we'd better to try to write
it to KVM so that we can known the value is acceptable for KVM.
Because it may modify the registers' values of KVM, it's not suitable
for other registers.

(cherry-picked from a0d7a9de807639fcfcbe1fe037cb8772d459a9cf)
Signed-off-by: Peng Liang <liangpeng10@huawei.com>
2021-01-04 16:26:46 +08:00
openeuler-ci-bot
c0da532870 !182 Automatically generate code patches with openeuler !57
From: @zhendongchen
Reviewed-by: @yorifang
Signed-off-by: @yorifang
2021-01-04 15:15:01 +08:00
Euler Robot
4ee63994f5 spec: Update release version with !57
increase release verison by one

Signed-off-by: Euler Robot <euler.robot@huawei.com>
2020-12-31 11:27:02 +08:00
Euler Robot
903c155e74 spec: Update patch and changelog with !57
hostmem: Fix up free host_nodes list right after visited

Signed-off-by: Alex Chen <alex.chen@huawei.com>
2020-12-31 11:26:53 +08:00
Huawei Technologies Co., Ltd
fe07d5c3ef hostmem: Fix up free host_nodes list right after visited
In host_memory_backend_get_host_nodes, we build host_nodes
list and output it to v (a StringOutputVisitor) but forget
to free the list. This fixes the memory leak.

The memory leak stack:

Direct leak of 32 byte(s) in 2 object(s) allocated from:
 #0 0xfffda30b3393 in __interceptor_calloc (/usr/lib64/libasan.so.4+0xd3393)
 #1 0xfffda1d28b9b in g_malloc0 (/usr/lib64/libglib-2.0.so.0+0x58b9b)
 #2 0xaaab05ca6e43 in host_memory_backend_get_host_nodes backends/hostmem.c:94
 #3 0xaaab061ddf83 in object_property_get_uint16List qom/object.c:1478
 #4 0xaaab05866513 in query_memdev hw/core/machine-qmp-cmds.c:312
 #5 0xaaab061d980b in do_object_child_foreach qom/object.c:1001
 #6 0xaaab0586779b in qmp_query_memdev hw/core/machine-qmp-cmds.c:328
 #7 0xaaab0615ed3f in qmp_marshal_query_memdev qapi/qapi-commands-machine.c:327
 #8 0xaaab0632d647 in do_qmp_dispatch qapi/qmp-dispatch.c:147
 #9 0xaaab0632d647 in qmp_dispatch qapi/qmp-dispatch.c:190
 #10 0xaaab0610f74b in monitor_qmp_dispatch monitor/qmp.c:120
 #11 0xaaab0611074b in monitor_qmp_bh_dispatcher monitor/qmp.c:209
 #12 0xaaab063caefb in aio_bh_poll util/async.c:117
 #13 0xaaab063d30fb in aio_dispatch util/aio-posix.c:459
 #14 0xaaab063cac8f in aio_ctx_dispatch util/async.c:268
 #15 0xfffda1d22a6b in g_main_context_dispatch (/usr/lib64/libglib-2.0.so.0+0x52a6b)
 #16 0xaaab063d0e97 in glib_pollfds_poll util/main-loop.c:218
 #17 0xaaab063d0e97 in os_host_main_loop_wait util/main-loop.c:241
 #18 0xaaab063d0e97 in main_loop_wait util/main-loop.c:517
 #19 0xaaab05c8bfa7 in main_loop /root/rpmbuild/BUILD/qemu-4.1.0/vl.c:1791
 #20 0xaaab05713bc3 in main /root/rpmbuild/BUILD/qemu-4.1.0/vl.c:4473
 #21 0xfffda0a83ebf in __libc_start_main (/usr/lib64/libc.so.6+0x23ebf)
 #22 0xaaab0571ed5f (aarch64-softmmu/qemu-system-aarch64+0x88ed5f)
SUMMARY: AddressSanitizer: 32 byte(s) leaked in 2 allocation(s).

Fixes: 4cf1b76bf1e2 (hostmem: add properties for NUMA memory policy)
Reported-by: Euler Robot <euler.robot@huawei.com>
Tested-by: Chen Qun <kuhn.chenqun@huawei.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
2020-12-31 11:26:53 +08:00
openeuler-ci-bot
141527b3c8 !179 Add qemu-block-rbd and qemu-block-ssh packages
From: @yangming73
Reviewed-by: @zhendongchen,@yorifang
Signed-off-by: @yorifang
2020-12-29 16:22:27 +08:00
Ming Yang
c0ee9876b5 spec: Add two packages.
1. Add qemu-block-rbd package.
2. Add qemu-block-ssh package.

Signed-off-by: Ming Yang <yangming73@huawei.com>
2020-12-28 20:25:54 +08:00
openeuler-ci-bot
c14fc30cad !178 Automatically generate code patches with openeuler !51
From: @zhendongchen
Reviewed-by: @yorifang
Signed-off-by: @yorifang
2020-12-16 13:35:17 +08:00
Euler Robot
aae6cc182b spec: Update release version with !51
increase release verison by one

Signed-off-by: Euler Robot <euler.robot@huawei.com>
2020-12-15 21:27:38 +08:00
Euler Robot
fb6029a728 spec: Update patch and changelog with !51
hw: usb: hcd-ohci: check for processed TD before retire
hw: ehci: check return value of 'usb_packet_map'
hw: usb: hcd-ohci: check len and frame_number variables
hw/net/e1000e: advance desc_offset in case of null descriptor

Signed-off-by: Alex Chen <alex.chen@huawei.com>
2020-12-15 21:27:19 +08:00
Huawei Technologies Co., Ltd
0ae4f14e93 hw/net/e1000e: advance desc_offset in case of null descriptor
While receiving packets via e1000e_write_packet_to_guest() routine,
'desc_offset' is advanced only when RX descriptor is processed. And
RX descriptor is not processed if it has NULL buffer address.
This may lead to an infinite loop condition. Increament 'desc_offset'
to process next descriptor in the ring to avoid infinite loop.

Reported-by: Cheol-woo Myung <330cjfdn@gmail.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry-picked from c2cb5116)
Fix CVE-2020-28916
Signed-off-by: Alex Chen <alex.chen@huawei.com>
2020-12-15 21:27:19 +08:00
Huawei Technologies Co., Ltd
1da457d194 hw: usb: hcd-ohci: check len and frame_number variables
While servicing the OHCI transfer descriptors(TD), OHCI host
controller derives variables 'start_addr', 'end_addr', 'len'
etc. from values supplied by the host controller driver.
Host controller driver may supply values such that using
above variables leads to out-of-bounds access issues.
Add checks to avoid them.

AddressSanitizer: stack-buffer-overflow on address 0x7ffd53af76a0
  READ of size 2 at 0x7ffd53af76a0 thread T0
  #0 ohci_service_iso_td ../hw/usb/hcd-ohci.c:734
  #1 ohci_service_ed_list ../hw/usb/hcd-ohci.c:1180
  #2 ohci_process_lists ../hw/usb/hcd-ohci.c:1214
  #3 ohci_frame_boundary ../hw/usb/hcd-ohci.c:1257
  #4 timerlist_run_timers ../util/qemu-timer.c:572
  #5 qemu_clock_run_timers ../util/qemu-timer.c:586
  #6 qemu_clock_run_all_timers ../util/qemu-timer.c:672
  #7 main_loop_wait ../util/main-loop.c:527
  #8 qemu_main_loop ../softmmu/vl.c:1676
  #9 main ../softmmu/main.c:50

Reported-by: Gaoning Pan <pgn@zju.edu.cn>
Reported-by: Yongkang Jia <j_kangel@163.com>
Reported-by: Yi Ren <yunye.ry@alibaba-inc.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Message-id: 20200915182259.68522-2-ppandit@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry-picked from 1328fe0c)
Fix CVE-2020-25624
Signed-off-by: Alex Chen <alex.chen@huawei.com>
2020-12-15 21:27:19 +08:00
Huawei Technologies Co., Ltd
baf7742ed7 hw: ehci: check return value of 'usb_packet_map'
If 'usb_packet_map' fails, we should stop to process the usb
request.

Signed-off-by: Li Qiang <liq3ea@163.com>
Message-Id: <20200812161727.29412-1-liq3ea@163.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry-picked from 2fdb42d8)
Fix CVE-2020-25723
Signed-off-by: Alex Chen <alex.chen@huawei.com>
2020-12-15 21:27:19 +08:00
Huawei Technologies Co., Ltd
94ee2e703d hw: usb: hcd-ohci: check for processed TD before retire
While servicing OHCI transfer descriptors(TD), ohci_service_iso_td
retires a TD if it has passed its time frame. It does not check if
the TD was already processed once and holds an error code in TD_CC.
It may happen if the TD list has a loop. Add check to avoid an
infinite loop condition.

Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Message-id: 20200915182259.68522-3-ppandit@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry-picked from 1be90ebe)
Fix CVE-2020-25625
Signed-off-by: Alex Chen <alex.chen@huawei.com>
2020-12-15 21:27:19 +08:00
openeuler-ci-bot
dae23299bd !171 slirp: check pkt_len before reading protocol header
From: @zhendongchen
Reviewed-by: @yorifang
Signed-off-by: @yorifang
2020-12-14 20:34:14 +08:00
Alex Chen
abe003640c slirp: check pkt_len before reading protocol header
While processing ARP/NCSI packets in 'arp_input' or 'ncsi_input'
routines, ensure that pkt_len is large enough to accommodate the
respective protocol headers, lest it should do an OOB access.
Add check to avoid it.

CVE-2020-29129 CVE-2020-29130
  QEMU: slirp: out-of-bounds access while processing ARP/NCSI packets
 -> https://www.openwall.com/lists/oss-security/2020/11/27/1

Reported-by: Qiuhao Li <Qiuhao.Li@outlook.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Message-Id: <20201126135706.273950-1-ppandit@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
(cherry-picked from 2e1dcbc0)
Signed-off-by: Alex Chen <alex.chen@huawei.com>
2020-12-14 18:00:31 +08:00
openeuler-ci-bot
ff04bde967 !160 Automatically generate code patches with openeuler !47
From: @zhendongchen
Reviewed-by: @yorifang
Signed-off-by: @yorifang
2020-12-10 10:10:19 +08:00
Euler Robot
0190db4b51 spec: Update release version with !47
increase release verison by one

Signed-off-by: Euler Robot <euler.robot@huawei.com>
2020-12-08 21:26:57 +08:00
Euler Robot
43a7247237 spec: Update patch and changelog with !47
Bugfix: hw/acpi: Use max_cpus instead of cpus when build PPTT table

Signed-off-by: Alex Chen <alex.chen@huawei.com>
2020-12-08 21:26:55 +08:00
Huawei Technologies Co., Ltd
4b608eccfd Bugfix: hw/acpi: Use max_cpus instead of cpus when build PPTT table
The field "cpus" is the initial number of CPU for guest, and the field "max_cpus"
is the max number of CPU after CPU hotplug. When building PPTT for guest, we
should take all CPUs into account, otherwise the "smp_sockets" is wrong.

Fixes: 7cfcd8c8a2fe ("build smt processor structure to support smt topology")
Signed-off-by: Keqian Zhu <zhukeqian1@huawei.com>
2020-12-08 21:26:55 +08:00
openeuler-ci-bot
9f218d7c43 !156 Automatically generate code patches with openeuler !43
From: @zhendongchen
Reviewed-by: @yorifang
Signed-off-by: @yorifang
2020-12-08 17:14:20 +08:00
Euler Robot
c6d7e42e3c spec: Update release version with !43
increase release verison by one

Signed-off-by: Euler Robot <euler.robot@huawei.com>
2020-12-08 17:07:55 +08:00
Euler Robot
8a67ba69fe spec: Update patch and changelog with !43
json: Fix a memleak in parse_pair()

Signed-off-by: Alex Chen <alex.chen@huawei.com>
2020-12-08 17:07:48 +08:00
Huawei Technologies Co., Ltd
b4d2b13109 json: Fix a memleak in parse_pair()
In qobject_type(), NULL is returned when the 'QObject' returned from parse_value() is not of QString type,
and this 'QObject' memory will leaked.
So we need to first cache the 'QObject' returned from parse_value(), and finally
free 'QObject' memory at the end of the function.
Also, we add a testcast about invalid dict key.

The memleak stack is as follows:
Direct leak of 32 byte(s) in 1 object(s) allocated from:
    #0 0xfffe4b3c34fb in __interceptor_malloc (/lib64/libasan.so.4+0xd34fb)
    #1 0xfffe4ae48aa3 in g_malloc (/lib64/libglib-2.0.so.0+0x58aa3)
    #2 0xaaab3557d9f7 in qnum_from_int qemu/qobject/qnum.c:25
    #3 0xaaab35584d23 in parse_literal qemu/qobject/json-parser.c:511
    #4 0xaaab35584d23 in parse_value qemu/qobject/json-parser.c:554
    #5 0xaaab35583d77 in parse_pair qemu/qobject/json-parser.c:270
    #6 0xaaab355845db in parse_object qemu/qobject/json-parser.c:327
    #7 0xaaab355845db in parse_value qemu/qobject/json-parser.c:546
    #8 0xaaab35585b1b in json_parser_parse qemu/qobject/json-parser.c:580
    #9 0xaaab35583703 in json_message_process_token qemu/qobject/json-streamer.c:92
    #10 0xaaab355ddccf in json_lexer_feed_char qemu/qobject/json-lexer.c:313
    #11 0xaaab355de0eb in json_lexer_feed qemu/qobject/json-lexer.c:350
    #12 0xaaab354aff67 in tcp_chr_read qemu/chardev/char-socket.c:525
    #13 0xfffe4ae429db in g_main_context_dispatch (/lib64/libglib-2.0.so.0+0x529db)
    #14 0xfffe4ae42d8f  (/lib64/libglib-2.0.so.0+0x52d8f)
    #15 0xfffe4ae430df in g_main_loop_run (/lib64/libglib-2.0.so.0+0x530df)
    #16 0xaaab34d70bff in iothread_run qemu/iothread.c:82
    #17 0xaaab3559d71b in qemu_thread_start qemu/util/qemu-thread-posix.c:519

Fixes: 532fb5328473 ("qapi: Make more of qobject_to()")
Reported-by: Euler Robot <euler.robot@huawei.com>
Signed-off-by: Alex Chen <alex.chen@huawei.com>
Signed-off-by: Chen Qun <kuhn.chenqun@huawei.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20201113145525.85151-1-alex.chen@huawei.com>
[Commit message tweaked]
(cherry-picked form commit 922d42bb)
2020-12-08 17:07:48 +08:00
openeuler-ci-bot
615a26914e !150 Automatically generate code patches with openeuler
From: @zhendongchen
Reviewed-by: @yorifang
Signed-off-by: @yorifang
2020-12-07 18:31:03 +08:00
Euler Robot
ef52e3f6f9 spec: Update release version with !39
increase release verison by one

Signed-off-by: Euler Robot <euler.robot@huawei.com>
2020-12-07 11:27:02 +08:00
Euler Robot
ac58d429a9 spec: Update patch and changelog with !39
net: remove an assert call in eth_get_gso_type

Signed-off-by: Alex Chen <alex.chen@huawei.com>
2020-12-07 11:26:54 +08:00
Huawei Technologies Co., Ltd
b69699a980 net: remove an assert call in eth_get_gso_type
fix CVE-2020-27617

eth_get_gso_type() routine returns segmentation offload type based on
L3 protocol type. It calls g_assert_not_reached if L3 protocol is
unknown, making the following return statement unreachable. Remove the
g_assert call, it maybe triggered by a guest user.

Reported-by: Gaoning Pan <pgn@zju.edu.cn>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Signed-off-by: Jason Wang <jasowang@redhat.com>

cherry-pick from commit 7564bf7701f00214cdc8a678a9f7df765244def1
Signed-off-by: Jiajie Li <lijiajie11@huawei.com>
2020-12-07 11:26:54 +08:00
openeuler-ci-bot
e59bcd4145 !148 Automatically generate code patches with openeuler
From: @zhendongchen
Reviewed-by: @yorifang
Signed-off-by: @yorifang
2020-12-03 22:44:39 +08:00
Euler Robot
0f34d3b407 spec: Update release version with !38
increase release verison by one

Signed-off-by: Euler Robot <euler.robot@huawei.com>
2020-12-03 21:26:57 +08:00
Euler Robot
dd0133f54b spec: Update patch and changelog with !38
migration/tls: save hostname into MigrationState
migration/tls: extract migration_tls_client_create for common-use
migration/tls: add tls_hostname into MultiFDSendParams
migration/tls: extract cleanup function for common-use
migration/tls: add support for multifd tls-handshake
migration/tls: add trace points for multifd-tls
qemu-file: Don't do IO after shutdown
multifd: Make sure that we don't do any IO after an error
migration: Don't send data if we have stopped
migration: Create migration_is_running()
migration: fix COLO broken caused by a previous commit
migration/multifd: fix hangup with TLS-Multifd due to  blocking handshake
multifd/tls: fix memoryleak of the QIOChannelSocket object when cancelling migration

Signed-off-by: Alex Chen <alex.chen@huawei.com>
2020-12-03 21:26:56 +08:00
Huawei Technologies Co., Ltd
957b899777 multifd/tls: fix memoryleak of the QIOChannelSocket object when cancelling migration
When creating new tls client, the tioc->master will be referenced which results in socket
leaking after multifd_save_cleanup if we cancel migration.
Fix it by do object_unref() after tls client creation.

Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Chuan Zheng <zhengchuan@huawei.com>
Message-Id: <1605104763-118687-1-git-send-email-zhengchuan@huawei.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2020-12-03 21:26:56 +08:00
Huawei Technologies Co., Ltd
9de3a5da88 migration/multifd: fix hangup with TLS-Multifd due to blocking handshake
The qemu main loop could hang up forever when we enable TLS+Multifd.
The Src multifd_send_0 invokes tls handshake, it sends hello to sever
and wait response.
However, the Dst main qemu loop has been waiting recvmsg() for multifd_recv_1.
Both of Src and Dst main qemu loop are blocking and waiting for reponse which
results in hanging up forever.

Src: (multifd_send_0)                                              Dst: (multifd_recv_1)
multifd_channel_connect                                            migration_channel_process_incoming
  multifd_tls_channel_connect                                        migration_tls_channel_process_incoming
    multifd_tls_channel_connect                                        qio_channel_tls_handshake_task
       qio_channel_tls_handshake                                         gnutls_handshake
          qio_channel_tls_handshake_task                                       ...
            qcrypto_tls_session_handshake                                      ...
              gnutls_handshake                                                 ...
                   ...                                                         ...
                recvmsg (Blocking I/O waiting for response)                recvmsg (Blocking I/O waiting for response)

Fix this by offloadinig handshake work to a background thread.

Reported-by: Yan Jin <jinyan12@huawei.com>
Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Chuan Zheng <zhengchuan@huawei.com>
Message-Id: <1604643893-8223-1-git-send-email-zhengchuan@huawei.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2020-12-03 21:26:56 +08:00
Huawei Technologies Co., Ltd
990c68bae3 migration: fix COLO broken caused by a previous commit
This commit "migration: Create migration_is_running()" broke
COLO. Becuase there is a process broken by this commit.

colo_process_checkpoint
 ->colo_do_checkpoint_transaction
   ->migrate_set_block_enabled
     ->qmp_migrate_set_capabilities

It can be fixed by make COLO process as an exception,
Maybe we need a better way to fix it.

Cc: Juan Quintela <quintela@redhat.com>
Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Signed-off-by: Juan Quintela <quintela@redhat.com>
2020-12-03 21:26:56 +08:00
Huawei Technologies Co., Ltd
b536a2b9ad migration: Create migration_is_running()
This function returns true if we are in the middle of a migration.
It is like migration_is_setup_or_active() with CANCELLING and COLO.
Adapt all callers that are needed.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2020-12-03 21:26:56 +08:00
Huawei Technologies Co., Ltd
5955b9d9ab migration: Don't send data if we have stopped
If we do a cancel, we got out without one error, but we can't do the
rest of the output as in a normal situation.

Signed-off-by: Juan Quintela <quintela@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
2020-12-03 21:26:56 +08:00