mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
multifd: Only send pages when packet are not empty
We send packages without pages sometimes for sysnchronizanion. The iov functions do the right thing, but we will be changing this code in future patches. Signed-off-by: Juan Quintela <quintela@redhat.com> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Juan Quintela <quintela@redhat.com>
This commit is contained in:
parent
50ccc488b0
commit
ad24c7cb59
1 changed files with 12 additions and 6 deletions
|
@ -1088,9 +1088,12 @@ static void *multifd_send_thread(void *opaque)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = qio_channel_writev_all(p->c, p->pages->iov, used, &local_err);
|
if (used) {
|
||||||
if (ret != 0) {
|
ret = qio_channel_writev_all(p->c, p->pages->iov,
|
||||||
break;
|
used, &local_err);
|
||||||
|
if (ret != 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
qemu_mutex_lock(&p->mutex);
|
qemu_mutex_lock(&p->mutex);
|
||||||
|
@ -1317,9 +1320,12 @@ static void *multifd_recv_thread(void *opaque)
|
||||||
p->num_pages += used;
|
p->num_pages += used;
|
||||||
qemu_mutex_unlock(&p->mutex);
|
qemu_mutex_unlock(&p->mutex);
|
||||||
|
|
||||||
ret = qio_channel_readv_all(p->c, p->pages->iov, used, &local_err);
|
if (used) {
|
||||||
if (ret != 0) {
|
ret = qio_channel_readv_all(p->c, p->pages->iov,
|
||||||
break;
|
used, &local_err);
|
||||||
|
if (ret != 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & MULTIFD_FLAG_SYNC) {
|
if (flags & MULTIFD_FLAG_SYNC) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue