[libvirt] [PATCHv6 0/6] Add virNodeGetCPUStats() API
by Minoru Usui
Hi,
This is v6 of virNodeGetCPUTimeParameters() API.
(This time, I rename it to virNodeGetCPUStats())
It returns cpu utilization or
cumulative cpu time of the node from /proc/stat since node boots up.
This patch only supports linux host.
Changes
v5->v6
- Rename API name to virNodeGetCPUStats()
- virsh nodecpustats subcommand returns raw/absolute cputime value by default,
and add --percent option for printing utilization.
v4->v5
- Rebase latest libvirt GIT tree.
v3->v4
- Rebase this patch like virDomainGetMemoryParameters() from v2 patches.
(drop v3 patches except virsh subcommand)
- Rename API name to virNodeGetCPUTimeParameters()
v2->v3
- Change user I/F. It is able to request what the user want by the @flags.
- Minor change of virsh nodecputime I/F.
v1->v2
- Change user I/F like virDomainGetMemoryStats()
- It can return either cpu utilization or cumulative cpu time of the node
depends on each driver.
Minoru Usui (6):
[v6] virNodeGetCPUStats: Expose new API
[v6] virNodeGetCPUStats: Define internal driver API
[v6] virNodeGetCPUStats: Implement public API
[v6] virNodeGetCPUStats: Implement remote protocol
[v6] virNodeGetCPUStats: Implement virsh support
[v6] virNodeGetCPUStats: Implement linux support
daemon/remote.c | 76 +++++++++++++++++++++++++
include/libvirt/libvirt.h.in | 65 +++++++++++++++++++++
src/driver.h | 8 +++
src/libvirt.c | 85 ++++++++++++++++++++++++++++
src/libvirt_private.syms | 1 +
src/libvirt_public.syms | 1 +
src/lxc/lxc_driver.c | 1 +
src/nodeinfo.c | 127 ++++++++++++++++++++++++++++++++++++++++++
src/nodeinfo.h | 5 +-
src/qemu/qemu_driver.c | 1 +
src/remote/remote_driver.c | 65 +++++++++++++++++++++
src/remote/remote_protocol.x | 21 +++++++-
src/uml/uml_driver.c | 1 +
tools/virsh.c | 127 ++++++++++++++++++++++++++++++++++++++++++
tools/virsh.pod | 6 ++
15 files changed, 588 insertions(+), 2 deletions(-)
--
Minoru Usui <usui(a)mxm.nes.nec.co.jp>
13 years, 5 months
[libvirt] [PATCH] security: plug regression introduced in disk probe logic
by Eric Blake
Regression introduced in commit d6623003 (v0.8.8) - using the
wrong sizeof operand meant that security manager private data
was overlaying the allowDiskFOrmatProbing member of struct
_virSecurityManager. This reopens disk probing, which was
supposed to be prevented by the solution to CVE-2010-2238.
* src/security/security_manager.c
(virSecurityManagerGetPrivateData): Use correct offset.
---
src/security/security_manager.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/security/security_manager.c b/src/security/security_manager.c
index 0246dd8..833c1a2 100644
--- a/src/security/security_manager.c
+++ b/src/security/security_manager.c
@@ -107,7 +107,7 @@ virSecurityManagerPtr virSecurityManagerNew(const char *name,
void *virSecurityManagerGetPrivateData(virSecurityManagerPtr mgr)
{
- return ((char*)mgr) + sizeof(mgr);
+ return ((char*)mgr) + sizeof(*mgr);
}
--
1.7.4.4
13 years, 5 months
[libvirt] [PATCH v2] screenshot: Expose the new API in virsh
by Michal Privoznik
* tools/virsh.c: Add screenshot command
* tools/virsh.pod: Document new command
* src/libvirt.c: Fix off-be-one error
---
diff to v1:
- make filename optional and generate filename when missing
src/libvirt.c | 2 +-
tools/virsh.c | 152 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
tools/virsh.pod | 9 +++
3 files changed, 162 insertions(+), 1 deletions(-)
diff --git a/src/libvirt.c b/src/libvirt.c
index 5a5439d..cfb9e3b 100644
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -2461,7 +2461,7 @@ error:
* The screen ID is the sequential number of screen. In case of multiple
* graphics cards, heads are enumerated before devices, e.g. having
* two graphics cards, both with four heads, screen ID 5 addresses
- * the first head on the second card.
+ * the second head on the second card.
*
* Returns a string representing the mime-type of the image format, or
* NULL upon error. The caller must free() the returned value.
diff --git a/tools/virsh.c b/tools/virsh.c
index e35637d..aad930e 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -1879,6 +1879,157 @@ cmdDump(vshControl *ctl, const vshCmd *cmd)
return ret;
}
+static const vshCmdInfo info_screenshot[] = {
+ {"help", N_("take a screenshot of a current domain console and store it "
+ "into a file")},
+ {"desc", N_("screenshot of a current domain console")},
+ {NULL, NULL}
+};
+
+static const vshCmdOptDef opts_screenshot[] = {
+ {"domain", VSH_OT_DATA, VSH_OFLAG_REQ, N_("domain name, id or uuid")},
+ {"file", VSH_OT_DATA, VSH_OFLAG_NONE, N_("where to store the screenshot")},
+ {"screen", VSH_OT_INT, VSH_OFLAG_NONE, N_("ID of a screen to take screenshot of")},
+ {NULL, 0, 0, NULL}
+};
+
+static int cmdScreenshotSink(virStreamPtr st ATTRIBUTE_UNUSED,
+ const char *bytes, size_t nbytes, void *opaque)
+{
+ int *fd = opaque;
+
+ return safewrite(*fd, bytes, nbytes);
+}
+
+/**
+ * Generate string: '<domain name>-<timestamp>>[<extension>]'
+ */
+static char *
+vshGenerFileName(vshControl *ctl, virDomainPtr dom) {
+ char timestr[100];
+ struct timeval cur_time;
+ struct tm time_info;
+ const char *ext = NULL;
+ const char *hypType = NULL;
+ char *ret = NULL;
+
+ /* We should be already connected, but doesn't
+ * hurt to check */
+ if (!vshConnectionUsability(ctl, ctl->conn))
+ return NULL;
+
+ if (!dom) {
+ vshError(ctl, "%s", _("Invalid domain supplied"));
+ return NULL;
+ }
+
+ if (!(hypType = virConnectGetType(ctl->conn))) {
+ vshError(ctl, "%s", _("Can't query hypervisor's type"));
+ return NULL;
+ }
+
+ if (STREQ(hypType, "QEMU"))
+ ext = ".ppm";
+ else if (STREQ(hypType, "VBOX"))
+ ext = ".png";
+ /* add hypervisors here */
+
+ gettimeofday(&cur_time, NULL);
+ localtime_r(&cur_time.tv_sec, &time_info);
+ strftime(timestr, sizeof(timestr), "%Y-%m-%d-%H:%M:%S", &time_info);
+
+ if (virAsprintf(&ret, "%s-%s%s", virDomainGetName(dom),
+ timestr, ext ? ext : "") < 0) {
+ vshError(ctl, "%s", _("Out of memory"));
+ return false;
+ }
+
+ return ret;
+}
+
+static bool
+cmdScreenshot(vshControl *ctl, const vshCmd *cmd) {
+ virDomainPtr dom;
+ const char *name = NULL;
+ char *file = NULL;
+ int fd = -1;
+ virStreamPtr st = NULL;
+ unsigned int screen = 0;
+ unsigned int flags = 0; /* currently unused */
+ int ret = false;
+ bool created = true;
+ bool generated = false;
+ char *mime = NULL;
+
+ if (!vshConnectionUsability(ctl, ctl->conn))
+ return false;
+
+ if (vshCommandOptString(cmd, "file", (const char **) &file) < 0) {
+ vshError(ctl, "%s", _("file must not be empty"));
+ return false;
+ }
+
+ if (vshCommandOptInt(cmd, "screen", (int*) &screen) < 0) {
+ vshError(ctl, "%s", _("invalid screen ID"));
+ return false;
+ }
+
+ if (!(dom = vshCommandOptDomain(ctl, cmd, &name)))
+ return false;
+
+ if (!file) {
+ if (!(file=vshGenerFileName(ctl, dom)))
+ return false;
+ generated = true;
+ }
+
+ if ((fd = open(file, O_WRONLY|O_CREAT|O_EXCL, 0666)) < 0) {
+ created = false;
+ if (errno != EEXIST ||
+ (fd = open(file, O_WRONLY|O_TRUNC, 0666)) < 0) {
+ vshError(ctl, _("cannot create file %s"), file);
+ goto cleanup;
+ }
+ }
+
+ st = virStreamNew(ctl->conn, 0);
+
+ mime = virDomainScreenshot(dom, st, screen, flags);
+ if (mime == NULL) {
+ vshError(ctl, _("could not take a screenshot of %s"), name);
+ goto cleanup;
+ }
+
+ if (virStreamRecvAll(st, cmdScreenshotSink, &fd) < 0) {
+ vshError(ctl, _("could not receive data from domain %s"), name);
+ goto cleanup;
+ }
+
+ if (VIR_CLOSE(fd) < 0) {
+ vshError(ctl, _("cannot close file %s"), file);
+ goto cleanup;
+ }
+
+ if (virStreamFinish(st) < 0) {
+ vshError(ctl, _("cannot close stream on domain %s"), name);
+ goto cleanup;
+ }
+
+ vshPrint(ctl, _("Screenshot saved to %s it's type is %s"), file, mime);
+ ret = true;
+
+cleanup:
+ if (ret == false && created)
+ unlink(file);
+ if (generated)
+ VIR_FREE(file);
+ virDomainFree(dom);
+ if (st)
+ virStreamFree(st);
+ VIR_FORCE_CLOSE(fd);
+ return ret;
+}
+
/*
* "resume" command
*/
@@ -10750,6 +10901,7 @@ static const vshCmdDef domManagementCmds[] = {
{"resume", cmdResume, opts_resume, info_resume},
{"save", cmdSave, opts_save, info_save},
{"schedinfo", cmdSchedinfo, opts_schedinfo, info_schedinfo},
+ {"screenshot", cmdScreenshot, opts_screenshot, info_screenshot},
{"setmaxmem", cmdSetmaxmem, opts_setmaxmem, info_setmaxmem},
{"setmem", cmdSetmem, opts_setmem, info_setmem},
{"setvcpus", cmdSetvcpus, opts_setvcpus, info_setvcpus},
diff --git a/tools/virsh.pod b/tools/virsh.pod
index d11a0e3..5390f19 100644
--- a/tools/virsh.pod
+++ b/tools/virsh.pod
@@ -589,6 +589,15 @@ Therefore, -1 is a useful shorthand for 262144.
B<Note>: The weight and cap parameters are defined only for the
XEN_CREDIT scheduler and are now I<DEPRECATED>.
+=item B<screenshot> I<domain-id> I<imagefilepath> optional I<--screen> B<screenID>
+
+Takes a screenshot of a current domain console and stores it into a file.
+Optionally, if hypervisor supports more displays for a domain, I<screenID>
+allows to specify from which should be the screenshot taken. It is the
+sequential number of screen. In case of multiple graphics cards, heads
+are enumerated before devices, e.g. having two graphics cards, both with
+four heads, screen ID 5 addresses the second head on the second card.
+
=item B<setmem> I<domain-id> B<kilobytes> optional I<--config> I<--live>
I<--current>
--
1.7.5.rc3
13 years, 5 months
[libvirt] RFC: Add virDomainBlockPull API family to libvirt
by Adam Litke
To help speed the provisioning process for large domains, new QED disks are
created with backing to a template image. These disks are configured with copy
on read such that blocks that are read from the backing file are copied to the
new disk. This reduces I/O over a potentially costly path to the backing
image.
In such a configuration, there is a desire to remove the dependency on the
backing image as the domain runs. To accomplish this, qemu will provide an
interface to perform sequential copy on read operations during normal VM
operation. Once all data has been copied, the disk image's link to the backing
file is removed.
The virDomainBlockPull API family brings this functionality to libvirt.
virDomainBlockPullAll() instructs the hypervisor to stream the entire device in
the background. Progress of this operation can be checked with the function
virDomainBlockPullInfo(). An ongoing stream can be cancelled with
virDomainBlockPullAbort(). If a more controlled IO rate is desired,
virDomainBlockPull() can be used to perform a single increment of IO.
Subsequent calls to this function will automatically stream the appropriate
next increment until the disk has been fully populated.
An event (VIR_DOMAIN_EVENT_ID_BLOCK_PULL) will be emitted when a disk has been
fully populated or if a BlockPullAll() operation was terminated due to an
error. This event is useful to avoid polling on virDomainBlockPullInfo() for
completion and could also be used by the security driver to revoke access to
the backing file when it is no longer needed.
Note: I am sending this series out now (even though image streaming is not
quite committed to qemu upstream) because I want to start the review process.
At this stage, I expect only minor changes to the qemu implementation.
make check: PASS
make syntax-check: PASS
make -C tests valgrind: PASS
I am testing this API with Python Unittest (see the last patch).
[PATCH 0/7] virDomainBlockPull: Add public symbols to libvirt API
[PATCH 2/7] Add virDomainBlockPull support to the remote driver
[PATCH 3/7] Implement virDomainBlockPull for the qemu driver
[PATCH 4/7] Enable the virDomainBlockPull API in virsh
[PATCH 5/7] Enable virDomainBlockPull in the python API.
[PATCH 6/7] Asynchronous event for BlockPull completion
[PATCH 7/7] test: Python Unittests for DomainBlockPull API
13 years, 5 months
[libvirt] [PATCH] remote generator: Handle some virTypedParameterPtr using functions
by Matthias Bolte
This doesn't cover the getters that allow to query nparams yet.
---
This patch depends on
https://www.redhat.com/archives/libvir-list/2011-May/msg01856.html
daemon/remote.c | 182 -----------------------------------
daemon/remote_generator.pl | 58 +++++++++++-
src/remote/remote_driver.c | 215 ------------------------------------------
src/remote/remote_protocol.x | 20 ++--
4 files changed, 67 insertions(+), 408 deletions(-)
diff --git a/daemon/remote.c b/daemon/remote.c
index e8db25b..1c26722 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -785,92 +785,6 @@ no_memory:
}
static int
-remoteDispatchDomainSetSchedulerParameters(struct qemud_server *server ATTRIBUTE_UNUSED,
- struct qemud_client *client ATTRIBUTE_UNUSED,
- virConnectPtr conn,
- remote_message_header *hdr ATTRIBUTE_UNUSED,
- remote_error *rerr,
- remote_domain_set_scheduler_parameters_args *args,
- void *ret ATTRIBUTE_UNUSED)
-{
- virDomainPtr dom = NULL;
- virTypedParameterPtr params = NULL;
- int nparams;
- int rv = -1;
-
- if (!conn) {
- virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
- goto cleanup;
- }
-
- nparams = args->params.params_len;
-
- if ((params = remoteDeserializeTypedParameters(args->params.params_val,
- args->params.params_len,
- REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX,
- &nparams)) == NULL)
- goto cleanup;
-
- if (!(dom = get_nonnull_domain(conn, args->dom)))
- goto cleanup;
-
- if (virDomainSetSchedulerParameters(dom, params, nparams) < 0)
- goto cleanup;
-
- rv = 0;
-
-cleanup:
- if (rv < 0)
- remoteDispatchError(rerr);
- if (dom)
- virDomainFree(dom);
- VIR_FREE(params);
- return rv;
-}
-
-static int
-remoteDispatchDomainSetSchedulerParametersFlags(struct qemud_server *server ATTRIBUTE_UNUSED,
- struct qemud_client *client ATTRIBUTE_UNUSED,
- virConnectPtr conn,
- remote_message_header *hdr ATTRIBUTE_UNUSED,
- remote_error *rerr,
- remote_domain_set_scheduler_parameters_flags_args *args,
- void *ret ATTRIBUTE_UNUSED)
-{
- virDomainPtr dom = NULL;
- virTypedParameterPtr params = NULL;
- int nparams;
- int rv = -1;
-
- if (!conn) {
- virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
- goto cleanup;
- }
-
- if ((params = remoteDeserializeTypedParameters(args->params.params_val,
- args->params.params_len,
- REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX,
- &nparams)) == NULL)
- goto cleanup;
-
- if (!(dom = get_nonnull_domain(conn, args->dom)))
- goto cleanup;
-
- if (virDomainSetSchedulerParametersFlags(dom, params, nparams, args->flags) < 0)
- goto cleanup;
-
- rv = 0;
-
-cleanup:
- if (rv < 0)
- remoteDispatchError(rerr);
- if (dom)
- virDomainFree(dom);
- VIR_FREE(params);
- return rv;
-}
-
-static int
remoteDispatchDomainMemoryStats(struct qemud_server *server ATTRIBUTE_UNUSED,
struct qemud_client *client ATTRIBUTE_UNUSED,
virConnectPtr conn,
@@ -1363,54 +1277,6 @@ cleanup:
}
static int
-remoteDispatchDomainSetMemoryParameters(struct qemud_server *server
- ATTRIBUTE_UNUSED,
- struct qemud_client *client
- ATTRIBUTE_UNUSED,
- virConnectPtr conn,
- remote_message_header *
- hdr ATTRIBUTE_UNUSED,
- remote_error * rerr,
- remote_domain_set_memory_parameters_args
- * args, void *ret ATTRIBUTE_UNUSED)
-{
- virDomainPtr dom = NULL;
- virTypedParameterPtr params = NULL;
- int nparams;
- unsigned int flags;
- int rv = -1;
-
- if (!conn) {
- virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
- goto cleanup;
- }
-
- flags = args->flags;
-
- if ((params = remoteDeserializeTypedParameters(args->params.params_val,
- args->params.params_len,
- REMOTE_DOMAIN_MEMORY_PARAMETERS_MAX,
- &nparams)) == NULL)
- goto cleanup;
-
- if (!(dom = get_nonnull_domain(conn, args->dom)))
- goto cleanup;
-
- if (virDomainSetMemoryParameters(dom, params, nparams, flags) < 0)
- goto cleanup;
-
- rv = 0;
-
-cleanup:
- if (rv < 0)
- remoteDispatchError(rerr);
- VIR_FREE(params);
- if (dom)
- virDomainFree(dom);
- return rv;
-}
-
-static int
remoteDispatchDomainGetMemoryParameters(struct qemud_server *server
ATTRIBUTE_UNUSED,
struct qemud_client *client
@@ -1478,54 +1344,6 @@ cleanup:
}
static int
-remoteDispatchDomainSetBlkioParameters(struct qemud_server *server
- ATTRIBUTE_UNUSED,
- struct qemud_client *client
- ATTRIBUTE_UNUSED,
- virConnectPtr conn,
- remote_message_header *
- hdr ATTRIBUTE_UNUSED,
- remote_error * rerr,
- remote_domain_set_blkio_parameters_args
- * args, void *ret ATTRIBUTE_UNUSED)
-{
- virDomainPtr dom = NULL;
- virTypedParameterPtr params = NULL;
- int nparams;
- unsigned int flags;
- int rv = -1;
-
- if (!conn) {
- virNetError(VIR_ERR_INTERNAL_ERROR, "%s", _("connection not open"));
- goto cleanup;
- }
-
- flags = args->flags;
-
- if ((params = remoteDeserializeTypedParameters(args->params.params_val,
- args->params.params_len,
- REMOTE_DOMAIN_BLKIO_PARAMETERS_MAX,
- &nparams)) == NULL)
- goto cleanup;
-
- if (!(dom = get_nonnull_domain(conn, args->dom)))
- goto cleanup;
-
- if (virDomainSetBlkioParameters(dom, params, nparams, flags) < 0)
- goto cleanup;
-
- rv = 0;
-
-cleanup:
- if (rv < 0)
- remoteDispatchError(rerr);
- VIR_FREE(params);
- if (dom)
- virDomainFree(dom);
- return rv;
-}
-
-static int
remoteDispatchDomainGetBlkioParameters(struct qemud_server *server
ATTRIBUTE_UNUSED,
struct qemud_client *client
diff --git a/daemon/remote_generator.pl b/daemon/remote_generator.pl
index e901acd..5f4d8e4 100755
--- a/daemon/remote_generator.pl
+++ b/daemon/remote_generator.pl
@@ -407,6 +407,17 @@ elsif ($opt_b) {
}
push(@args_list, "args->$2.$2_len");
+ } elsif ($args_member =~ m/^remote_typed_param (\S+)<(\S+)>;/) {
+ push(@vars_list, "virTypedParameterPtr $1 = NULL");
+ push(@vars_list, "int n$1");
+ push(@args_list, "$1");
+ push(@args_list, "n$1");
+ push(@getters_list, " if (($1 = remoteDeserializeTypedParameters(args->$1.$1_val,\n" .
+ " args->$1.$1_len,\n" .
+ " $2,\n" .
+ " &n$1)) == NULL)\n" .
+ " goto cleanup;\n");
+ push(@free_list, " VIR_FREE(params);");
} elsif ($args_member =~ m/<\S+>;/ or $args_member =~ m/\[\S+\];/) {
# just make all other array types fail
die "unhandled type for argument value: $args_member";
@@ -893,6 +904,7 @@ elsif ($opt_k) {
my @vars_list = ();
my @args_check_list = ();
my @setters_list = ();
+ my @setters_list2 = ();
my $priv_src = "conn";
my $priv_name = "privateData";
my $call_args = "&args";
@@ -973,6 +985,19 @@ elsif ($opt_k) {
push(@setters_list, "args.$arg_name.${arg_name}_val = (char *)$arg_name;");
push(@setters_list, "args.$arg_name.${arg_name}_len = ${arg_name}len;");
push(@args_check_list, { name => "\"$arg_name\"", arg => "${arg_name}len", limit => $limit });
+ } elsif ($args_member =~ m/^remote_typed_param (\S+)<(\S+)>;/) {
+ push(@args_list, "virTypedParameterPtr $1");
+ push(@args_list, "int n$1");
+ push(@setters_list2, "if (remoteSerializeTypedParameters($1, n$1, &args.$1.$1_val, &args.$1.$1_len) < 0) {\n" .
+ " xdr_free((xdrproc_t)xdr_$call->{args}, (char *)&args);\n" .
+ " goto done;\n" .
+ " }");
+ } elsif ($args_member =~ m/^(unsigned )?int (\S+);\s*\/\*\s*call-by-reference\s*\*\//) {
+ my $type_name = $1; $type_name .= "int *";
+ my $arg_name = $2;
+
+ push(@args_list, "$type_name $arg_name");
+ push(@setters_list, "args.$arg_name = *$arg_name;");
} elsif ($args_member =~ m/^(unsigned )?int (\S+);/) {
my $type_name = $1; $type_name .= "int";
my $arg_name = $2;
@@ -1021,6 +1046,7 @@ elsif ($opt_k) {
# handle return values of the function
my @ret_list = ();
+ my @ret_list2 = ();
my $call_ret = "&ret";
my $single_ret_var = "int rv = -1";
my $single_ret_type = "int";
@@ -1029,6 +1055,7 @@ elsif ($opt_k) {
my $single_ret_list_name = "undefined";
my $single_ret_list_max_var = "undefined";
my $single_ret_list_max_define = "undefined";
+ my $single_ret_cleanup = 0;
my $multi_ret = 0;
if ($call->{ret} ne "void" and
@@ -1118,6 +1145,18 @@ elsif ($opt_k) {
$single_ret_var = "vir${type_name}Ptr rv = NULL";
$single_ret_type = "vir${type_name}Ptr";
}
+ } elsif ($ret_member =~ m/^remote_typed_param (\S+)<(\S+)>;\s*\/\*\s*insert@(\d+)\s*\*\//) {
+ splice(@args_list, int($3), 0, ("virTypedParameterPtr $1"));
+ push(@ret_list2, "if (remoteDeserializeTypedParameters(ret.$1.$1_val,\n" .
+ " ret.$1.$1_len,\n" .
+ " $2,\n" .
+ " $1,\n" .
+ " n$1) < 0)\n" .
+ " goto cleanup;\n");
+ $single_ret_cleanup = 1;
+ } elsif ($ret_member =~ m/^remote_typed_param (\S+)<\S+>;/) {
+ # error out on unannotated arrays
+ die "remote_typed_param array without insert@<offset> annotation: $ret_member";
} elsif ($ret_member =~ m/^int (\S+);/) {
my $arg_name = $1;
@@ -1257,6 +1296,17 @@ elsif ($opt_k) {
print "\n";
}
+ if (@setters_list2) {
+ print "\n";
+ print " ";
+ }
+
+ print join("\n ", @setters_list2);
+
+ if (@setters_list2) {
+ print "\n";
+ }
+
if ($call->{ret} ne "void") {
print "\n";
print " memset(&ret, 0, sizeof ret);\n";
@@ -1301,6 +1351,12 @@ elsif ($opt_k) {
print "\n";
}
+ if (@ret_list2) {
+ print " ";
+ print join("\n ", @ret_list2);
+ print "\n";
+ }
+
if (@ret_list) {
print " ";
print join("\n ", @ret_list);
@@ -1316,7 +1372,7 @@ elsif ($opt_k) {
print " rv = 0;\n";
}
- if ($single_ret_as_list) {
+ if ($single_ret_as_list or $single_ret_cleanup) {
print "\n";
print "cleanup:\n";
print " xdr_free((xdrproc_t)xdr_remote_$call->{name}_ret, (char *)&ret);\n";
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index ec290a0..5b3fbc9 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -1930,42 +1930,6 @@ cleanup:
}
static int
-remoteDomainSetMemoryParameters (virDomainPtr domain,
- virTypedParameterPtr params,
- int nparams,
- unsigned int flags)
-{
- int rv = -1;
- remote_domain_set_memory_parameters_args args;
- struct private_data *priv = domain->conn->privateData;
-
- remoteDriverLock(priv);
-
- make_nonnull_domain (&args.dom, domain);
-
- args.flags = flags;
-
- if (remoteSerializeTypedParameters(params, nparams,
- &args.params.params_val,
- &args.params.params_len) < 0) {
- xdr_free ((xdrproc_t) xdr_remote_domain_set_memory_parameters_args,
- (char *) &args);
- goto done;
- }
-
- if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_SET_MEMORY_PARAMETERS,
- (xdrproc_t) xdr_remote_domain_set_memory_parameters_args,
- (char *) &args, (xdrproc_t) xdr_void, (char *) NULL) == -1)
- goto done;
-
- rv = 0;
-
-done:
- remoteDriverUnlock(priv);
- return rv;
-}
-
-static int
remoteDomainGetMemoryParameters (virDomainPtr domain,
virTypedParameterPtr params, int *nparams,
unsigned int flags)
@@ -2014,42 +1978,6 @@ done:
}
static int
-remoteDomainSetBlkioParameters (virDomainPtr domain,
- virTypedParameterPtr params,
- int nparams,
- unsigned int flags)
-{
- int rv = -1;
- remote_domain_set_blkio_parameters_args args;
- struct private_data *priv = domain->conn->privateData;
-
- remoteDriverLock(priv);
-
- make_nonnull_domain (&args.dom, domain);
-
- args.flags = flags;
-
- if (remoteSerializeTypedParameters(params, nparams,
- &args.params.params_val,
- &args.params.params_len) < 0) {
- xdr_free ((xdrproc_t) xdr_remote_domain_set_blkio_parameters_args,
- (char *) &args);
- goto done;
- }
-
- if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_SET_BLKIO_PARAMETERS,
- (xdrproc_t) xdr_remote_domain_set_blkio_parameters_args,
- (char *) &args, (xdrproc_t) xdr_void, (char *) NULL) == -1)
- goto done;
-
- rv = 0;
-
-done:
- remoteDriverUnlock(priv);
- return rv;
-}
-
-static int
remoteDomainGetBlkioParameters (virDomainPtr domain,
virTypedParameterPtr params, int *nparams,
unsigned int flags)
@@ -2449,149 +2377,6 @@ done:
}
static int
-remoteDomainGetSchedulerParameters (virDomainPtr domain,
- virTypedParameterPtr params, int *nparams)
-{
- int rv = -1;
- remote_domain_get_scheduler_parameters_args args;
- remote_domain_get_scheduler_parameters_ret ret;
- struct private_data *priv = domain->conn->privateData;
-
- remoteDriverLock(priv);
-
- make_nonnull_domain (&args.dom, domain);
- args.nparams = *nparams;
-
- memset (&ret, 0, sizeof ret);
- if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_SCHEDULER_PARAMETERS,
- (xdrproc_t) xdr_remote_domain_get_scheduler_parameters_args, (char *) &args,
- (xdrproc_t) xdr_remote_domain_get_scheduler_parameters_ret, (char *) &ret) == -1)
- goto done;
-
- if (remoteDeserializeTypedParameters(ret.params.params_val,
- ret.params.params_len,
- REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX,
- params,
- nparams) < 0)
- goto cleanup;
-
- rv = 0;
-
-cleanup:
- xdr_free ((xdrproc_t) xdr_remote_domain_get_scheduler_parameters_ret, (char *) &ret);
-done:
- remoteDriverUnlock(priv);
- return rv;
-}
-
-static int
-remoteDomainGetSchedulerParametersFlags (virDomainPtr domain,
- virTypedParameterPtr params,
- int *nparams,
- unsigned int flags)
-{
- int rv = -1;
- remote_domain_get_scheduler_parameters_flags_args args;
- remote_domain_get_scheduler_parameters_flags_ret ret;
- struct private_data *priv = domain->conn->privateData;
-
- remoteDriverLock(priv);
-
- make_nonnull_domain (&args.dom, domain);
- args.nparams = *nparams;
- args.flags = flags;
-
- memset (&ret, 0, sizeof ret);
- if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_GET_SCHEDULER_PARAMETERS_FLAGS,
- (xdrproc_t) xdr_remote_domain_get_scheduler_parameters_flags_args, (char *) &args,
- (xdrproc_t) xdr_remote_domain_get_scheduler_parameters_flags_ret, (char *) &ret) == -1)
- goto done;
-
- if (remoteDeserializeTypedParameters(ret.params.params_val,
- ret.params.params_len,
- REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX,
- params,
- nparams) < 0)
- goto cleanup;
-
- rv = 0;
-
-cleanup:
- xdr_free ((xdrproc_t) xdr_remote_domain_get_scheduler_parameters_flags_ret, (char *) &ret);
-done:
- remoteDriverUnlock(priv);
- return rv;
-}
-
-static int
-remoteDomainSetSchedulerParameters (virDomainPtr domain,
- virTypedParameterPtr params, int nparams)
-{
- int rv = -1;
- remote_domain_set_scheduler_parameters_args args;
- struct private_data *priv = domain->conn->privateData;
-
- remoteDriverLock(priv);
-
- make_nonnull_domain (&args.dom, domain);
-
- if (remoteSerializeTypedParameters(params, nparams,
- &args.params.params_val,
- &args.params.params_len) < 0) {
- xdr_free ((xdrproc_t) xdr_remote_domain_set_scheduler_parameters_args,
- (char *) &args);
- goto done;
- }
-
- if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_SET_SCHEDULER_PARAMETERS,
- (xdrproc_t) xdr_remote_domain_set_scheduler_parameters_args, (char *) &args,
- (xdrproc_t) xdr_void, (char *) NULL) == -1)
- goto done;
-
- rv = 0;
-
-done:
- remoteDriverUnlock(priv);
- return rv;
-}
-
-static int
-remoteDomainSetSchedulerParametersFlags(virDomainPtr domain,
- virTypedParameterPtr params,
- int nparams,
- unsigned int flags)
-{
- int rv = -1;
- remote_domain_set_scheduler_parameters_flags_args args;
- struct private_data *priv = domain->conn->privateData;
-
- remoteDriverLock(priv);
-
- make_nonnull_domain (&args.dom, domain);
-
- args.flags = flags;
-
- if (remoteSerializeTypedParameters(params, nparams,
- &args.params.params_val,
- &args.params.params_len) < 0) {
- xdr_free ((xdrproc_t) xdr_remote_domain_set_scheduler_parameters_flags_args,
- (char *) &args);
- goto done;
- }
-
- if (call (domain->conn, priv, 0, REMOTE_PROC_DOMAIN_SET_SCHEDULER_PARAMETERS_FLAGS,
- (xdrproc_t) xdr_remote_domain_set_scheduler_parameters_flags_args, (char *) &args,
- (xdrproc_t) xdr_void, (char *) NULL) == -1)
- goto done;
-
- rv = 0;
-
-done:
- remoteDriverUnlock(priv);
- return rv;
-}
-
-static int
remoteDomainMemoryStats (virDomainPtr domain,
struct _virDomainMemoryStat *stats,
unsigned int nr_stats)
diff --git a/src/remote/remote_protocol.x b/src/remote/remote_protocol.x
index 0602c27..c9b8cff 100644
--- a/src/remote/remote_protocol.x
+++ b/src/remote/remote_protocol.x
@@ -427,21 +427,21 @@ struct remote_domain_get_scheduler_type_ret {
struct remote_domain_get_scheduler_parameters_args {
remote_nonnull_domain dom;
- int nparams;
+ int nparams; /* call-by-reference */
};
struct remote_domain_get_scheduler_parameters_ret {
- remote_typed_param params<REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX>;
+ remote_typed_param params<REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX>; /* insert@1 */
};
struct remote_domain_get_scheduler_parameters_flags_args {
remote_nonnull_domain dom;
- int nparams;
+ int nparams; /* call-by-reference */
unsigned int flags;
};
struct remote_domain_get_scheduler_parameters_flags_ret {
- remote_typed_param params<REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX>;
+ remote_typed_param params<REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX>; /* insert@1 */
};
struct remote_domain_set_scheduler_parameters_args {
@@ -2113,8 +2113,8 @@ enum remote_procedure {
REMOTE_PROC_DOMAIN_RESTORE = 54, /* autogen autogen */
REMOTE_PROC_DOMAIN_SAVE = 55, /* autogen autogen */
REMOTE_PROC_DOMAIN_GET_SCHEDULER_TYPE = 56, /* skipgen skipgen */
- REMOTE_PROC_DOMAIN_GET_SCHEDULER_PARAMETERS = 57, /* skipgen skipgen */
- REMOTE_PROC_DOMAIN_SET_SCHEDULER_PARAMETERS = 58, /* skipgen skipgen */
+ REMOTE_PROC_DOMAIN_GET_SCHEDULER_PARAMETERS = 57, /* skipgen autogen */
+ REMOTE_PROC_DOMAIN_SET_SCHEDULER_PARAMETERS = 58, /* autogen autogen */
REMOTE_PROC_GET_HOSTNAME = 59, /* autogen autogen */
REMOTE_PROC_SUPPORTS_FEATURE = 60, /* autogen autogen */
@@ -2267,7 +2267,7 @@ enum remote_procedure {
REMOTE_PROC_DOMAIN_GET_BLOCK_INFO = 194, /* autogen autogen */
REMOTE_PROC_DOMAIN_EVENT_IO_ERROR_REASON = 195, /* autogen autogen */
REMOTE_PROC_DOMAIN_CREATE_WITH_FLAGS = 196, /* autogen autogen */
- REMOTE_PROC_DOMAIN_SET_MEMORY_PARAMETERS = 197, /* skipgen skipgen */
+ REMOTE_PROC_DOMAIN_SET_MEMORY_PARAMETERS = 197, /* autogen autogen */
REMOTE_PROC_DOMAIN_GET_MEMORY_PARAMETERS = 198, /* skipgen skipgen */
REMOTE_PROC_DOMAIN_SET_VCPUS_FLAGS = 199, /* autogen autogen */
REMOTE_PROC_DOMAIN_GET_VCPUS_FLAGS = 200, /* autogen autogen */
@@ -2276,7 +2276,7 @@ enum remote_procedure {
REMOTE_PROC_DOMAIN_IS_UPDATED = 202, /* autogen autogen */
REMOTE_PROC_GET_SYSINFO = 203, /* autogen autogen */
REMOTE_PROC_DOMAIN_SET_MEMORY_FLAGS = 204, /* autogen autogen */
- REMOTE_PROC_DOMAIN_SET_BLKIO_PARAMETERS = 205, /* skipgen skipgen */
+ REMOTE_PROC_DOMAIN_SET_BLKIO_PARAMETERS = 205, /* autogen autogen */
REMOTE_PROC_DOMAIN_GET_BLKIO_PARAMETERS = 206, /* skipgen skipgen */
REMOTE_PROC_DOMAIN_MIGRATE_SET_MAX_SPEED = 207, /* autogen autogen */
REMOTE_PROC_STORAGE_VOL_UPLOAD = 208, /* autogen autogen | writestream@1 */
@@ -2291,12 +2291,12 @@ enum remote_procedure {
REMOTE_PROC_DOMAIN_MIGRATE_PERFORM3 = 216, /* skipgen skipgen */
REMOTE_PROC_DOMAIN_MIGRATE_FINISH3 = 217, /* skipgen skipgen */
REMOTE_PROC_DOMAIN_MIGRATE_CONFIRM3 = 218, /* skipgen skipgen */
- REMOTE_PROC_DOMAIN_SET_SCHEDULER_PARAMETERS_FLAGS = 219, /* skipgen skipgen */
+ REMOTE_PROC_DOMAIN_SET_SCHEDULER_PARAMETERS_FLAGS = 219, /* autogen autogen */
REMOTE_PROC_INTERFACE_CHANGE_BEGIN = 220, /* autogen autogen */
REMOTE_PROC_INTERFACE_CHANGE_COMMIT = 221, /* autogen autogen */
REMOTE_PROC_INTERFACE_CHANGE_ROLLBACK = 222, /* autogen autogen */
- REMOTE_PROC_DOMAIN_GET_SCHEDULER_PARAMETERS_FLAGS = 223, /* skipgen skipgen */
+ REMOTE_PROC_DOMAIN_GET_SCHEDULER_PARAMETERS_FLAGS = 223, /* skipgen autogen */
REMOTE_PROC_DOMAIN_EVENT_CONTROL_ERROR = 224 /* skipgen skipgen */
/*
--
1.7.0.4
13 years, 5 months
[libvirt] remote generator: Legacy support for hyper to long mappings
by Matthias Bolte
This can be considered as a v2 for hyper annotation patch [1]. Dan
argued that hyper-to-long mapping is considered as legacy and hyper
should be mapped to long long for all new APIs. Therefore, he voted
against the longlong annotation, because this should be the default
anyway.
I removed the longlong annotations from the original patch. This
results in version-A of the attached patch 0001. But this optional
annotation makes the parser more complex. One of the reasons for
annotating things in the .x is to have single place to define a new
procedure. But as the long/longlong annotation only affect exiting
procedures and will not be added to new ones it's much simpler to
store this information in the generator itself. This information it is
fixed and will not change anymore. This is implemented in version-B of
the attached patch 0001. I favor version-B, what's your opinion on
this?
Attached patch 0002 extends the apibuild script to allow the usage of
long for the same fixed set as in the remote generator only. It
reports an error when new functions or structs use long instead of
longlong.
[1] https://www.redhat.com/archives/libvir-list/2011-May/msg01434.html
Matthias
13 years, 5 months
[libvirt] [PATCH] Remove call to deprecated gnutls_certificate_type_set_priority
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
The gnutls_certificate_type_set_priority method is deprecated.
Since we already set the default gnutls priority, and do not
support OpenGPG credentials in any case, it was not serving
any useful purpose and can be removed
* src/remote/remote_driver.c: Remove src/remote/remote_driver.c
call
---
src/remote/remote_driver.c | 14 --------------
1 files changed, 0 insertions(+), 14 deletions(-)
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index d6bf7c3..6f78ace 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -1293,11 +1293,6 @@ negotiate_gnutls_on_connection (virConnectPtr conn,
struct private_data *priv,
int no_verify)
{
- const int cert_type_priority[3] = {
- GNUTLS_CRT_X509,
- GNUTLS_CRT_OPENPGP,
- 0
- };
bool success = false;
int err;
gnutls_session_t session;
@@ -1320,15 +1315,6 @@ negotiate_gnutls_on_connection (virConnectPtr conn,
gnutls_strerror (err));
goto cleanup;
}
- err =
- gnutls_certificate_type_set_priority (session,
- cert_type_priority);
- if (err) {
- remoteError(VIR_ERR_GNUTLS_ERROR,
- _("unable to set certificate priority: %s"),
- gnutls_strerror (err));
- goto cleanup;
- }
/* put the x509 credentials to the current session
*/
--
1.7.5.2
13 years, 5 months
[libvirt] [PATCH] Use common parameter order for remote(De)SerializeTypedParameters
by Matthias Bolte
We commonly use "value, length" order, let's stick to this.
---
daemon/remote.c | 40 ++++++++++++++++++++--------------------
src/remote/remote_driver.c | 40 ++++++++++++++++++++--------------------
2 files changed, 40 insertions(+), 40 deletions(-)
diff --git a/daemon/remote.c b/daemon/remote.c
index 5bcf202..e8db25b 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -546,8 +546,8 @@ cleanup:
static int
remoteSerializeTypedParameters(virTypedParameterPtr params,
int nparams,
- u_int *ret_params_len,
- remote_typed_param **ret_params_val)
+ remote_typed_param **ret_params_val,
+ u_int *ret_params_len)
{
int i;
int rv = -1;
@@ -608,8 +608,8 @@ cleanup:
/* Helper to deserialize typed parameters. */
static virTypedParameterPtr
-remoteDeserializeTypedParameters(u_int args_params_len,
- remote_typed_param *args_params_val,
+remoteDeserializeTypedParameters(remote_typed_param *args_params_val,
+ u_int args_params_len,
int limit,
int *nparams)
{
@@ -712,8 +712,8 @@ remoteDispatchDomainGetSchedulerParameters(struct qemud_server *server ATTRIBUTE
goto cleanup;
if (remoteSerializeTypedParameters(params, nparams,
- &ret->params.params_len,
- &ret->params.params_val) < 0)
+ &ret->params.params_val,
+ &ret->params.params_len) < 0)
goto cleanup;
rv = 0;
@@ -765,8 +765,8 @@ remoteDispatchDomainGetSchedulerParametersFlags(struct qemud_server *server ATTR
goto cleanup;
if (remoteSerializeTypedParameters(params, nparams,
- &ret->params.params_len,
- &ret->params.params_val) < 0)
+ &ret->params.params_val,
+ &ret->params.params_len) < 0)
goto cleanup;
rv = 0;
@@ -805,8 +805,8 @@ remoteDispatchDomainSetSchedulerParameters(struct qemud_server *server ATTRIBUTE
nparams = args->params.params_len;
- if ((params = remoteDeserializeTypedParameters(args->params.params_len,
- args->params.params_val,
+ if ((params = remoteDeserializeTypedParameters(args->params.params_val,
+ args->params.params_len,
REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX,
&nparams)) == NULL)
goto cleanup;
@@ -847,8 +847,8 @@ remoteDispatchDomainSetSchedulerParametersFlags(struct qemud_server *server ATTR
goto cleanup;
}
- if ((params = remoteDeserializeTypedParameters(args->params.params_len,
- args->params.params_val,
+ if ((params = remoteDeserializeTypedParameters(args->params.params_val,
+ args->params.params_len,
REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX,
&nparams)) == NULL)
goto cleanup;
@@ -1387,8 +1387,8 @@ remoteDispatchDomainSetMemoryParameters(struct qemud_server *server
flags = args->flags;
- if ((params = remoteDeserializeTypedParameters(args->params.params_len,
- args->params.params_val,
+ if ((params = remoteDeserializeTypedParameters(args->params.params_val,
+ args->params.params_len,
REMOTE_DOMAIN_MEMORY_PARAMETERS_MAX,
&nparams)) == NULL)
goto cleanup;
@@ -1461,8 +1461,8 @@ remoteDispatchDomainGetMemoryParameters(struct qemud_server *server
}
if (remoteSerializeTypedParameters(params, nparams,
- &ret->params.params_len,
- &ret->params.params_val) < 0)
+ &ret->params.params_val,
+ &ret->params.params_len) < 0)
goto cleanup;
success:
@@ -1502,8 +1502,8 @@ remoteDispatchDomainSetBlkioParameters(struct qemud_server *server
flags = args->flags;
- if ((params = remoteDeserializeTypedParameters(args->params.params_len,
- args->params.params_val,
+ if ((params = remoteDeserializeTypedParameters(args->params.params_val,
+ args->params.params_len,
REMOTE_DOMAIN_BLKIO_PARAMETERS_MAX,
&nparams)) == NULL)
goto cleanup;
@@ -1576,8 +1576,8 @@ remoteDispatchDomainGetBlkioParameters(struct qemud_server *server
}
if (remoteSerializeTypedParameters(params, nparams,
- &ret->params.params_len,
- &ret->params.params_val) < 0)
+ &ret->params.params_val,
+ &ret->params.params_len) < 0)
goto cleanup;
success:
diff --git a/src/remote/remote_driver.c b/src/remote/remote_driver.c
index 75c7db3..ec290a0 100644
--- a/src/remote/remote_driver.c
+++ b/src/remote/remote_driver.c
@@ -1801,8 +1801,8 @@ done:
static int
remoteSerializeTypedParameters(virTypedParameterPtr params,
int nparams,
- u_int *args_params_len,
- remote_typed_param **args_params_val)
+ remote_typed_param **args_params_val,
+ u_int *args_params_len)
{
int i;
int rv = -1;
@@ -1863,8 +1863,8 @@ cleanup:
/* Helper to deserialize typed parameters. */
static int
-remoteDeserializeTypedParameters(u_int ret_params_len,
- remote_typed_param *ret_params_val,
+remoteDeserializeTypedParameters(remote_typed_param *ret_params_val,
+ u_int ret_params_len,
int limit,
virTypedParameterPtr params,
int *nparams)
@@ -1946,8 +1946,8 @@ remoteDomainSetMemoryParameters (virDomainPtr domain,
args.flags = flags;
if (remoteSerializeTypedParameters(params, nparams,
- &args.params.params_len,
- &args.params.params_val) < 0) {
+ &args.params.params_val,
+ &args.params.params_len) < 0) {
xdr_free ((xdrproc_t) xdr_remote_domain_set_memory_parameters_args,
(char *) &args);
goto done;
@@ -1996,8 +1996,8 @@ remoteDomainGetMemoryParameters (virDomainPtr domain,
goto cleanup;
}
- if (remoteDeserializeTypedParameters(ret.params.params_len,
- ret.params.params_val,
+ if (remoteDeserializeTypedParameters(ret.params.params_val,
+ ret.params.params_len,
REMOTE_DOMAIN_MEMORY_PARAMETERS_MAX,
params,
nparams) < 0)
@@ -2030,8 +2030,8 @@ remoteDomainSetBlkioParameters (virDomainPtr domain,
args.flags = flags;
if (remoteSerializeTypedParameters(params, nparams,
- &args.params.params_len,
- &args.params.params_val) < 0) {
+ &args.params.params_val,
+ &args.params.params_len) < 0) {
xdr_free ((xdrproc_t) xdr_remote_domain_set_blkio_parameters_args,
(char *) &args);
goto done;
@@ -2080,8 +2080,8 @@ remoteDomainGetBlkioParameters (virDomainPtr domain,
goto cleanup;
}
- if (remoteDeserializeTypedParameters(ret.params.params_len,
- ret.params.params_val,
+ if (remoteDeserializeTypedParameters(ret.params.params_val,
+ ret.params.params_len,
REMOTE_DOMAIN_BLKIO_PARAMETERS_MAX,
params,
nparams) < 0)
@@ -2468,8 +2468,8 @@ remoteDomainGetSchedulerParameters (virDomainPtr domain,
(xdrproc_t) xdr_remote_domain_get_scheduler_parameters_ret, (char *) &ret) == -1)
goto done;
- if (remoteDeserializeTypedParameters(ret.params.params_len,
- ret.params.params_val,
+ if (remoteDeserializeTypedParameters(ret.params.params_val,
+ ret.params.params_len,
REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX,
params,
nparams) < 0)
@@ -2507,8 +2507,8 @@ remoteDomainGetSchedulerParametersFlags (virDomainPtr domain,
(xdrproc_t) xdr_remote_domain_get_scheduler_parameters_flags_ret, (char *) &ret) == -1)
goto done;
- if (remoteDeserializeTypedParameters(ret.params.params_len,
- ret.params.params_val,
+ if (remoteDeserializeTypedParameters(ret.params.params_val,
+ ret.params.params_len,
REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX,
params,
nparams) < 0)
@@ -2536,8 +2536,8 @@ remoteDomainSetSchedulerParameters (virDomainPtr domain,
make_nonnull_domain (&args.dom, domain);
if (remoteSerializeTypedParameters(params, nparams,
- &args.params.params_len,
- &args.params.params_val) < 0) {
+ &args.params.params_val,
+ &args.params.params_len) < 0) {
xdr_free ((xdrproc_t) xdr_remote_domain_set_scheduler_parameters_args,
(char *) &args);
goto done;
@@ -2572,8 +2572,8 @@ remoteDomainSetSchedulerParametersFlags(virDomainPtr domain,
args.flags = flags;
if (remoteSerializeTypedParameters(params, nparams,
- &args.params.params_len,
- &args.params.params_val) < 0) {
+ &args.params.params_val,
+ &args.params.params_len) < 0) {
xdr_free ((xdrproc_t) xdr_remote_domain_set_scheduler_parameters_flags_args,
(char *) &args);
goto done;
--
1.7.0.4
13 years, 5 months
[libvirt] Git write access for wrote C# bindings
by Anthony Fox
Hi all!
I wanna try to get help with C# bindings.
I ask Arnaud Champion to get me git write access.
He wrote that I should write to the mailing list.
Can someone get me access?
13 years, 5 months
[libvirt] [PATCH] openvz: fix bridge devices parsing in openvzReadNetworkConf()
by Jean-Baptiste Rouault
strchrnul() was called on the wrong string so it returned
the same result for each iteration.
---
src/openvz/openvz_conf.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/openvz/openvz_conf.c b/src/openvz/openvz_conf.c
index 5f33f75..6e32242 100644
--- a/src/openvz/openvz_conf.c
+++ b/src/openvz/openvz_conf.c
@@ -237,7 +237,7 @@ openvzReadNetworkConf(virDomainDefPtr def,
/*parse string*/
do {
- char *next = strchrnul (token, ',');
+ char *next = strchrnul (p, ',');
if (STRPREFIX(p, "ifname=")) {
/* skip in libvirt */
} else if (STRPREFIX(p, "host_ifname=")) {
--
1.7.1
13 years, 5 months