migration/next for 20150326
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAABCAAGBQJVFBhbAAoJEPSH7xhYctcjHkUP/RISkmiAR9v9x+i/l9jFPDhy unyP2+p5/O6WhFR3nG+x7ISXTT29IDWIL5TGT0+bJ3DwqLBU6Tt7goEPqzE5T3vG Q3C2C2vp3Po5ngFcbaukIhqO8tFrieeURfxDYj550eaLkuVblC1g7R3F5K7Da/Y9 tvEB7nQpwJQjdg2LHeeUZAK0hVKRZthCeMlD64E11rfycmRWmdIUlbkfZVUy8Q2u ko9mCIPIoZ2xsj505J2+hH6hn8yRUTRjqXqWMPkmnNZYXmPMlXXT7EZ1AhfCjHPr ExrFDtNRiIcHTu7kRlkMFdvhyJGLvf5h+7raTMI4HsvrFgGqKjjS2tKgWIHcFl19 eciWjkTJD6K4EOCBYQTVQp1q9OP1mbaAmmPjEdCXjLElL4LaneCSO0dRVc6bEGwW u9EiPJm7Z8kw3tfS3BhpnqVJxom25HjN3oOYsR4pjr6ceXrK+9DTL3fRZX7nAbqv gpnuJUzK3r3pfaJkLXCZ7dGkW1h+XYKpuLi8lg4xDoHeYOGUmi/I6NCQ6F91eVYV qRpremkW5+2Oa/W9+sKdWThNBD66CJ4CpOTpAMRD03Jj0cPVKRtvfYi6E5gV8JSF G8zSM4+UtrcPnECuUuAjWFFwfhdiyZLMW09K9cYNWX24d29b5gZtcUPSjA9PToar q7TvfokLZjlYMpV68h0t =bsza -----END PGP SIGNATURE----- Merge remote-tracking branch 'remotes/juanquintela/tags/migration/20150326' into staging migration/next for 20150326 # gpg: Signature made Thu Mar 26 14:31:55 2015 GMT using RSA key ID 5872D723 # gpg: Can't check signature: public key not found * remotes/juanquintela/tags/migration/20150326: migration: remove last_sent_block from save_page_header rdma: Fix cleanup in error paths Avoid crashing on multiple -incoming Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
99b7f47c54
12
arch_init.c
12
arch_init.c
|
@ -332,19 +332,14 @@ static size_t save_page_header(QEMUFile *f, RAMBlock *block, ram_addr_t offset)
|
|||
{
|
||||
size_t size;
|
||||
|
||||
if (block == last_sent_block) {
|
||||
offset |= RAM_SAVE_FLAG_CONTINUE;
|
||||
}
|
||||
|
||||
qemu_put_be64(f, offset);
|
||||
size = 8;
|
||||
|
||||
if (block != last_sent_block) {
|
||||
if (!(offset & RAM_SAVE_FLAG_CONTINUE)) {
|
||||
qemu_put_byte(f, strlen(block->idstr));
|
||||
qemu_put_buffer(f, (uint8_t *)block->idstr,
|
||||
strlen(block->idstr));
|
||||
size += 1 + strlen(block->idstr);
|
||||
last_sent_block = block;
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
@ -644,6 +639,10 @@ static int ram_save_page(QEMUFile *f, RAMBlock* block, ram_addr_t offset,
|
|||
XBZRLE_cache_lock();
|
||||
|
||||
current_addr = block->offset + offset;
|
||||
|
||||
if (block == last_sent_block) {
|
||||
offset |= RAM_SAVE_FLAG_CONTINUE;
|
||||
}
|
||||
if (ret != RAM_SAVE_CONTROL_NOT_SUPP) {
|
||||
if (ret != RAM_SAVE_CONTROL_DELAYED) {
|
||||
if (bytes_xmit > 0) {
|
||||
|
@ -739,6 +738,7 @@ static int ram_find_and_save_block(QEMUFile *f, bool last_stage,
|
|||
|
||||
/* if page is unmodified, continue to the next */
|
||||
if (pages > 0) {
|
||||
last_sent_block = block;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2194,6 +2194,10 @@ static void qemu_rdma_cleanup(RDMAContext *rdma)
|
|||
}
|
||||
}
|
||||
|
||||
if (rdma->qp) {
|
||||
rdma_destroy_qp(rdma->cm_id);
|
||||
rdma->qp = NULL;
|
||||
}
|
||||
if (rdma->cq) {
|
||||
ibv_destroy_cq(rdma->cq);
|
||||
rdma->cq = NULL;
|
||||
|
@ -2206,18 +2210,14 @@ static void qemu_rdma_cleanup(RDMAContext *rdma)
|
|||
ibv_dealloc_pd(rdma->pd);
|
||||
rdma->pd = NULL;
|
||||
}
|
||||
if (rdma->cm_id) {
|
||||
rdma_destroy_id(rdma->cm_id);
|
||||
rdma->cm_id = NULL;
|
||||
}
|
||||
if (rdma->listen_id) {
|
||||
rdma_destroy_id(rdma->listen_id);
|
||||
rdma->listen_id = NULL;
|
||||
}
|
||||
if (rdma->cm_id) {
|
||||
if (rdma->qp) {
|
||||
rdma_destroy_qp(rdma->cm_id);
|
||||
rdma->qp = NULL;
|
||||
}
|
||||
rdma_destroy_id(rdma->cm_id);
|
||||
rdma->cm_id = NULL;
|
||||
}
|
||||
if (rdma->channel) {
|
||||
rdma_destroy_event_channel(rdma->channel);
|
||||
rdma->channel = NULL;
|
||||
|
@ -2309,8 +2309,6 @@ static int qemu_rdma_connect(RDMAContext *rdma, Error **errp)
|
|||
if (ret) {
|
||||
perror("rdma_connect");
|
||||
ERROR(errp, "connecting to destination!");
|
||||
rdma_destroy_id(rdma->cm_id);
|
||||
rdma->cm_id = NULL;
|
||||
goto err_rdma_source_connect;
|
||||
}
|
||||
|
||||
|
@ -2319,8 +2317,6 @@ static int qemu_rdma_connect(RDMAContext *rdma, Error **errp)
|
|||
perror("rdma_get_cm_event after rdma_connect");
|
||||
ERROR(errp, "connecting to destination!");
|
||||
rdma_ack_cm_event(cm_event);
|
||||
rdma_destroy_id(rdma->cm_id);
|
||||
rdma->cm_id = NULL;
|
||||
goto err_rdma_source_connect;
|
||||
}
|
||||
|
||||
|
@ -2328,8 +2324,6 @@ static int qemu_rdma_connect(RDMAContext *rdma, Error **errp)
|
|||
perror("rdma_get_cm_event != EVENT_ESTABLISHED after rdma_connect");
|
||||
ERROR(errp, "connecting to destination!");
|
||||
rdma_ack_cm_event(cm_event);
|
||||
rdma_destroy_id(rdma->cm_id);
|
||||
rdma->cm_id = NULL;
|
||||
goto err_rdma_source_connect;
|
||||
}
|
||||
rdma->connected = true;
|
||||
|
|
Loading…
Reference in a new issue