[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCHv2 18/27] xen: reject unknown flags



2011/7/8 Eric Blake <eblake redhat com>:
> * src/xen/xen_driver.c (xenUnifiedDomainXMLFromNative)
> (xenUnifiedDomainXMLToNative, xenUnifiedDomainBlockPeek): Reject
> unknown flags.
> * src/xen/xen_hypervisor.c (xenHypervisorOpen)
> (xenHypervisorGetDomainState): Likewise.
> * src/xen/xen_inotify.c (xenInotifyOpen): Likewise.
> * src/xen/xs_internal.c (xenStoreOpen, xenStoreDomainGetState)
> (xenStoreDomainReboot): Likewise.
> * src/xen/xend_internal.c (xenDaemonOpen, xenDaemonDomainReboot)
> (xenDaemonDomainCoreDump, xenDaemonDomainGetState)
> (xenDaemonDomainMigratePrepare): Likewise.
> (xenDaemonDomainGetXMLDesc): Prefer unsigned flags.
> * src/xen/xend_internal.h (xenDaemonDomainGetXMLDesc): Likewise.
> * src/xen/xm_internal.h (xenXMDomainGetXMLDesc): Likewise.
> * src/xen/xm_internal.c (xenXMDomainGetXMLDesc): Likewise.
> (xenXMOpen, xenXMDomainGetState): Reject unknown flags.
> ---
>  src/xen/xen_driver.c     |   12 +++++++++---
>  src/xen/xen_hypervisor.c |    8 ++++++--
>  src/xen/xen_inotify.c    |    4 +++-
>  src/xen/xend_internal.c  |   23 +++++++++++++++++------
>  src/xen/xend_internal.h  |    3 ++-
>  src/xen/xm_internal.c    |   11 ++++++++---
>  src/xen/xm_internal.h    |    2 +-
>  src/xen/xs_internal.c    |   12 +++++++++---
>  8 files changed, 55 insertions(+), 20 deletions(-)

> @@ -1629,8 +1633,10 @@ xenDaemonDomainSave(virDomainPtr domain, const char *filename)
>  */
>  static int
>  xenDaemonDomainCoreDump(virDomainPtr domain, const char *filename,
> -                        unsigned int flags ATTRIBUTE_UNUSED)
> +                        unsigned int flags)
>  {
> +    virCheckFlags(0, -1);
> +
>     if ((domain == NULL) || (domain->conn == NULL) || (domain->name == NULL) ||
>         (filename == NULL)) {
>         virXendError(VIR_ERR_INVALID_ARG, __FUNCTION__);

Third time fooled by ATTRIBUTE_UNUSED. xenDaemonDomainCoreDump
understands VIR_DUMP_LIVE and VIR_DUMP_CRASH.

> @@ -3151,10 +3160,12 @@ xenDaemonDomainMigratePrepare (virConnectPtr dconn,
>                                int *cookielen ATTRIBUTE_UNUSED,
>                                const char *uri_in,
>                                char **uri_out,
> -                               unsigned long flags ATTRIBUTE_UNUSED,
> +                               unsigned long flags,
>                                const char *dname ATTRIBUTE_UNUSED,
>                                unsigned long resource ATTRIBUTE_UNUSED)
>  {
> +    virCheckFlags(0, -1);
> +
>     /* If uri_in is NULL, get the current hostname as a best guess
>      * of how the source host should connect to us.  Note that caller
>      * deallocates this string.

This breaks virDomainMigrate, because *DomainMigratePrepare is called
with the flags passed to virDomainMigrate, even if
xenDaemonDomainMigratePrepare doesn't use this flags it has to accept
all flags that the Xen driver understand in general form migration.

A quick grep for VIR_MIGRATE_ shows that those are at least

VIR_MIGRATE_LIVE
VIR_MIGRATE_PERSIST_DEST
VIR_MIGRATE_UNDEFINE_SOURCE
VIR_MIGRATE_PAUSED

-- 
Matthias Bolte
http://photron.blogspot.com


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]