[libvirt] [PATCH 1/9] Move the VIR_DRV_FEATURE* constants

Daniel Veillard veillard at redhat.com
Wed Oct 7 14:55:27 UTC 2009


On Mon, Oct 05, 2009 at 12:44:48PM +0100, Daniel P. Berrange wrote:
> Move the VIR_DRV_FEATURE* constants into libvirt_internal.h
> since these flags are indicating whether  APIs in the
> libvirt_internal.h file are supported by a driver
> 
> * src/driver.h: Remove VIR_DRV_FEATURE* constants
> * src/libvirt_internal.h: Add VIR_DRV_FEATURE* constants, using
>   an enum instead of #define
> * src/internal.h: pull in libvirt_internal.h
> ---
>  src/driver.h           |   19 -------------------
>  src/internal.h         |    2 ++
>  src/libvirt_internal.h |   27 +++++++++++++++++++++++++++
>  3 files changed, 29 insertions(+), 19 deletions(-)
> 
> diff --git a/src/driver.h b/src/driver.h
> index c926614..2773a95 100644
> --- a/src/driver.h
> +++ b/src/driver.h
> @@ -44,25 +44,6 @@ typedef enum {
>      VIR_DRV_OPEN_ERROR = -2,
>  } virDrvOpenStatus;
>  
> -/* Feature detection.  This is a libvirt-private interface for determining
> - * what features are supported by the driver.
> - *
> - * The remote driver passes features through to the real driver at the
> - * remote end unmodified, except if you query a VIR_DRV_FEATURE_REMOTE*
> - * feature.
> - */
> -    /* Driver supports V1-style virDomainMigrate, ie. domainMigratePrepare/
> -     * domainMigratePerform/domainMigrateFinish.
> -     */
> -#define VIR_DRV_FEATURE_MIGRATION_V1 1
> -
> -    /* Driver is not local. */
> -#define VIR_DRV_FEATURE_REMOTE 2
> -
> -    /* Driver supports V2-style virDomainMigrate, ie. domainMigratePrepare2/
> -     * domainMigratePerform/domainMigrateFinish2.
> -     */
> -#define VIR_DRV_FEATURE_MIGRATION_V2 3
>  
>  /* Internal feature-detection macro.  Don't call drv->supports_feature
>   * directly, because it may be NULL, use this macro instead.
> diff --git a/src/internal.h b/src/internal.h
> index 8fa579c..bd1cfe6 100644
> --- a/src/internal.h
> +++ b/src/internal.h
> @@ -24,6 +24,8 @@
>  #include "libvirt/libvirt.h"
>  #include "libvirt/virterror.h"
>  
> +#include "libvirt_internal.h"
> +
>  /* On architectures which lack these limits, define them (ie. Cygwin).
>   * Note that the libvirt code should be robust enough to handle the
>   * case where actual value is longer than these limits (eg. by setting
> diff --git a/src/libvirt_internal.h b/src/libvirt_internal.h
> index 8f1ac3d..d3edcfa 100644
> --- a/src/libvirt_internal.h
> +++ b/src/libvirt_internal.h
> @@ -17,6 +17,9 @@
>   * License along with this library; if not, write to the Free Software
>   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
>   *
> + * NB This file is ABI sensitive. Things here impact the wire
> + * protocol ABI in the remote driver. Same rules as for things
> + * include/libvirt/libvirt.h apply. ie this file is *append* only
>   */
>  
>  #ifndef __LIBVIRT_H_
> @@ -31,6 +34,30 @@ int virStateReload(void);
>  int virStateActive(void);
>  #endif
>  
> +/* Feature detection.  This is a libvirt-private interface for determining
> + * what features are supported by the driver.
> + *
> + * The remote driver passes features through to the real driver at the
> + * remote end unmodified, except if you query a VIR_DRV_FEATURE_REMOTE*
> + * feature.
> + *
> + */
> +enum {
> +    /* Driver supports V1-style virDomainMigrate, ie. domainMigratePrepare/
> +     * domainMigratePerform/domainMigrateFinish.
> +     */
> +    VIR_DRV_FEATURE_MIGRATION_V1 = 1,
> +
> +    /* Driver is not local. */
> +    VIR_DRV_FEATURE_REMOTE = 2,
> +
> +    /* Driver supports V2-style virDomainMigrate, ie. domainMigratePrepare2/
> +     * domainMigratePerform/domainMigrateFinish2.
> +     */
> +    VIR_DRV_FEATURE_MIGRATION_V2 = 3,
> +};
> +
> +
>  int virDrvSupportsFeature (virConnectPtr conn, int feature);
>  
>  int virDomainMigratePrepare (virConnectPtr dconn,

  ACK,

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel at veillard.com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/




More information about the libvir-list mailing list