qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 5/8] migration: move calling control_save_page t


From: Xiao Guangrong
Subject: Re: [Qemu-devel] [PATCH 5/8] migration: move calling control_save_page to the common place
Date: Fri, 16 Mar 2018 16:59:26 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0



On 03/15/2018 07:47 PM, Dr. David Alan Gilbert wrote:

      /* Check the pages is dirty and if it is send it */
      if (migration_bitmap_clear_dirty(rs, pss->block, pss->page)) {
+        RAMBlock *block = pss->block;
+        ram_addr_t offset = pss->page << TARGET_PAGE_BITS;
+
+        if (control_save_page(rs, block, offset, &res)) {
+            goto page_saved;

OK, but I'd prefer if you avoided this forward goto;  we do use goto but
we tend to keep it just for error cases.


There is a common operation, clearing unsentmap, for save_control,
save_zero, save_compressed and save_normal, if we do not use 'goto',
the operation would to be duplicated several times or we will have
big if...elseif...elseif... section.

So it may be not too bad to have 'goto' under this case? :)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]