From: Jim Fehlig <jfehlig@suse.com>
To: "Daniel P. Berrange" <berrange@redhat.com>
Cc: libvir-list@redhat.com, xen-devel@lists.xensource.com
Subject: Re: [libvirt] [PATCH 2/5] Don't pass libxlDriverPrivatePtr into libxlBuildDomainConfig
Date: Fri, 30 May 2014 16:34:51 -0600 [thread overview]
Message-ID: <5389078B.3070505@suse.com> (raw)
In-Reply-To: <1401470645-19869-3-git-send-email-berrange@redhat.com>
Daniel P. Berrange wrote:
> To make it easier to test, change libxlBuildDomainConfig so
> that it takes a virPortAllocatorPtr instead of the larger
> libxlDriverPrivatePtr object.
>
> Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
> ---
> src/libxl/libxl_conf.c | 12 ++++++------
> src/libxl/libxl_conf.h | 4 ++--
> src/libxl/libxl_domain.c | 2 +-
> 3 files changed, 9 insertions(+), 9 deletions(-)
>
ACK.
Regards,
Jim
> diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
> index a98e27a..f9e3a1b 100644
> --- a/src/libxl/libxl_conf.c
> +++ b/src/libxl/libxl_conf.c
> @@ -959,7 +959,7 @@ libxlMakeNicList(virDomainDefPtr def, libxl_domain_config *d_config)
> }
>
> int
> -libxlMakeVfb(libxlDriverPrivatePtr driver,
> +libxlMakeVfb(virPortAllocatorPtr graphicsports,
> virDomainGraphicsDefPtr l_vfb,
> libxl_device_vfb *x_vfb)
> {
> @@ -982,7 +982,7 @@ libxlMakeVfb(libxlDriverPrivatePtr driver,
> libxl_defbool_set(&x_vfb->vnc.findunused, 0);
> if (l_vfb->data.vnc.autoport) {
>
> - if (virPortAllocatorAcquire(driver->reservedVNCPorts, &port) < 0)
> + if (virPortAllocatorAcquire(graphicsports, &port) < 0)
> return -1;
> l_vfb->data.vnc.port = port;
> }
> @@ -1004,7 +1004,7 @@ libxlMakeVfb(libxlDriverPrivatePtr driver,
> }
>
> static int
> -libxlMakeVfbList(libxlDriverPrivatePtr driver,
> +libxlMakeVfbList(virPortAllocatorPtr graphicsports,
> virDomainDefPtr def,
> libxl_domain_config *d_config)
> {
> @@ -1027,7 +1027,7 @@ libxlMakeVfbList(libxlDriverPrivatePtr driver,
> for (i = 0; i < nvfbs; i++) {
> libxl_device_vkb_init(&x_vkbs[i]);
>
> - if (libxlMakeVfb(driver, l_vfbs[i], &x_vfbs[i]) < 0)
> + if (libxlMakeVfb(graphicsports, l_vfbs[i], &x_vfbs[i]) < 0)
> goto error;
> }
>
> @@ -1305,7 +1305,7 @@ libxlMakeCapabilities(libxl_ctx *ctx)
> }
>
> int
> -libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
> +libxlBuildDomainConfig(virPortAllocatorPtr graphicsports,
> virDomainDefPtr def,
> libxl_ctx *ctx,
> libxl_domain_config *d_config)
> @@ -1324,7 +1324,7 @@ libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
> if (libxlMakeNicList(def, d_config) < 0)
> return -1;
>
> - if (libxlMakeVfbList(driver, def, d_config) < 0)
> + if (libxlMakeVfbList(graphicsports, def, d_config) < 0)
> return -1;
>
> if (libxlMakePCIList(def, d_config) < 0)
> diff --git a/src/libxl/libxl_conf.h b/src/libxl/libxl_conf.h
> index 1dd9de3..2dcd0b8 100644
> --- a/src/libxl/libxl_conf.h
> +++ b/src/libxl/libxl_conf.h
> @@ -152,14 +152,14 @@ libxlMakeNic(virDomainDefPtr def,
> virDomainNetDefPtr l_nic,
> libxl_device_nic *x_nic);
> int
> -libxlMakeVfb(libxlDriverPrivatePtr driver,
> +libxlMakeVfb(virPortAllocatorPtr graphicsports,
> virDomainGraphicsDefPtr l_vfb, libxl_device_vfb *x_vfb);
>
> int
> libxlMakePCI(virDomainHostdevDefPtr hostdev, libxl_device_pci *pcidev);
>
> int
> -libxlBuildDomainConfig(libxlDriverPrivatePtr driver,
> +libxlBuildDomainConfig(virPortAllocatorPtr graphicsports,
> virDomainDefPtr def,
> libxl_ctx *ctx,
> libxl_domain_config *d_config);
> diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
> index f95f8ce..e00a3fb 100644
> --- a/src/libxl/libxl_domain.c
> +++ b/src/libxl/libxl_domain.c
> @@ -1151,7 +1151,7 @@ libxlDomainStart(libxlDriverPrivatePtr driver, virDomainObjPtr vm,
>
> libxl_domain_config_init(&d_config);
>
> - if (libxlBuildDomainConfig(driver, vm->def,
> + if (libxlBuildDomainConfig(driver->reservedVNCPorts, vm->def,
> priv->ctx, &d_config) < 0)
> goto endjob;
>
>
next prev parent reply other threads:[~2014-05-30 22:34 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-30 17:24 [libvirt] [PATCH 0/5] Testing libvirt XML -> libxl_domain_config conversion Daniel P. Berrange
2014-05-30 17:24 ` [libvirt] [PATCH 1/5] Don't pass virDomainObjPtr to libxlBuildDomainConfig Daniel P. Berrange
2014-05-30 22:26 ` Jim Fehlig
2014-05-30 17:24 ` [libvirt] [PATCH 2/5] Don't pass libxlDriverPrivatePtr into libxlBuildDomainConfig Daniel P. Berrange
2014-05-30 22:34 ` Jim Fehlig [this message]
2014-05-30 17:24 ` [libvirt] [PATCH 3/5] libxl: Move virDomainXMLOptionNew into libxlCreateXMLConf Daniel P. Berrange
2014-05-30 22:41 ` Jim Fehlig
2014-06-02 9:33 ` Daniel P. Berrange
2014-05-30 17:24 ` [libvirt] [PATCH 4/5] Add more test suite mock helpers Daniel P. Berrange
2014-05-30 17:24 ` [PATCH 5/5] Add a test suite for libxl option generator Daniel P. Berrange
2014-06-02 12:53 ` Ian Campbell
2014-06-02 12:57 ` [libvirt] [Xen-devel] " Daniel P. Berrange
2014-06-02 21:42 ` Jim Fehlig
2014-06-02 12:41 ` [PATCH 0/5] Testing libvirt XML -> libxl_domain_config conversion Ian Campbell
2014-06-02 12:49 ` [libvirt] [Xen-devel] " Daniel P. Berrange
2014-06-02 22:43 ` Jim Fehlig
2014-06-03 9:26 ` [libvirt] [Xen-devel] " Daniel P. Berrange
2014-06-02 12:57 ` Ian Campbell
2014-06-02 13:15 ` Processed: " xen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5389078B.3070505@suse.com \
--to=jfehlig@suse.com \
--cc=berrange@redhat.com \
--cc=libvir-list@redhat.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.