[libvirt] [PATCH] qemu: Properly report a startup timeout error

Cole Robinson crobinso at redhat.com
Wed Feb 10 16:55:54 UTC 2010


On 02/10/2010 05:49 AM, Daniel Veillard wrote:
> On Tue, Feb 09, 2010 at 03:31:41PM -0500, Cole Robinson wrote:
>> The timeout errors were unconditionally being overwritten by the less
>> helpful 'unable to start guest' error.
>>
>> Signed-off-by: Cole Robinson <crobinso at redhat.com>
>> ---
>>  src/qemu/qemu_driver.c |   17 +++++++----------
>>  1 files changed, 7 insertions(+), 10 deletions(-)
>>
>> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
>> index 4374291..2172c99 100644
>> --- a/src/qemu/qemu_driver.c
>> +++ b/src/qemu/qemu_driver.c
>> @@ -1358,15 +1358,15 @@ qemudReadLogOutput(virConnectPtr conn,
>>          buf[got] = '\0';
>>          if (got == buflen-1) {
>>              qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
>> -                             _("Out of space while reading %s log output"),
>> -                             what);
>> +                             _("Out of space while reading %s log output: %s"),
>> +                             what, buf);
>>              return -1;
>>          }
>>  
>>          if (isdead) {
>>              qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
>> -                             _("Process exited while reading %s log output"),
>> -                             what);
>> +                             _("Process exited while reading %s log output: %s"),
>> +                             what, buf);
>>              return -1;
>>          }
>>  
>> @@ -1378,7 +1378,8 @@ qemudReadLogOutput(virConnectPtr conn,
>>      }
>>  
>>      qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
>> -                     _("Timed out while reading %s log output"), what);
>> +                     _("Timed out while reading %s log output: %s"),
>> +                     what, buf);
>>      return -1;
>>  }
>>  
>> @@ -1557,12 +1558,8 @@ qemudWaitForMonitor(virConnectPtr conn,
>>                   virStrerror(errno, ebuf, sizeof ebuf));
>>      }
>>  
>> -    if (ret < 0) {
>> -        /* Unexpected end of file - inform user of QEMU log data */
>> -        qemudReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
>> -                         _("unable to start guest: %s"), buf);
>> +    if (ret < 0)
>>          return -1;
>> -    }
>>  
>>      VIR_DEBUG("Connect monitor to %p '%s'", vm, vm->def->name);
>>      if (qemuConnectMonitor(vm) < 0)
> 
>   ACK,
> 
> Daniel
> 

Thanks, I've pushed these two patches.

- Cole




More information about the libvir-list mailing list