[libvirt] [PATCH] nwfilter: Fix the test for the result of atomic dec and test
by Stefan Berger
From: Stefan Berger <stefanb(a)linux.vnet.ibm.com>
https://bugzilla.redhat.com/show_bug.cgi?id=1071181
Commit 49b59a15 fixed one problem but masks another one related to pointer
freeing.
Use virAtomicIntGet() to test for 0 rather than trying to test for 'true'
after virAtomicIntDecAndTest().
Avoid putting of the virNWFilterSnoopReq once the thread has been started.
Signed-off-by: Stefan Berger <stefanb(a)linux.vnet.ibm.com>
---
src/nwfilter/nwfilter_dhcpsnoop.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcpsnoop.c
index d2a8062..32ca304 100644
--- a/src/nwfilter/nwfilter_dhcpsnoop.c
+++ b/src/nwfilter/nwfilter_dhcpsnoop.c
@@ -720,7 +720,10 @@ virNWFilterSnoopReqPut(virNWFilterSnoopReqPtr req)
virNWFilterSnoopLock();
- if (virAtomicIntDecAndTest(&req->refctr)) {
+ virAtomicIntDecAndTest(&req->refctr);
+
+ /* make sure it's 0; virAtomitIntDecAndTest may return true on '1' */
+ if (virAtomicIntGet(&req->refctr) == 0) {
/*
* delete the request:
* - if we don't find req on the global list anymore
@@ -1605,6 +1608,7 @@ virNWFilterDHCPSnoopReq(virNWFilterTechDriverPtr techdriver,
int tmp;
virThread thread;
virNWFilterVarValuePtr dhcpsrvrs;
+ bool threadPuts = false;
virNWFilterSnoopIFKeyFMT(ifkey, vmuuid, macaddr);
@@ -1690,6 +1694,8 @@ virNWFilterDHCPSnoopReq(virNWFilterTechDriverPtr techdriver,
/* prevent thread from holding req */
virNWFilterSnoopReqLock(req);
+ threadPuts = true;
+
if (virThreadCreate(&thread, false, virNWFilterDHCPSnoopThread,
req) != 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
@@ -1737,7 +1743,8 @@ exit_rem_ifnametokey:
exit_snoopunlock:
virNWFilterSnoopUnlock();
exit_snoopreqput:
- virNWFilterSnoopReqPut(req);
+ if (!threadPuts)
+ virNWFilterSnoopReqPut(req);
return -1;
}
--
1.8.1.4
10 years, 9 months
[libvirt] [PATCH] build: Fix build with old automake
by Jiri Denemark
Ancient automake (such as from RHEL5) does not provide abs_srcdir and
abs_builddir variables which are used by a recent commit of mine
(e562e82).
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/Makefile.am | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/Makefile.am b/src/Makefile.am
index d4d7b2b..fce9056 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -16,6 +16,10 @@
## License along with this library. If not, see
## <http://www.gnu.org/licenses/>.
+# old automake does not provide abs_{src,build}dir variables
+abs_builddir = $(shell pwd)
+abs_srcdir = $(shell cd $(srcdir) && pwd)
+
# No libraries with the exception of LIBXML should be listed
# here. List them against the individual XXX_la_CFLAGS targets
# that actually use them. Also keep GETTEXT_CPPFLAGS at the end.
--
1.9.0
10 years, 9 months
[libvirt] [PATCH] libxl: fix framebuffer port setting for HVM domains
by Jim Fehlig
libxl uses the libxl_vnc_info and libxl_sdl_info fields from the
hvm union in libxl_domain_build_info struct when generating QEMU
args for VNC or SDL. These fields were left unset by the libxl
driver, causing libxl to ignore any user settings. E.g. with
<graphics type='vnc' port='5950'/>
port would be ignored and QEMU would instead be invoked with
-vnc 127.0.0.1:0,to=99
Unlike the libxl_domain_config struct, the libxl_domain_build_info
contains only a single libxl_vnc_info and libxl_sdl_info, so
populate these fields from the first vfb in
libxl_domain_config->vfbs.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
Signed-off-by: David Kiarie <davidkiarie4(a)gmail.com>
---
src/libxl/libxl_conf.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/src/libxl/libxl_conf.c b/src/libxl/libxl_conf.c
index aa5d958..cfac847 100644
--- a/src/libxl/libxl_conf.c
+++ b/src/libxl/libxl_conf.c
@@ -1022,6 +1022,20 @@ libxlMakeVfbList(libxlDriverPrivatePtr driver,
d_config->vkbs = x_vkbs;
d_config->num_vfbs = d_config->num_vkbs = nvfbs;
+ /*
+ * VNC or SDL info must also be set in libxl_domain_build_info
+ * for HVM domains. Use the first vfb device.
+ */
+ if (STREQ(def->os.type, "hvm")) {
+ libxl_domain_build_info *b_info = &d_config->b_info;
+ libxl_device_vfb vfb = d_config->vfbs[0];
+
+ if (libxl_defbool_val(vfb.vnc.enable))
+ memcpy(&b_info->u.hvm.vnc, &vfb.vnc, sizeof(libxl_vnc_info));
+ else if (libxl_defbool_val(vfb.sdl.enable))
+ memcpy(&b_info->u.hvm.sdl, &vfb.sdl, sizeof(libxl_sdl_info));
+ }
+
return 0;
error:
--
1.8.1.4
10 years, 9 months
[libvirt] specifying cirrus ram size
by Serge Hallyn
Hi,
In order to migrate a VM from an older system with qemu-kvm to a newer
one with qemu, the newer qemu needs to be told to use the same vga
ram size as qemu-kvm used, 8M.
virsh domxml-from-native suggests that the way to specify a
8mb cirrus vga ram size would be to add
<qemu:commandline>
<qemu:arg value='-global'/>
<qemu:arg value='cirrus-vga.vgamem_mb=8'/>
</qemu:commandline>
However whenever I edit a .xml to add this, it disappears.
I'm adding it right before the ending
</domain>
Am I doing something silly?
thanks,
-serge
10 years, 9 months
[libvirt] [PATCH] domiftune: Reword bandwidth clearing paragraph
by Michal Privoznik
s/of value/value of/
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
tools/virsh.pod | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/virsh.pod b/tools/virsh.pod
index 3e721e0..0fb8248 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -699,7 +699,7 @@ in a single burst at -I<peak> speed as described in the Network XML
documentation at L<http://libvirt.org/formatnetwork.html#elementQoS>.
To clear inbound or outbound settings, use I<--inbound> or I<--outbound>
-respectfully with average of value zero.
+respectfully with average value of zero.
If I<--live> is specified, affect a running guest.
If I<--config> is specified, affect the next boot of a persistent guest.
--
1.9.0
10 years, 9 months
[libvirt] [PATCH] qemuDomainSetInterfaceParameters: Allow bandwidth clear out
by Michal Privoznik
We allow translation from no_bandwidth to has_bandwidth for a vnic.
However, going in the opposite direction is not implemented. It's not
limitation of the API rather than internal implementation. The problem
is, we correctly detect that user hasn't specified any outbound (say
he wants to clear out outbound). However, this gets overwritten by
current vnic outbound settings. Then, virNetDevBandwidthSet doesn't
change anything. We need to stop overwriting the outbound if users
don't want us to. Same applies for inbound.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/qemu/qemu_driver.c | 15 +++++++++++----
tools/virsh-domain.c | 4 ++--
tools/virsh.pod | 3 +++
3 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index fc382a5..26ac79b 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -9782,6 +9782,7 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
virNetDevBandwidthPtr bandwidth = NULL, newBandwidth = NULL;
virQEMUDriverConfigPtr cfg = NULL;
virCapsPtr caps = NULL;
+ bool inboundSpecified = false, outboundSpecified = false;
virCheckFlags(VIR_DOMAIN_AFFECT_LIVE |
VIR_DOMAIN_AFFECT_CONFIG, -1);
@@ -9843,12 +9844,14 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
if (STREQ(param->field, VIR_DOMAIN_BANDWIDTH_IN_AVERAGE)) {
bandwidth->in->average = params[i].value.ui;
+ inboundSpecified = true;
} else if (STREQ(param->field, VIR_DOMAIN_BANDWIDTH_IN_PEAK)) {
bandwidth->in->peak = params[i].value.ui;
} else if (STREQ(param->field, VIR_DOMAIN_BANDWIDTH_IN_BURST)) {
bandwidth->in->burst = params[i].value.ui;
} else if (STREQ(param->field, VIR_DOMAIN_BANDWIDTH_OUT_AVERAGE)) {
bandwidth->out->average = params[i].value.ui;
+ outboundSpecified = true;
} else if (STREQ(param->field, VIR_DOMAIN_BANDWIDTH_OUT_PEAK)) {
bandwidth->out->peak = params[i].value.ui;
} else if (STREQ(param->field, VIR_DOMAIN_BANDWIDTH_OUT_BURST)) {
@@ -9874,7 +9877,7 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
* bandwidth parameters, so merge with old bandwidth parameters
* here to prevent them from being lost. */
if (bandwidth->in ||
- (net->bandwidth && net->bandwidth->in)) {
+ (!inboundSpecified && net->bandwidth && net->bandwidth->in)) {
if (VIR_ALLOC(newBandwidth->in) < 0)
goto cleanup;
@@ -9883,7 +9886,7 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
sizeof(*newBandwidth->in));
}
if (bandwidth->out ||
- (net->bandwidth && net->bandwidth->out)) {
+ (!outboundSpecified && net->bandwidth && net->bandwidth->out)) {
if (VIR_ALLOC(newBandwidth->out) < 0)
goto cleanup;
@@ -9900,8 +9903,12 @@ qemuDomainSetInterfaceParameters(virDomainPtr dom,
}
virNetDevBandwidthFree(net->bandwidth);
- net->bandwidth = newBandwidth;
- newBandwidth = NULL;
+ if (newBandwidth->in || newBandwidth->out) {
+ net->bandwidth = newBandwidth;
+ newBandwidth = NULL;
+ } else {
+ net->bandwidth = NULL;
+ }
}
if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
if (!persistentNet->bandwidth) {
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index fbde3da..cb6bf63 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -2615,7 +2615,7 @@ cmdDomIftune(vshControl *ctl, const vshCmd *cmd)
vshError(ctl, _("inbound format is incorrect"));
goto cleanup;
}
- if (inbound.average == 0) {
+ if (inbound.average == 0 && (inbound.burst || inbound.peak)) {
vshError(ctl, _("inbound average is mandatory"));
goto cleanup;
}
@@ -2643,7 +2643,7 @@ cmdDomIftune(vshControl *ctl, const vshCmd *cmd)
vshError(ctl, _("outbound format is incorrect"));
goto cleanup;
}
- if (outbound.average == 0) {
+ if (outbound.average == 0 && (outbound.burst || outbound.peak)) {
vshError(ctl, _("outbound average is mandatory"));
goto cleanup;
}
diff --git a/tools/virsh.pod b/tools/virsh.pod
index 5c74bb3..3e721e0 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -698,6 +698,9 @@ expressed in kilobytes per second, while I<burst> is expressed in kilobytes
in a single burst at -I<peak> speed as described in the Network XML
documentation at L<http://libvirt.org/formatnetwork.html#elementQoS>.
+To clear inbound or outbound settings, use I<--inbound> or I<--outbound>
+respectfully with average of value zero.
+
If I<--live> is specified, affect a running guest.
If I<--config> is specified, affect the next boot of a persistent guest.
If I<--current> is specified, affect the current guest state.
--
1.9.0
10 years, 9 months
[libvirt] [PATCH v2] Add ability to register callback for virCommand dry run
by Daniel P. Berrange
To allow for fault injection of the virCommand dry run,
add the ability to register a callback. The callback will
be passed the argv, env and stdin buffer and is expected
to return the exit status and optionally fill stdout and
stderr buffers.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/util/vircommand.c | 52 ++++++++++++++++++++++++++++++++----------
src/util/vircommand.h | 1 +
src/util/vircommandpriv.h | 13 ++++++++++-
tests/virkmodtest.c | 8 +++----
tests/virnetdevbandwidthtest.c | 3 ++-
5 files changed, 59 insertions(+), 18 deletions(-)
diff --git a/src/util/vircommand.c b/src/util/vircommand.c
index ff135bf..79bb20c 100644
--- a/src/util/vircommand.c
+++ b/src/util/vircommand.c
@@ -135,6 +135,9 @@ struct _virCommand {
/* See virCommandSetDryRun for description for this variable */
static virBufferPtr dryRunBuffer;
+static virCommandDryRunCallback dryRunCallback;
+static void *dryRunOpaque;
+static int dryRunStatus;
/*
* virCommandFDIsSet:
@@ -1860,6 +1863,11 @@ virCommandProcessIO(virCommandPtr cmd)
size_t inoff = 0;
int ret = 0;
+ if (dryRunBuffer || dryRunCallback) {
+ VIR_DEBUG("Dry run requested, skipping I/O processing");
+ return 0;
+ }
+
/* With an input buffer, feed data to child
* via pipe */
if (cmd->inbuf)
@@ -2267,16 +2275,25 @@ virCommandRunAsync(virCommandPtr cmd, pid_t *pid)
}
str = virCommandToString(cmd);
- if (dryRunBuffer) {
+ if (dryRunBuffer || dryRunCallback) {
+ dryRunStatus = 0;
if (!str) {
/* error already reported by virCommandToString */
goto cleanup;
}
- VIR_DEBUG("Dry run requested, appending stringified "
- "command to dryRunBuffer=%p", dryRunBuffer);
- virBufferAdd(dryRunBuffer, str, -1);
- virBufferAddChar(dryRunBuffer, '\n');
+ if (dryRunBuffer) {
+ VIR_DEBUG("Dry run requested, appending stringified "
+ "command to dryRunBuffer=%p", dryRunBuffer);
+ virBufferAdd(dryRunBuffer, str, -1);
+ virBufferAddChar(dryRunBuffer, '\n');
+ }
+ if (dryRunCallback) {
+ dryRunCallback((const char *const*)cmd->args,
+ (const char *const*)cmd->env,
+ cmd->inbuf, cmd->outbuf, cmd->errbuf,
+ &dryRunStatus, dryRunOpaque);
+ }
ret = 0;
goto cleanup;
}
@@ -2356,10 +2373,11 @@ virCommandWait(virCommandPtr cmd, int *exitstatus)
return -1;
}
- if (dryRunBuffer) {
- VIR_DEBUG("Dry run requested, claiming success");
+ if (dryRunBuffer || dryRunCallback) {
+ VIR_DEBUG("Dry run requested, returning status %d",
+ dryRunStatus);
if (exitstatus)
- *exitstatus = 0;
+ *exitstatus = dryRunStatus;
return 0;
}
@@ -2704,6 +2722,7 @@ virCommandDoAsyncIO(virCommandPtr cmd)
/**
* virCommandSetDryRun:
* @buf: buffer to store stringified commands
+ * @callback: callback to process input/output/args
*
* Sometimes it's desired to not actually run given command, but
* see its string representation without having to change the
@@ -2712,8 +2731,13 @@ virCommandDoAsyncIO(virCommandPtr cmd)
* virCommandRun* API. The virCommandSetDryRun allows you to
* modify this behavior: once called, every call to
* virCommandRun* results in command string representation being
- * appended to @buf instead of being executed. the strings are
- * escaped for a shell and separated by a newline. For example:
+ * appended to @buf instead of being executed. If @callback is
+ * provided, then it is invoked with the argv, env and stdin
+ * data string for the command. It is expected to fill the stdout
+ * and stderr data strings and exit status variables.
+ *
+ * The strings stored in @buf are escaped for a shell and
+ * separated by a newline. For example:
*
* virBuffer buffer = VIR_BUFFER_INITIALIZER;
* virCommandSetDryRun(&buffer);
@@ -2725,10 +2749,14 @@ virCommandDoAsyncIO(virCommandPtr cmd)
*
* /bin/echo 'Hello world'\n
*
- * To cancel this effect pass NULL.
+ * To cancel this effect pass NULL for @buf and @callback.
*/
void
-virCommandSetDryRun(virBufferPtr buf)
+virCommandSetDryRun(virBufferPtr buf,
+ virCommandDryRunCallback cb,
+ void *opaque)
{
dryRunBuffer = buf;
+ dryRunCallback = cb;
+ dryRunOpaque = opaque;
}
diff --git a/src/util/vircommand.h b/src/util/vircommand.h
index 10b4fa2..929375b 100644
--- a/src/util/vircommand.h
+++ b/src/util/vircommand.h
@@ -186,4 +186,5 @@ void virCommandAbort(virCommandPtr cmd);
void virCommandFree(virCommandPtr cmd);
void virCommandDoAsyncIO(virCommandPtr cmd);
+
#endif /* __VIR_COMMAND_H__ */
diff --git a/src/util/vircommandpriv.h b/src/util/vircommandpriv.h
index 80247b2..8930299 100644
--- a/src/util/vircommandpriv.h
+++ b/src/util/vircommandpriv.h
@@ -28,5 +28,16 @@
# include "vircommand.h"
-void virCommandSetDryRun(virBufferPtr buf);
+typedef void (*virCommandDryRunCallback)(const char *const*args,
+ const char *const*env,
+ const char *input,
+ char **output,
+ char **error,
+ int *status,
+ void *opaque);
+
+void virCommandSetDryRun(virBufferPtr buf,
+ virCommandDryRunCallback cb,
+ void *opaque);
+
#endif /* __VIR_COMMAND_PRIV_H__ */
diff --git a/tests/virkmodtest.c b/tests/virkmodtest.c
index 8899689..9473352 100644
--- a/tests/virkmodtest.c
+++ b/tests/virkmodtest.c
@@ -96,7 +96,7 @@ testKModLoad(const void *args)
bool useBlacklist = info->useBlacklist;
virBuffer buf = VIR_BUFFER_INITIALIZER;
- virCommandSetDryRun(&buf);
+ virCommandSetDryRun(&buf, NULL, NULL);
errbuf = virKModLoad(module, useBlacklist);
if (errbuf) {
@@ -110,7 +110,7 @@ testKModLoad(const void *args)
ret = 0;
cleanup:
- virCommandSetDryRun(NULL);
+ virCommandSetDryRun(NULL, NULL, NULL);
VIR_FREE(errbuf);
return ret;
}
@@ -125,7 +125,7 @@ testKModUnload(const void *args)
const char *module = info->module;
virBuffer buf = VIR_BUFFER_INITIALIZER;
- virCommandSetDryRun(&buf);
+ virCommandSetDryRun(&buf, NULL, NULL);
errbuf = virKModUnload(module);
if (errbuf) {
@@ -139,7 +139,7 @@ testKModUnload(const void *args)
ret = 0;
cleanup:
- virCommandSetDryRun(NULL);
+ virCommandSetDryRun(NULL, NULL, NULL);
VIR_FREE(errbuf);
return ret;
}
diff --git a/tests/virnetdevbandwidthtest.c b/tests/virnetdevbandwidthtest.c
index 38dfbc1..f5d252c 100644
--- a/tests/virnetdevbandwidthtest.c
+++ b/tests/virnetdevbandwidthtest.c
@@ -77,7 +77,7 @@ testVirNetDevBandwidthSet(const void *data)
if (!iface)
iface = "eth0";
- virCommandSetDryRun(&buf);
+ virCommandSetDryRun(&buf, NULL, NULL);
if (virNetDevBandwidthSet(iface, band, info->hierarchical_class) < 0)
goto cleanup;
@@ -101,6 +101,7 @@ testVirNetDevBandwidthSet(const void *data)
ret = 0;
cleanup:
+ virCommandSetDryRun(NULL, NULL, NULL);
virNetDevBandwidthFree(band);
virBufferFreeAndReset(&buf);
VIR_FREE(actual_cmd);
--
1.8.5.3
10 years, 9 months
[libvirt] [PATCH] virhostdev.h: remove ATTRIBUTE_NONNULL to oldStateDir
by Chunyan Liu
For libxl driver usage, it didn't support hostdev passthrough before,
oldStateDir is NULL when calling virHostdevReAttachDomainHostdevs.
That is allowed. Remove ATTRIBUTE_NONNULL setting to oldStateDir.
Signed-off-by: Chunyan Liu <cyliu(a)suse.com>
---
src/util/virhostdev.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/virhostdev.h b/src/util/virhostdev.h
index a56a2b5..2036430 100644
--- a/src/util/virhostdev.h
+++ b/src/util/virhostdev.h
@@ -142,7 +142,7 @@ virHostdevReAttachDomainDevices(virHostdevManagerPtr mgr,
virDomainDefPtr def,
unsigned int flags,
const char *oldStateDir)
- ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3) ATTRIBUTE_NONNULL(5);
+ ATTRIBUTE_NONNULL(1) ATTRIBUTE_NONNULL(2) ATTRIBUTE_NONNULL(3);
/* functions used by NodeDevDetach/Reattach/Reset */
int virHostdevPCINodeDeviceDetach(virHostdevManagerPtr mgr,
--
1.7.12.4
10 years, 9 months
[libvirt] [PATCH] maint: avoid unbalanced {} across vbox #ifdef
by Eric Blake
Emacs is fairly good about navigating across function and scope
boundaries, provided that the code has balanced {}. The vbox
code, however, violated that premise, by splitting 'if () {'
across several #ifdef branches, but sharing the '} else {...}'
outside of the branches. The extra lines of code is worth my
sanity, in a function that is already a horrendous 1100+ lines
long. Bad nesting is hard to maintain.
* src/vbox/vbox_tmpl.c (vboxDomainGetXMLDesc) Duplicate code
rather than trying to share else branch across #ifdef.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
Pushing under the trivial rule. I'm tired of '^X-4-a' pulling
up a changelog template for the wrong function, only to have
to scroll through several hundred lines of #ifdef mess to find
what function I'm really modifying.
src/vbox/vbox_tmpl.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/vbox/vbox_tmpl.c b/src/vbox/vbox_tmpl.c
index 7162a25..2aeddd0 100644
--- a/src/vbox/vbox_tmpl.c
+++ b/src/vbox/vbox_tmpl.c
@@ -2649,6 +2649,9 @@ static char *vboxDomainGetXMLDesc(virDomainPtr dom, unsigned int flags) {
VRDxServer->vtbl->GetPort(VRDxServer, &VRDPport);
if (VRDPport) {
def->graphics[def->ngraphics]->data.rdp.port = VRDPport;
+ } else {
+ def->graphics[def->ngraphics]->data.rdp.autoport = true;
+ }
#elif VBOX_API_VERSION < 4000000 /* 3001000 <= VBOX_API_VERSION < 4000000 */
PRUnichar *VRDPport = NULL;
VRDxServer->vtbl->GetPorts(VRDxServer, &VRDPport);
@@ -2656,6 +2659,9 @@ static char *vboxDomainGetXMLDesc(virDomainPtr dom, unsigned int flags) {
/* even if vbox supports mutilpe ports, single port for now here */
def->graphics[def->ngraphics]->data.rdp.port = PRUnicharToInt(VRDPport);
VBOX_UTF16_FREE(VRDPport);
+ } else {
+ def->graphics[def->ngraphics]->data.rdp.autoport = true;
+ }
#else /* VBOX_API_VERSION >= 4000000 */
PRUnichar *VRDEPortsKey = NULL;
PRUnichar *VRDEPortsValue = NULL;
@@ -2666,10 +2672,10 @@ static char *vboxDomainGetXMLDesc(virDomainPtr dom, unsigned int flags) {
/* even if vbox supports mutilpe ports, single port for now here */
def->graphics[def->ngraphics]->data.rdp.port = PRUnicharToInt(VRDEPortsValue);
VBOX_UTF16_FREE(VRDEPortsValue);
-#endif /* VBOX_API_VERSION >= 4000000 */
} else {
def->graphics[def->ngraphics]->data.rdp.autoport = true;
}
+#endif /* VBOX_API_VERSION >= 4000000 */
def->graphics[def->ngraphics]->type = VIR_DOMAIN_GRAPHICS_TYPE_RDP;
--
1.8.5.3
10 years, 9 months
[libvirt] [PATCH 0/6] Misc cleanups to nwfilter code
by Daniel P. Berrange
This mini-series performs a few style cleanups on the nwfilter
code. There should be no functional change in any of these
patches.
Daniel P. Berrange (6):
Change 'int incoming' to 'bool incoming' in nwfilter code
Remove pointless brackets around boolean
Remove 'int stopOnError' parameters in nwfilter methods
Remove pointless return values in nwfilter methods
Change 'int isTempChain' to bool in nwfilter
Change CMD_STOPONERR(1) to use true
src/nwfilter/nwfilter_ebiptables_driver.c | 523 ++++++++++++++----------------
1 file changed, 241 insertions(+), 282 deletions(-)
--
1.8.5.3
10 years, 9 months