On 09.03.20 14:51, Janosch Frank wrote:
> On 3/9/20 2:41 PM, David Hildenbrand wrote:
>> On 09.03.20 12:21, Janosch Frank wrote:
>>> Migration is not yet supported.
>>>
>>> Signed-off-by: Janosch Frank <fran...@linux.ibm.com>
>>> ---
>>>  hw/s390x/s390-virtio-ccw.c | 26 ++++++++++++++++++++++++--
>>>  1 file changed, 24 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
>>> index f718cfc591..4bb38704ff 100644
>>> --- a/hw/s390x/s390-virtio-ccw.c
>>> +++ b/hw/s390x/s390-virtio-ccw.c
>>> @@ -43,6 +43,9 @@
>>>  #include "sysemu/sysemu.h"
>>>  #include "hw/s390x/pv.h"
>>>  #include <linux/kvm.h>
>>> +#include "migration/blocker.h"
>>> +
>>> +static Error *pv_mig_blocker;
>>>  
>>>  S390CPU *s390_cpu_addr2state(uint16_t cpu_addr)
>>>  {
>>> @@ -331,16 +334,33 @@ static void 
>>> s390_machine_unprotect(S390CcwMachineState *ms)
>>>          }
>>>          ms->pv = false;
>>>      }
>>> +    migrate_del_blocker(pv_mig_blocker);
>>> +    error_free(pv_mig_blocker);
>>> +    pv_mig_blocker = NULL;
>>
>> Maybe use error_free_or_abort(&pv_mig_blocker);
> 
> I dislike hiding setting the ptr to NULL with that function.
> The assert for NULL in error_setg has caused me a lot of headache initially.
> 
> But if that's how it's done I'll fix it.

No strong feelings on my side. Seemed like a nice function to me :)

-- 
Thanks,

David / dhildenb


Reply via email to