Re: [PATCH v7 20/35] dimm: get mapped memory region from DIMMDeviceClass->get_memory_region

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

 





On 11/06/2015 01:29 AM, Eduardo Habkost wrote:
On Mon, Nov 02, 2015 at 05:13:22PM +0800, Xiao Guangrong wrote:
[...]
  static MemoryRegion *pc_dimm_get_memory_region(DIMMDevice *dimm)
  {
-    return host_memory_backend_get_memory(dimm->hostmem, &error_abort);
+    Error *local_err = NULL;
+    MemoryRegion *mr;
+
+    mr = host_memory_backend_get_memory(dimm->hostmem, &local_err);
+
+    /*
+     * plug a pc-dimm device whose backend memory was not properly
+     * initialized?
+     */
+    assert(!local_err && mr);

I don't know if you are going to remove the errp parameter in the next
version, but if you want to simply abort in case an error is reported by
a function, you can use &error_abort.


Thank you, Eduardo! let's happily drop the unused errp parameter in
host_memory_backend_get_memory in the next version. :)
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux