Skip to content
  • Marc Marí's avatar
    88d88798
    blockdev: Add dynamic module loading for block drivers · 88d88798
    Marc Marí authored
    
    
    Extend the current module interface to allow for block drivers to be
    loaded dynamically on request. The only block drivers that can be
    converted into modules are the drivers that don't perform any init
    operation except for registering themselves.
    
    In addition, only the protocol drivers are being modularized, as they
    are the only ones which see significant performance benefits. The format
    drivers do not generally link to external libraries, so modularizing
    them is of no benefit from a performance perspective.
    
    All the necessary module information is located in a new structure found
    in module_block.h
    
    This spoils the purpose of 5505e8b7 (block/dmg: make it modular).
    
    Before this patch, if module build is enabled, block-dmg.so is linked to
    libbz2, whereas the main binary is not. In downstream, theoretically, it
    means only the qemu-block-extra package depends on libbz2, while the
    main QEMU package needn't to. With this patch, we (temporarily) change
    the case so that the main QEMU depends on libbz2 again.
    
    Signed-off-by: default avatarMarc Marí <markmb@redhat.com>
    Signed-off-by: default avatarColin Lord <clord@redhat.com>
    Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Message-id: 1471008424-16465-4-git-send-email-clord@redhat.com
    Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
    [mreitz: Do a signed comparison against the length of
     block_driver_modules[], so it will not cause a compile error when
     empty]
    Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
    88d88798
    blockdev: Add dynamic module loading for block drivers
    Marc Marí authored
    
    
    Extend the current module interface to allow for block drivers to be
    loaded dynamically on request. The only block drivers that can be
    converted into modules are the drivers that don't perform any init
    operation except for registering themselves.
    
    In addition, only the protocol drivers are being modularized, as they
    are the only ones which see significant performance benefits. The format
    drivers do not generally link to external libraries, so modularizing
    them is of no benefit from a performance perspective.
    
    All the necessary module information is located in a new structure found
    in module_block.h
    
    This spoils the purpose of 5505e8b7 (block/dmg: make it modular).
    
    Before this patch, if module build is enabled, block-dmg.so is linked to
    libbz2, whereas the main binary is not. In downstream, theoretically, it
    means only the qemu-block-extra package depends on libbz2, while the
    main QEMU package needn't to. With this patch, we (temporarily) change
    the case so that the main QEMU depends on libbz2 again.
    
    Signed-off-by: default avatarMarc Marí <markmb@redhat.com>
    Signed-off-by: default avatarColin Lord <clord@redhat.com>
    Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Message-id: 1471008424-16465-4-git-send-email-clord@redhat.com
    Reviewed-by: default avatarMax Reitz <mreitz@redhat.com>
    [mreitz: Do a signed comparison against the length of
     block_driver_modules[], so it will not cause a compile error when
     empty]
    Signed-off-by: default avatarMax Reitz <mreitz@redhat.com>
Loading