Re: [Qemu-devel] [PATCH v1 07/11] pc-dimm: get_memory_region() can never fail

2018-06-15 Thread David Hildenbrand
>>> pre_plug isn't part of device, it's a separate part that might vary >>> depending on machine and which might modify device properties along >>> the way and then exaggerating we would need 'prepare2()' and after >>> that 'pre_plug2()' and ... >> >> That's how two parties (device vs hotplug h

Re: [Qemu-devel] [PATCH v1 07/11] pc-dimm: get_memory_region() can never fail

2018-06-15 Thread Igor Mammedov
On Thu, 14 Jun 2018 17:11:38 +0200 David Hildenbrand wrote: > On 14.06.2018 17:00, Igor Mammedov wrote: > > On Wed, 13 Jun 2018 16:50:54 +0200 > > David Hildenbrand wrote: > > > >> On 13.06.2018 16:07, David Hildenbrand wrote: > >>> On 13.06.2018 15:03, Igor Mammedov wrote: > On Mo

Re: [Qemu-devel] [PATCH v1 07/11] pc-dimm: get_memory_region() can never fail

2018-06-14 Thread David Hildenbrand
On 14.06.2018 17:00, Igor Mammedov wrote: > On Wed, 13 Jun 2018 16:50:54 +0200 > David Hildenbrand wrote: > >> On 13.06.2018 16:07, David Hildenbrand wrote: >>> On 13.06.2018 15:03, Igor Mammedov wrote: On Mon, 11 Jun 2018 14:16:51 +0200 David Hildenbrand wrote: > We alrea

Re: [Qemu-devel] [PATCH v1 07/11] pc-dimm: get_memory_region() can never fail

2018-06-14 Thread Igor Mammedov
On Wed, 13 Jun 2018 16:50:54 +0200 David Hildenbrand wrote: > On 13.06.2018 16:07, David Hildenbrand wrote: > > On 13.06.2018 15:03, Igor Mammedov wrote: > >> On Mon, 11 Jun 2018 14:16:51 +0200 > >> David Hildenbrand wrote: > >> > >>> We already verify when realizing that the memdev property

Re: [Qemu-devel] [PATCH v1 07/11] pc-dimm: get_memory_region() can never fail

2018-06-13 Thread David Hildenbrand
On 13.06.2018 16:07, David Hildenbrand wrote: > On 13.06.2018 15:03, Igor Mammedov wrote: >> On Mon, 11 Jun 2018 14:16:51 +0200 >> David Hildenbrand wrote: >> >>> We already verify when realizing that the memdev property has been >>> set. We have no more accesses to get_memory_region() before the

Re: [Qemu-devel] [PATCH v1 07/11] pc-dimm: get_memory_region() can never fail

2018-06-13 Thread David Hildenbrand
On 13.06.2018 15:03, Igor Mammedov wrote: > On Mon, 11 Jun 2018 14:16:51 +0200 > David Hildenbrand wrote: > >> We already verify when realizing that the memdev property has been >> set. We have no more accesses to get_memory_region() before the device >> is realized. > this stems from assumption

Re: [Qemu-devel] [PATCH v1 07/11] pc-dimm: get_memory_region() can never fail

2018-06-13 Thread Igor Mammedov
On Mon, 11 Jun 2018 14:16:51 +0200 David Hildenbrand wrote: > We already verify when realizing that the memdev property has been > set. We have no more accesses to get_memory_region() before the device > is realized. this stems from assumption that get_memory_region shouldn't be called before dev

Re: [Qemu-devel] [PATCH v1 07/11] pc-dimm: get_memory_region() can never fail

2018-06-11 Thread David Gibson
On Mon, Jun 11, 2018 at 02:16:51PM +0200, David Hildenbrand wrote: > We already verify when realizing that the memdev property has been > set. We have no more accesses to get_memory_region() before the device > is realized. > > So this function will never fail. Remove the stale check and the > err

[Qemu-devel] [PATCH v1 07/11] pc-dimm: get_memory_region() can never fail

2018-06-11 Thread David Hildenbrand
We already verify when realizing that the memdev property has been set. We have no more accesses to get_memory_region() before the device is realized. So this function will never fail. Remove the stale check and the error variable. Add a comment to the functions stating that they should never be c