On 25/04/2017 19:00, Juan Quintela wrote:
> Laurent Vivier <[email protected]> wrote:
>> On 25/04/2017 12:24, Juan Quintela wrote:
>>> This way we use the "normal" way of printing errors for hmp commands.
>>>
>>> --
>>> Paolo suggestion
>>
>> "Suggested-by" tag?
> 
> Thanks.
>>>  {
>>> +    Error *err = NULL;
>>> +
>>>      if (replay_snapshot) {
>>>          if (replay_mode == REPLAY_MODE_RECORD) {
>>> -            if (save_vmstate(replay_snapshot) != 0) {
>>> +            if (save_vmstate(replay_snapshot, &err) != 0) {
>>>                  error_report("Could not create snapshot for icount 
>>> record");
>>>                  exit(1);
>>>              }
>>>          } else if (replay_mode == REPLAY_MODE_PLAY) {
>>> -            if (load_vmstate(replay_snapshot) != 0) {
>>> +            if (load_vmstate(replay_snapshot, &err) != 0) {
>>>                  error_report("Could not load snapshot for icount replay");
>>>                  exit(1);
>>>              }
>>
>> You can use "&error_fatal" in these cases.
> 
> I was very happy with your suggestion.  But then I realized that if I
> use error_fatal, I would lost the error_report() messages, right?

The "Could not create snapshot for icount record" and "Could not load
snapshot for icount replay", yes.

But you keep the one from the inside load_vmstate().

Isn't it enough?

Laurent

Reply via email to