[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 7/7] Don't throw away QEMU startup errors when migrating.



Daniel P. Berrange wrote:
> On Tue, Apr 28, 2009 at 11:31:57AM -0400, Cole Robinson wrote:
>> ---
>>  src/qemu_driver.c |   10 +++++++---
>>  1 files changed, 7 insertions(+), 3 deletions(-)
>>
>> diff --git a/src/qemu_driver.c b/src/qemu_driver.c
>> index 04df8ae..b293f72 100644
>> --- a/src/qemu_driver.c
>> +++ b/src/qemu_driver.c
>> @@ -225,7 +225,7 @@ qemudAutostartConfigs(struct qemud_driver *driver) {
>>                  virErrorPtr err = virGetLastError();
>>                  VIR_ERROR(_("Failed to autostart VM '%s': %s\n"),
>>                            vm->def->name,
>> -                          err ? err->message : NULL);
>> +                          err ? err->message : "");
>>              } else {
>>                  virDomainEventPtr event =
>>                      virDomainEventNewFromObj(vm,
>> @@ -3293,8 +3293,10 @@ static int qemudDomainRestore(virConnectPtr conn,
>>      close(fd);
>>      fd = -1;
>>      if (ret < 0) {
>> +        virErrorPtr err = virGetLastError();
>>          qemudReportError(conn, NULL, NULL, VIR_ERR_OPERATION_FAILED,
>> -                         "%s", _("failed to start VM"));
>> +                         _("failed to start VM: %s"),
>> +                         err ? err->message : "");
>>          if (!vm->persistent) {
>>              virDomainRemoveInactive(&driver->domains,
>>                                      vm);
>> @@ -4790,8 +4792,10 @@ qemudDomainMigratePrepare2 (virConnectPtr dconn,
>>       */
>>      snprintf (migrateFrom, sizeof (migrateFrom), "tcp:0.0.0.0:%d", this_port);
>>      if (qemudStartVMDaemon (dconn, driver, vm, migrateFrom, -1) < 0) {
>> +        virErrorPtr err = virGetLastError();
>>          qemudReportError (dconn, NULL, NULL, VIR_ERR_OPERATION_FAILED,
>> -                          "%s", _("failed to start listening VM"));
>> +                          _("failed to start listening VM: %s"),
>> +                          err ? err->message : "");
>>          if (!vm->persistent) {
>>              virDomainRemoveInactive(&driver->domains, vm);
>>              vm = NULL;
> 
> It think we should just be removing the qemudReportError() calls 
> completely in both these places & let qemudStartVMDaemon take
> care of reporting errors, since there is no need to have different
> error messages in each caller.
> 
> 
> Daniel

Okay, I sent an updated patch outside of this series, since it's an
isolated fix.

Thanks,
Cole


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]