driver: xen-blkfront: move talk_to_blkback to a more suitable place
authorBob Liu <bob.liu@oracle.com>
Wed, 3 Jun 2015 05:40:02 +0000 (13:40 +0800)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Sat, 6 Jun 2015 01:14:05 +0000 (21:14 -0400)
commit8ab0144a466320cc37c52e7866b5103c5bbd4e90
tree0ac74c2ea054c0a71839b7935329c15997d6c707
parent69b91ede5cab843dcf345c28bd1f4b5a99dacd9b
driver: xen-blkfront: move talk_to_blkback to a more suitable place

The major responsibility of talk_to_blkback() is allocate and initialize
the request ring and write the ring info to xenstore.
But this work should be done after backend entered 'XenbusStateInitWait' as
defined in the protocol file.
See xen/include/public/io/blkif.h in XEN git tree:
Front                                Back
=================================    =====================================
XenbusStateInitialising              XenbusStateInitialising
 o Query virtual device               o Query backend device identification
   properties.                          data.
 o Setup OS device instance.          o Open and validate backend device.
                                      o Publish backend features and
                                        transport parameters.
                                                     |
                                                     |
                                                     V
                                     XenbusStateInitWait

o Query backend features and
  transport parameters.
o Allocate and initialize the
  request ring.

There is no problem with this yet, but it is an violation of the design and
furthermore it would not allow frontend/backend to negotiate 'multi-page'
and 'multi-queue' features.

Changes in v2:
 - Re-write the commit message to be more clear.

Signed-off-by: Bob Liu <bob.liu@oracle.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/block/xen-blkfront.c