Diff for /qemu/qerror.c between versions 1.1.1.4 and 1.1.1.5

version 1.1.1.4, 2018/04/24 18:55:38 version 1.1.1.5, 2018/04/24 19:16:40
Line 49  static const QErrorStringTable qerror_ta Line 49  static const QErrorStringTable qerror_ta
         .desc      = "Device '%(device)' can't go on a %(bad_bus_type) bus",          .desc      = "Device '%(device)' can't go on a %(bad_bus_type) bus",
     },      },
     {      {
           .error_fmt = QERR_BLOCK_FORMAT_FEATURE_NOT_SUPPORTED,
           .desc      = "Block format '%(format)' used by device '%(name)' does not support feature '%(feature)'",
       },
       {
         .error_fmt = QERR_BUS_NOT_FOUND,          .error_fmt = QERR_BUS_NOT_FOUND,
         .desc      = "Bus '%(bus)' not found",          .desc      = "Bus '%(bus)' not found",
     },      },
Line 73  static const QErrorStringTable qerror_ta Line 77  static const QErrorStringTable qerror_ta
         .desc      = "Device '%(device)' is in use",          .desc      = "Device '%(device)' is in use",
     },      },
     {      {
           .error_fmt = QERR_DEVICE_FEATURE_BLOCKS_MIGRATION,
           .desc      = "Migration is disabled when using feature '%(feature)' in device '%(device)'",
       },
       {
         .error_fmt = QERR_DEVICE_LOCKED,          .error_fmt = QERR_DEVICE_LOCKED,
         .desc      = "Device '%(device)' is locked",          .desc      = "Device '%(device)' is locked",
     },      },
Line 117  static const QErrorStringTable qerror_ta Line 125  static const QErrorStringTable qerror_ta
         .desc      = "No file descriptor supplied via SCM_RIGHTS",          .desc      = "No file descriptor supplied via SCM_RIGHTS",
     },      },
     {      {
           .error_fmt = QERR_FEATURE_DISABLED,
           .desc      = "The feature '%(name)' is not enabled",
       },
       {
         .error_fmt = QERR_INVALID_BLOCK_FORMAT,          .error_fmt = QERR_INVALID_BLOCK_FORMAT,
         .desc      = "Invalid block format '%(name)'",          .desc      = "Invalid block format '%(name)'",
     },      },
Line 194  static const QErrorStringTable qerror_ta Line 206  static const QErrorStringTable qerror_ta
         .desc      = "QMP input object member '%(member)' is unexpected",          .desc      = "QMP input object member '%(member)' is unexpected",
     },      },
     {      {
           .error_fmt = QERR_RESET_REQUIRED,
           .desc      = "Resetting the Virtual Machine is required",
       },
       {
         .error_fmt = QERR_SET_PASSWD_FAILED,          .error_fmt = QERR_SET_PASSWD_FAILED,
         .desc      = "Could not set password",          .desc      = "Could not set password",
     },      },
Line 219  static const QErrorStringTable qerror_ta Line 235  static const QErrorStringTable qerror_ta
                      "supported by this qemu version: %(feature)",                       "supported by this qemu version: %(feature)",
     },      },
     {      {
           .error_fmt = QERR_VIRTFS_FEATURE_BLOCKS_MIGRATION,
           .desc      = "Migration is disabled when VirtFS export path '%(path)' "
                        "is mounted in the guest using mount_tag '%(tag)'",
       },
       {
         .error_fmt = QERR_VNC_SERVER_FAILED,          .error_fmt = QERR_VNC_SERVER_FAILED,
         .desc      = "Could not start VNC server on %(target)",          .desc      = "Could not start VNC server on %(target)",
     },      },
Line 242  QError *qerror_new(void) Line 263  QError *qerror_new(void)
 {  {
     QError *qerr;      QError *qerr;
   
     qerr = qemu_mallocz(sizeof(*qerr));      qerr = g_malloc0(sizeof(*qerr));
     QOBJECT_INIT(qerr, &qerror_type);      QOBJECT_INIT(qerr, &qerror_type);
   
     return qerr;      return qerr;
Line 478  void qerror_report_internal(const char * Line 499  void qerror_report_internal(const char *
     }      }
 }  }
   
   /* Evil... */
   struct Error
   {
       QDict *obj;
       const char *fmt;
       char *msg;
   };
   
   void qerror_report_err(Error *err)
   {
       QError *qerr;
       int i;
   
       qerr = qerror_new();
       loc_save(&qerr->loc);
       QINCREF(err->obj);
       qerr->error = err->obj;
   
       for (i = 0; qerror_table[i].error_fmt; i++) {
           if (strcmp(qerror_table[i].error_fmt, err->fmt) == 0) {
               qerr->entry = &qerror_table[i];
               break;
           }
       }
   
       if (monitor_cur_is_qmp()) {
           monitor_set_error(cur_mon, qerr);
       } else {
           qerror_print(qerr);
           QDECREF(qerr);
       }
   }
   
 /**  /**
  * qobject_to_qerror(): Convert a QObject into a QError   * qobject_to_qerror(): Convert a QObject into a QError
  */   */
Line 501  static void qerror_destroy_obj(QObject * Line 555  static void qerror_destroy_obj(QObject *
     qerr = qobject_to_qerror(obj);      qerr = qobject_to_qerror(obj);
   
     QDECREF(qerr->error);      QDECREF(qerr->error);
     qemu_free(qerr);      g_free(qerr);
 }  }

Removed from v.1.1.1.4  
changed lines
  Added in v.1.1.1.5


unix.superglobalmegacorp.com