Skip to content
  • Markus Armbruster's avatar
    d83c29e9
    hw/arm/versatilepb hw/arm/vexpress: Replace drive_get_next() by drive_get() · d83c29e9
    Markus Armbruster authored
    
    
    drive_get_next() is basically a bad idea.  It returns the "next" block
    backend of a certain interface type.  "Next" means bus=0,unit=N, where
    subsequent calls count N up from zero, per interface type.
    
    This lets you define unit numbers implicitly by execution order.  If the
    order changes, or new calls appear "in the middle", unit numbers change.
    ABI break.  Hard to spot in review.
    
    The versatile and vexpress machines ("versatileab", "versatilepb",
    "vexpress-a9", "vexpress-a15") connect just one or two backends of a
    type with drive_get_next().  Change them to use drive_get() directly.
    This makes the unit numbers explicit in the code.
    
    Cc: Peter Maydell <peter.maydell@linaro.org>
    Cc: qemu-arm@nongnu.org
    Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
    Message-Id: <20211117163409.3587705-5-armbru@redhat.com>
    Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
    d83c29e9
    hw/arm/versatilepb hw/arm/vexpress: Replace drive_get_next() by drive_get()
    Markus Armbruster authored
    
    
    drive_get_next() is basically a bad idea.  It returns the "next" block
    backend of a certain interface type.  "Next" means bus=0,unit=N, where
    subsequent calls count N up from zero, per interface type.
    
    This lets you define unit numbers implicitly by execution order.  If the
    order changes, or new calls appear "in the middle", unit numbers change.
    ABI break.  Hard to spot in review.
    
    The versatile and vexpress machines ("versatileab", "versatilepb",
    "vexpress-a9", "vexpress-a15") connect just one or two backends of a
    type with drive_get_next().  Change them to use drive_get() directly.
    This makes the unit numbers explicit in the code.
    
    Cc: Peter Maydell <peter.maydell@linaro.org>
    Cc: qemu-arm@nongnu.org
    Signed-off-by: default avatarMarkus Armbruster <armbru@redhat.com>
    Message-Id: <20211117163409.3587705-5-armbru@redhat.com>
    Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
Loading