[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 15/17] migration: Test new fd infrastructure
From: |
Dr. David Alan Gilbert |
Subject: |
Re: [Qemu-devel] [PATCH 15/17] migration: Test new fd infrastructure |
Date: |
Tue, 14 Feb 2017 11:05:52 +0000 |
User-agent: |
Mutt/1.7.1 (2016-10-04) |
* Juan Quintela (address@hidden) wrote:
> "Dr. David Alan Gilbert" <address@hidden> wrote:
> > * Juan Quintela (address@hidden) wrote:
> >> We just send the address through the alternate channels and test that it
> >> is ok.
> >>
> >> Signed-off-by: Juan Quintela <address@hidden>
> >> ---
> >> migration/ram.c | 36 ++++++++++++++++++++++++++++++++++++
> >> 1 file changed, 36 insertions(+)
> >>
> >> diff --git a/migration/ram.c b/migration/ram.c
> >> index 4e530ea..95af694 100644
> >> --- a/migration/ram.c
> >> +++ b/migration/ram.c
> >> @@ -432,8 +432,22 @@ static void *multifd_send_thread(void *opaque)
> >> qemu_mutex_lock(¶ms->mutex);
> >> while (!params->quit){
> >> if (params->pages.num) {
> >> + int i;
> >> + int num;
> >> +
> >> + num = params->pages.num;
> >> params->pages.num = 0;
> >> qemu_mutex_unlock(¶ms->mutex);
> >> +
> >> + for(i=0; i < num; i++) {
> >> + if (qio_channel_write(params->c,
> >> + (const char
> >> *)¶ms->pages.address[i],
> >> + sizeof(uint8_t *), &error_abort)
> >> + != sizeof(uint8_t*)) {
> >> + /* Shuoudn't ever happen */
> >> + exit(-1);
> >> + }
> >
> > Nope, need to find a way to cleanly find the migration; that
> > might actually be tricky from one of these threads?
>
> It is tricky, but the error handling is wrong in the callers of this
> already. Will try to improve it on next series, but the problem is
> already there.
Well we should never kill the source because of a failed migration;
especially just due to a fairly boring IO error.
You could just exit the thread and return a marker value that gets
delivered to the pthread_join.
There is qemu_file_set_error() that you could call - although you'd
have to figure out thread safety.
(Which might be as simple as cmpxchg the error values and only
change the error value if it was previously 0).
Dave
--
Dr. David Alan Gilbert / address@hidden / Manchester, UK