Re: [libvirt] [PATCH 03/10] Canonicalize the qemu machine type in qemuxml2argvtest

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

 



On Thu, Sep 10, 2009 at 12:35:11PM +0100, Mark McLoughlin wrote:
> This doesn't have any affect on the current tests because we don't have
> any machine aliases in the current test data.
> 
> * src/qemu_conf.h, src/qemu_driver.c: expose qemudCanonicalizeMachine()
>   for the tests
> 
> * tests/qemuxml2argvtest.c: canonicalize the machine type
> ---
>  src/qemu_conf.h          |    3 +++
>  src/qemu_driver.c        |    7 +++----
>  tests/qemuxml2argvtest.c |    3 +++
>  3 files changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/src/qemu_conf.h b/src/qemu_conf.h
> index 9fa4559..ed91d2c 100644
> --- a/src/qemu_conf.h
> +++ b/src/qemu_conf.h
> @@ -194,6 +194,9 @@ int         qemudProbeMachineTypes      (const char *binary,
>                                           virCapsGuestMachinePtr **machines,
>                                           int *nmachines);
>  
> +int         qemudCanonicalizeMachine    (struct qemud_driver *driver,
> +                                         virDomainDefPtr def);
> +
>  virDomainDefPtr qemuParseCommandLine(virConnectPtr conn,
>                                       virCapsPtr caps,
>                                       const char **progenv,
> diff --git a/src/qemu_driver.c b/src/qemu_driver.c
> index ae112d8..f2b0bec 100644
> --- a/src/qemu_driver.c
> +++ b/src/qemu_driver.c
> @@ -4781,10 +4781,9 @@ qemudCanonicalizeMachineDirect(virDomainDefPtr def, char **canonical)
>      return 0;
>  }
>  
> -static int
> -qemudCanonicalizeMachine(virConnectPtr conn, virDomainDefPtr def)
> +int
> +qemudCanonicalizeMachine(struct qemud_driver *driver, virDomainDefPtr def)
>  {
> -    struct qemud_driver *driver = conn->privateData;
>      char *canonical = NULL;
>      int i;
>  
> @@ -4875,7 +4874,7 @@ static virDomainPtr qemudDomainDefine(virConnectPtr conn, const char *xml) {
>          }
>      }
>  
> -    if (qemudCanonicalizeMachine(conn, def) < 0)
> +    if (qemudCanonicalizeMachine(driver, def) < 0)
>          goto cleanup;
>  
>      if (!(vm = virDomainAssignDef(conn,
> diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c
> index d1cef0e..edd3744 100644
> --- a/tests/qemuxml2argvtest.c
> +++ b/tests/qemuxml2argvtest.c
> @@ -56,6 +56,9 @@ static int testCompareXMLToArgvFiles(const char *xml,
>          QEMUD_CMD_FLAG_NO_REBOOT |
>          extraFlags;
>  
> +    if (qemudCanonicalizeMachine(&driver, vmdef) < 0)
> +        goto fail;
> +
>      if (qemudBuildCommandLine(NULL, &driver,
>                                vmdef, &monitor_chr, flags,
>                                &argv, &qenv,

  Okay, the patch to source is minor, and this will help later on
  testing, ACK,

Daniel

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

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]