Devel
Threads by month
- ----- 2026 -----
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- 18 participants
- 40170 discussions
I'm trying to get NAT networking working with libvirt/virtual-manager and
KVM on Mandriva Linux.
I installed dnsmasq (and disabled the init script, as libvirt starts up
dnsmasq manually), bridge-utils, and added MII_NOT_SUPPORTED=yes to /etc/
sysconfig/ifcfg-virbr0, otherwise Mandriva's network scripts would
immediately try to get an IP on virbr0 with DHCP, removing the correct IP
address set by libvirt on its activation.
So currently I have:
# virsh net-list --all
Name State Autostart
-----------------------------------------
default active yes
# brctl show
bridge name bridge id STP enabled interfaces
pan0 8000.000000000000 no
virbr0 8000.000000000000 yes
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:21:70:AC:B0:8A
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Memory:f6ae0000-f6b00000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:9664 errors:0 dropped:0 overruns:0 frame:0
TX packets:9664 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:45094959 (43.0 MiB) TX bytes:45094959 (43.0 MiB)
virbr0 Link encap:Ethernet HWaddr EE:F4:3D:09:50:15
inet addr:192.168.122.1 Bcast:192.168.122.255
Mask:255.255.255.0
inet6 addr: fe80::ecf4:3dff:fe09:5015/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:52 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:11785 (11.5 KiB)
wlan0 Link encap:Ethernet HWaddr 00:16:EA:4C:A9:38
inet addr:192.168.100.24 Bcast:192.168.100.255
Mask:255.255.255.0
inet6 addr: fe80::216:eaff:fe4c:a938/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1496 errors:0 dropped:0 overruns:0 frame:0
TX packets:899 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:464043 (453.1 KiB) TX bytes:157558 (153.8 KiB)
wmaster0 Link encap:UNSPEC HWaddr 00-16-EA-4C-A9-38-20-
B4-00-00-00-00-00-00-00-00
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT udp -- anywhere anywhere udp
dpt:domain
ACCEPT tcp -- anywhere anywhere tcp
dpt:domain
ACCEPT udp -- anywhere anywhere udp
dpt:bootps
ACCEPT tcp -- anywhere anywhere tcp
dpt:bootps
Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere 192.168.122.0/24 state
RELATED,ESTABLISHED
ACCEPT all -- 192.168.122.0/24 anywhere
ACCEPT all -- anywhere anywhere
REJECT all -- anywhere anywhere reject-with
icmp-port-unreachable
REJECT all -- anywhere anywhere reject-with
icmp-port-unreachable
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
# ps aux | grep dnsmasq
nobody 2892 0.0 0.0 12388 920 ? S 22:26 0:00 dnsmasq
--keep-in-foreground --strict-order --bind-interfaces --pid-file --conf-
file --listen-address 192.168.122.1 --except-interface lo --dhcp-
leasefile=/var/lib/libvirt/dhcp-default.leases --dhcp-range
192.168.122.2,192.168.122.254
However, I still fail to get an IP address in my virtual machine.
In the logs, I cannot find anything problematic at first sight, libvirtd
when ran with the verbose option, continuously gives this:
Oct 19 22:45:02 defected libvirtd: EVENT: Poll got 1 event
Oct 19 22:45:02 defected libvirtd: EVENT: Dispatch 10 1 0x633040
Oct 19 22:45:02 defected libvirtd: EVENT: Remove handle 10
Oct 19 22:45:02 defected libvirtd: EVENT: mark delete 5
Oct 19 22:45:02 defected libvirtd: EVENT: Add handle 10 25 0x406e40
0x633040
Oct 19 22:45:02 defected libvirtd: EVENT: Remove handle 10
Oct 19 22:45:02 defected libvirtd: EVENT: mark delete 6
Oct 19 22:45:02 defected libvirtd: EVENT: Add handle 10 28 0x406e40
0x633040
Oct 19 22:45:02 defected libvirtd: EVENT: Calculate expiry of 0 timers
Oct 19 22:45:02 defected libvirtd: EVENT: Timeout at 0 due in -1 ms
Oct 19 22:45:02 defected libvirtd: EVENT: Poll on 6 handles 0x6574c0
timeout -1
Oct 19 22:45:02 defected libvirtd: EVENT: Poll got 1 event
Oct 19 22:45:02 defected libvirtd: EVENT: Dispatch 10 4 0x633040
Oct 19 22:45:02 defected libvirtd: EVENT: Remove handle 10
Oct 19 22:45:02 defected libvirtd: EVENT: mark delete 5
Oct 19 22:45:02 defected libvirtd: EVENT: Add handle 10 25 0x406e40
0x633040
Oct 19 22:45:02 defected libvirtd: EVENT: Calculate expiry of 0 timers
Oct 19 22:45:02 defected libvirtd: EVENT: Timeout at 0 due in -1 ms
Oct 19 22:45:02 defected libvirtd: EVENT: Poll on 6 handles 0x6574c0
timeout -1
Oct 19 22:45:02 defected libvirtd: EVENT: Poll got 1 event
Any idea what is wrong or what I should check to debug this further?
--
Frederik Himpe
1
0
[libvirt] PATCH: 0/5: Experimental patches for driver thread safety
by Daniel P. Berrange 17 Oct '08
by Daniel P. Berrange 17 Oct '08
17 Oct '08
The following series of 5 patches implement basic thread safety for the
QEMU, LXC and Network drivers. It does not address the OpenVZ or Test
driver yet. The Xen driver is totally stateless so does not require
changes - though I do need to verify there's no 'static' variables that
are used in an unsafe yet in Xen drivers.
Also note that these patches are *not* bisectable at this time, because
the domain config APIs add locking to some generic APIs, and unless the
drivers using these APIs are updated at same time deadlocks will occur.
I need to re-arrange ordering of changes a little to make it bisectable.
The core idea here is to have 2 levels of locking
- A per-driver lock.
- A per-virDomainObjPtr/NetworkObjPtr lock
For every API call, the driver lock is initialy taken. If the API involves
use of a domain / network object, the 2nd object specific lock is taken,
and the driver lock can (optionally) be released at this time.
When creating / deleting domain/network objects though, the driver lock
has to be held for the entire duration of the API call. Fortunately these
API calls don't have very long critical sections.
Daniel
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
2
8
Hi,
currently devices added via qemudDomainAttachDevice don't ever get
written out into the xml domain definition. Is this intentional?
Attached patch calls virDomainSaveConfig to fix this.
-- Guido
3
2
17 Oct '08
Looking at the libvirtd objects with pfunct I knoticed that the method
remoteDispatchClientRequest in remote.c was unusually large
size: 11497, variables: 169, inline expansions: 159 (5144 bytes)
Listing variables present its clear why - for every RPC call, we have
a pair of local variables declared for the structs for the reply and
response. Following by a memset() call for every single one.
Any single call to this method only processes one RPC call, so I figured
we could collapse all these variables down into a single pair by using
a union for all args, and a union for all replies.
This patch does just that with the result that the method changes to:
/* size: 1386, variables: 10, inline expansions: 4 (89 bytes) */
If you want to see details list of variables before and after results
then run
$ pfunct -f remoteDispatchClientRequest libvirtd-remote.o
NB pfunct is in the 'dwarves' RPM, along with some other interesting
tools like 'pahole'
In doing this I noticed that the dispatch function is O(n) on the
number of RPC calls we have defined. This isn't a serious bottleneck
since 'n' isn't very large, but while doing the refactoring for the
union stuf, it was easy enough to also change it to declare an array
of all the dispatch methods, which could simply be indexed on the
RPC call number. This changes it to O(1) time to dispatch.
b/qemud/Makefile.am | 24 -
b/qemud/remote.c | 61 +-
b/qemud/remote_dispatch_args.h | 92 ++++
b/qemud/remote_dispatch_ret.h | 75 +++
b/qemud/remote_dispatch_table.h | 529 ++++++++++++++++++++++++
b/qemud/remote_generate_stubs.pl | 189 ++------
qemud/remote_dispatch_localvars.h | 163 -------
qemud/remote_dispatch_proc_switch.h | 793 ------------------------------------
8 files changed, 809 insertions(+), 1117 deletions(-)
Two existing generated files go away
remote_dispatch_localvars.h (the huge list of local vars)
remote_dispatch_proc_switch.h (the switch dispatch func)
And 3 new generated files are added
remote_dispatch_args.h (the union of args)
remote_dispatch_ret.h (the union of replies)
remote_dispatch_table.h (the array of dispatch functions)
In reviewing this patch, the only hand-written code is in 'remote.c'
and the 'remote_generate_stubs.pl', the rest is generated code
from remote_generate_stubs.pl.
Regards,
Daniel
diff --git a/qemud/Makefile.am b/qemud/Makefile.am
--- a/qemud/Makefile.am
+++ b/qemud/Makefile.am
@@ -7,8 +7,9 @@ DAEMON_SOURCES = \
qemud.c qemud.h \
remote.c \
remote_dispatch_prototypes.h \
- remote_dispatch_localvars.h \
- remote_dispatch_proc_switch.h \
+ remote_dispatch_table.h \
+ remote_dispatch_args.h \
+ remote_dispatch_ret.h \
remote_protocol.h remote_protocol.c \
$(srcdir)/../src/util-lib.c
@@ -148,17 +149,22 @@ endif
remote.c: remote_dispatch_prototypes.h \
- remote_dispatch_localvars.h \
- remote_dispatch_proc_switch.h
+ remote_dispatch_table.h \
+ remote_dispatch_args.h \
+ remote_dispatch_ret.h
remote_dispatch_prototypes.h: $(srcdir)/remote_generate_stubs.pl remote_protocol.x
- perl -w $(srcdir)/remote_generate_stubs.pl -i $(srcdir)/remote_protocol.x > $@
+ perl -w $(srcdir)/remote_generate_stubs.pl -p $(srcdir)/remote_protocol.x > $@
-remote_dispatch_localvars.h: $(srcdir)/remote_generate_stubs.pl remote_protocol.x
- perl -w $(srcdir)/remote_generate_stubs.pl -v $(srcdir)/remote_protocol.x > $@
+remote_dispatch_table.h: $(srcdir)/remote_generate_stubs.pl remote_protocol.x
+ perl -w $(srcdir)/remote_generate_stubs.pl -t $(srcdir)/remote_protocol.x > $@
-remote_dispatch_proc_switch.h: $(srcdir)/remote_generate_stubs.pl remote_protocol.x
- perl -w $(srcdir)/remote_generate_stubs.pl -w $(srcdir)/remote_protocol.x > $@
+remote_dispatch_args.h: $(srcdir)/remote_generate_stubs.pl remote_protocol.x
+ perl -w $(srcdir)/remote_generate_stubs.pl -a $(srcdir)/remote_protocol.x > $@
+
+remote_dispatch_ret.h: $(srcdir)/remote_generate_stubs.pl remote_protocol.x
+ perl -w $(srcdir)/remote_generate_stubs.pl -r $(srcdir)/remote_protocol.x > $@
+
if LIBVIRT_INIT_SCRIPTS_RED_HAT
install-init: libvirtd.init
diff --git a/qemud/remote.c b/qemud/remote.c
--- a/qemud/remote.c
+++ b/qemud/remote.c
@@ -69,11 +69,30 @@ static void make_nonnull_storage_vol (re
#include "remote_dispatch_prototypes.h"
+typedef union {
+#include "remote_dispatch_args.h"
+} dispatch_args;
+
+typedef union {
+#include "remote_dispatch_ret.h"
+} dispatch_ret;
+
+
typedef int (*dispatch_fn) (struct qemud_server *server,
struct qemud_client *client,
remote_message_header *req,
- char *args,
- char *ret);
+ dispatch_args *args,
+ dispatch_ret *ret);
+
+typedef struct {
+ dispatch_fn fn;
+ xdrproc_t args_filter;
+ xdrproc_t ret_filter;
+} dispatch_data;
+
+static const dispatch_data const dispatch_table[] = {
+#include "remote_dispatch_table.h"
+};
/* This function gets called from qemud when it detects an incoming
* remote protocol message. At this point, client->buffer contains
@@ -85,13 +104,13 @@ remoteDispatchClientRequest (struct qemu
{
XDR xdr;
remote_message_header req, rep;
- dispatch_fn fn;
- xdrproc_t args_filter = (xdrproc_t) xdr_void;
- xdrproc_t ret_filter = (xdrproc_t) xdr_void;
- char *args = NULL, *ret = NULL;
+ dispatch_args args;
+ dispatch_ret ret;
+ const dispatch_data *data = NULL;
int rv, len;
-#include "remote_dispatch_localvars.h"
+ memset(&args, 0, sizeof args);
+ memset(&ret, 0, sizeof ret);
/* Parse the header. */
xdrmem_create (&xdr, client->buffer, client->bufferLength, XDR_DECODE);
@@ -146,31 +165,27 @@ remoteDispatchClientRequest (struct qemu
}
}
- /* Based on the procedure number, dispatch. In future we may base
- * this on the version number as well.
- */
- switch (req.proc) {
-#include "remote_dispatch_proc_switch.h"
-
- default:
+ if (req.proc >= ARRAY_CARDINALITY(dispatch_table) ||
+ dispatch_table[req.proc].fn == NULL) {
remoteDispatchError (client, &req, _("unknown procedure: %d"),
req.proc);
xdr_destroy (&xdr);
return;
}
- /* Parse args. */
- if (!(*args_filter) (&xdr, args)) {
+ data = &(dispatch_table[req.proc]);
+
+ /* De-serialize args off the wire */
+ if (!((data->args_filter)(&xdr, &args))) {
remoteDispatchError (client, &req, "%s", _("parse args failed"));
xdr_destroy (&xdr);
- return;
}
xdr_destroy (&xdr);
/* Call function. */
- rv = fn (server, client, &req, args, ret);
- xdr_free (args_filter, args);
+ rv = (data->fn)(server, client, &req, &args, &ret);
+ xdr_free (data->args_filter, (char*)&args);
/* Dispatch function must return -2, -1 or 0. Anything else is
* an internal error.
@@ -201,25 +216,25 @@ remoteDispatchClientRequest (struct qemu
if (!xdr_int (&xdr, &len)) {
remoteDispatchError (client, &req, "%s", _("dummy length"));
xdr_destroy (&xdr);
- if (rv == 0) xdr_free (ret_filter, ret);
+ if (rv == 0) xdr_free (data->ret_filter, (char*)&ret);
return;
}
if (!xdr_remote_message_header (&xdr, &rep)) {
remoteDispatchError (client, &req, "%s", _("serialise reply header"));
xdr_destroy (&xdr);
- if (rv == 0) xdr_free (ret_filter, ret);
+ if (rv == 0) xdr_free (data->ret_filter, (char*)&ret);
return;
}
/* If OK, serialise return structure, if error serialise error. */
if (rv == 0) {
- if (!(*ret_filter) (&xdr, ret)) {
+ if (!((data->ret_filter) (&xdr, &ret))) {
remoteDispatchError (client, &req, "%s", _("serialise return struct"));
xdr_destroy (&xdr);
return;
}
- xdr_free (ret_filter, ret);
+ xdr_free (data->ret_filter, (char*)&ret);
} else /* error */ {
virErrorPtr verr;
remote_error error;
diff --git a/qemud/remote_dispatch_args.h b/qemud/remote_dispatch_args.h
new file mode 100644
--- /dev/null
+++ b/qemud/remote_dispatch_args.h
@@ -0,0 +1,92 @@
+/* Automatically generated by remote_generate_stubs.pl.
+ * Do not edit this file. Any changes you make will be lost.
+ */
+
+ remote_open_args val_remote_open_args;
+ remote_get_max_vcpus_args val_remote_get_max_vcpus_args;
+ remote_domain_attach_device_args val_remote_domain_attach_device_args;
+ remote_domain_create_args val_remote_domain_create_args;
+ remote_domain_create_linux_args val_remote_domain_create_linux_args;
+ remote_domain_define_xml_args val_remote_domain_define_xml_args;
+ remote_domain_destroy_args val_remote_domain_destroy_args;
+ remote_domain_detach_device_args val_remote_domain_detach_device_args;
+ remote_domain_dump_xml_args val_remote_domain_dump_xml_args;
+ remote_domain_get_autostart_args val_remote_domain_get_autostart_args;
+ remote_domain_get_info_args val_remote_domain_get_info_args;
+ remote_domain_get_max_memory_args val_remote_domain_get_max_memory_args;
+ remote_domain_get_max_vcpus_args val_remote_domain_get_max_vcpus_args;
+ remote_domain_get_os_type_args val_remote_domain_get_os_type_args;
+ remote_domain_get_vcpus_args val_remote_domain_get_vcpus_args;
+ remote_list_defined_domains_args val_remote_list_defined_domains_args;
+ remote_domain_lookup_by_id_args val_remote_domain_lookup_by_id_args;
+ remote_domain_lookup_by_name_args val_remote_domain_lookup_by_name_args;
+ remote_domain_lookup_by_uuid_args val_remote_domain_lookup_by_uuid_args;
+ remote_domain_pin_vcpu_args val_remote_domain_pin_vcpu_args;
+ remote_domain_reboot_args val_remote_domain_reboot_args;
+ remote_domain_resume_args val_remote_domain_resume_args;
+ remote_domain_set_autostart_args val_remote_domain_set_autostart_args;
+ remote_domain_set_max_memory_args val_remote_domain_set_max_memory_args;
+ remote_domain_set_memory_args val_remote_domain_set_memory_args;
+ remote_domain_set_vcpus_args val_remote_domain_set_vcpus_args;
+ remote_domain_shutdown_args val_remote_domain_shutdown_args;
+ remote_domain_suspend_args val_remote_domain_suspend_args;
+ remote_domain_undefine_args val_remote_domain_undefine_args;
+ remote_list_defined_networks_args val_remote_list_defined_networks_args;
+ remote_list_domains_args val_remote_list_domains_args;
+ remote_list_networks_args val_remote_list_networks_args;
+ remote_network_create_args val_remote_network_create_args;
+ remote_network_create_xml_args val_remote_network_create_xml_args;
+ remote_network_define_xml_args val_remote_network_define_xml_args;
+ remote_network_destroy_args val_remote_network_destroy_args;
+ remote_network_dump_xml_args val_remote_network_dump_xml_args;
+ remote_network_get_autostart_args val_remote_network_get_autostart_args;
+ remote_network_get_bridge_name_args val_remote_network_get_bridge_name_args;
+ remote_network_lookup_by_name_args val_remote_network_lookup_by_name_args;
+ remote_network_lookup_by_uuid_args val_remote_network_lookup_by_uuid_args;
+ remote_network_set_autostart_args val_remote_network_set_autostart_args;
+ remote_network_undefine_args val_remote_network_undefine_args;
+ remote_domain_core_dump_args val_remote_domain_core_dump_args;
+ remote_domain_restore_args val_remote_domain_restore_args;
+ remote_domain_save_args val_remote_domain_save_args;
+ remote_domain_get_scheduler_type_args val_remote_domain_get_scheduler_type_args;
+ remote_domain_get_scheduler_parameters_args val_remote_domain_get_scheduler_parameters_args;
+ remote_domain_set_scheduler_parameters_args val_remote_domain_set_scheduler_parameters_args;
+ remote_supports_feature_args val_remote_supports_feature_args;
+ remote_domain_migrate_prepare_args val_remote_domain_migrate_prepare_args;
+ remote_domain_migrate_perform_args val_remote_domain_migrate_perform_args;
+ remote_domain_migrate_finish_args val_remote_domain_migrate_finish_args;
+ remote_domain_block_stats_args val_remote_domain_block_stats_args;
+ remote_domain_interface_stats_args val_remote_domain_interface_stats_args;
+ remote_auth_sasl_start_args val_remote_auth_sasl_start_args;
+ remote_auth_sasl_step_args val_remote_auth_sasl_step_args;
+ remote_list_storage_pools_args val_remote_list_storage_pools_args;
+ remote_list_defined_storage_pools_args val_remote_list_defined_storage_pools_args;
+ remote_find_storage_pool_sources_args val_remote_find_storage_pool_sources_args;
+ remote_storage_pool_create_xml_args val_remote_storage_pool_create_xml_args;
+ remote_storage_pool_define_xml_args val_remote_storage_pool_define_xml_args;
+ remote_storage_pool_create_args val_remote_storage_pool_create_args;
+ remote_storage_pool_build_args val_remote_storage_pool_build_args;
+ remote_storage_pool_destroy_args val_remote_storage_pool_destroy_args;
+ remote_storage_pool_delete_args val_remote_storage_pool_delete_args;
+ remote_storage_pool_undefine_args val_remote_storage_pool_undefine_args;
+ remote_storage_pool_refresh_args val_remote_storage_pool_refresh_args;
+ remote_storage_pool_lookup_by_name_args val_remote_storage_pool_lookup_by_name_args;
+ remote_storage_pool_lookup_by_uuid_args val_remote_storage_pool_lookup_by_uuid_args;
+ remote_storage_pool_lookup_by_volume_args val_remote_storage_pool_lookup_by_volume_args;
+ remote_storage_pool_get_info_args val_remote_storage_pool_get_info_args;
+ remote_storage_pool_dump_xml_args val_remote_storage_pool_dump_xml_args;
+ remote_storage_pool_get_autostart_args val_remote_storage_pool_get_autostart_args;
+ remote_storage_pool_set_autostart_args val_remote_storage_pool_set_autostart_args;
+ remote_storage_pool_num_of_volumes_args val_remote_storage_pool_num_of_volumes_args;
+ remote_storage_pool_list_volumes_args val_remote_storage_pool_list_volumes_args;
+ remote_storage_vol_create_xml_args val_remote_storage_vol_create_xml_args;
+ remote_storage_vol_delete_args val_remote_storage_vol_delete_args;
+ remote_storage_vol_lookup_by_name_args val_remote_storage_vol_lookup_by_name_args;
+ remote_storage_vol_lookup_by_key_args val_remote_storage_vol_lookup_by_key_args;
+ remote_storage_vol_lookup_by_path_args val_remote_storage_vol_lookup_by_path_args;
+ remote_storage_vol_get_info_args val_remote_storage_vol_get_info_args;
+ remote_storage_vol_dump_xml_args val_remote_storage_vol_dump_xml_args;
+ remote_storage_vol_get_path_args val_remote_storage_vol_get_path_args;
+ remote_node_get_cells_free_memory_args val_remote_node_get_cells_free_memory_args;
+ remote_domain_block_peek_args val_remote_domain_block_peek_args;
+ remote_domain_memory_peek_args val_remote_domain_memory_peek_args;
diff --git a/qemud/remote_dispatch_localvars.h b/qemud/remote_dispatch_localvars.h
deleted file mode 100644
--- a/qemud/remote_dispatch_localvars.h
+++ /dev/null
@@ -1,163 +0,0 @@
-/* Automatically generated by remote_generate_stubs.pl.
- * Do not edit this file. Any changes you make will be lost.
- */
-
-remote_domain_lookup_by_uuid_args lv_remote_domain_lookup_by_uuid_args;
-remote_domain_lookup_by_uuid_ret lv_remote_domain_lookup_by_uuid_ret;
-remote_storage_pool_list_volumes_args lv_remote_storage_pool_list_volumes_args;
-remote_storage_pool_list_volumes_ret lv_remote_storage_pool_list_volumes_ret;
-remote_domain_shutdown_args lv_remote_domain_shutdown_args;
-remote_list_defined_domains_args lv_remote_list_defined_domains_args;
-remote_list_defined_domains_ret lv_remote_list_defined_domains_ret;
-remote_get_capabilities_ret lv_remote_get_capabilities_ret;
-remote_storage_vol_create_xml_args lv_remote_storage_vol_create_xml_args;
-remote_storage_vol_create_xml_ret lv_remote_storage_vol_create_xml_ret;
-remote_domain_set_max_memory_args lv_remote_domain_set_max_memory_args;
-remote_auth_sasl_init_ret lv_remote_auth_sasl_init_ret;
-remote_domain_get_os_type_args lv_remote_domain_get_os_type_args;
-remote_domain_get_os_type_ret lv_remote_domain_get_os_type_ret;
-remote_domain_get_autostart_args lv_remote_domain_get_autostart_args;
-remote_domain_get_autostart_ret lv_remote_domain_get_autostart_ret;
-remote_domain_set_vcpus_args lv_remote_domain_set_vcpus_args;
-remote_get_hostname_ret lv_remote_get_hostname_ret;
-remote_network_undefine_args lv_remote_network_undefine_args;
-remote_domain_create_args lv_remote_domain_create_args;
-remote_network_destroy_args lv_remote_network_destroy_args;
-remote_storage_vol_lookup_by_key_args lv_remote_storage_vol_lookup_by_key_args;
-remote_storage_vol_lookup_by_key_ret lv_remote_storage_vol_lookup_by_key_ret;
-remote_storage_pool_lookup_by_uuid_args lv_remote_storage_pool_lookup_by_uuid_args;
-remote_storage_pool_lookup_by_uuid_ret lv_remote_storage_pool_lookup_by_uuid_ret;
-remote_domain_pin_vcpu_args lv_remote_domain_pin_vcpu_args;
-remote_list_defined_networks_args lv_remote_list_defined_networks_args;
-remote_list_defined_networks_ret lv_remote_list_defined_networks_ret;
-remote_network_create_xml_args lv_remote_network_create_xml_args;
-remote_network_create_xml_ret lv_remote_network_create_xml_ret;
-remote_open_args lv_remote_open_args;
-remote_storage_pool_refresh_args lv_remote_storage_pool_refresh_args;
-remote_storage_vol_lookup_by_path_args lv_remote_storage_vol_lookup_by_path_args;
-remote_storage_vol_lookup_by_path_ret lv_remote_storage_vol_lookup_by_path_ret;
-remote_list_domains_args lv_remote_list_domains_args;
-remote_list_domains_ret lv_remote_list_domains_ret;
-remote_network_define_xml_args lv_remote_network_define_xml_args;
-remote_network_define_xml_ret lv_remote_network_define_xml_ret;
-remote_get_type_ret lv_remote_get_type_ret;
-remote_domain_block_peek_args lv_remote_domain_block_peek_args;
-remote_domain_block_peek_ret lv_remote_domain_block_peek_ret;
-remote_storage_vol_delete_args lv_remote_storage_vol_delete_args;
-remote_network_dump_xml_args lv_remote_network_dump_xml_args;
-remote_network_dump_xml_ret lv_remote_network_dump_xml_ret;
-remote_domain_reboot_args lv_remote_domain_reboot_args;
-remote_domain_set_memory_args lv_remote_domain_set_memory_args;
-remote_storage_pool_destroy_args lv_remote_storage_pool_destroy_args;
-remote_domain_set_scheduler_parameters_args lv_remote_domain_set_scheduler_parameters_args;
-remote_auth_polkit_ret lv_remote_auth_polkit_ret;
-remote_auth_sasl_start_args lv_remote_auth_sasl_start_args;
-remote_auth_sasl_start_ret lv_remote_auth_sasl_start_ret;
-remote_domain_interface_stats_args lv_remote_domain_interface_stats_args;
-remote_domain_interface_stats_ret lv_remote_domain_interface_stats_ret;
-remote_storage_pool_dump_xml_args lv_remote_storage_pool_dump_xml_args;
-remote_storage_pool_dump_xml_ret lv_remote_storage_pool_dump_xml_ret;
-remote_storage_pool_create_xml_args lv_remote_storage_pool_create_xml_args;
-remote_storage_pool_create_xml_ret lv_remote_storage_pool_create_xml_ret;
-remote_storage_pool_build_args lv_remote_storage_pool_build_args;
-remote_storage_pool_delete_args lv_remote_storage_pool_delete_args;
-remote_storage_pool_lookup_by_volume_args lv_remote_storage_pool_lookup_by_volume_args;
-remote_storage_pool_lookup_by_volume_ret lv_remote_storage_pool_lookup_by_volume_ret;
-remote_domain_get_max_vcpus_args lv_remote_domain_get_max_vcpus_args;
-remote_domain_get_max_vcpus_ret lv_remote_domain_get_max_vcpus_ret;
-remote_domain_get_info_args lv_remote_domain_get_info_args;
-remote_domain_get_info_ret lv_remote_domain_get_info_ret;
-remote_storage_pool_num_of_volumes_args lv_remote_storage_pool_num_of_volumes_args;
-remote_storage_pool_num_of_volumes_ret lv_remote_storage_pool_num_of_volumes_ret;
-remote_supports_feature_args lv_remote_supports_feature_args;
-remote_supports_feature_ret lv_remote_supports_feature_ret;
-remote_domain_lookup_by_name_args lv_remote_domain_lookup_by_name_args;
-remote_domain_lookup_by_name_ret lv_remote_domain_lookup_by_name_ret;
-remote_storage_pool_set_autostart_args lv_remote_storage_pool_set_autostart_args;
-remote_domain_resume_args lv_remote_domain_resume_args;
-remote_network_get_bridge_name_args lv_remote_network_get_bridge_name_args;
-remote_network_get_bridge_name_ret lv_remote_network_get_bridge_name_ret;
-remote_domain_destroy_args lv_remote_domain_destroy_args;
-remote_find_storage_pool_sources_args lv_remote_find_storage_pool_sources_args;
-remote_find_storage_pool_sources_ret lv_remote_find_storage_pool_sources_ret;
-remote_auth_sasl_step_args lv_remote_auth_sasl_step_args;
-remote_auth_sasl_step_ret lv_remote_auth_sasl_step_ret;
-remote_domain_migrate_finish_args lv_remote_domain_migrate_finish_args;
-remote_domain_migrate_finish_ret lv_remote_domain_migrate_finish_ret;
-remote_domain_get_vcpus_args lv_remote_domain_get_vcpus_args;
-remote_domain_get_vcpus_ret lv_remote_domain_get_vcpus_ret;
-remote_domain_get_scheduler_parameters_args lv_remote_domain_get_scheduler_parameters_args;
-remote_domain_get_scheduler_parameters_ret lv_remote_domain_get_scheduler_parameters_ret;
-remote_node_get_info_ret lv_remote_node_get_info_ret;
-remote_network_lookup_by_name_args lv_remote_network_lookup_by_name_args;
-remote_network_lookup_by_name_ret lv_remote_network_lookup_by_name_ret;
-remote_domain_memory_peek_args lv_remote_domain_memory_peek_args;
-remote_domain_memory_peek_ret lv_remote_domain_memory_peek_ret;
-remote_num_of_defined_domains_ret lv_remote_num_of_defined_domains_ret;
-remote_domain_block_stats_args lv_remote_domain_block_stats_args;
-remote_domain_block_stats_ret lv_remote_domain_block_stats_ret;
-remote_domain_detach_device_args lv_remote_domain_detach_device_args;
-remote_num_of_storage_pools_ret lv_remote_num_of_storage_pools_ret;
-remote_domain_save_args lv_remote_domain_save_args;
-remote_domain_migrate_prepare_args lv_remote_domain_migrate_prepare_args;
-remote_domain_migrate_prepare_ret lv_remote_domain_migrate_prepare_ret;
-remote_domain_create_xml_args lv_remote_domain_create_xml_args;
-remote_domain_create_xml_ret lv_remote_domain_create_xml_ret;
-remote_domain_undefine_args lv_remote_domain_undefine_args;
-remote_node_get_cells_free_memory_args lv_remote_node_get_cells_free_memory_args;
-remote_node_get_cells_free_memory_ret lv_remote_node_get_cells_free_memory_ret;
-remote_domain_get_scheduler_type_args lv_remote_domain_get_scheduler_type_args;
-remote_domain_get_scheduler_type_ret lv_remote_domain_get_scheduler_type_ret;
-remote_get_version_ret lv_remote_get_version_ret;
-remote_domain_suspend_args lv_remote_domain_suspend_args;
-remote_storage_pool_lookup_by_name_args lv_remote_storage_pool_lookup_by_name_args;
-remote_storage_pool_lookup_by_name_ret lv_remote_storage_pool_lookup_by_name_ret;
-remote_network_set_autostart_args lv_remote_network_set_autostart_args;
-remote_network_get_autostart_args lv_remote_network_get_autostart_args;
-remote_network_get_autostart_ret lv_remote_network_get_autostart_ret;
-remote_storage_pool_create_args lv_remote_storage_pool_create_args;
-remote_auth_list_ret lv_remote_auth_list_ret;
-remote_num_of_defined_storage_pools_ret lv_remote_num_of_defined_storage_pools_ret;
-remote_domain_core_dump_args lv_remote_domain_core_dump_args;
-remote_list_defined_storage_pools_args lv_remote_list_defined_storage_pools_args;
-remote_list_defined_storage_pools_ret lv_remote_list_defined_storage_pools_ret;
-remote_domain_get_max_memory_args lv_remote_domain_get_max_memory_args;
-remote_domain_get_max_memory_ret lv_remote_domain_get_max_memory_ret;
-remote_num_of_domains_ret lv_remote_num_of_domains_ret;
-remote_list_networks_args lv_remote_list_networks_args;
-remote_list_networks_ret lv_remote_list_networks_ret;
-remote_storage_pool_undefine_args lv_remote_storage_pool_undefine_args;
-remote_domain_set_autostart_args lv_remote_domain_set_autostart_args;
-remote_storage_pool_get_autostart_args lv_remote_storage_pool_get_autostart_args;
-remote_storage_pool_get_autostart_ret lv_remote_storage_pool_get_autostart_ret;
-remote_node_get_free_memory_ret lv_remote_node_get_free_memory_ret;
-remote_storage_vol_get_path_args lv_remote_storage_vol_get_path_args;
-remote_storage_vol_get_path_ret lv_remote_storage_vol_get_path_ret;
-remote_domain_lookup_by_id_args lv_remote_domain_lookup_by_id_args;
-remote_domain_lookup_by_id_ret lv_remote_domain_lookup_by_id_ret;
-remote_domain_attach_device_args lv_remote_domain_attach_device_args;
-remote_num_of_networks_ret lv_remote_num_of_networks_ret;
-remote_storage_pool_get_info_args lv_remote_storage_pool_get_info_args;
-remote_storage_pool_get_info_ret lv_remote_storage_pool_get_info_ret;
-remote_list_storage_pools_args lv_remote_list_storage_pools_args;
-remote_list_storage_pools_ret lv_remote_list_storage_pools_ret;
-remote_domain_restore_args lv_remote_domain_restore_args;
-remote_network_create_args lv_remote_network_create_args;
-remote_num_of_defined_networks_ret lv_remote_num_of_defined_networks_ret;
-remote_storage_vol_lookup_by_name_args lv_remote_storage_vol_lookup_by_name_args;
-remote_storage_vol_lookup_by_name_ret lv_remote_storage_vol_lookup_by_name_ret;
-remote_storage_pool_define_xml_args lv_remote_storage_pool_define_xml_args;
-remote_storage_pool_define_xml_ret lv_remote_storage_pool_define_xml_ret;
-remote_network_lookup_by_uuid_args lv_remote_network_lookup_by_uuid_args;
-remote_network_lookup_by_uuid_ret lv_remote_network_lookup_by_uuid_ret;
-remote_storage_vol_get_info_args lv_remote_storage_vol_get_info_args;
-remote_storage_vol_get_info_ret lv_remote_storage_vol_get_info_ret;
-remote_domain_define_xml_args lv_remote_domain_define_xml_args;
-remote_domain_define_xml_ret lv_remote_domain_define_xml_ret;
-remote_storage_vol_dump_xml_args lv_remote_storage_vol_dump_xml_args;
-remote_storage_vol_dump_xml_ret lv_remote_storage_vol_dump_xml_ret;
-remote_domain_dump_xml_args lv_remote_domain_dump_xml_args;
-remote_domain_dump_xml_ret lv_remote_domain_dump_xml_ret;
-remote_get_max_vcpus_args lv_remote_get_max_vcpus_args;
-remote_get_max_vcpus_ret lv_remote_get_max_vcpus_ret;
-remote_domain_migrate_perform_args lv_remote_domain_migrate_perform_args;
diff --git a/qemud/remote_dispatch_proc_switch.h b/qemud/remote_dispatch_proc_switch.h
deleted file mode 100644
--- a/qemud/remote_dispatch_proc_switch.h
+++ /dev/null
@@ -1,793 +0,0 @@
-/* Automatically generated by remote_generate_stubs.pl.
- * Do not edit this file. Any changes you make will be lost.
- */
-
-case REMOTE_PROC_AUTH_LIST:
- fn = (dispatch_fn) remoteDispatchAuthList;
- ret_filter = (xdrproc_t) xdr_remote_auth_list_ret;
- ret = (char *) &lv_remote_auth_list_ret;
- memset (&lv_remote_auth_list_ret, 0, sizeof lv_remote_auth_list_ret);
- break;
-case REMOTE_PROC_AUTH_POLKIT:
- fn = (dispatch_fn) remoteDispatchAuthPolkit;
- ret_filter = (xdrproc_t) xdr_remote_auth_polkit_ret;
- ret = (char *) &lv_remote_auth_polkit_ret;
- memset (&lv_remote_auth_polkit_ret, 0, sizeof lv_remote_auth_polkit_ret);
- break;
-case REMOTE_PROC_AUTH_SASL_INIT:
- fn = (dispatch_fn) remoteDispatchAuthSaslInit;
- ret_filter = (xdrproc_t) xdr_remote_auth_sasl_init_ret;
- ret = (char *) &lv_remote_auth_sasl_init_ret;
- memset (&lv_remote_auth_sasl_init_ret, 0, sizeof lv_remote_auth_sasl_init_ret);
- break;
-case REMOTE_PROC_AUTH_SASL_START:
- fn = (dispatch_fn) remoteDispatchAuthSaslStart;
- args_filter = (xdrproc_t) xdr_remote_auth_sasl_start_args;
- args = (char *) &lv_remote_auth_sasl_start_args;
- memset (&lv_remote_auth_sasl_start_args, 0, sizeof lv_remote_auth_sasl_start_args);
- ret_filter = (xdrproc_t) xdr_remote_auth_sasl_start_ret;
- ret = (char *) &lv_remote_auth_sasl_start_ret;
- memset (&lv_remote_auth_sasl_start_ret, 0, sizeof lv_remote_auth_sasl_start_ret);
- break;
-case REMOTE_PROC_AUTH_SASL_STEP:
- fn = (dispatch_fn) remoteDispatchAuthSaslStep;
- args_filter = (xdrproc_t) xdr_remote_auth_sasl_step_args;
- args = (char *) &lv_remote_auth_sasl_step_args;
- memset (&lv_remote_auth_sasl_step_args, 0, sizeof lv_remote_auth_sasl_step_args);
- ret_filter = (xdrproc_t) xdr_remote_auth_sasl_step_ret;
- ret = (char *) &lv_remote_auth_sasl_step_ret;
- memset (&lv_remote_auth_sasl_step_ret, 0, sizeof lv_remote_auth_sasl_step_ret);
- break;
-case REMOTE_PROC_CLOSE:
- fn = (dispatch_fn) remoteDispatchClose;
- break;
-case REMOTE_PROC_DOMAIN_ATTACH_DEVICE:
- fn = (dispatch_fn) remoteDispatchDomainAttachDevice;
- args_filter = (xdrproc_t) xdr_remote_domain_attach_device_args;
- args = (char *) &lv_remote_domain_attach_device_args;
- memset (&lv_remote_domain_attach_device_args, 0, sizeof lv_remote_domain_attach_device_args);
- break;
-case REMOTE_PROC_DOMAIN_BLOCK_PEEK:
- fn = (dispatch_fn) remoteDispatchDomainBlockPeek;
- args_filter = (xdrproc_t) xdr_remote_domain_block_peek_args;
- args = (char *) &lv_remote_domain_block_peek_args;
- memset (&lv_remote_domain_block_peek_args, 0, sizeof lv_remote_domain_block_peek_args);
- ret_filter = (xdrproc_t) xdr_remote_domain_block_peek_ret;
- ret = (char *) &lv_remote_domain_block_peek_ret;
- memset (&lv_remote_domain_block_peek_ret, 0, sizeof lv_remote_domain_block_peek_ret);
- break;
-case REMOTE_PROC_DOMAIN_BLOCK_STATS:
- fn = (dispatch_fn) remoteDispatchDomainBlockStats;
- args_filter = (xdrproc_t) xdr_remote_domain_block_stats_args;
- args = (char *) &lv_remote_domain_block_stats_args;
- memset (&lv_remote_domain_block_stats_args, 0, sizeof lv_remote_domain_block_stats_args);
- ret_filter = (xdrproc_t) xdr_remote_domain_block_stats_ret;
- ret = (char *) &lv_remote_domain_block_stats_ret;
- memset (&lv_remote_domain_block_stats_ret, 0, sizeof lv_remote_domain_block_stats_ret);
- break;
-case REMOTE_PROC_DOMAIN_CORE_DUMP:
- fn = (dispatch_fn) remoteDispatchDomainCoreDump;
- args_filter = (xdrproc_t) xdr_remote_domain_core_dump_args;
- args = (char *) &lv_remote_domain_core_dump_args;
- memset (&lv_remote_domain_core_dump_args, 0, sizeof lv_remote_domain_core_dump_args);
- break;
-case REMOTE_PROC_DOMAIN_CREATE:
- fn = (dispatch_fn) remoteDispatchDomainCreate;
- args_filter = (xdrproc_t) xdr_remote_domain_create_args;
- args = (char *) &lv_remote_domain_create_args;
- memset (&lv_remote_domain_create_args, 0, sizeof lv_remote_domain_create_args);
- break;
-case REMOTE_PROC_DOMAIN_CREATE_XML:
- fn = (dispatch_fn) remoteDispatchDomainCreateXml;
- args_filter = (xdrproc_t) xdr_remote_domain_create_xml_args;
- args = (char *) &lv_remote_domain_create_xml_args;
- memset (&lv_remote_domain_create_xml_args, 0, sizeof lv_remote_domain_create_xml_args);
- ret_filter = (xdrproc_t) xdr_remote_domain_create_xml_ret;
- ret = (char *) &lv_remote_domain_create_xml_ret;
- memset (&lv_remote_domain_create_xml_ret, 0, sizeof lv_remote_domain_create_xml_ret);
- break;
-case REMOTE_PROC_DOMAIN_DEFINE_XML:
- fn = (dispatch_fn) remoteDispatchDomainDefineXml;
- args_filter = (xdrproc_t) xdr_remote_domain_define_xml_args;
- args = (char *) &lv_remote_domain_define_xml_args;
- memset (&lv_remote_domain_define_xml_args, 0, sizeof lv_remote_domain_define_xml_args);
- ret_filter = (xdrproc_t) xdr_remote_domain_define_xml_ret;
- ret = (char *) &lv_remote_domain_define_xml_ret;
- memset (&lv_remote_domain_define_xml_ret, 0, sizeof lv_remote_domain_define_xml_ret);
- break;
-case REMOTE_PROC_DOMAIN_DESTROY:
- fn = (dispatch_fn) remoteDispatchDomainDestroy;
- args_filter = (xdrproc_t) xdr_remote_domain_destroy_args;
- args = (char *) &lv_remote_domain_destroy_args;
- memset (&lv_remote_domain_destroy_args, 0, sizeof lv_remote_domain_destroy_args);
- break;
-case REMOTE_PROC_DOMAIN_DETACH_DEVICE:
- fn = (dispatch_fn) remoteDispatchDomainDetachDevice;
- args_filter = (xdrproc_t) xdr_remote_domain_detach_device_args;
- args = (char *) &lv_remote_domain_detach_device_args;
- memset (&lv_remote_domain_detach_device_args, 0, sizeof lv_remote_domain_detach_device_args);
- break;
-case REMOTE_PROC_DOMAIN_DUMP_XML:
- fn = (dispatch_fn) remoteDispatchDomainDumpXml;
- args_filter = (xdrproc_t) xdr_remote_domain_dump_xml_args;
- args = (char *) &lv_remote_domain_dump_xml_args;
- memset (&lv_remote_domain_dump_xml_args, 0, sizeof lv_remote_domain_dump_xml_args);
- ret_filter = (xdrproc_t) xdr_remote_domain_dump_xml_ret;
- ret = (char *) &lv_remote_domain_dump_xml_ret;
- memset (&lv_remote_domain_dump_xml_ret, 0, sizeof lv_remote_domain_dump_xml_ret);
- break;
-case REMOTE_PROC_DOMAIN_GET_AUTOSTART:
- fn = (dispatch_fn) remoteDispatchDomainGetAutostart;
- args_filter = (xdrproc_t) xdr_remote_domain_get_autostart_args;
- args = (char *) &lv_remote_domain_get_autostart_args;
- memset (&lv_remote_domain_get_autostart_args, 0, sizeof lv_remote_domain_get_autostart_args);
- ret_filter = (xdrproc_t) xdr_remote_domain_get_autostart_ret;
- ret = (char *) &lv_remote_domain_get_autostart_ret;
- memset (&lv_remote_domain_get_autostart_ret, 0, sizeof lv_remote_domain_get_autostart_ret);
- break;
-case REMOTE_PROC_DOMAIN_GET_INFO:
- fn = (dispatch_fn) remoteDispatchDomainGetInfo;
- args_filter = (xdrproc_t) xdr_remote_domain_get_info_args;
- args = (char *) &lv_remote_domain_get_info_args;
- memset (&lv_remote_domain_get_info_args, 0, sizeof lv_remote_domain_get_info_args);
- ret_filter = (xdrproc_t) xdr_remote_domain_get_info_ret;
- ret = (char *) &lv_remote_domain_get_info_ret;
- memset (&lv_remote_domain_get_info_ret, 0, sizeof lv_remote_domain_get_info_ret);
- break;
-case REMOTE_PROC_DOMAIN_GET_MAX_MEMORY:
- fn = (dispatch_fn) remoteDispatchDomainGetMaxMemory;
- args_filter = (xdrproc_t) xdr_remote_domain_get_max_memory_args;
- args = (char *) &lv_remote_domain_get_max_memory_args;
- memset (&lv_remote_domain_get_max_memory_args, 0, sizeof lv_remote_domain_get_max_memory_args);
- ret_filter = (xdrproc_t) xdr_remote_domain_get_max_memory_ret;
- ret = (char *) &lv_remote_domain_get_max_memory_ret;
- memset (&lv_remote_domain_get_max_memory_ret, 0, sizeof lv_remote_domain_get_max_memory_ret);
- break;
-case REMOTE_PROC_DOMAIN_GET_MAX_VCPUS:
- fn = (dispatch_fn) remoteDispatchDomainGetMaxVcpus;
- args_filter = (xdrproc_t) xdr_remote_domain_get_max_vcpus_args;
- args = (char *) &lv_remote_domain_get_max_vcpus_args;
- memset (&lv_remote_domain_get_max_vcpus_args, 0, sizeof lv_remote_domain_get_max_vcpus_args);
- ret_filter = (xdrproc_t) xdr_remote_domain_get_max_vcpus_ret;
- ret = (char *) &lv_remote_domain_get_max_vcpus_ret;
- memset (&lv_remote_domain_get_max_vcpus_ret, 0, sizeof lv_remote_domain_get_max_vcpus_ret);
- break;
-case REMOTE_PROC_DOMAIN_GET_OS_TYPE:
- fn = (dispatch_fn) remoteDispatchDomainGetOsType;
- args_filter = (xdrproc_t) xdr_remote_domain_get_os_type_args;
- args = (char *) &lv_remote_domain_get_os_type_args;
- memset (&lv_remote_domain_get_os_type_args, 0, sizeof lv_remote_domain_get_os_type_args);
- ret_filter = (xdrproc_t) xdr_remote_domain_get_os_type_ret;
- ret = (char *) &lv_remote_domain_get_os_type_ret;
- memset (&lv_remote_domain_get_os_type_ret, 0, sizeof lv_remote_domain_get_os_type_ret);
- break;
-case REMOTE_PROC_DOMAIN_GET_SCHEDULER_PARAMETERS:
- fn = (dispatch_fn) remoteDispatchDomainGetSchedulerParameters;
- args_filter = (xdrproc_t) xdr_remote_domain_get_scheduler_parameters_args;
- args = (char *) &lv_remote_domain_get_scheduler_parameters_args;
- memset (&lv_remote_domain_get_scheduler_parameters_args, 0, sizeof lv_remote_domain_get_scheduler_parameters_args);
- ret_filter = (xdrproc_t) xdr_remote_domain_get_scheduler_parameters_ret;
- ret = (char *) &lv_remote_domain_get_scheduler_parameters_ret;
- memset (&lv_remote_domain_get_scheduler_parameters_ret, 0, sizeof lv_remote_domain_get_scheduler_parameters_ret);
- break;
-case REMOTE_PROC_DOMAIN_GET_SCHEDULER_TYPE:
- fn = (dispatch_fn) remoteDispatchDomainGetSchedulerType;
- args_filter = (xdrproc_t) xdr_remote_domain_get_scheduler_type_args;
- args = (char *) &lv_remote_domain_get_scheduler_type_args;
- memset (&lv_remote_domain_get_scheduler_type_args, 0, sizeof lv_remote_domain_get_scheduler_type_args);
- ret_filter = (xdrproc_t) xdr_remote_domain_get_scheduler_type_ret;
- ret = (char *) &lv_remote_domain_get_scheduler_type_ret;
- memset (&lv_remote_domain_get_scheduler_type_ret, 0, sizeof lv_remote_domain_get_scheduler_type_ret);
- break;
-case REMOTE_PROC_DOMAIN_GET_VCPUS:
- fn = (dispatch_fn) remoteDispatchDomainGetVcpus;
- args_filter = (xdrproc_t) xdr_remote_domain_get_vcpus_args;
- args = (char *) &lv_remote_domain_get_vcpus_args;
- memset (&lv_remote_domain_get_vcpus_args, 0, sizeof lv_remote_domain_get_vcpus_args);
- ret_filter = (xdrproc_t) xdr_remote_domain_get_vcpus_ret;
- ret = (char *) &lv_remote_domain_get_vcpus_ret;
- memset (&lv_remote_domain_get_vcpus_ret, 0, sizeof lv_remote_domain_get_vcpus_ret);
- break;
-case REMOTE_PROC_DOMAIN_INTERFACE_STATS:
- fn = (dispatch_fn) remoteDispatchDomainInterfaceStats;
- args_filter = (xdrproc_t) xdr_remote_domain_interface_stats_args;
- args = (char *) &lv_remote_domain_interface_stats_args;
- memset (&lv_remote_domain_interface_stats_args, 0, sizeof lv_remote_domain_interface_stats_args);
- ret_filter = (xdrproc_t) xdr_remote_domain_interface_stats_ret;
- ret = (char *) &lv_remote_domain_interface_stats_ret;
- memset (&lv_remote_domain_interface_stats_ret, 0, sizeof lv_remote_domain_interface_stats_ret);
- break;
-case REMOTE_PROC_DOMAIN_LOOKUP_BY_ID:
- fn = (dispatch_fn) remoteDispatchDomainLookupById;
- args_filter = (xdrproc_t) xdr_remote_domain_lookup_by_id_args;
- args = (char *) &lv_remote_domain_lookup_by_id_args;
- memset (&lv_remote_domain_lookup_by_id_args, 0, sizeof lv_remote_domain_lookup_by_id_args);
- ret_filter = (xdrproc_t) xdr_remote_domain_lookup_by_id_ret;
- ret = (char *) &lv_remote_domain_lookup_by_id_ret;
- memset (&lv_remote_domain_lookup_by_id_ret, 0, sizeof lv_remote_domain_lookup_by_id_ret);
- break;
-case REMOTE_PROC_DOMAIN_LOOKUP_BY_NAME:
- fn = (dispatch_fn) remoteDispatchDomainLookupByName;
- args_filter = (xdrproc_t) xdr_remote_domain_lookup_by_name_args;
- args = (char *) &lv_remote_domain_lookup_by_name_args;
- memset (&lv_remote_domain_lookup_by_name_args, 0, sizeof lv_remote_domain_lookup_by_name_args);
- ret_filter = (xdrproc_t) xdr_remote_domain_lookup_by_name_ret;
- ret = (char *) &lv_remote_domain_lookup_by_name_ret;
- memset (&lv_remote_domain_lookup_by_name_ret, 0, sizeof lv_remote_domain_lookup_by_name_ret);
- break;
-case REMOTE_PROC_DOMAIN_LOOKUP_BY_UUID:
- fn = (dispatch_fn) remoteDispatchDomainLookupByUuid;
- args_filter = (xdrproc_t) xdr_remote_domain_lookup_by_uuid_args;
- args = (char *) &lv_remote_domain_lookup_by_uuid_args;
- memset (&lv_remote_domain_lookup_by_uuid_args, 0, sizeof lv_remote_domain_lookup_by_uuid_args);
- ret_filter = (xdrproc_t) xdr_remote_domain_lookup_by_uuid_ret;
- ret = (char *) &lv_remote_domain_lookup_by_uuid_ret;
- memset (&lv_remote_domain_lookup_by_uuid_ret, 0, sizeof lv_remote_domain_lookup_by_uuid_ret);
- break;
-case REMOTE_PROC_DOMAIN_MEMORY_PEEK:
- fn = (dispatch_fn) remoteDispatchDomainMemoryPeek;
- args_filter = (xdrproc_t) xdr_remote_domain_memory_peek_args;
- args = (char *) &lv_remote_domain_memory_peek_args;
- memset (&lv_remote_domain_memory_peek_args, 0, sizeof lv_remote_domain_memory_peek_args);
- ret_filter = (xdrproc_t) xdr_remote_domain_memory_peek_ret;
- ret = (char *) &lv_remote_domain_memory_peek_ret;
- memset (&lv_remote_domain_memory_peek_ret, 0, sizeof lv_remote_domain_memory_peek_ret);
- break;
-case REMOTE_PROC_DOMAIN_MIGRATE_FINISH:
- fn = (dispatch_fn) remoteDispatchDomainMigrateFinish;
- args_filter = (xdrproc_t) xdr_remote_domain_migrate_finish_args;
- args = (char *) &lv_remote_domain_migrate_finish_args;
- memset (&lv_remote_domain_migrate_finish_args, 0, sizeof lv_remote_domain_migrate_finish_args);
- ret_filter = (xdrproc_t) xdr_remote_domain_migrate_finish_ret;
- ret = (char *) &lv_remote_domain_migrate_finish_ret;
- memset (&lv_remote_domain_migrate_finish_ret, 0, sizeof lv_remote_domain_migrate_finish_ret);
- break;
-case REMOTE_PROC_DOMAIN_MIGRATE_PERFORM:
- fn = (dispatch_fn) remoteDispatchDomainMigratePerform;
- args_filter = (xdrproc_t) xdr_remote_domain_migrate_perform_args;
- args = (char *) &lv_remote_domain_migrate_perform_args;
- memset (&lv_remote_domain_migrate_perform_args, 0, sizeof lv_remote_domain_migrate_perform_args);
- break;
-case REMOTE_PROC_DOMAIN_MIGRATE_PREPARE:
- fn = (dispatch_fn) remoteDispatchDomainMigratePrepare;
- args_filter = (xdrproc_t) xdr_remote_domain_migrate_prepare_args;
- args = (char *) &lv_remote_domain_migrate_prepare_args;
- memset (&lv_remote_domain_migrate_prepare_args, 0, sizeof lv_remote_domain_migrate_prepare_args);
- ret_filter = (xdrproc_t) xdr_remote_domain_migrate_prepare_ret;
- ret = (char *) &lv_remote_domain_migrate_prepare_ret;
- memset (&lv_remote_domain_migrate_prepare_ret, 0, sizeof lv_remote_domain_migrate_prepare_ret);
- break;
-case REMOTE_PROC_DOMAIN_PIN_VCPU:
- fn = (dispatch_fn) remoteDispatchDomainPinVcpu;
- args_filter = (xdrproc_t) xdr_remote_domain_pin_vcpu_args;
- args = (char *) &lv_remote_domain_pin_vcpu_args;
- memset (&lv_remote_domain_pin_vcpu_args, 0, sizeof lv_remote_domain_pin_vcpu_args);
- break;
-case REMOTE_PROC_DOMAIN_REBOOT:
- fn = (dispatch_fn) remoteDispatchDomainReboot;
- args_filter = (xdrproc_t) xdr_remote_domain_reboot_args;
- args = (char *) &lv_remote_domain_reboot_args;
- memset (&lv_remote_domain_reboot_args, 0, sizeof lv_remote_domain_reboot_args);
- break;
-case REMOTE_PROC_DOMAIN_RESTORE:
- fn = (dispatch_fn) remoteDispatchDomainRestore;
- args_filter = (xdrproc_t) xdr_remote_domain_restore_args;
- args = (char *) &lv_remote_domain_restore_args;
- memset (&lv_remote_domain_restore_args, 0, sizeof lv_remote_domain_restore_args);
- break;
-case REMOTE_PROC_DOMAIN_RESUME:
- fn = (dispatch_fn) remoteDispatchDomainResume;
- args_filter = (xdrproc_t) xdr_remote_domain_resume_args;
- args = (char *) &lv_remote_domain_resume_args;
- memset (&lv_remote_domain_resume_args, 0, sizeof lv_remote_domain_resume_args);
- break;
-case REMOTE_PROC_DOMAIN_SAVE:
- fn = (dispatch_fn) remoteDispatchDomainSave;
- args_filter = (xdrproc_t) xdr_remote_domain_save_args;
- args = (char *) &lv_remote_domain_save_args;
- memset (&lv_remote_domain_save_args, 0, sizeof lv_remote_domain_save_args);
- break;
-case REMOTE_PROC_DOMAIN_SET_AUTOSTART:
- fn = (dispatch_fn) remoteDispatchDomainSetAutostart;
- args_filter = (xdrproc_t) xdr_remote_domain_set_autostart_args;
- args = (char *) &lv_remote_domain_set_autostart_args;
- memset (&lv_remote_domain_set_autostart_args, 0, sizeof lv_remote_domain_set_autostart_args);
- break;
-case REMOTE_PROC_DOMAIN_SET_MAX_MEMORY:
- fn = (dispatch_fn) remoteDispatchDomainSetMaxMemory;
- args_filter = (xdrproc_t) xdr_remote_domain_set_max_memory_args;
- args = (char *) &lv_remote_domain_set_max_memory_args;
- memset (&lv_remote_domain_set_max_memory_args, 0, sizeof lv_remote_domain_set_max_memory_args);
- break;
-case REMOTE_PROC_DOMAIN_SET_MEMORY:
- fn = (dispatch_fn) remoteDispatchDomainSetMemory;
- args_filter = (xdrproc_t) xdr_remote_domain_set_memory_args;
- args = (char *) &lv_remote_domain_set_memory_args;
- memset (&lv_remote_domain_set_memory_args, 0, sizeof lv_remote_domain_set_memory_args);
- break;
-case REMOTE_PROC_DOMAIN_SET_SCHEDULER_PARAMETERS:
- fn = (dispatch_fn) remoteDispatchDomainSetSchedulerParameters;
- args_filter = (xdrproc_t) xdr_remote_domain_set_scheduler_parameters_args;
- args = (char *) &lv_remote_domain_set_scheduler_parameters_args;
- memset (&lv_remote_domain_set_scheduler_parameters_args, 0, sizeof lv_remote_domain_set_scheduler_parameters_args);
- break;
-case REMOTE_PROC_DOMAIN_SET_VCPUS:
- fn = (dispatch_fn) remoteDispatchDomainSetVcpus;
- args_filter = (xdrproc_t) xdr_remote_domain_set_vcpus_args;
- args = (char *) &lv_remote_domain_set_vcpus_args;
- memset (&lv_remote_domain_set_vcpus_args, 0, sizeof lv_remote_domain_set_vcpus_args);
- break;
-case REMOTE_PROC_DOMAIN_SHUTDOWN:
- fn = (dispatch_fn) remoteDispatchDomainShutdown;
- args_filter = (xdrproc_t) xdr_remote_domain_shutdown_args;
- args = (char *) &lv_remote_domain_shutdown_args;
- memset (&lv_remote_domain_shutdown_args, 0, sizeof lv_remote_domain_shutdown_args);
- break;
-case REMOTE_PROC_DOMAIN_SUSPEND:
- fn = (dispatch_fn) remoteDispatchDomainSuspend;
- args_filter = (xdrproc_t) xdr_remote_domain_suspend_args;
- args = (char *) &lv_remote_domain_suspend_args;
- memset (&lv_remote_domain_suspend_args, 0, sizeof lv_remote_domain_suspend_args);
- break;
-case REMOTE_PROC_DOMAIN_UNDEFINE:
- fn = (dispatch_fn) remoteDispatchDomainUndefine;
- args_filter = (xdrproc_t) xdr_remote_domain_undefine_args;
- args = (char *) &lv_remote_domain_undefine_args;
- memset (&lv_remote_domain_undefine_args, 0, sizeof lv_remote_domain_undefine_args);
- break;
-case REMOTE_PROC_FIND_STORAGE_POOL_SOURCES:
- fn = (dispatch_fn) remoteDispatchFindStoragePoolSources;
- args_filter = (xdrproc_t) xdr_remote_find_storage_pool_sources_args;
- args = (char *) &lv_remote_find_storage_pool_sources_args;
- memset (&lv_remote_find_storage_pool_sources_args, 0, sizeof lv_remote_find_storage_pool_sources_args);
- ret_filter = (xdrproc_t) xdr_remote_find_storage_pool_sources_ret;
- ret = (char *) &lv_remote_find_storage_pool_sources_ret;
- memset (&lv_remote_find_storage_pool_sources_ret, 0, sizeof lv_remote_find_storage_pool_sources_ret);
- break;
-case REMOTE_PROC_GET_CAPABILITIES:
- fn = (dispatch_fn) remoteDispatchGetCapabilities;
- ret_filter = (xdrproc_t) xdr_remote_get_capabilities_ret;
- ret = (char *) &lv_remote_get_capabilities_ret;
- memset (&lv_remote_get_capabilities_ret, 0, sizeof lv_remote_get_capabilities_ret);
- break;
-case REMOTE_PROC_GET_HOSTNAME:
- fn = (dispatch_fn) remoteDispatchGetHostname;
- ret_filter = (xdrproc_t) xdr_remote_get_hostname_ret;
- ret = (char *) &lv_remote_get_hostname_ret;
- memset (&lv_remote_get_hostname_ret, 0, sizeof lv_remote_get_hostname_ret);
- break;
-case REMOTE_PROC_GET_MAX_VCPUS:
- fn = (dispatch_fn) remoteDispatchGetMaxVcpus;
- args_filter = (xdrproc_t) xdr_remote_get_max_vcpus_args;
- args = (char *) &lv_remote_get_max_vcpus_args;
- memset (&lv_remote_get_max_vcpus_args, 0, sizeof lv_remote_get_max_vcpus_args);
- ret_filter = (xdrproc_t) xdr_remote_get_max_vcpus_ret;
- ret = (char *) &lv_remote_get_max_vcpus_ret;
- memset (&lv_remote_get_max_vcpus_ret, 0, sizeof lv_remote_get_max_vcpus_ret);
- break;
-case REMOTE_PROC_GET_TYPE:
- fn = (dispatch_fn) remoteDispatchGetType;
- ret_filter = (xdrproc_t) xdr_remote_get_type_ret;
- ret = (char *) &lv_remote_get_type_ret;
- memset (&lv_remote_get_type_ret, 0, sizeof lv_remote_get_type_ret);
- break;
-case REMOTE_PROC_GET_VERSION:
- fn = (dispatch_fn) remoteDispatchGetVersion;
- ret_filter = (xdrproc_t) xdr_remote_get_version_ret;
- ret = (char *) &lv_remote_get_version_ret;
- memset (&lv_remote_get_version_ret, 0, sizeof lv_remote_get_version_ret);
- break;
-case REMOTE_PROC_LIST_DEFINED_DOMAINS:
- fn = (dispatch_fn) remoteDispatchListDefinedDomains;
- args_filter = (xdrproc_t) xdr_remote_list_defined_domains_args;
- args = (char *) &lv_remote_list_defined_domains_args;
- memset (&lv_remote_list_defined_domains_args, 0, sizeof lv_remote_list_defined_domains_args);
- ret_filter = (xdrproc_t) xdr_remote_list_defined_domains_ret;
- ret = (char *) &lv_remote_list_defined_domains_ret;
- memset (&lv_remote_list_defined_domains_ret, 0, sizeof lv_remote_list_defined_domains_ret);
- break;
-case REMOTE_PROC_LIST_DEFINED_NETWORKS:
- fn = (dispatch_fn) remoteDispatchListDefinedNetworks;
- args_filter = (xdrproc_t) xdr_remote_list_defined_networks_args;
- args = (char *) &lv_remote_list_defined_networks_args;
- memset (&lv_remote_list_defined_networks_args, 0, sizeof lv_remote_list_defined_networks_args);
- ret_filter = (xdrproc_t) xdr_remote_list_defined_networks_ret;
- ret = (char *) &lv_remote_list_defined_networks_ret;
- memset (&lv_remote_list_defined_networks_ret, 0, sizeof lv_remote_list_defined_networks_ret);
- break;
-case REMOTE_PROC_LIST_DEFINED_STORAGE_POOLS:
- fn = (dispatch_fn) remoteDispatchListDefinedStoragePools;
- args_filter = (xdrproc_t) xdr_remote_list_defined_storage_pools_args;
- args = (char *) &lv_remote_list_defined_storage_pools_args;
- memset (&lv_remote_list_defined_storage_pools_args, 0, sizeof lv_remote_list_defined_storage_pools_args);
- ret_filter = (xdrproc_t) xdr_remote_list_defined_storage_pools_ret;
- ret = (char *) &lv_remote_list_defined_storage_pools_ret;
- memset (&lv_remote_list_defined_storage_pools_ret, 0, sizeof lv_remote_list_defined_storage_pools_ret);
- break;
-case REMOTE_PROC_LIST_DOMAINS:
- fn = (dispatch_fn) remoteDispatchListDomains;
- args_filter = (xdrproc_t) xdr_remote_list_domains_args;
- args = (char *) &lv_remote_list_domains_args;
- memset (&lv_remote_list_domains_args, 0, sizeof lv_remote_list_domains_args);
- ret_filter = (xdrproc_t) xdr_remote_list_domains_ret;
- ret = (char *) &lv_remote_list_domains_ret;
- memset (&lv_remote_list_domains_ret, 0, sizeof lv_remote_list_domains_ret);
- break;
-case REMOTE_PROC_LIST_NETWORKS:
- fn = (dispatch_fn) remoteDispatchListNetworks;
- args_filter = (xdrproc_t) xdr_remote_list_networks_args;
- args = (char *) &lv_remote_list_networks_args;
- memset (&lv_remote_list_networks_args, 0, sizeof lv_remote_list_networks_args);
- ret_filter = (xdrproc_t) xdr_remote_list_networks_ret;
- ret = (char *) &lv_remote_list_networks_ret;
- memset (&lv_remote_list_networks_ret, 0, sizeof lv_remote_list_networks_ret);
- break;
-case REMOTE_PROC_LIST_STORAGE_POOLS:
- fn = (dispatch_fn) remoteDispatchListStoragePools;
- args_filter = (xdrproc_t) xdr_remote_list_storage_pools_args;
- args = (char *) &lv_remote_list_storage_pools_args;
- memset (&lv_remote_list_storage_pools_args, 0, sizeof lv_remote_list_storage_pools_args);
- ret_filter = (xdrproc_t) xdr_remote_list_storage_pools_ret;
- ret = (char *) &lv_remote_list_storage_pools_ret;
- memset (&lv_remote_list_storage_pools_ret, 0, sizeof lv_remote_list_storage_pools_ret);
- break;
-case REMOTE_PROC_NETWORK_CREATE:
- fn = (dispatch_fn) remoteDispatchNetworkCreate;
- args_filter = (xdrproc_t) xdr_remote_network_create_args;
- args = (char *) &lv_remote_network_create_args;
- memset (&lv_remote_network_create_args, 0, sizeof lv_remote_network_create_args);
- break;
-case REMOTE_PROC_NETWORK_CREATE_XML:
- fn = (dispatch_fn) remoteDispatchNetworkCreateXml;
- args_filter = (xdrproc_t) xdr_remote_network_create_xml_args;
- args = (char *) &lv_remote_network_create_xml_args;
- memset (&lv_remote_network_create_xml_args, 0, sizeof lv_remote_network_create_xml_args);
- ret_filter = (xdrproc_t) xdr_remote_network_create_xml_ret;
- ret = (char *) &lv_remote_network_create_xml_ret;
- memset (&lv_remote_network_create_xml_ret, 0, sizeof lv_remote_network_create_xml_ret);
- break;
-case REMOTE_PROC_NETWORK_DEFINE_XML:
- fn = (dispatch_fn) remoteDispatchNetworkDefineXml;
- args_filter = (xdrproc_t) xdr_remote_network_define_xml_args;
- args = (char *) &lv_remote_network_define_xml_args;
- memset (&lv_remote_network_define_xml_args, 0, sizeof lv_remote_network_define_xml_args);
- ret_filter = (xdrproc_t) xdr_remote_network_define_xml_ret;
- ret = (char *) &lv_remote_network_define_xml_ret;
- memset (&lv_remote_network_define_xml_ret, 0, sizeof lv_remote_network_define_xml_ret);
- break;
-case REMOTE_PROC_NETWORK_DESTROY:
- fn = (dispatch_fn) remoteDispatchNetworkDestroy;
- args_filter = (xdrproc_t) xdr_remote_network_destroy_args;
- args = (char *) &lv_remote_network_destroy_args;
- memset (&lv_remote_network_destroy_args, 0, sizeof lv_remote_network_destroy_args);
- break;
-case REMOTE_PROC_NETWORK_DUMP_XML:
- fn = (dispatch_fn) remoteDispatchNetworkDumpXml;
- args_filter = (xdrproc_t) xdr_remote_network_dump_xml_args;
- args = (char *) &lv_remote_network_dump_xml_args;
- memset (&lv_remote_network_dump_xml_args, 0, sizeof lv_remote_network_dump_xml_args);
- ret_filter = (xdrproc_t) xdr_remote_network_dump_xml_ret;
- ret = (char *) &lv_remote_network_dump_xml_ret;
- memset (&lv_remote_network_dump_xml_ret, 0, sizeof lv_remote_network_dump_xml_ret);
- break;
-case REMOTE_PROC_NETWORK_GET_AUTOSTART:
- fn = (dispatch_fn) remoteDispatchNetworkGetAutostart;
- args_filter = (xdrproc_t) xdr_remote_network_get_autostart_args;
- args = (char *) &lv_remote_network_get_autostart_args;
- memset (&lv_remote_network_get_autostart_args, 0, sizeof lv_remote_network_get_autostart_args);
- ret_filter = (xdrproc_t) xdr_remote_network_get_autostart_ret;
- ret = (char *) &lv_remote_network_get_autostart_ret;
- memset (&lv_remote_network_get_autostart_ret, 0, sizeof lv_remote_network_get_autostart_ret);
- break;
-case REMOTE_PROC_NETWORK_GET_BRIDGE_NAME:
- fn = (dispatch_fn) remoteDispatchNetworkGetBridgeName;
- args_filter = (xdrproc_t) xdr_remote_network_get_bridge_name_args;
- args = (char *) &lv_remote_network_get_bridge_name_args;
- memset (&lv_remote_network_get_bridge_name_args, 0, sizeof lv_remote_network_get_bridge_name_args);
- ret_filter = (xdrproc_t) xdr_remote_network_get_bridge_name_ret;
- ret = (char *) &lv_remote_network_get_bridge_name_ret;
- memset (&lv_remote_network_get_bridge_name_ret, 0, sizeof lv_remote_network_get_bridge_name_ret);
- break;
-case REMOTE_PROC_NETWORK_LOOKUP_BY_NAME:
- fn = (dispatch_fn) remoteDispatchNetworkLookupByName;
- args_filter = (xdrproc_t) xdr_remote_network_lookup_by_name_args;
- args = (char *) &lv_remote_network_lookup_by_name_args;
- memset (&lv_remote_network_lookup_by_name_args, 0, sizeof lv_remote_network_lookup_by_name_args);
- ret_filter = (xdrproc_t) xdr_remote_network_lookup_by_name_ret;
- ret = (char *) &lv_remote_network_lookup_by_name_ret;
- memset (&lv_remote_network_lookup_by_name_ret, 0, sizeof lv_remote_network_lookup_by_name_ret);
- break;
-case REMOTE_PROC_NETWORK_LOOKUP_BY_UUID:
- fn = (dispatch_fn) remoteDispatchNetworkLookupByUuid;
- args_filter = (xdrproc_t) xdr_remote_network_lookup_by_uuid_args;
- args = (char *) &lv_remote_network_lookup_by_uuid_args;
- memset (&lv_remote_network_lookup_by_uuid_args, 0, sizeof lv_remote_network_lookup_by_uuid_args);
- ret_filter = (xdrproc_t) xdr_remote_network_lookup_by_uuid_ret;
- ret = (char *) &lv_remote_network_lookup_by_uuid_ret;
- memset (&lv_remote_network_lookup_by_uuid_ret, 0, sizeof lv_remote_network_lookup_by_uuid_ret);
- break;
-case REMOTE_PROC_NETWORK_SET_AUTOSTART:
- fn = (dispatch_fn) remoteDispatchNetworkSetAutostart;
- args_filter = (xdrproc_t) xdr_remote_network_set_autostart_args;
- args = (char *) &lv_remote_network_set_autostart_args;
- memset (&lv_remote_network_set_autostart_args, 0, sizeof lv_remote_network_set_autostart_args);
- break;
-case REMOTE_PROC_NETWORK_UNDEFINE:
- fn = (dispatch_fn) remoteDispatchNetworkUndefine;
- args_filter = (xdrproc_t) xdr_remote_network_undefine_args;
- args = (char *) &lv_remote_network_undefine_args;
- memset (&lv_remote_network_undefine_args, 0, sizeof lv_remote_network_undefine_args);
- break;
-case REMOTE_PROC_NODE_GET_CELLS_FREE_MEMORY:
- fn = (dispatch_fn) remoteDispatchNodeGetCellsFreeMemory;
- args_filter = (xdrproc_t) xdr_remote_node_get_cells_free_memory_args;
- args = (char *) &lv_remote_node_get_cells_free_memory_args;
- memset (&lv_remote_node_get_cells_free_memory_args, 0, sizeof lv_remote_node_get_cells_free_memory_args);
- ret_filter = (xdrproc_t) xdr_remote_node_get_cells_free_memory_ret;
- ret = (char *) &lv_remote_node_get_cells_free_memory_ret;
- memset (&lv_remote_node_get_cells_free_memory_ret, 0, sizeof lv_remote_node_get_cells_free_memory_ret);
- break;
-case REMOTE_PROC_NODE_GET_FREE_MEMORY:
- fn = (dispatch_fn) remoteDispatchNodeGetFreeMemory;
- ret_filter = (xdrproc_t) xdr_remote_node_get_free_memory_ret;
- ret = (char *) &lv_remote_node_get_free_memory_ret;
- memset (&lv_remote_node_get_free_memory_ret, 0, sizeof lv_remote_node_get_free_memory_ret);
- break;
-case REMOTE_PROC_NODE_GET_INFO:
- fn = (dispatch_fn) remoteDispatchNodeGetInfo;
- ret_filter = (xdrproc_t) xdr_remote_node_get_info_ret;
- ret = (char *) &lv_remote_node_get_info_ret;
- memset (&lv_remote_node_get_info_ret, 0, sizeof lv_remote_node_get_info_ret);
- break;
-case REMOTE_PROC_NUM_OF_DEFINED_DOMAINS:
- fn = (dispatch_fn) remoteDispatchNumOfDefinedDomains;
- ret_filter = (xdrproc_t) xdr_remote_num_of_defined_domains_ret;
- ret = (char *) &lv_remote_num_of_defined_domains_ret;
- memset (&lv_remote_num_of_defined_domains_ret, 0, sizeof lv_remote_num_of_defined_domains_ret);
- break;
-case REMOTE_PROC_NUM_OF_DEFINED_NETWORKS:
- fn = (dispatch_fn) remoteDispatchNumOfDefinedNetworks;
- ret_filter = (xdrproc_t) xdr_remote_num_of_defined_networks_ret;
- ret = (char *) &lv_remote_num_of_defined_networks_ret;
- memset (&lv_remote_num_of_defined_networks_ret, 0, sizeof lv_remote_num_of_defined_networks_ret);
- break;
-case REMOTE_PROC_NUM_OF_DEFINED_STORAGE_POOLS:
- fn = (dispatch_fn) remoteDispatchNumOfDefinedStoragePools;
- ret_filter = (xdrproc_t) xdr_remote_num_of_defined_storage_pools_ret;
- ret = (char *) &lv_remote_num_of_defined_storage_pools_ret;
- memset (&lv_remote_num_of_defined_storage_pools_ret, 0, sizeof lv_remote_num_of_defined_storage_pools_ret);
- break;
-case REMOTE_PROC_NUM_OF_DOMAINS:
- fn = (dispatch_fn) remoteDispatchNumOfDomains;
- ret_filter = (xdrproc_t) xdr_remote_num_of_domains_ret;
- ret = (char *) &lv_remote_num_of_domains_ret;
- memset (&lv_remote_num_of_domains_ret, 0, sizeof lv_remote_num_of_domains_ret);
- break;
-case REMOTE_PROC_NUM_OF_NETWORKS:
- fn = (dispatch_fn) remoteDispatchNumOfNetworks;
- ret_filter = (xdrproc_t) xdr_remote_num_of_networks_ret;
- ret = (char *) &lv_remote_num_of_networks_ret;
- memset (&lv_remote_num_of_networks_ret, 0, sizeof lv_remote_num_of_networks_ret);
- break;
-case REMOTE_PROC_NUM_OF_STORAGE_POOLS:
- fn = (dispatch_fn) remoteDispatchNumOfStoragePools;
- ret_filter = (xdrproc_t) xdr_remote_num_of_storage_pools_ret;
- ret = (char *) &lv_remote_num_of_storage_pools_ret;
- memset (&lv_remote_num_of_storage_pools_ret, 0, sizeof lv_remote_num_of_storage_pools_ret);
- break;
-case REMOTE_PROC_OPEN:
- fn = (dispatch_fn) remoteDispatchOpen;
- args_filter = (xdrproc_t) xdr_remote_open_args;
- args = (char *) &lv_remote_open_args;
- memset (&lv_remote_open_args, 0, sizeof lv_remote_open_args);
- break;
-case REMOTE_PROC_STORAGE_POOL_BUILD:
- fn = (dispatch_fn) remoteDispatchStoragePoolBuild;
- args_filter = (xdrproc_t) xdr_remote_storage_pool_build_args;
- args = (char *) &lv_remote_storage_pool_build_args;
- memset (&lv_remote_storage_pool_build_args, 0, sizeof lv_remote_storage_pool_build_args);
- break;
-case REMOTE_PROC_STORAGE_POOL_CREATE:
- fn = (dispatch_fn) remoteDispatchStoragePoolCreate;
- args_filter = (xdrproc_t) xdr_remote_storage_pool_create_args;
- args = (char *) &lv_remote_storage_pool_create_args;
- memset (&lv_remote_storage_pool_create_args, 0, sizeof lv_remote_storage_pool_create_args);
- break;
-case REMOTE_PROC_STORAGE_POOL_CREATE_XML:
- fn = (dispatch_fn) remoteDispatchStoragePoolCreateXml;
- args_filter = (xdrproc_t) xdr_remote_storage_pool_create_xml_args;
- args = (char *) &lv_remote_storage_pool_create_xml_args;
- memset (&lv_remote_storage_pool_create_xml_args, 0, sizeof lv_remote_storage_pool_create_xml_args);
- ret_filter = (xdrproc_t) xdr_remote_storage_pool_create_xml_ret;
- ret = (char *) &lv_remote_storage_pool_create_xml_ret;
- memset (&lv_remote_storage_pool_create_xml_ret, 0, sizeof lv_remote_storage_pool_create_xml_ret);
- break;
-case REMOTE_PROC_STORAGE_POOL_DEFINE_XML:
- fn = (dispatch_fn) remoteDispatchStoragePoolDefineXml;
- args_filter = (xdrproc_t) xdr_remote_storage_pool_define_xml_args;
- args = (char *) &lv_remote_storage_pool_define_xml_args;
- memset (&lv_remote_storage_pool_define_xml_args, 0, sizeof lv_remote_storage_pool_define_xml_args);
- ret_filter = (xdrproc_t) xdr_remote_storage_pool_define_xml_ret;
- ret = (char *) &lv_remote_storage_pool_define_xml_ret;
- memset (&lv_remote_storage_pool_define_xml_ret, 0, sizeof lv_remote_storage_pool_define_xml_ret);
- break;
-case REMOTE_PROC_STORAGE_POOL_DELETE:
- fn = (dispatch_fn) remoteDispatchStoragePoolDelete;
- args_filter = (xdrproc_t) xdr_remote_storage_pool_delete_args;
- args = (char *) &lv_remote_storage_pool_delete_args;
- memset (&lv_remote_storage_pool_delete_args, 0, sizeof lv_remote_storage_pool_delete_args);
- break;
-case REMOTE_PROC_STORAGE_POOL_DESTROY:
- fn = (dispatch_fn) remoteDispatchStoragePoolDestroy;
- args_filter = (xdrproc_t) xdr_remote_storage_pool_destroy_args;
- args = (char *) &lv_remote_storage_pool_destroy_args;
- memset (&lv_remote_storage_pool_destroy_args, 0, sizeof lv_remote_storage_pool_destroy_args);
- break;
-case REMOTE_PROC_STORAGE_POOL_DUMP_XML:
- fn = (dispatch_fn) remoteDispatchStoragePoolDumpXml;
- args_filter = (xdrproc_t) xdr_remote_storage_pool_dump_xml_args;
- args = (char *) &lv_remote_storage_pool_dump_xml_args;
- memset (&lv_remote_storage_pool_dump_xml_args, 0, sizeof lv_remote_storage_pool_dump_xml_args);
- ret_filter = (xdrproc_t) xdr_remote_storage_pool_dump_xml_ret;
- ret = (char *) &lv_remote_storage_pool_dump_xml_ret;
- memset (&lv_remote_storage_pool_dump_xml_ret, 0, sizeof lv_remote_storage_pool_dump_xml_ret);
- break;
-case REMOTE_PROC_STORAGE_POOL_GET_AUTOSTART:
- fn = (dispatch_fn) remoteDispatchStoragePoolGetAutostart;
- args_filter = (xdrproc_t) xdr_remote_storage_pool_get_autostart_args;
- args = (char *) &lv_remote_storage_pool_get_autostart_args;
- memset (&lv_remote_storage_pool_get_autostart_args, 0, sizeof lv_remote_storage_pool_get_autostart_args);
- ret_filter = (xdrproc_t) xdr_remote_storage_pool_get_autostart_ret;
- ret = (char *) &lv_remote_storage_pool_get_autostart_ret;
- memset (&lv_remote_storage_pool_get_autostart_ret, 0, sizeof lv_remote_storage_pool_get_autostart_ret);
- break;
-case REMOTE_PROC_STORAGE_POOL_GET_INFO:
- fn = (dispatch_fn) remoteDispatchStoragePoolGetInfo;
- args_filter = (xdrproc_t) xdr_remote_storage_pool_get_info_args;
- args = (char *) &lv_remote_storage_pool_get_info_args;
- memset (&lv_remote_storage_pool_get_info_args, 0, sizeof lv_remote_storage_pool_get_info_args);
- ret_filter = (xdrproc_t) xdr_remote_storage_pool_get_info_ret;
- ret = (char *) &lv_remote_storage_pool_get_info_ret;
- memset (&lv_remote_storage_pool_get_info_ret, 0, sizeof lv_remote_storage_pool_get_info_ret);
- break;
-case REMOTE_PROC_STORAGE_POOL_LIST_VOLUMES:
- fn = (dispatch_fn) remoteDispatchStoragePoolListVolumes;
- args_filter = (xdrproc_t) xdr_remote_storage_pool_list_volumes_args;
- args = (char *) &lv_remote_storage_pool_list_volumes_args;
- memset (&lv_remote_storage_pool_list_volumes_args, 0, sizeof lv_remote_storage_pool_list_volumes_args);
- ret_filter = (xdrproc_t) xdr_remote_storage_pool_list_volumes_ret;
- ret = (char *) &lv_remote_storage_pool_list_volumes_ret;
- memset (&lv_remote_storage_pool_list_volumes_ret, 0, sizeof lv_remote_storage_pool_list_volumes_ret);
- break;
-case REMOTE_PROC_STORAGE_POOL_LOOKUP_BY_NAME:
- fn = (dispatch_fn) remoteDispatchStoragePoolLookupByName;
- args_filter = (xdrproc_t) xdr_remote_storage_pool_lookup_by_name_args;
- args = (char *) &lv_remote_storage_pool_lookup_by_name_args;
- memset (&lv_remote_storage_pool_lookup_by_name_args, 0, sizeof lv_remote_storage_pool_lookup_by_name_args);
- ret_filter = (xdrproc_t) xdr_remote_storage_pool_lookup_by_name_ret;
- ret = (char *) &lv_remote_storage_pool_lookup_by_name_ret;
- memset (&lv_remote_storage_pool_lookup_by_name_ret, 0, sizeof lv_remote_storage_pool_lookup_by_name_ret);
- break;
-case REMOTE_PROC_STORAGE_POOL_LOOKUP_BY_UUID:
- fn = (dispatch_fn) remoteDispatchStoragePoolLookupByUuid;
- args_filter = (xdrproc_t) xdr_remote_storage_pool_lookup_by_uuid_args;
- args = (char *) &lv_remote_storage_pool_lookup_by_uuid_args;
- memset (&lv_remote_storage_pool_lookup_by_uuid_args, 0, sizeof lv_remote_storage_pool_lookup_by_uuid_args);
- ret_filter = (xdrproc_t) xdr_remote_storage_pool_lookup_by_uuid_ret;
- ret = (char *) &lv_remote_storage_pool_lookup_by_uuid_ret;
- memset (&lv_remote_storage_pool_lookup_by_uuid_ret, 0, sizeof lv_remote_storage_pool_lookup_by_uuid_ret);
- break;
-case REMOTE_PROC_STORAGE_POOL_LOOKUP_BY_VOLUME:
- fn = (dispatch_fn) remoteDispatchStoragePoolLookupByVolume;
- args_filter = (xdrproc_t) xdr_remote_storage_pool_lookup_by_volume_args;
- args = (char *) &lv_remote_storage_pool_lookup_by_volume_args;
- memset (&lv_remote_storage_pool_lookup_by_volume_args, 0, sizeof lv_remote_storage_pool_lookup_by_volume_args);
- ret_filter = (xdrproc_t) xdr_remote_storage_pool_lookup_by_volume_ret;
- ret = (char *) &lv_remote_storage_pool_lookup_by_volume_ret;
- memset (&lv_remote_storage_pool_lookup_by_volume_ret, 0, sizeof lv_remote_storage_pool_lookup_by_volume_ret);
- break;
-case REMOTE_PROC_STORAGE_POOL_NUM_OF_VOLUMES:
- fn = (dispatch_fn) remoteDispatchStoragePoolNumOfVolumes;
- args_filter = (xdrproc_t) xdr_remote_storage_pool_num_of_volumes_args;
- args = (char *) &lv_remote_storage_pool_num_of_volumes_args;
- memset (&lv_remote_storage_pool_num_of_volumes_args, 0, sizeof lv_remote_storage_pool_num_of_volumes_args);
- ret_filter = (xdrproc_t) xdr_remote_storage_pool_num_of_volumes_ret;
- ret = (char *) &lv_remote_storage_pool_num_of_volumes_ret;
- memset (&lv_remote_storage_pool_num_of_volumes_ret, 0, sizeof lv_remote_storage_pool_num_of_volumes_ret);
- break;
-case REMOTE_PROC_STORAGE_POOL_REFRESH:
- fn = (dispatch_fn) remoteDispatchStoragePoolRefresh;
- args_filter = (xdrproc_t) xdr_remote_storage_pool_refresh_args;
- args = (char *) &lv_remote_storage_pool_refresh_args;
- memset (&lv_remote_storage_pool_refresh_args, 0, sizeof lv_remote_storage_pool_refresh_args);
- break;
-case REMOTE_PROC_STORAGE_POOL_SET_AUTOSTART:
- fn = (dispatch_fn) remoteDispatchStoragePoolSetAutostart;
- args_filter = (xdrproc_t) xdr_remote_storage_pool_set_autostart_args;
- args = (char *) &lv_remote_storage_pool_set_autostart_args;
- memset (&lv_remote_storage_pool_set_autostart_args, 0, sizeof lv_remote_storage_pool_set_autostart_args);
- break;
-case REMOTE_PROC_STORAGE_POOL_UNDEFINE:
- fn = (dispatch_fn) remoteDispatchStoragePoolUndefine;
- args_filter = (xdrproc_t) xdr_remote_storage_pool_undefine_args;
- args = (char *) &lv_remote_storage_pool_undefine_args;
- memset (&lv_remote_storage_pool_undefine_args, 0, sizeof lv_remote_storage_pool_undefine_args);
- break;
-case REMOTE_PROC_STORAGE_VOL_CREATE_XML:
- fn = (dispatch_fn) remoteDispatchStorageVolCreateXml;
- args_filter = (xdrproc_t) xdr_remote_storage_vol_create_xml_args;
- args = (char *) &lv_remote_storage_vol_create_xml_args;
- memset (&lv_remote_storage_vol_create_xml_args, 0, sizeof lv_remote_storage_vol_create_xml_args);
- ret_filter = (xdrproc_t) xdr_remote_storage_vol_create_xml_ret;
- ret = (char *) &lv_remote_storage_vol_create_xml_ret;
- memset (&lv_remote_storage_vol_create_xml_ret, 0, sizeof lv_remote_storage_vol_create_xml_ret);
- break;
-case REMOTE_PROC_STORAGE_VOL_DELETE:
- fn = (dispatch_fn) remoteDispatchStorageVolDelete;
- args_filter = (xdrproc_t) xdr_remote_storage_vol_delete_args;
- args = (char *) &lv_remote_storage_vol_delete_args;
- memset (&lv_remote_storage_vol_delete_args, 0, sizeof lv_remote_storage_vol_delete_args);
- break;
-case REMOTE_PROC_STORAGE_VOL_DUMP_XML:
- fn = (dispatch_fn) remoteDispatchStorageVolDumpXml;
- args_filter = (xdrproc_t) xdr_remote_storage_vol_dump_xml_args;
- args = (char *) &lv_remote_storage_vol_dump_xml_args;
- memset (&lv_remote_storage_vol_dump_xml_args, 0, sizeof lv_remote_storage_vol_dump_xml_args);
- ret_filter = (xdrproc_t) xdr_remote_storage_vol_dump_xml_ret;
- ret = (char *) &lv_remote_storage_vol_dump_xml_ret;
- memset (&lv_remote_storage_vol_dump_xml_ret, 0, sizeof lv_remote_storage_vol_dump_xml_ret);
- break;
-case REMOTE_PROC_STORAGE_VOL_GET_INFO:
- fn = (dispatch_fn) remoteDispatchStorageVolGetInfo;
- args_filter = (xdrproc_t) xdr_remote_storage_vol_get_info_args;
- args = (char *) &lv_remote_storage_vol_get_info_args;
- memset (&lv_remote_storage_vol_get_info_args, 0, sizeof lv_remote_storage_vol_get_info_args);
- ret_filter = (xdrproc_t) xdr_remote_storage_vol_get_info_ret;
- ret = (char *) &lv_remote_storage_vol_get_info_ret;
- memset (&lv_remote_storage_vol_get_info_ret, 0, sizeof lv_remote_storage_vol_get_info_ret);
- break;
-case REMOTE_PROC_STORAGE_VOL_GET_PATH:
- fn = (dispatch_fn) remoteDispatchStorageVolGetPath;
- args_filter = (xdrproc_t) xdr_remote_storage_vol_get_path_args;
- args = (char *) &lv_remote_storage_vol_get_path_args;
- memset (&lv_remote_storage_vol_get_path_args, 0, sizeof lv_remote_storage_vol_get_path_args);
- ret_filter = (xdrproc_t) xdr_remote_storage_vol_get_path_ret;
- ret = (char *) &lv_remote_storage_vol_get_path_ret;
- memset (&lv_remote_storage_vol_get_path_ret, 0, sizeof lv_remote_storage_vol_get_path_ret);
- break;
-case REMOTE_PROC_STORAGE_VOL_LOOKUP_BY_KEY:
- fn = (dispatch_fn) remoteDispatchStorageVolLookupByKey;
- args_filter = (xdrproc_t) xdr_remote_storage_vol_lookup_by_key_args;
- args = (char *) &lv_remote_storage_vol_lookup_by_key_args;
- memset (&lv_remote_storage_vol_lookup_by_key_args, 0, sizeof lv_remote_storage_vol_lookup_by_key_args);
- ret_filter = (xdrproc_t) xdr_remote_storage_vol_lookup_by_key_ret;
- ret = (char *) &lv_remote_storage_vol_lookup_by_key_ret;
- memset (&lv_remote_storage_vol_lookup_by_key_ret, 0, sizeof lv_remote_storage_vol_lookup_by_key_ret);
- break;
-case REMOTE_PROC_STORAGE_VOL_LOOKUP_BY_NAME:
- fn = (dispatch_fn) remoteDispatchStorageVolLookupByName;
- args_filter = (xdrproc_t) xdr_remote_storage_vol_lookup_by_name_args;
- args = (char *) &lv_remote_storage_vol_lookup_by_name_args;
- memset (&lv_remote_storage_vol_lookup_by_name_args, 0, sizeof lv_remote_storage_vol_lookup_by_name_args);
- ret_filter = (xdrproc_t) xdr_remote_storage_vol_lookup_by_name_ret;
- ret = (char *) &lv_remote_storage_vol_lookup_by_name_ret;
- memset (&lv_remote_storage_vol_lookup_by_name_ret, 0, sizeof lv_remote_storage_vol_lookup_by_name_ret);
- break;
-case REMOTE_PROC_STORAGE_VOL_LOOKUP_BY_PATH:
- fn = (dispatch_fn) remoteDispatchStorageVolLookupByPath;
- args_filter = (xdrproc_t) xdr_remote_storage_vol_lookup_by_path_args;
- args = (char *) &lv_remote_storage_vol_lookup_by_path_args;
- memset (&lv_remote_storage_vol_lookup_by_path_args, 0, sizeof lv_remote_storage_vol_lookup_by_path_args);
- ret_filter = (xdrproc_t) xdr_remote_storage_vol_lookup_by_path_ret;
- ret = (char *) &lv_remote_storage_vol_lookup_by_path_ret;
- memset (&lv_remote_storage_vol_lookup_by_path_ret, 0, sizeof lv_remote_storage_vol_lookup_by_path_ret);
- break;
-case REMOTE_PROC_SUPPORTS_FEATURE:
- fn = (dispatch_fn) remoteDispatchSupportsFeature;
- args_filter = (xdrproc_t) xdr_remote_supports_feature_args;
- args = (char *) &lv_remote_supports_feature_args;
- memset (&lv_remote_supports_feature_args, 0, sizeof lv_remote_supports_feature_args);
- ret_filter = (xdrproc_t) xdr_remote_supports_feature_ret;
- ret = (char *) &lv_remote_supports_feature_ret;
- memset (&lv_remote_supports_feature_ret, 0, sizeof lv_remote_supports_feature_ret);
- break;
diff --git a/qemud/remote_dispatch_ret.h b/qemud/remote_dispatch_ret.h
new file mode 100644
--- /dev/null
+++ b/qemud/remote_dispatch_ret.h
@@ -0,0 +1,75 @@
+/* Automatically generated by remote_generate_stubs.pl.
+ * Do not edit this file. Any changes you make will be lost.
+ */
+
+ remote_get_type_ret val_remote_get_type_ret;
+ remote_get_version_ret val_remote_get_version_ret;
+ remote_get_max_vcpus_ret val_remote_get_max_vcpus_ret;
+ remote_node_get_info_ret val_remote_node_get_info_ret;
+ remote_get_capabilities_ret val_remote_get_capabilities_ret;
+ remote_domain_create_linux_ret val_remote_domain_create_linux_ret;
+ remote_domain_define_xml_ret val_remote_domain_define_xml_ret;
+ remote_domain_dump_xml_ret val_remote_domain_dump_xml_ret;
+ remote_domain_get_autostart_ret val_remote_domain_get_autostart_ret;
+ remote_domain_get_info_ret val_remote_domain_get_info_ret;
+ remote_domain_get_max_memory_ret val_remote_domain_get_max_memory_ret;
+ remote_domain_get_max_vcpus_ret val_remote_domain_get_max_vcpus_ret;
+ remote_domain_get_os_type_ret val_remote_domain_get_os_type_ret;
+ remote_domain_get_vcpus_ret val_remote_domain_get_vcpus_ret;
+ remote_list_defined_domains_ret val_remote_list_defined_domains_ret;
+ remote_domain_lookup_by_id_ret val_remote_domain_lookup_by_id_ret;
+ remote_domain_lookup_by_name_ret val_remote_domain_lookup_by_name_ret;
+ remote_domain_lookup_by_uuid_ret val_remote_domain_lookup_by_uuid_ret;
+ remote_num_of_defined_domains_ret val_remote_num_of_defined_domains_ret;
+ remote_list_defined_networks_ret val_remote_list_defined_networks_ret;
+ remote_list_domains_ret val_remote_list_domains_ret;
+ remote_list_networks_ret val_remote_list_networks_ret;
+ remote_network_create_xml_ret val_remote_network_create_xml_ret;
+ remote_network_define_xml_ret val_remote_network_define_xml_ret;
+ remote_network_dump_xml_ret val_remote_network_dump_xml_ret;
+ remote_network_get_autostart_ret val_remote_network_get_autostart_ret;
+ remote_network_get_bridge_name_ret val_remote_network_get_bridge_name_ret;
+ remote_network_lookup_by_name_ret val_remote_network_lookup_by_name_ret;
+ remote_network_lookup_by_uuid_ret val_remote_network_lookup_by_uuid_ret;
+ remote_num_of_defined_networks_ret val_remote_num_of_defined_networks_ret;
+ remote_num_of_domains_ret val_remote_num_of_domains_ret;
+ remote_num_of_networks_ret val_remote_num_of_networks_ret;
+ remote_domain_get_scheduler_type_ret val_remote_domain_get_scheduler_type_ret;
+ remote_domain_get_scheduler_parameters_ret val_remote_domain_get_scheduler_parameters_ret;
+ remote_get_hostname_ret val_remote_get_hostname_ret;
+ remote_supports_feature_ret val_remote_supports_feature_ret;
+ remote_domain_migrate_prepare_ret val_remote_domain_migrate_prepare_ret;
+ remote_domain_migrate_finish_ret val_remote_domain_migrate_finish_ret;
+ remote_domain_block_stats_ret val_remote_domain_block_stats_ret;
+ remote_domain_interface_stats_ret val_remote_domain_interface_stats_ret;
+ remote_auth_list_ret val_remote_auth_list_ret;
+ remote_auth_sasl_init_ret val_remote_auth_sasl_init_ret;
+ remote_auth_sasl_start_ret val_remote_auth_sasl_start_ret;
+ remote_auth_sasl_step_ret val_remote_auth_sasl_step_ret;
+ remote_auth_polkit_ret val_remote_auth_polkit_ret;
+ remote_num_of_storage_pools_ret val_remote_num_of_storage_pools_ret;
+ remote_list_storage_pools_ret val_remote_list_storage_pools_ret;
+ remote_num_of_defined_storage_pools_ret val_remote_num_of_defined_storage_pools_ret;
+ remote_list_defined_storage_pools_ret val_remote_list_defined_storage_pools_ret;
+ remote_find_storage_pool_sources_ret val_remote_find_storage_pool_sources_ret;
+ remote_storage_pool_create_xml_ret val_remote_storage_pool_create_xml_ret;
+ remote_storage_pool_define_xml_ret val_remote_storage_pool_define_xml_ret;
+ remote_storage_pool_lookup_by_name_ret val_remote_storage_pool_lookup_by_name_ret;
+ remote_storage_pool_lookup_by_uuid_ret val_remote_storage_pool_lookup_by_uuid_ret;
+ remote_storage_pool_lookup_by_volume_ret val_remote_storage_pool_lookup_by_volume_ret;
+ remote_storage_pool_get_info_ret val_remote_storage_pool_get_info_ret;
+ remote_storage_pool_dump_xml_ret val_remote_storage_pool_dump_xml_ret;
+ remote_storage_pool_get_autostart_ret val_remote_storage_pool_get_autostart_ret;
+ remote_storage_pool_num_of_volumes_ret val_remote_storage_pool_num_of_volumes_ret;
+ remote_storage_pool_list_volumes_ret val_remote_storage_pool_list_volumes_ret;
+ remote_storage_vol_create_xml_ret val_remote_storage_vol_create_xml_ret;
+ remote_storage_vol_lookup_by_name_ret val_remote_storage_vol_lookup_by_name_ret;
+ remote_storage_vol_lookup_by_key_ret val_remote_storage_vol_lookup_by_key_ret;
+ remote_storage_vol_lookup_by_path_ret val_remote_storage_vol_lookup_by_path_ret;
+ remote_storage_vol_get_info_ret val_remote_storage_vol_get_info_ret;
+ remote_storage_vol_dump_xml_ret val_remote_storage_vol_dump_xml_ret;
+ remote_storage_vol_get_path_ret val_remote_storage_vol_get_path_ret;
+ remote_node_get_cells_free_memory_ret val_remote_node_get_cells_free_memory_ret;
+ remote_node_get_free_memory_ret val_remote_node_get_free_memory_ret;
+ remote_domain_block_peek_ret val_remote_domain_block_peek_ret;
+ remote_domain_memory_peek_ret val_remote_domain_memory_peek_ret;
diff --git a/qemud/remote_dispatch_table.h b/qemud/remote_dispatch_table.h
new file mode 100644
--- /dev/null
+++ b/qemud/remote_dispatch_table.h
@@ -0,0 +1,529 @@
+/* Automatically generated by remote_generate_stubs.pl.
+ * Do not edit this file. Any changes you make will be lost.
+ */
+
+{ /* (unused) => 0 */
+ .fn = NULL,
+ .args_filter = (xdrproc_t) xdr_void,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* Open => 1 */
+ .fn = (dispatch_fn) remoteDispatchOpen,
+ .args_filter = (xdrproc_t) xdr_remote_open_args,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* Close => 2 */
+ .fn = (dispatch_fn) remoteDispatchClose,
+ .args_filter = (xdrproc_t) xdr_void,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* GetType => 3 */
+ .fn = (dispatch_fn) remoteDispatchGetType,
+ .args_filter = (xdrproc_t) xdr_void,
+ .ret_filter = (xdrproc_t) xdr_remote_get_type_ret,
+},
+{ /* GetVersion => 4 */
+ .fn = (dispatch_fn) remoteDispatchGetVersion,
+ .args_filter = (xdrproc_t) xdr_void,
+ .ret_filter = (xdrproc_t) xdr_remote_get_version_ret,
+},
+{ /* GetMaxVcpus => 5 */
+ .fn = (dispatch_fn) remoteDispatchGetMaxVcpus,
+ .args_filter = (xdrproc_t) xdr_remote_get_max_vcpus_args,
+ .ret_filter = (xdrproc_t) xdr_remote_get_max_vcpus_ret,
+},
+{ /* NodeGetInfo => 6 */
+ .fn = (dispatch_fn) remoteDispatchNodeGetInfo,
+ .args_filter = (xdrproc_t) xdr_void,
+ .ret_filter = (xdrproc_t) xdr_remote_node_get_info_ret,
+},
+{ /* GetCapabilities => 7 */
+ .fn = (dispatch_fn) remoteDispatchGetCapabilities,
+ .args_filter = (xdrproc_t) xdr_void,
+ .ret_filter = (xdrproc_t) xdr_remote_get_capabilities_ret,
+},
+{ /* DomainAttachDevice => 8 */
+ .fn = (dispatch_fn) remoteDispatchDomainAttachDevice,
+ .args_filter = (xdrproc_t) xdr_remote_domain_attach_device_args,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* DomainCreate => 9 */
+ .fn = (dispatch_fn) remoteDispatchDomainCreate,
+ .args_filter = (xdrproc_t) xdr_remote_domain_create_args,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* DomainCreateLinux => 10 */
+ .fn = (dispatch_fn) remoteDispatchDomainCreateLinux,
+ .args_filter = (xdrproc_t) xdr_remote_domain_create_linux_args,
+ .ret_filter = (xdrproc_t) xdr_remote_domain_create_linux_ret,
+},
+{ /* DomainDefineXml => 11 */
+ .fn = (dispatch_fn) remoteDispatchDomainDefineXml,
+ .args_filter = (xdrproc_t) xdr_remote_domain_define_xml_args,
+ .ret_filter = (xdrproc_t) xdr_remote_domain_define_xml_ret,
+},
+{ /* DomainDestroy => 12 */
+ .fn = (dispatch_fn) remoteDispatchDomainDestroy,
+ .args_filter = (xdrproc_t) xdr_remote_domain_destroy_args,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* DomainDetachDevice => 13 */
+ .fn = (dispatch_fn) remoteDispatchDomainDetachDevice,
+ .args_filter = (xdrproc_t) xdr_remote_domain_detach_device_args,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* DomainDumpXml => 14 */
+ .fn = (dispatch_fn) remoteDispatchDomainDumpXml,
+ .args_filter = (xdrproc_t) xdr_remote_domain_dump_xml_args,
+ .ret_filter = (xdrproc_t) xdr_remote_domain_dump_xml_ret,
+},
+{ /* DomainGetAutostart => 15 */
+ .fn = (dispatch_fn) remoteDispatchDomainGetAutostart,
+ .args_filter = (xdrproc_t) xdr_remote_domain_get_autostart_args,
+ .ret_filter = (xdrproc_t) xdr_remote_domain_get_autostart_ret,
+},
+{ /* DomainGetInfo => 16 */
+ .fn = (dispatch_fn) remoteDispatchDomainGetInfo,
+ .args_filter = (xdrproc_t) xdr_remote_domain_get_info_args,
+ .ret_filter = (xdrproc_t) xdr_remote_domain_get_info_ret,
+},
+{ /* DomainGetMaxMemory => 17 */
+ .fn = (dispatch_fn) remoteDispatchDomainGetMaxMemory,
+ .args_filter = (xdrproc_t) xdr_remote_domain_get_max_memory_args,
+ .ret_filter = (xdrproc_t) xdr_remote_domain_get_max_memory_ret,
+},
+{ /* DomainGetMaxVcpus => 18 */
+ .fn = (dispatch_fn) remoteDispatchDomainGetMaxVcpus,
+ .args_filter = (xdrproc_t) xdr_remote_domain_get_max_vcpus_args,
+ .ret_filter = (xdrproc_t) xdr_remote_domain_get_max_vcpus_ret,
+},
+{ /* DomainGetOsType => 19 */
+ .fn = (dispatch_fn) remoteDispatchDomainGetOsType,
+ .args_filter = (xdrproc_t) xdr_remote_domain_get_os_type_args,
+ .ret_filter = (xdrproc_t) xdr_remote_domain_get_os_type_ret,
+},
+{ /* DomainGetVcpus => 20 */
+ .fn = (dispatch_fn) remoteDispatchDomainGetVcpus,
+ .args_filter = (xdrproc_t) xdr_remote_domain_get_vcpus_args,
+ .ret_filter = (xdrproc_t) xdr_remote_domain_get_vcpus_ret,
+},
+{ /* ListDefinedDomains => 21 */
+ .fn = (dispatch_fn) remoteDispatchListDefinedDomains,
+ .args_filter = (xdrproc_t) xdr_remote_list_defined_domains_args,
+ .ret_filter = (xdrproc_t) xdr_remote_list_defined_domains_ret,
+},
+{ /* DomainLookupById => 22 */
+ .fn = (dispatch_fn) remoteDispatchDomainLookupById,
+ .args_filter = (xdrproc_t) xdr_remote_domain_lookup_by_id_args,
+ .ret_filter = (xdrproc_t) xdr_remote_domain_lookup_by_id_ret,
+},
+{ /* DomainLookupByName => 23 */
+ .fn = (dispatch_fn) remoteDispatchDomainLookupByName,
+ .args_filter = (xdrproc_t) xdr_remote_domain_lookup_by_name_args,
+ .ret_filter = (xdrproc_t) xdr_remote_domain_lookup_by_name_ret,
+},
+{ /* DomainLookupByUuid => 24 */
+ .fn = (dispatch_fn) remoteDispatchDomainLookupByUuid,
+ .args_filter = (xdrproc_t) xdr_remote_domain_lookup_by_uuid_args,
+ .ret_filter = (xdrproc_t) xdr_remote_domain_lookup_by_uuid_ret,
+},
+{ /* NumOfDefinedDomains => 25 */
+ .fn = (dispatch_fn) remoteDispatchNumOfDefinedDomains,
+ .args_filter = (xdrproc_t) xdr_void,
+ .ret_filter = (xdrproc_t) xdr_remote_num_of_defined_domains_ret,
+},
+{ /* DomainPinVcpu => 26 */
+ .fn = (dispatch_fn) remoteDispatchDomainPinVcpu,
+ .args_filter = (xdrproc_t) xdr_remote_domain_pin_vcpu_args,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* DomainReboot => 27 */
+ .fn = (dispatch_fn) remoteDispatchDomainReboot,
+ .args_filter = (xdrproc_t) xdr_remote_domain_reboot_args,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* DomainResume => 28 */
+ .fn = (dispatch_fn) remoteDispatchDomainResume,
+ .args_filter = (xdrproc_t) xdr_remote_domain_resume_args,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* DomainSetAutostart => 29 */
+ .fn = (dispatch_fn) remoteDispatchDomainSetAutostart,
+ .args_filter = (xdrproc_t) xdr_remote_domain_set_autostart_args,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* DomainSetMaxMemory => 30 */
+ .fn = (dispatch_fn) remoteDispatchDomainSetMaxMemory,
+ .args_filter = (xdrproc_t) xdr_remote_domain_set_max_memory_args,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* DomainSetMemory => 31 */
+ .fn = (dispatch_fn) remoteDispatchDomainSetMemory,
+ .args_filter = (xdrproc_t) xdr_remote_domain_set_memory_args,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* DomainSetVcpus => 32 */
+ .fn = (dispatch_fn) remoteDispatchDomainSetVcpus,
+ .args_filter = (xdrproc_t) xdr_remote_domain_set_vcpus_args,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* DomainShutdown => 33 */
+ .fn = (dispatch_fn) remoteDispatchDomainShutdown,
+ .args_filter = (xdrproc_t) xdr_remote_domain_shutdown_args,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* DomainSuspend => 34 */
+ .fn = (dispatch_fn) remoteDispatchDomainSuspend,
+ .args_filter = (xdrproc_t) xdr_remote_domain_suspend_args,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* DomainUndefine => 35 */
+ .fn = (dispatch_fn) remoteDispatchDomainUndefine,
+ .args_filter = (xdrproc_t) xdr_remote_domain_undefine_args,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* ListDefinedNetworks => 36 */
+ .fn = (dispatch_fn) remoteDispatchListDefinedNetworks,
+ .args_filter = (xdrproc_t) xdr_remote_list_defined_networks_args,
+ .ret_filter = (xdrproc_t) xdr_remote_list_defined_networks_ret,
+},
+{ /* ListDomains => 37 */
+ .fn = (dispatch_fn) remoteDispatchListDomains,
+ .args_filter = (xdrproc_t) xdr_remote_list_domains_args,
+ .ret_filter = (xdrproc_t) xdr_remote_list_domains_ret,
+},
+{ /* ListNetworks => 38 */
+ .fn = (dispatch_fn) remoteDispatchListNetworks,
+ .args_filter = (xdrproc_t) xdr_remote_list_networks_args,
+ .ret_filter = (xdrproc_t) xdr_remote_list_networks_ret,
+},
+{ /* NetworkCreate => 39 */
+ .fn = (dispatch_fn) remoteDispatchNetworkCreate,
+ .args_filter = (xdrproc_t) xdr_remote_network_create_args,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* NetworkCreateXml => 40 */
+ .fn = (dispatch_fn) remoteDispatchNetworkCreateXml,
+ .args_filter = (xdrproc_t) xdr_remote_network_create_xml_args,
+ .ret_filter = (xdrproc_t) xdr_remote_network_create_xml_ret,
+},
+{ /* NetworkDefineXml => 41 */
+ .fn = (dispatch_fn) remoteDispatchNetworkDefineXml,
+ .args_filter = (xdrproc_t) xdr_remote_network_define_xml_args,
+ .ret_filter = (xdrproc_t) xdr_remote_network_define_xml_ret,
+},
+{ /* NetworkDestroy => 42 */
+ .fn = (dispatch_fn) remoteDispatchNetworkDestroy,
+ .args_filter = (xdrproc_t) xdr_remote_network_destroy_args,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* NetworkDumpXml => 43 */
+ .fn = (dispatch_fn) remoteDispatchNetworkDumpXml,
+ .args_filter = (xdrproc_t) xdr_remote_network_dump_xml_args,
+ .ret_filter = (xdrproc_t) xdr_remote_network_dump_xml_ret,
+},
+{ /* NetworkGetAutostart => 44 */
+ .fn = (dispatch_fn) remoteDispatchNetworkGetAutostart,
+ .args_filter = (xdrproc_t) xdr_remote_network_get_autostart_args,
+ .ret_filter = (xdrproc_t) xdr_remote_network_get_autostart_ret,
+},
+{ /* NetworkGetBridgeName => 45 */
+ .fn = (dispatch_fn) remoteDispatchNetworkGetBridgeName,
+ .args_filter = (xdrproc_t) xdr_remote_network_get_bridge_name_args,
+ .ret_filter = (xdrproc_t) xdr_remote_network_get_bridge_name_ret,
+},
+{ /* NetworkLookupByName => 46 */
+ .fn = (dispatch_fn) remoteDispatchNetworkLookupByName,
+ .args_filter = (xdrproc_t) xdr_remote_network_lookup_by_name_args,
+ .ret_filter = (xdrproc_t) xdr_remote_network_lookup_by_name_ret,
+},
+{ /* NetworkLookupByUuid => 47 */
+ .fn = (dispatch_fn) remoteDispatchNetworkLookupByUuid,
+ .args_filter = (xdrproc_t) xdr_remote_network_lookup_by_uuid_args,
+ .ret_filter = (xdrproc_t) xdr_remote_network_lookup_by_uuid_ret,
+},
+{ /* NetworkSetAutostart => 48 */
+ .fn = (dispatch_fn) remoteDispatchNetworkSetAutostart,
+ .args_filter = (xdrproc_t) xdr_remote_network_set_autostart_args,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* NetworkUndefine => 49 */
+ .fn = (dispatch_fn) remoteDispatchNetworkUndefine,
+ .args_filter = (xdrproc_t) xdr_remote_network_undefine_args,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* NumOfDefinedNetworks => 50 */
+ .fn = (dispatch_fn) remoteDispatchNumOfDefinedNetworks,
+ .args_filter = (xdrproc_t) xdr_void,
+ .ret_filter = (xdrproc_t) xdr_remote_num_of_defined_networks_ret,
+},
+{ /* NumOfDomains => 51 */
+ .fn = (dispatch_fn) remoteDispatchNumOfDomains,
+ .args_filter = (xdrproc_t) xdr_void,
+ .ret_filter = (xdrproc_t) xdr_remote_num_of_domains_ret,
+},
+{ /* NumOfNetworks => 52 */
+ .fn = (dispatch_fn) remoteDispatchNumOfNetworks,
+ .args_filter = (xdrproc_t) xdr_void,
+ .ret_filter = (xdrproc_t) xdr_remote_num_of_networks_ret,
+},
+{ /* DomainCoreDump => 53 */
+ .fn = (dispatch_fn) remoteDispatchDomainCoreDump,
+ .args_filter = (xdrproc_t) xdr_remote_domain_core_dump_args,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* DomainRestore => 54 */
+ .fn = (dispatch_fn) remoteDispatchDomainRestore,
+ .args_filter = (xdrproc_t) xdr_remote_domain_restore_args,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* DomainSave => 55 */
+ .fn = (dispatch_fn) remoteDispatchDomainSave,
+ .args_filter = (xdrproc_t) xdr_remote_domain_save_args,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* DomainGetSchedulerType => 56 */
+ .fn = (dispatch_fn) remoteDispatchDomainGetSchedulerType,
+ .args_filter = (xdrproc_t) xdr_remote_domain_get_scheduler_type_args,
+ .ret_filter = (xdrproc_t) xdr_remote_domain_get_scheduler_type_ret,
+},
+{ /* DomainGetSchedulerParameters => 57 */
+ .fn = (dispatch_fn) remoteDispatchDomainGetSchedulerParameters,
+ .args_filter = (xdrproc_t) xdr_remote_domain_get_scheduler_parameters_args,
+ .ret_filter = (xdrproc_t) xdr_remote_domain_get_scheduler_parameters_ret,
+},
+{ /* DomainSetSchedulerParameters => 58 */
+ .fn = (dispatch_fn) remoteDispatchDomainSetSchedulerParameters,
+ .args_filter = (xdrproc_t) xdr_remote_domain_set_scheduler_parameters_args,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* GetHostname => 59 */
+ .fn = (dispatch_fn) remoteDispatchGetHostname,
+ .args_filter = (xdrproc_t) xdr_void,
+ .ret_filter = (xdrproc_t) xdr_remote_get_hostname_ret,
+},
+{ /* SupportsFeature => 60 */
+ .fn = (dispatch_fn) remoteDispatchSupportsFeature,
+ .args_filter = (xdrproc_t) xdr_remote_supports_feature_args,
+ .ret_filter = (xdrproc_t) xdr_remote_supports_feature_ret,
+},
+{ /* DomainMigratePrepare => 61 */
+ .fn = (dispatch_fn) remoteDispatchDomainMigratePrepare,
+ .args_filter = (xdrproc_t) xdr_remote_domain_migrate_prepare_args,
+ .ret_filter = (xdrproc_t) xdr_remote_domain_migrate_prepare_ret,
+},
+{ /* DomainMigratePerform => 62 */
+ .fn = (dispatch_fn) remoteDispatchDomainMigratePerform,
+ .args_filter = (xdrproc_t) xdr_remote_domain_migrate_perform_args,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* DomainMigrateFinish => 63 */
+ .fn = (dispatch_fn) remoteDispatchDomainMigrateFinish,
+ .args_filter = (xdrproc_t) xdr_remote_domain_migrate_finish_args,
+ .ret_filter = (xdrproc_t) xdr_remote_domain_migrate_finish_ret,
+},
+{ /* DomainBlockStats => 64 */
+ .fn = (dispatch_fn) remoteDispatchDomainBlockStats,
+ .args_filter = (xdrproc_t) xdr_remote_domain_block_stats_args,
+ .ret_filter = (xdrproc_t) xdr_remote_domain_block_stats_ret,
+},
+{ /* DomainInterfaceStats => 65 */
+ .fn = (dispatch_fn) remoteDispatchDomainInterfaceStats,
+ .args_filter = (xdrproc_t) xdr_remote_domain_interface_stats_args,
+ .ret_filter = (xdrproc_t) xdr_remote_domain_interface_stats_ret,
+},
+{ /* AuthList => 66 */
+ .fn = (dispatch_fn) remoteDispatchAuthList,
+ .args_filter = (xdrproc_t) xdr_void,
+ .ret_filter = (xdrproc_t) xdr_remote_auth_list_ret,
+},
+{ /* AuthSaslInit => 67 */
+ .fn = (dispatch_fn) remoteDispatchAuthSaslInit,
+ .args_filter = (xdrproc_t) xdr_void,
+ .ret_filter = (xdrproc_t) xdr_remote_auth_sasl_init_ret,
+},
+{ /* AuthSaslStart => 68 */
+ .fn = (dispatch_fn) remoteDispatchAuthSaslStart,
+ .args_filter = (xdrproc_t) xdr_remote_auth_sasl_start_args,
+ .ret_filter = (xdrproc_t) xdr_remote_auth_sasl_start_ret,
+},
+{ /* AuthSaslStep => 69 */
+ .fn = (dispatch_fn) remoteDispatchAuthSaslStep,
+ .args_filter = (xdrproc_t) xdr_remote_auth_sasl_step_args,
+ .ret_filter = (xdrproc_t) xdr_remote_auth_sasl_step_ret,
+},
+{ /* AuthPolkit => 70 */
+ .fn = (dispatch_fn) remoteDispatchAuthPolkit,
+ .args_filter = (xdrproc_t) xdr_void,
+ .ret_filter = (xdrproc_t) xdr_remote_auth_polkit_ret,
+},
+{ /* NumOfStoragePools => 71 */
+ .fn = (dispatch_fn) remoteDispatchNumOfStoragePools,
+ .args_filter = (xdrproc_t) xdr_void,
+ .ret_filter = (xdrproc_t) xdr_remote_num_of_storage_pools_ret,
+},
+{ /* ListStoragePools => 72 */
+ .fn = (dispatch_fn) remoteDispatchListStoragePools,
+ .args_filter = (xdrproc_t) xdr_remote_list_storage_pools_args,
+ .ret_filter = (xdrproc_t) xdr_remote_list_storage_pools_ret,
+},
+{ /* NumOfDefinedStoragePools => 73 */
+ .fn = (dispatch_fn) remoteDispatchNumOfDefinedStoragePools,
+ .args_filter = (xdrproc_t) xdr_void,
+ .ret_filter = (xdrproc_t) xdr_remote_num_of_defined_storage_pools_ret,
+},
+{ /* ListDefinedStoragePools => 74 */
+ .fn = (dispatch_fn) remoteDispatchListDefinedStoragePools,
+ .args_filter = (xdrproc_t) xdr_remote_list_defined_storage_pools_args,
+ .ret_filter = (xdrproc_t) xdr_remote_list_defined_storage_pools_ret,
+},
+{ /* FindStoragePoolSources => 75 */
+ .fn = (dispatch_fn) remoteDispatchFindStoragePoolSources,
+ .args_filter = (xdrproc_t) xdr_remote_find_storage_pool_sources_args,
+ .ret_filter = (xdrproc_t) xdr_remote_find_storage_pool_sources_ret,
+},
+{ /* StoragePoolCreateXml => 76 */
+ .fn = (dispatch_fn) remoteDispatchStoragePoolCreateXml,
+ .args_filter = (xdrproc_t) xdr_remote_storage_pool_create_xml_args,
+ .ret_filter = (xdrproc_t) xdr_remote_storage_pool_create_xml_ret,
+},
+{ /* StoragePoolDefineXml => 77 */
+ .fn = (dispatch_fn) remoteDispatchStoragePoolDefineXml,
+ .args_filter = (xdrproc_t) xdr_remote_storage_pool_define_xml_args,
+ .ret_filter = (xdrproc_t) xdr_remote_storage_pool_define_xml_ret,
+},
+{ /* StoragePoolCreate => 78 */
+ .fn = (dispatch_fn) remoteDispatchStoragePoolCreate,
+ .args_filter = (xdrproc_t) xdr_remote_storage_pool_create_args,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* StoragePoolBuild => 79 */
+ .fn = (dispatch_fn) remoteDispatchStoragePoolBuild,
+ .args_filter = (xdrproc_t) xdr_remote_storage_pool_build_args,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* StoragePoolDestroy => 80 */
+ .fn = (dispatch_fn) remoteDispatchStoragePoolDestroy,
+ .args_filter = (xdrproc_t) xdr_remote_storage_pool_destroy_args,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* StoragePoolDelete => 81 */
+ .fn = (dispatch_fn) remoteDispatchStoragePoolDelete,
+ .args_filter = (xdrproc_t) xdr_remote_storage_pool_delete_args,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* StoragePoolUndefine => 82 */
+ .fn = (dispatch_fn) remoteDispatchStoragePoolUndefine,
+ .args_filter = (xdrproc_t) xdr_remote_storage_pool_undefine_args,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* StoragePoolRefresh => 83 */
+ .fn = (dispatch_fn) remoteDispatchStoragePoolRefresh,
+ .args_filter = (xdrproc_t) xdr_remote_storage_pool_refresh_args,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* StoragePoolLookupByName => 84 */
+ .fn = (dispatch_fn) remoteDispatchStoragePoolLookupByName,
+ .args_filter = (xdrproc_t) xdr_remote_storage_pool_lookup_by_name_args,
+ .ret_filter = (xdrproc_t) xdr_remote_storage_pool_lookup_by_name_ret,
+},
+{ /* StoragePoolLookupByUuid => 85 */
+ .fn = (dispatch_fn) remoteDispatchStoragePoolLookupByUuid,
+ .args_filter = (xdrproc_t) xdr_remote_storage_pool_lookup_by_uuid_args,
+ .ret_filter = (xdrproc_t) xdr_remote_storage_pool_lookup_by_uuid_ret,
+},
+{ /* StoragePoolLookupByVolume => 86 */
+ .fn = (dispatch_fn) remoteDispatchStoragePoolLookupByVolume,
+ .args_filter = (xdrproc_t) xdr_remote_storage_pool_lookup_by_volume_args,
+ .ret_filter = (xdrproc_t) xdr_remote_storage_pool_lookup_by_volume_ret,
+},
+{ /* StoragePoolGetInfo => 87 */
+ .fn = (dispatch_fn) remoteDispatchStoragePoolGetInfo,
+ .args_filter = (xdrproc_t) xdr_remote_storage_pool_get_info_args,
+ .ret_filter = (xdrproc_t) xdr_remote_storage_pool_get_info_ret,
+},
+{ /* StoragePoolDumpXml => 88 */
+ .fn = (dispatch_fn) remoteDispatchStoragePoolDumpXml,
+ .args_filter = (xdrproc_t) xdr_remote_storage_pool_dump_xml_args,
+ .ret_filter = (xdrproc_t) xdr_remote_storage_pool_dump_xml_ret,
+},
+{ /* StoragePoolGetAutostart => 89 */
+ .fn = (dispatch_fn) remoteDispatchStoragePoolGetAutostart,
+ .args_filter = (xdrproc_t) xdr_remote_storage_pool_get_autostart_args,
+ .ret_filter = (xdrproc_t) xdr_remote_storage_pool_get_autostart_ret,
+},
+{ /* StoragePoolSetAutostart => 90 */
+ .fn = (dispatch_fn) remoteDispatchStoragePoolSetAutostart,
+ .args_filter = (xdrproc_t) xdr_remote_storage_pool_set_autostart_args,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* StoragePoolNumOfVolumes => 91 */
+ .fn = (dispatch_fn) remoteDispatchStoragePoolNumOfVolumes,
+ .args_filter = (xdrproc_t) xdr_remote_storage_pool_num_of_volumes_args,
+ .ret_filter = (xdrproc_t) xdr_remote_storage_pool_num_of_volumes_ret,
+},
+{ /* StoragePoolListVolumes => 92 */
+ .fn = (dispatch_fn) remoteDispatchStoragePoolListVolumes,
+ .args_filter = (xdrproc_t) xdr_remote_storage_pool_list_volumes_args,
+ .ret_filter = (xdrproc_t) xdr_remote_storage_pool_list_volumes_ret,
+},
+{ /* StorageVolCreateXml => 93 */
+ .fn = (dispatch_fn) remoteDispatchStorageVolCreateXml,
+ .args_filter = (xdrproc_t) xdr_remote_storage_vol_create_xml_args,
+ .ret_filter = (xdrproc_t) xdr_remote_storage_vol_create_xml_ret,
+},
+{ /* StorageVolDelete => 94 */
+ .fn = (dispatch_fn) remoteDispatchStorageVolDelete,
+ .args_filter = (xdrproc_t) xdr_remote_storage_vol_delete_args,
+ .ret_filter = (xdrproc_t) xdr_void,
+},
+{ /* StorageVolLookupByName => 95 */
+ .fn = (dispatch_fn) remoteDispatchStorageVolLookupByName,
+ .args_filter = (xdrproc_t) xdr_remote_storage_vol_lookup_by_name_args,
+ .ret_filter = (xdrproc_t) xdr_remote_storage_vol_lookup_by_name_ret,
+},
+{ /* StorageVolLookupByKey => 96 */
+ .fn = (dispatch_fn) remoteDispatchStorageVolLookupByKey,
+ .args_filter = (xdrproc_t) xdr_remote_storage_vol_lookup_by_key_args,
+ .ret_filter = (xdrproc_t) xdr_remote_storage_vol_lookup_by_key_ret,
+},
+{ /* StorageVolLookupByPath => 97 */
+ .fn = (dispatch_fn) remoteDispatchStorageVolLookupByPath,
+ .args_filter = (xdrproc_t) xdr_remote_storage_vol_lookup_by_path_args,
+ .ret_filter = (xdrproc_t) xdr_remote_storage_vol_lookup_by_path_ret,
+},
+{ /* StorageVolGetInfo => 98 */
+ .fn = (dispatch_fn) remoteDispatchStorageVolGetInfo,
+ .args_filter = (xdrproc_t) xdr_remote_storage_vol_get_info_args,
+ .ret_filter = (xdrproc_t) xdr_remote_storage_vol_get_info_ret,
+},
+{ /* StorageVolDumpXml => 99 */
+ .fn = (dispatch_fn) remoteDispatchStorageVolDumpXml,
+ .args_filter = (xdrproc_t) xdr_remote_storage_vol_dump_xml_args,
+ .ret_filter = (xdrproc_t) xdr_remote_storage_vol_dump_xml_ret,
+},
+{ /* StorageVolGetPath => 100 */
+ .fn = (dispatch_fn) remoteDispatchStorageVolGetPath,
+ .args_filter = (xdrproc_t) xdr_remote_storage_vol_get_path_args,
+ .ret_filter = (xdrproc_t) xdr_remote_storage_vol_get_path_ret,
+},
+{ /* NodeGetCellsFreeMemory => 101 */
+ .fn = (dispatch_fn) remoteDispatchNodeGetCellsFreeMemory,
+ .args_filter = (xdrproc_t) xdr_remote_node_get_cells_free_memory_args,
+ .ret_filter = (xdrproc_t) xdr_remote_node_get_cells_free_memory_ret,
+},
+{ /* NodeGetFreeMemory => 102 */
+ .fn = (dispatch_fn) remoteDispatchNodeGetFreeMemory,
+ .args_filter = (xdrproc_t) xdr_void,
+ .ret_filter = (xdrproc_t) xdr_remote_node_get_free_memory_ret,
+},
+{ /* DomainBlockPeek => 103 */
+ .fn = (dispatch_fn) remoteDispatchDomainBlockPeek,
+ .args_filter = (xdrproc_t) xdr_remote_domain_block_peek_args,
+ .ret_filter = (xdrproc_t) xdr_remote_domain_block_peek_ret,
+},
+{ /* DomainMemoryPeek => 104 */
+ .fn = (dispatch_fn) remoteDispatchDomainMemoryPeek,
+ .args_filter = (xdrproc_t) xdr_remote_domain_memory_peek_args,
+ .ret_filter = (xdrproc_t) xdr_remote_domain_memory_peek_ret,
+},
diff --git a/qemud/remote_generate_stubs.pl b/qemud/remote_generate_stubs.pl
--- a/qemud/remote_generate_stubs.pl
+++ b/qemud/remote_generate_stubs.pl
@@ -12,8 +12,8 @@ use Getopt::Std;
use Getopt::Std;
# Command line options.
-our ($opt_c, $opt_d, $opt_i, $opt_s, $opt_v, $opt_w);
-getopts ('cdisvw');
+our ($opt_p, $opt_t, $opt_a, $opt_r, $opt_d);
+getopts ('ptard');
# Convert name_of_call to NameOfCall.
sub name_to_ProcName {
@@ -25,7 +25,17 @@ sub name_to_ProcName {
# Read the input file (usually remote_protocol.x) and form an
# opinion about the name, args and return type of each RPC.
-my ($name, $ProcName, %calls);
+my ($name, $ProcName, $id, %calls, @calls);
+
+# REMOTE_PROC_CLOSE has no args or ret.
+$calls{close} = {
+ name => "close",
+ ProcName => "Close",
+ UC_NAME => "CLOSE",
+ args => "void",
+ ret => "void",
+};
+
while (<>) {
if (/^struct remote_(.*)_args/) {
$name = $1;
@@ -57,17 +67,14 @@ while (<>) {
ret => "remote_${name}_ret"
}
}
+ } elsif (/^\s*REMOTE_PROC_(.*?)\s+=\s+(\d+),?$/) {
+ $name = lc $1;
+ $id = $2;
+ $ProcName = name_to_ProcName ($name);
+
+ $calls[$id] = $calls{$name};
}
}
-
-# REMOTE_PROC_CLOSE has no args or ret.
-$calls{close} = {
- name => "close",
- ProcName => "Close",
- UC_NAME => "CLOSE",
- args => "void",
- ret => "void",
-};
#----------------------------------------------------------------------
# Output
@@ -90,135 +97,59 @@ if ($opt_d) {
}
# Prototypes for dispatch functions ("remote_dispatch_prototypes.h").
-elsif ($opt_i) {
+elsif ($opt_p) {
my @keys = sort (keys %calls);
foreach (@keys) {
print "static int remoteDispatch$calls{$_}->{ProcName} (struct qemud_server *server, struct qemud_client *client, remote_message_header *req, $calls{$_}->{args} *args, $calls{$_}->{ret} *ret);\n";
}
}
-# Local variables used inside remoteDispatchClientRequest
-# ("remote_dispatch_localvars.h").
-elsif ($opt_v) {
- my @values = values %calls;
- foreach (@values) {
- if ($_->{args} ne "void") {
- print "$_->{args} lv_$_->{args};\n";
+# Union of all arg types
+# ("remote_dispatch_args.h").
+elsif ($opt_a) {
+ for ($id = 0 ; $id <= $#calls ; $id++) {
+ if (defined $calls[$id] &&
+ $calls[$id]->{args} ne "void") {
+ print " $calls[$id]->{args} val_$calls[$id]->{args};\n";
}
- if ($_->{ret} ne "void") {
- print "$_->{ret} lv_$_->{ret};\n";
+ }
+}
+
+# Union of all arg types
+# ("remote_dispatch_ret.h").
+elsif ($opt_r) {
+ for ($id = 0 ; $id <= $#calls ; $id++) {
+ if (defined $calls[$id] &&
+ $calls[$id]->{ret} ne "void") {
+ print " $calls[$id]->{ret} val_$calls[$id]->{ret};\n";
}
}
}
# Inside the switch statement, prepare the 'fn', 'args_filter', etc
-# ("remote_dispatch_proc_switch.h").
-elsif ($opt_w) {
- my @keys = sort (keys %calls);
- foreach (@keys) {
- print "case REMOTE_PROC_$calls{$_}->{UC_NAME}:\n";
- print " fn = (dispatch_fn) remoteDispatch$calls{$_}->{ProcName};\n";
- if ($calls{$_}->{args} ne "void") {
- print " args_filter = (xdrproc_t) xdr_$calls{$_}->{args};\n";
- print " args = (char *) &lv_$calls{$_}->{args};\n";
- print " memset (&lv_$calls{$_}->{args}, 0, sizeof lv_$calls{$_}->{args});\n"
+# ("remote_dispatch_table.h").
+elsif ($opt_t) {
+ for ($id = 0 ; $id <= $#calls ; $id++) {
+ if (defined $calls[$id]) {
+ print "{ /* $calls[$id]->{ProcName} => $id */\n";
+ print " .fn = (dispatch_fn) remoteDispatch$calls[$id]->{ProcName},\n";
+ if ($calls[$id]->{args} ne "void") {
+ print " .args_filter = (xdrproc_t) xdr_$calls[$id]->{args},\n";
+ } else {
+ print " .args_filter = (xdrproc_t) xdr_void,\n";
+ }
+ if ($calls[$id]->{ret} ne "void") {
+ print " .ret_filter = (xdrproc_t) xdr_$calls[$id]->{ret},\n";
+ } else {
+ print " .ret_filter = (xdrproc_t) xdr_void,\n";
+ }
+ print "},\n";
+ } else {
+ print "{ /* (unused) => $id */\n";
+ print " .fn = NULL,\n";
+ print " .args_filter = (xdrproc_t) xdr_void,\n";
+ print " .ret_filter = (xdrproc_t) xdr_void,\n";
+ print "},\n";
}
- if ($calls{$_}->{ret} ne "void") {
- print " ret_filter = (xdrproc_t) xdr_$calls{$_}->{ret};\n";
- print " ret = (char *) &lv_$calls{$_}->{ret};\n";
- print " memset (&lv_$calls{$_}->{ret}, 0, sizeof lv_$calls{$_}->{ret});\n"
- }
- print " break;\n";
}
}
-
-# Generate client stubs - just used to generate the first
-# version of the stubs in remote_internal.c. They need
-# hand-hacking afterwards.
-elsif ($opt_c) {
- my @keys = sort (keys %calls);
-
- foreach (@keys) {
- my $args = $calls{$_}->{args};
- my $argsvoid = $args eq "void";
- my $ret = $calls{$_}->{ret};
- my $retvoid = $ret eq "void";
-
- print "static @@\n";
- print "remote$calls{$_}->{ProcName} (@@)\n";
- print "{\n";
- if (!$argsvoid) {
- print " $args args;\n";
- }
- if (!$retvoid) {
- print " $ret ret;\n";
- }
- print " GET_PRIVATE (conn, @@);\n";
- print "\n";
- if (!$argsvoid) {
- print " @@\n";
- print "\n";
- }
- if (!$retvoid) {
- print " memset (&ret, 0, sizeof ret);\n";
- }
- print " if (call (conn, priv, 0, REMOTE_PROC_$calls{$_}->{UC_NAME},\n";
- print " (xdrproc_t) xdr_$args, (char *) ";
- if ($argsvoid) {
- print "NULL";
- } else {
- print "&args";
- }
- print ",\n";
- print " (xdrproc_t) xdr_$ret, (char *) ";
- if ($retvoid) {
- print "NULL";
- } else {
- print "&ret";
- }
- print ") == -1)\n";
- print " return -1;\n";
- print "\n @@\n";
- print "}\n\n";
- }
-}
-
-# Generate server stubs - just used to generate the first
-# version of the stubs in remote.c. They need hand-hacking
-# afterwards.
-elsif ($opt_s) {
- my @keys = sort (keys %calls);
-
- foreach (@keys) {
- my $args = $calls{$_}->{args};
- my $argsvoid = $args eq "void";
- my $ret = $calls{$_}->{ret};
- my $retvoid = $ret eq "void";
-
- print "static int\n";
- print "remoteDispatch$calls{$_}->{ProcName} (struct qemud_server *server,\n";
- print " struct qemud_client *client,\n";
- print " remote_message_header *req,\n";
- print " remote_get_max_vcpus_args *args,\n";
- print " remote_get_max_vcpus_ret *ret)\n";
- print "{\n";
- if (!$argsvoid || !$retvoid) {
- print " @@\n";
- }
- print " CHECK_CONN;\n";
- print "\n";
- if (!$argsvoid) {
- print " @@\n";
- print "\n";
- }
- print " @@ = vir$calls{$_}->{ProcName} (@@);\n";
- print " if (@@) return -1;\n";
- print "\n";
- if (!$retvoid) {
- print " @@\n";
- print "\n";
- }
- print " return 0;\n";
- print "}\n\n";
- }
-}
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
3
4
[libvirt] [PATCH] Makefile.maint (sync-vcs-ignore-files): avoid risk of abuse
by Jim Meyering 17 Oct '08
by Jim Meyering 17 Oct '08
17 Oct '08
As I wrote the original version of that rule, I realized that running
it in the presence of a maliciously named sub-directory containing a
.cvsignore file could result in arbitrary damage. This fixes it at
the expense of embedding a Perl script in the Makefile. Rather ugly,
when you take into account the original, doubled $$, and appended \n\
everywhere, but slightly better than having a separate script, I thought.
Anyhow, most people will never run the rule, and even fewer will
look at the sources in this file.
>From f27c8d4e76e153356a1283462295b0d3ddac4f5c Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Fri, 17 Oct 2008 14:03:21 +0200
Subject: [PATCH] Makefile.maint (sync-vcs-ignore-files): avoid risk of abuse
* Makefile.maint (sync-vcs-ignore-files): Rewrite rule so that
it won't misbehave even with maliciously-named sub-directories.
---
ChangeLog | 4 ++++
Makefile.maint | 30 +++++++++++++++++++++++-------
2 files changed, 27 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 719b05c..3c678fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
Fri Oct 17 11:58:31 +0200 Jim Meyering <meyering(a)redhat.com>
+ Makefile.maint (sync-vcs-ignore-files): avoid risk of abuse
+ * Makefile.maint (sync-vcs-ignore-files): Rewrite rule so that
+ it won't misbehave even with maliciously-named sub-directories.
+
generate .gitignore files from .cvsignore ones
* Makefile.maint (sync-vcs-ignore-files): New target.
Prompted by a patch from James Morris.
diff --git a/Makefile.maint b/Makefile.maint
index 441deac..d856469 100644
--- a/Makefile.maint
+++ b/Makefile.maint
@@ -608,11 +608,27 @@ my-distcheck: $(local-check) check
echo "$(distdir).tar.gz is ready for distribution"; \
echo "========================"
-gi=.gitignore
+cvs-to-git = '\#!/usr/bin/perl\n\
+use warnings;\n\
+use strict;\n\
+use File::Find;\n\
+use File::Copy;\n\
+\n\
+find ({wanted =>\n\
+ sub {$$_ eq q/.cvsignore/ or return;\n\
+ my $$gi = q/.gitignore/;\n\
+ unlink $$gi;\n\
+ copy($$_, $$gi) or die qq/copy failed: $$_->$$gi: $$!\\n/;\n\
+ chmod 0444, $$gi;\n\
+ }},\n\
+ q!.!);\n'
+
+.PHONY: sync-vcs-ignore-files
+c2g = cvs-to-git
sync-vcs-ignore-files:
- find . -name .cvsignore \
- | sed \
- -e 's,\(.*\),cp -f \1 \1; chmod 444 \1,' \
- -e 's,\.cvsignore; ,$(gi); ,' \
- -e 's,\.cvsignore$$,$(gi),' \
- | $(SHELL)
+ rm -f $(c2g)-t $(c2g)
+ printf $(cvs-to-git) > $(c2g)-t
+ chmod a+x-w $(c2g)-t
+ mv $(c2g)-t $(c2g)
+ perl $(c2g)
+ rm -f $(c2g)
--
1.6.0.2.532.g84ed4c
1
0
[libvirt] PATCH: Remove linked list of clients in favour of an array
by Daniel P. Berrange 17 Oct '08
by Daniel P. Berrange 17 Oct '08
17 Oct '08
More preparation for multi-thread support, this time in the libvirtd
daemon. This removes the embedded linked list of 'struct qemud_client'
and replaces it with an explicit array of pointers of client objects.
This makes per-client locking more practical in a patch to follow.
This touches suprisingly little code :-)
qemud.c | 43 ++++++++++++++++++++++++-------------------
qemud.h | 4 +---
2 files changed, 25 insertions(+), 22 deletions(-)
Daniel
diff --git a/qemud/qemud.c b/qemud/qemud.c
--- a/qemud/qemud.c
+++ b/qemud/qemud.c
@@ -1086,6 +1086,12 @@ static int qemudDispatchServer(struct qe
return -1;
}
+ if (VIR_REALLOC_N(server->clients, server->nclients+1) < 0) {
+ qemudLog(QEMUD_ERR, "%s", _("Out of memory allocating clients"));
+ close(fd);
+ return -1;
+ }
+
/* Disable Nagle. Unix sockets will ignore this. */
setsockopt (fd, IPPROTO_TCP, TCP_NODELAY, (void *)&no_slow_start,
sizeof no_slow_start);
@@ -1165,9 +1171,7 @@ static int qemudDispatchServer(struct qe
}
}
- client->next = server->clients;
- server->clients = client;
- server->nclients++;
+ server->clients[server->nclients++] = client;
return 0;
@@ -1182,19 +1186,19 @@ static int qemudDispatchServer(struct qe
static void qemudDispatchClientFailure(struct qemud_server *server, struct qemud_client *client) {
- struct qemud_client *tmp = server->clients;
- struct qemud_client *prev = NULL;
- while (tmp) {
- if (tmp == client) {
- if (prev == NULL)
- server->clients = client->next;
- else
- prev->next = client->next;
- server->nclients--;
+ int i, n = -1;
+ for (i = 0 ; i < server->nclients ; i++) {
+ if (server->clients[i] == client) {
+ n = i;
break;
}
- prev = tmp;
- tmp = tmp->next;
+ }
+ if (n != -1) {
+ if (n < (server->nclients-1))
+ memmove(server->clients + n,
+ server->clients + n + 1,
+ server->nclients - (n + 1));
+ server->nclients--;
}
virEventRemoveHandleImpl(client->fd);
@@ -1554,13 +1558,14 @@ static void qemudDispatchClientWrite(str
static void qemudDispatchClientEvent(int fd, int events, void *opaque) {
struct qemud_server *server = (struct qemud_server *)opaque;
- struct qemud_client *client = server->clients;
+ struct qemud_client *client = NULL;
+ int i;
- while (client) {
- if (client->fd == fd)
+ for (i = 0 ; i < server->nclients ; i++) {
+ if (server->clients[i]->fd == fd) {
+ client = server->clients[i];
break;
-
- client = client->next;
+ }
}
if (!client)
diff --git a/qemud/qemud.h b/qemud/qemud.h
--- a/qemud/qemud.h
+++ b/qemud/qemud.h
@@ -131,8 +131,6 @@ struct qemud_client {
* called, it will be set back to NULL if that succeeds.
*/
virConnectPtr conn;
-
- struct qemud_client *next;
};
#define QEMUD_CLIENT_MAGIC 0x7788aaee
@@ -152,7 +150,7 @@ struct qemud_server {
int nsockets;
struct qemud_socket *sockets;
int nclients;
- struct qemud_client *clients;
+ struct qemud_client **clients;
int sigread;
char logDir[PATH_MAX];
unsigned int shutdown : 1;
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
2
1
17 Oct '08
These two patches add support for making the libvirtd daemon multithreaded
in its dispatch of client requests. Any single client still has all its
requests serialized - since a virConnectPtr instance is only allowed to be
used from a single thread. Multiple clients though can now be processed
in parallel without blocking each other.
NB, these patches are not intended to be applied yet. They are *unsafe*
untill the stateful drivers (QEMU, LXC, OpenVZ, Test) get suitable
mutex locking. I've nearly got those drivers done and will post for
review in the near future.
The description that follows is also added to CVS as qemud/THREADING.txt
for reference:
- the top level lock is on 'struct qemud_server'. This must be
held before acquiring any other lock
- Each 'struct qemud_client' object has a lock. The server lock
must be held before acquiring it. Once the client lock is acquired
the server lock can (optionally) be dropped.
- The event loop has its own self-contained lock. You can ignore
this as a caller of virEvent APIs.
The server lock is only needed / used once the daemon has entered
its main loop, which is the qemudRunLoop() . The initial thread
acquires the lock upon entering this method.
It immediatelty spawns 'n' worker threads, whose main loop is
the qemudWorker() method. The workers will immediately try to
acquire the server lock, and thus block since its held by the
initial thread.
When the initial thread enters the poll() call, it drops the
server lock. The worker locks now each wakeup, acquire the
server lock and go into a condition wait on the 'job' condition
variable. The workers are now all 'primed' for incoming RPC
calls.
A file descriptor event now occurrs, causing the initial thread
to exit poll(). It invokes the registered callback associated
with the file descriptors on which the event occurrs. The callbacks
are required to immediately acquire the server lock.
If the callback is dealing with a client event, it will then
acquire the client lock, and drop the server lock.
The callback will now handle the I/O event, reading or writing
a RPC message. Once a complete RPC message has been read the
client is marked as being in state QEMUD_MODE_WAIT_DISPATCH,
and the 'job' condition variable is signaled. The callback
now drops the client lock and goes back into the poll() loop
waiting for more I/O events.
Meanwhile one of the worker threads wakes up from its condition
variable sleep, holding the server lock. It now searches for a
client in state QEMUD_MODE_WAIT_DISPATCH. If it doesn't find
one, it goes back to sleep. If it does find one, then it calls
into the remoteDispatchClientRequest() method de-serialize the
incoming message into an XDR object and invoke the helper method
for the associated RPC call.
While the helper method is executing, no locks are held on either
the client or server, but the ref count on the 'struct qemud_client'
object is incremented to ensure its not deleted. The helper can
now safely invoke the neccessary libvirt API call.
Daniel
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
1
2
Add .gitignore files to make developing with git easier. These
are simply copies of the .cvsignore files.
Signed-off-by: James Morris <jmorris(a)namei.org>
---
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..5e055a6
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,32 @@
+.git
+Makefile
+aclocal.m4
+autom4te.cache
+stamp-h.in
+Makefile.in
+configure
+config.cache
+config.h
+config.h.in
+config.log
+config.status
+config.guess
+config.sub
+config.rpath
+stamp-h
+stamp-h1
+libtool
+ltconfig
+update.log
+libvirt.pc
+libvirt.spec
+mingw-libvirt.spec
+COPYING
+m4
+ABOUT-NLS
+coverage
+results.log
+libvirt-*.tar.gz
+INSTALL
+ltmain.sh
+mkinstalldirs
diff --git a/build-aux/.gitignore b/build-aux/.gitignore
new file mode 100644
index 0000000..096cccb
--- /dev/null
+++ b/build-aux/.gitignore
@@ -0,0 +1,10 @@
+compile
+config.guess
+config.rpath
+config.sub
+depcomp
+install-sh
+ltmain.sh
+missing
+mkinstalldirs
+mktempd
diff --git a/docs/.gitignore b/docs/.gitignore
new file mode 100644
index 0000000..f284184
--- /dev/null
+++ b/docs/.gitignore
@@ -0,0 +1,4 @@
+Makefile
+Makefile.in
+.memdump
+apibuild.pyc
diff --git a/docs/devhelp/.gitignore b/docs/devhelp/.gitignore
new file mode 100644
index 0000000..cc4abab
--- /dev/null
+++ b/docs/devhelp/.gitignore
@@ -0,0 +1,3 @@
+Makefile
+Makefile.in
+libvirt.devhelp
diff --git a/docs/examples/.gitignore b/docs/examples/.gitignore
new file mode 100644
index 0000000..5f0e251
--- /dev/null
+++ b/docs/examples/.gitignore
@@ -0,0 +1,7 @@
+.memdump
+Makefile.in
+Makefile
+.deps
+.libs
+info1
+suspend
diff --git a/docs/examples/python/.gitignore b/docs/examples/python/.gitignore
new file mode 100644
index 0000000..282522d
--- /dev/null
+++ b/docs/examples/python/.gitignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/gnulib/lib/.gitignore b/gnulib/lib/.gitignore
new file mode 100644
index 0000000..2849ca9
--- /dev/null
+++ b/gnulib/lib/.gitignore
@@ -0,0 +1,23 @@
+*.la
+*.lo
+.deps
+.libs
+Makefile
+Makefile.in
+alloca.h
+arpa_inet.h
+float.h
+netinet_in.h
+poll.h
+stdbool.h
+stdint.h
+stdio-impl.h
+stdio.h
+stdlib.h
+string.h
+sys_select.h
+sys_socket.h
+sys_stat.h
+sys_time.h
+unistd.h
+wchar.h
diff --git a/gnulib/lib/arpa/.gitignore b/gnulib/lib/arpa/.gitignore
new file mode 100644
index 0000000..b9013ae
--- /dev/null
+++ b/gnulib/lib/arpa/.gitignore
@@ -0,0 +1 @@
+inet.h
diff --git a/gnulib/lib/netinet/.gitignore b/gnulib/lib/netinet/.gitignore
new file mode 100644
index 0000000..95f1a2e
--- /dev/null
+++ b/gnulib/lib/netinet/.gitignore
@@ -0,0 +1 @@
+in.h
\ No newline at end of file
diff --git a/gnulib/lib/sys/.gitignore b/gnulib/lib/sys/.gitignore
new file mode 100644
index 0000000..f6e392f
--- /dev/null
+++ b/gnulib/lib/sys/.gitignore
@@ -0,0 +1,4 @@
+select.h
+socket.h
+stat.h
+time.h
\ No newline at end of file
diff --git a/gnulib/tests/.gitignore b/gnulib/tests/.gitignore
new file mode 100644
index 0000000..5b93dc2
--- /dev/null
+++ b/gnulib/tests/.gitignore
@@ -0,0 +1,29 @@
+.deps
+.libs
+Makefile
+Makefile.in
+test-alloca-opt
+test-arpa_inet
+test-fseeko
+test-getaddrinfo
+test-getdelim
+test-getline
+test-lseek
+test-netinet_in
+test-snprintf
+test-stdbool
+test-stdint
+test-stdio
+test-stdlib
+test-string
+test-sys_select
+test-sys_socket
+test-sys_stat
+test-sys_time
+test-unistd
+test-vasnprintf
+test-vasprintf
+test-wchar
+test-EOVERFLOW.c
+test-EOVERFLOW
+test-c-ctype
diff --git a/include/.gitignore b/include/.gitignore
new file mode 100644
index 0000000..282522d
--- /dev/null
+++ b/include/.gitignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/include/libvirt/.gitignore b/include/libvirt/.gitignore
new file mode 100644
index 0000000..282522d
--- /dev/null
+++ b/include/libvirt/.gitignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/po/.gitignore b/po/.gitignore
new file mode 100644
index 0000000..a0b63f3
--- /dev/null
+++ b/po/.gitignore
@@ -0,0 +1,15 @@
+stamp-po
+remove-potcdate.sin
+quot.sed
+insert-header.sin
+*.gmo
+en(a)quot.header
+en(a)boldquot.header
+boldquot.sed
+Rules-quot
+POTFILES
+Makevars.template
+Makefile.in.in
+Makefile.in
+Makefile
+remove-potcdate.sed
diff --git a/proxy/.gitignore b/proxy/.gitignore
new file mode 100644
index 0000000..f3d6ec7
--- /dev/null
+++ b/proxy/.gitignore
@@ -0,0 +1,5 @@
+Makefile
+Makefile.in
+.deps
+.libs
+libvirt_proxy
diff --git a/python/.gitignore b/python/.gitignore
new file mode 100644
index 0000000..079e574
--- /dev/null
+++ b/python/.gitignore
@@ -0,0 +1,14 @@
+Makefile
+Makefile.in
+.deps
+.libs
+*.lo
+*.la
+*.loT
+libvirt.py
+libvirt-export.c
+libvirtclass.txt
+libvirt-py.[ch]
+libvirtclass.py
+gen_prog
+*.pyc
diff --git a/python/tests/.gitignore b/python/tests/.gitignore
new file mode 100644
index 0000000..282522d
--- /dev/null
+++ b/python/tests/.gitignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/qemud/.gitignore b/qemud/.gitignore
new file mode 100644
index 0000000..04fed54
--- /dev/null
+++ b/qemud/.gitignore
@@ -0,0 +1,11 @@
+Makefile
+Makefile.in
+.deps
+.libs
+*.lo
+*.la
+libvirt_qemud
+libvirtd
+libvirtd.init
+*.gcno
+*.gcda
diff --git a/src/.gitignore b/src/.gitignore
new file mode 100644
index 0000000..165a562
--- /dev/null
+++ b/src/.gitignore
@@ -0,0 +1,16 @@
+Makefile
+Makefile.in
+.deps
+.libs
+*.lo
+*.loT
+*.la
+virsh
+*.gcda
+*.gcno
+*.gcov
+*.cov
+libvirt_parthelper
+libvirt_lxc
+virsh-net-edit.c
+virsh-pool-edit.c
diff --git a/tests/.gitignore b/tests/.gitignore
new file mode 100644
index 0000000..f09e6bb
--- /dev/null
+++ b/tests/.gitignore
@@ -0,0 +1,20 @@
+Makefile
+Makefile.in
+.deps
+.libs
+xmlrpctest
+sexpr2xmltest
+xml2sexprtest
+virshtest
+conftest
+reconnect
+xmconfigtest
+xencapstest
+qemuxml2xmltest
+qemuxml2argvtest
+nodeinfotest
+statstest
+qparamtest
+*.gcda
+*.gcno
+
diff --git a/tests/confdata/.gitignore b/tests/confdata/.gitignore
new file mode 100644
index 0000000..282522d
--- /dev/null
+++ b/tests/confdata/.gitignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/tests/sexpr2xmldata/.gitignore b/tests/sexpr2xmldata/.gitignore
new file mode 100644
index 0000000..282522d
--- /dev/null
+++ b/tests/sexpr2xmldata/.gitignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/tests/virshdata/.gitignore b/tests/virshdata/.gitignore
new file mode 100644
index 0000000..282522d
--- /dev/null
+++ b/tests/virshdata/.gitignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/tests/xencapsdata/.gitignore b/tests/xencapsdata/.gitignore
new file mode 100644
index 0000000..282522d
--- /dev/null
+++ b/tests/xencapsdata/.gitignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/tests/xmconfigdata/.gitignore b/tests/xmconfigdata/.gitignore
new file mode 100644
index 0000000..282522d
--- /dev/null
+++ b/tests/xmconfigdata/.gitignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
diff --git a/tests/xml2sexprdata/.gitignore b/tests/xml2sexprdata/.gitignore
new file mode 100644
index 0000000..282522d
--- /dev/null
+++ b/tests/xml2sexprdata/.gitignore
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
3
5
[libvirt] [PATCH] Couple of patches to fix remote connections from Windows
by Richard W.M. Jones 17 Oct '08
by Richard W.M. Jones 17 Oct '08
17 Oct '08
There's a mistake in the way drivers are registered which means that
if libvirt is configured with the remote driver but without libvirtd,
then the remote driver is compiled in but not registered, which means
it doesn't work. The first patch fixes this.
The second patch just causes LIBVIRT_DEBUG to list drivers as they are
registered, which is useful for debugging these sorts of issues.
Rich.
--
Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones
Read my OCaml programming blog: http://camltastic.blogspot.com/
Fedora now supports 68 OCaml packages (the OPEN alternative to F#)
http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
2
1
Hi,
qemudDomainBlockStats needs to map between qemu and libvirt device
naming as well. Possible patch attached.
Cheers,
-- Guido
4
19
Howdy folks!
So I've been working on a qpid interface to libvirt. Here's the description
I've come up with:
libvirt-qpid provides an interface with libvirt using QMF (qpid modeling
framework) which utilizes the AMQP protocol. The Advanced Message Queuing
Protocol (AMQP) is an open standard application layer protocol providing
reliable transport of messages.
QMF provides a modeling framework layer on top of qpid. This interface
allows you to manage hosts, domains, pools etc. as a set of objects with
properties and methods.
The source code repo:
http://git.et.redhat.com/?p=libvirt-qpid.git;a=summary
So I'd like to hear any feedback you guys might have. This file in particular
describes the API that is used to interact with libvirt.
http://git.et.redhat.com/?p=libvirt-qpid.git;a=blob_plain;f=src/libvirt-sch…
My TODO list looks like this:
- Not sure on camel case or underscores. Original libvirt API uses
camel case, I went with underscores as I was originally basing it off
the ruby bindings.
- Need rc scripts, daemonization, better reconnect/error handling for
both qpid and libvirt. I think it should attempt to reconnect until
successful whenever it gets disconnected. We may need an extra status
property for this state as well.
- Return libvirt error codes? (it's just text msgs right now with error
status bit).
- Make it less chatty, but log stuff
If you wish to try it out, I've made rpms for fedora 9 x86_64 and i386.
They are in the ovirt repo, which you can add to yum using:
rpm -ivh http://ovirt.org/repos/ovirt/9/ovirt-release-LATEST.fc9.noarch.rpm
Once you have that set up, 'yum install libvirt-qpid python-qpid', and then
run (each in their own terminals):
qpidd --auth no
libvirt-qpid (as root to auth with libvirt)
qpid-tool
qpid-tool provides an interface to qpid and allows you to view/manipulate the
qpid models/objects. Here is an example of how it looks using qpid-tool:
$ qpid-tool
Management Tool for QPID
qpid: list
Management Object Types:
ObjectType Active Deleted
============================================
com.redhat.libvirt:domain 2 0
com.redhat.libvirt:node 1 0
qpid: list node
Objects of type com.redhat.libvirt:node
ID Created Destroyed Index
=================================
101 00:02:00 -
qpid: show 101
Object of type com.redhat.libvirt:node: (last sample time: 17:47:54)
Type Element 101
==============================================
property hostname vpro.mains.net
property uri qemu:///system
property libvirt_version 0.4.5
property api_version 0.4.5
property hypervisor_version 0.9.1
property hypervisor_type QEMU
qpid: list domain
Objects of type com.redhat.libvirt:domain
ID Created Destroyed Index
=================================
102 00:02:05 - 101
103 00:02:05 - 101
qpid: show 102
Object of type com.redhat.libvirt:domain: (last sample time: 17:48:09)
Type Element 102
=================================================================
property uuid 662958f8-12c5-baad-2252-4d2126e0971f
property name ovirt-appliance
property node 101
property state shutoff
property num_vcpus 1
property active false
statistic maximum_memory 786432
statistic memory 786432
statistic cpu_time 0
qpid: call 102 create
Call Result: create 0 (OK) {}
qpid: show 102
Object of type com.redhat.libvirt:domain: (last sample time: 17:48:24)
Type Element 102
=================================================================
property uuid 662958f8-12c5-baad-2252-4d2126e0971f
property name ovirt-appliance
property node 101
property state running
property num_vcpus 1
property active true
statistic maximum_memory 786432
statistic memory 786432
statistic cpu_time 0
qpid:
3
21
16 Oct '08
Revision 3 of the cgroups patch, with the round 2 comments addressed.
3
13
As the number of compilation options and platform grows, it gets
more difficult for a commiter to always ensure one chunk of code
won't give a problem in a different situation. To try to lower the
cost of maintaining the protability I would suggest the following
rule for commit:
- if a recently commited patch breaks compilation on a platform
or for a given driver then it's fine to commit a minimal fix
directly without getting the review feedback first
- similary if make check or make syntax-chek breaks, if there is
an obvious fix, it's fine to commit immediately
Note that this would remove the need to send the patch to the list
anyway (or tell what the fix was if trivial). This doesn't either
remove the rule that 'make check syntax-check' should pass before
commiting anything, and obviously the existing review process is still
needed t for anything which is not a trivial fix breaking make or
checks.
I guess it makes sense to minimize disruption for those working on
head and lower the time needed to get those fix in for those who catch
and fix them ;-)
Opinions ?
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel(a)veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
4
6
[libvirt] [PATCH] Thu Oct 16 17:07:10 +0200 Jim Meyering <meyering@redhat.com>
by Jim Meyering 16 Oct '08
by Jim Meyering 16 Oct '08
16 Oct '08
The output of a failed po-check rule (part of "make syntax-check)
was unnecessarily cryptic. Here's the fix that I've already applied
in upstream coreutils:
build: when po-check fails, say why and suggest a fix
* Makefile.maint (po-check): Before, when this check failed, it just
spat out a diff mentioning two temporary files. Now, it tells you
what's wrong and suggests a fix with a patch using the name of the
affected file (rather than temporary file names) in the diff output.
diff --git a/Makefile.maint b/Makefile.maint
index 03800f8..4920112 100644
--- a/Makefile.maint
+++ b/Makefile.maint
@@ -466,8 +466,12 @@ m4-check:
&& { echo 'Makefile.maint: quote the first arg to AC_DEFUN' 1>&2; \
exit 1; } || :
+fix_po_file_diag = \
+'you have changed the set of files with translatable diagnostics;\n\
+apply the above patch\n'
+
# Verify that all source files using _() are listed in po/POTFILES.in.
-# FIXME: don't hard-code file names below; use a more general mechanism.
+po_file = po/POTFILES.in
po-check:
@if test -f po/POTFILES.in; then \
grep -E -v '^(#|$$)' po/POTFILES.in \
@@ -482,13 +486,14 @@ po-check:
*.[ch]) \
base=`expr " $$file" : ' \(.*\)\..'`; \
{ test -f $$base.l || test -f $$base.y; } && continue;; \
- *) continue;; \
+ *) continue;; \
esac; \
files="$$files $$file"; \
done; \
grep -E -l '\b(N?_|gettext *)\([^)"]*("|$$)' $$files \
| sort -u > $@-2; \
- diff -u $@-1 $@-2 || exit 1; \
+ diff -u -L $(po_file) -L $(po_file) $@-1 $@-2 \
+ || { printf '$(ME): '$(fix_po_file_diag) 1>&2; exit 1; }; \
rm -f $@-1 $@-2; \
fi
--
1.6.0.2.98.gc82e
1
0
To support LVM partitioning in oVirt, one of the things we need is the ability
to tell what kind of label is currently on a block device. Here, a 'label' is
used in the same sense that it is used in parted; namely, it defines which kind
of partition table is on the disk, whether it be DOS, LVM2, SUN, BSD, etc. Note
that this is different than the partition type; those are things like Linux,
FAT16, FAT32, etc.
This actually turns out to be fairly easy to implement; there are really only a
few labels that are in common use, and they all have an easy signature to
recognize (but see comments in the code about pc98). This patch implements
label detection on block devices in virStorageBackendUpdateVolInfoFD, and hooks
it up to the iSCSI backend so it works there.
To keep code duplication down, I moved some of the enum's from
storage_backend_disk.c into a common place. Note, however, that there is a
slight semantic change because of this. Previously, if no label was found on a
disk in storage_backend_disk.c, it would always return "dos" as the label type.
That's not actually true, though; if it's a completely zeroed disk, for
instance, it really just has label type of 'unknown'. This patch changes to the
new semantic of 'unknown' for label types we don't understand. I don't think
this will be a huge issue for compatibility, but there could be something I'm
missing.
Otherwise, this patch has been tested by me to work, and now when you do:
# virsh vol-dumpxml --pool iscsitest lun-1
you'll get:
<volume>
...
<target>
...
<format type='dos' />
Which should be sufficient for oVirt to do it's detection.
Signed-off-by: Chris Lalancette <clalance(a)redhat.com>
4
16
16 Oct '08
This patch implements a driver supporting User Mode Linux guests. User mode
linux is a kind of paravirtualized kernel which runs on a plain Linux host.
It requires no elevated privileges at all, except for some of the network
integration. It is a pretty straightforward thing to invoke, so I figured
it would be easy to write a driver to support it. I was right :-)
As with the QEMU driver, there are two styles of invocation
uml:///system - a single privileged, per host driver instance as root
uml:///session - a per-user unprivileged instance
The user mode linux docs recommend against running as root, so naturally
I recommend use of uml:///session, though my testing is so far with
uml:///system.
It supports the bare minimum neccessary for a libvirt driver, namely start,
stop, define, create, destroy, undefine against domains. For configuration
it supports setting of memory limit, virtual disk devices, and paravirt
console devices - good enough to get 'virsh console' working over a PTY,
and dump XML config.
Like QEMU, UML has an admin monitor console. It is a little different
though, using a UNIX domain socket, in datagram mode, sending command
strings back & forth. This actaully makes it a little easier to deal
with in libvirt. User mode linux has a uml_mconsole command line tool
to interact with it, but I directly implement the socket support in
libvirt instead, so this driver does not (yet) have any dependancy on
the UML utilities.
The driver is largely a clone of the QEMU driver, replacing the bit which
builds the command line argv, and all code dealing with the QEMU monitor.
Since the monitor socket is datagram based, we can't make use of it for
detecting VM shutdown as we do with QEMU/LXC. So instead, I make use of
inotify, to monitor $HOME/.uml which is populated witha directory for
each VM. When we see a directory created, libvirt marks the corresponding
VM as running, finds it PID & probes the monitor for the PTY config. When
we see a directory deleted, libvirt makes the VM as shutoff and frees any
resources its holding. This actually works very nicely & simply.
An example config I'm using for testing is
<domain type='uml'>
<name>demo</name>
<uuid>b4433fc2-a22e-ffb3-0a3d-9c173b395800</uuid>
<memory>500000</memory>
<os>
<type arch='x86_64'>uml</type>
<kernel>/home/berrange/linux</kernel>
</os>
<devices>
<disk type='file' device='disk'>
<source file='/home/berrange/FedoraCore6-AMD64-root_fs'/>
<target dev='ubd0' bus='uml'/>
</disk>
<console type='pty'>
<target port='0'/>
</console>
<serial type='tcp'>
<source mode='bind' host='localhost' service='9000'/>
<target port='0'/>
</serial>
<serial type='pty'>
<target port='3'/>
</serial>
</devices>
</domain>
The user mode linux kernel, has the device emulator built-in, so there's no
need to specify the device emulator path explicitly. The kernel I built
straight from latest 2.6.27 sources, and the root filesystem I downloaded
from the UML website. I've been testing with latest libvirt CVS, on a
Fedora 9 x86_64 host.
If you save that config to a file 'demo.xml', you ought to be able todo
virsh --connect uml:///system define demo.xml
virsh --connect uml:///system start demo
virsh --connect uml:///system console demo
Though there is still a small race whereby we can ask for the PTY device
before its been created, causing console to fail.
If things go wrong /var/log/libvirt/uml/$NAME.log contains log messages,
The configuration is stored in /etc/libvirt/uml/$NAME.xml, or in
$HOME/.libvirt/uml/$NAME.xml, and you can also query stuff with mconsole
by doing 'uml_mconsole $NAME'
This isn't quite ready to merge, but I thought I'd send it here to make
people aware of it.
configure.in | 8
include/libvirt/virterror.h | 1
src/Makefile.am | 9
src/domain_conf.c | 47 -
src/domain_conf.h | 1
src/driver.h | 3
src/libvirt.c | 6
src/qemu_conf.c | 3
src/remote_internal.c | 16
src/uml_conf.c | 404 ++++++++++
src/uml_conf.h | 72 +
src/uml_driver.c | 1771 ++++++++++++++++++++++++++++++++++++++++++++
src/uml_driver.h | 34
src/virterror.c | 4
14 files changed, 2355 insertions(+), 24 deletions(-)
Daniel
diff --git a/configure.in b/configure.in
--- a/configure.in
+++ b/configure.in
@@ -149,6 +149,8 @@ AC_ARG_WITH([xen],
[ --with-xen add XEN support (on)],[],[with_xen=yes])
AC_ARG_WITH([qemu],
[ --with-qemu add QEMU/KVM support (on)],[],[with_qemu=yes])
+AC_ARG_WITH([uml],
+[ --with-uml add UML support (on)],[],[with_uml=yes])
AC_ARG_WITH([openvz],
[ --with-openvz add OpenVZ support (on)],[],[with_openvz=yes])
AC_ARG_WITH([lxc],
@@ -261,6 +263,11 @@ if test "$with_qemu" = "yes" ; then
LIBVIRT_FEATURES="$LIBVIRT_FEATURES -DWITH_QEMU"
fi
AM_CONDITIONAL([WITH_QEMU], [test "$with_qemu" = "yes"])
+
+if test "$with_uml" = "yes" ; then
+ LIBVIRT_FEATURES="$LIBVIRT_FEATURES -DWITH_UML"
+fi
+AM_CONDITIONAL([WITH_UML], [test "$with_uml" = "yes"])
if test "$with_test" = "yes" ; then
LIBVIRT_FEATURES="$LIBVIRT_FEATURES -DWITH_TEST"
@@ -1083,6 +1090,7 @@ AC_MSG_NOTICE([ Xen: $with_xen])
AC_MSG_NOTICE([ Xen: $with_xen])
AC_MSG_NOTICE([ Proxy: $with_xen_proxy])
AC_MSG_NOTICE([ QEMU: $with_qemu])
+AC_MSG_NOTICE([ UML: $with_uml])
AC_MSG_NOTICE([ OpenVZ: $with_openvz])
AC_MSG_NOTICE([ LXC: $with_lxc])
AC_MSG_NOTICE([ Test: $with_test])
diff --git a/include/libvirt/virterror.h b/include/libvirt/virterror.h
--- a/include/libvirt/virterror.h
+++ b/include/libvirt/virterror.h
@@ -58,6 +58,7 @@ typedef enum {
VIR_FROM_STORAGE, /* Error from storage driver */
VIR_FROM_NETWORK, /* Error from network config */
VIR_FROM_DOMAIN, /* Error from domain config */
+ VIR_FROM_UML, /* Error at the UML driver */
} virErrorDomain;
diff --git a/src/Makefile.am b/src/Makefile.am
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -107,6 +107,10 @@ QEMU_DRIVER_SOURCES = \
QEMU_DRIVER_SOURCES = \
qemu_conf.c qemu_conf.h \
qemu_driver.c qemu_driver.h
+
+UML_DRIVER_SOURCES = \
+ uml_conf.c uml_conf.h \
+ uml_driver.c uml_driver.h
NETWORK_DRIVER_SOURCES = \
network_driver.h network_driver.c
@@ -178,6 +182,10 @@ libvirt_la_SOURCES += $(QEMU_DRIVER_SOUR
libvirt_la_SOURCES += $(QEMU_DRIVER_SOURCES)
endif
+if WITH_UML
+libvirt_la_SOURCES += $(UML_DRIVER_SOURCES)
+endif
+
if WITH_LXC
libvirt_la_SOURCES += $(LXC_DRIVER_SOURCES)
endif
@@ -201,6 +209,7 @@ EXTRA_DIST += \
$(REMOTE_DRIVER_SOURCES) \
$(XEN_DRIVER_SOURCES) \
$(QEMU_DRIVER_SOURCES) \
+ $(UML_DRIVER_SOURCES) \
$(LXC_DRIVER_SOURCES) \
$(OPENVZ_DRIVER_SOURCES) \
$(NETWORK_DRIVER_SOURCES) \
diff --git a/src/domain_conf.c b/src/domain_conf.c
--- a/src/domain_conf.c
+++ b/src/domain_conf.c
@@ -86,7 +86,8 @@ VIR_ENUM_IMPL(virDomainDiskBus, VIR_DOMA
"scsi",
"virtio",
"xen",
- "usb")
+ "usb",
+ "uml")
VIR_ENUM_IMPL(virDomainFS, VIR_DOMAIN_FS_TYPE_LAST,
"mount",
@@ -610,7 +611,8 @@ virDomainDiskDefParseXML(virConnectPtr c
!STRPREFIX((const char *)target, "hd") &&
!STRPREFIX((const char *)target, "sd") &&
!STRPREFIX((const char *)target, "vd") &&
- !STRPREFIX((const char *)target, "xvd")) {
+ !STRPREFIX((const char *)target, "xvd") &&
+ !STRPREFIX((const char *)target, "ubd")) {
virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
_("Invalid harddisk device name: %s"), target);
goto error;
@@ -634,6 +636,8 @@ virDomainDiskDefParseXML(virConnectPtr c
def->bus = VIR_DOMAIN_DISK_BUS_VIRTIO;
else if (STRPREFIX(target, "xvd"))
def->bus = VIR_DOMAIN_DISK_BUS_XEN;
+ else if (STRPREFIX(target, "ubd"))
+ def->bus = VIR_DOMAIN_DISK_BUS_UML;
else
def->bus = VIR_DOMAIN_DISK_BUS_IDE;
}
@@ -1900,13 +1904,16 @@ static virDomainDefPtr virDomainDefParse
}
if (STREQ(def->os.type, "xen") ||
- STREQ(def->os.type, "hvm")) {
+ STREQ(def->os.type, "hvm") ||
+ STREQ(def->os.type, "uml")) {
def->os.kernel = virXPathString(conn, "string(./os/kernel[1])", ctxt);
def->os.initrd = virXPathString(conn, "string(./os/initrd[1])", ctxt);
def->os.cmdline = virXPathString(conn, "string(./os/cmdline[1])", ctxt);
def->os.root = virXPathString(conn, "string(./os/root[1])", ctxt);
def->os.loader = virXPathString(conn, "string(./os/loader[1])", ctxt);
+ }
+ if (STREQ(def->os.type, "hvm")) {
/* analysis of the boot devices */
if ((n = virXPathNodeSet(conn, "./os/boot", ctxt, &nodes)) < 0) {
virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
@@ -2036,32 +2043,30 @@ static virDomainDefPtr virDomainDefParse
}
VIR_FREE(nodes);
- /*
- * If no serial devices were listed, then look for console
- * devices which is the legacy syntax for the same thing
- */
- if (def->nserials == 0) {
- if ((node = virXPathNode(conn, "./devices/console[1]", ctxt)) != NULL) {
- virDomainChrDefPtr chr = virDomainChrDefParseXML(conn,
- node);
- if (!chr)
- goto error;
+ if ((node = virXPathNode(conn, "./devices/console[1]", ctxt)) != NULL) {
+ virDomainChrDefPtr chr = virDomainChrDefParseXML(conn,
+ node);
+ if (!chr)
+ goto error;
- chr->dstPort = 0;
- /*
- * For HVM console actually created a serial device
- * while for non-HVM it was a parvirt console
- */
- if (STREQ(def->os.type, "hvm")) {
+ chr->dstPort = 0;
+ /*
+ * For HVM console actually created a serial device
+ * while for non-HVM it was a parvirt console
+ */
+ if (STREQ(def->os.type, "hvm")) {
+ if (def->nserials != 0) {
+ virDomainChrDefFree(chr);
+ } else {
if (VIR_ALLOC_N(def->serials, 1) < 0) {
virDomainChrDefFree(chr);
goto no_memory;
}
def->nserials = 1;
def->serials[0] = chr;
- } else {
- def->console = chr;
}
+ } else {
+ def->console = chr;
}
}
diff --git a/src/domain_conf.h b/src/domain_conf.h
--- a/src/domain_conf.h
+++ b/src/domain_conf.h
@@ -73,6 +73,7 @@ enum virDomainDiskBus {
VIR_DOMAIN_DISK_BUS_VIRTIO,
VIR_DOMAIN_DISK_BUS_XEN,
VIR_DOMAIN_DISK_BUS_USB,
+ VIR_DOMAIN_DISK_BUS_UML,
VIR_DOMAIN_DISK_BUS_LAST
};
diff --git a/src/driver.h b/src/driver.h
--- a/src/driver.h
+++ b/src/driver.h
@@ -22,7 +22,8 @@ typedef enum {
VIR_DRV_QEMU = 3,
VIR_DRV_REMOTE = 4,
VIR_DRV_OPENVZ = 5,
- VIR_DRV_LXC = 6
+ VIR_DRV_LXC = 6,
+ VIR_DRV_UML = 7,
} virDrvNo;
diff --git a/src/libvirt.c b/src/libvirt.c
--- a/src/libvirt.c
+++ b/src/libvirt.c
@@ -50,6 +50,9 @@
#ifdef WITH_QEMU
#include "qemu_driver.h"
#endif
+#ifdef WITH_UML
+#include "uml_driver.h"
+#endif
#ifdef WITH_OPENVZ
#include "openvz_driver.h"
#endif
@@ -289,6 +292,9 @@ virInitialize(void)
#ifdef WITH_LIBVIRTD
#ifdef WITH_QEMU
if (qemudRegister() == -1) return -1;
+#endif
+#ifdef WITH_UML
+ if (umlRegister() == -1) return -1;
#endif
#ifdef WITH_OPENVZ
if (openvzRegister() == -1) return -1;
diff --git a/src/qemu_conf.c b/src/qemu_conf.c
--- a/src/qemu_conf.c
+++ b/src/qemu_conf.c
@@ -55,7 +55,8 @@ VIR_ENUM_IMPL(virDomainDiskQEMUBus, VIR_
"scsi",
"virtio",
"xen",
- "usb")
+ "usb",
+ "uml")
#define qemudLog(level, msg...) fprintf(stderr, msg)
diff --git a/src/remote_internal.c b/src/remote_internal.c
--- a/src/remote_internal.c
+++ b/src/remote_internal.c
@@ -757,6 +757,22 @@ remoteOpen (virConnectPtr conn,
#if WITH_QEMU
if (uri &&
uri->scheme && STREQ (uri->scheme, "qemu") &&
+ (!uri->server || STREQ (uri->server, "")) &&
+ uri->path) {
+ if (STREQ (uri->path, "/system")) {
+ rflags |= VIR_DRV_OPEN_REMOTE_UNIX;
+ } else if (STREQ (uri->path, "/session")) {
+ rflags |= VIR_DRV_OPEN_REMOTE_UNIX;
+ if (getuid() > 0) {
+ rflags |= VIR_DRV_OPEN_REMOTE_USER;
+ rflags |= VIR_DRV_OPEN_REMOTE_AUTOSTART;
+ }
+ }
+ }
+#endif
+#if WITH_UML
+ if (uri &&
+ uri->scheme && STREQ (uri->scheme, "uml") &&
(!uri->server || STREQ (uri->server, "")) &&
uri->path) {
if (STREQ (uri->path, "/system")) {
diff --git a/src/uml_conf.c b/src/uml_conf.c
new file mode 100644
--- /dev/null
+++ b/src/uml_conf.c
@@ -0,0 +1,404 @@
+/*
+ * uml_conf.c: UML driver configuration
+ *
+ * Copyright (C) 2006, 2007, 2008 Red Hat, Inc.
+ * Copyright (C) 2006 Daniel P. Berrange
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Author: Daniel P. Berrange <berrange(a)redhat.com>
+ */
+
+#include <config.h>
+
+#include <dirent.h>
+#include <string.h>
+#include <limits.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/wait.h>
+#include <arpa/inet.h>
+#include <sys/utsname.h>
+
+#if HAVE_NUMACTL
+#include <numa.h>
+#endif
+
+#include "uml_conf.h"
+#include "uuid.h"
+#include "buf.h"
+#include "conf.h"
+#include "util.h"
+#include "memory.h"
+#include "verify.h"
+
+
+#define umlLog(level, msg...) fprintf(stderr, msg)
+
+
+
+#if HAVE_NUMACTL
+#define MAX_CPUS 4096
+#define MAX_CPUS_MASK_SIZE (sizeof(unsigned long))
+#define MAX_CPUS_MASK_LEN (MAX_CPUS / MAX_CPUS_MASK_SIZE)
+#define MAX_CPUS_MASK_BYTES (MAX_CPUS / 8)
+
+#define MASK_CPU_ISSET(mask, cpu) \
+ (((mask)[((cpu) / MAX_CPUS_MASK_SIZE)] >> ((cpu) % MAX_CPUS_MASK_SIZE)) & 1)
+
+static int
+umlCapsInitNUMA(virCapsPtr caps)
+{
+ int n, i;
+ unsigned long *mask = NULL;
+ int ncpus;
+ int *cpus = NULL;
+ int ret = -1;
+
+ if (numa_available() < 0)
+ return 0;
+
+ if (VIR_ALLOC_N(mask, MAX_CPUS_MASK_LEN) < 0)
+ goto cleanup;
+
+ for (n = 0 ; n <= numa_max_node() ; n++) {
+ if (numa_node_to_cpus(n, mask, MAX_CPUS_MASK_BYTES) < 0)
+ goto cleanup;
+
+ for (ncpus = 0, i = 0 ; i < MAX_CPUS ; i++)
+ if (MASK_CPU_ISSET(mask, i))
+ ncpus++;
+
+ if (VIR_ALLOC_N(cpus, ncpus) < 0)
+ goto cleanup;
+
+ for (ncpus = 0, i = 0 ; i < MAX_CPUS ; i++)
+ if (MASK_CPU_ISSET(mask, i))
+ cpus[ncpus++] = i;
+
+ if (virCapabilitiesAddHostNUMACell(caps,
+ n,
+ ncpus,
+ cpus) < 0)
+ goto cleanup;
+
+ VIR_FREE(cpus);
+ }
+
+ ret = 0;
+
+cleanup:
+ VIR_FREE(cpus);
+ VIR_FREE(mask);
+ return ret;
+}
+#else
+static int umlCapsInitNUMA(virCapsPtr caps ATTRIBUTE_UNUSED) { return 0; }
+#endif
+
+virCapsPtr umlCapsInit(void) {
+ struct utsname utsname;
+ virCapsPtr caps;
+ virCapsGuestPtr guest;
+
+ /* Really, this never fails - look at the man-page. */
+ uname (&utsname);
+
+ if ((caps = virCapabilitiesNew(utsname.machine,
+ 0, 0)) == NULL)
+ goto no_memory;
+
+ if (umlCapsInitNUMA(caps) < 0)
+ goto no_memory;
+
+ if ((guest = virCapabilitiesAddGuest(caps,
+ "uml",
+ utsname.machine,
+ STREQ(utsname.machine, "x86_64") ? 64 : 32,
+ NULL,
+ NULL,
+ 0,
+ NULL)) == NULL)
+ goto no_memory;
+
+ if (virCapabilitiesAddGuestDomain(guest,
+ "uml",
+ NULL,
+ NULL,
+ 0,
+ NULL) == NULL)
+ goto no_memory;
+
+ return caps;
+
+ no_memory:
+ virCapabilitiesFree(caps);
+ return NULL;
+}
+
+
+static char *
+umlBuildCommandLineChr(virConnectPtr conn,
+ virDomainChrDefPtr def,
+ const char *dev)
+{
+ char *ret;
+
+ switch (def->type) {
+ case VIR_DOMAIN_CHR_TYPE_NULL:
+ if (asprintf(&ret, "%s%d=null", dev, def->dstPort) < 0) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_NO_MEMORY, NULL);
+ return NULL;
+ }
+ break;
+
+ case VIR_DOMAIN_CHR_TYPE_PTY:
+ if (asprintf(&ret, "%s%d=pts", dev, def->dstPort) < 0) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_NO_MEMORY, NULL);
+ return NULL;
+ }
+ break;
+
+ case VIR_DOMAIN_CHR_TYPE_DEV:
+ if (asprintf(&ret, "%s%d=tty:%s", dev, def->dstPort,
+ def->data.file.path) < 0) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_NO_MEMORY, NULL);
+ return NULL;
+ }
+ break;
+
+ case VIR_DOMAIN_CHR_TYPE_STDIO:
+ if (asprintf(&ret, "%s%d=fd:0,fd:1", dev, def->dstPort) < 0) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_NO_MEMORY, NULL);
+ return NULL;
+ }
+ break;
+
+ case VIR_DOMAIN_CHR_TYPE_TCP:
+ if (def->data.tcp.listen != 1) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("only TCP listen is supported for chr device"));
+ return NULL;
+ }
+
+ if (asprintf(&ret, "%s%d=port:%s", dev, def->dstPort,
+ def->data.tcp.service) < 0) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_NO_MEMORY, NULL);
+ return NULL;
+ }
+ break;
+
+ case VIR_DOMAIN_CHR_TYPE_FILE:
+ case VIR_DOMAIN_CHR_TYPE_PIPE:
+ /* XXX could open the file/pipe & just pass the FDs */
+
+ case VIR_DOMAIN_CHR_TYPE_VC:
+ case VIR_DOMAIN_CHR_TYPE_UDP:
+ case VIR_DOMAIN_CHR_TYPE_UNIX:
+ default:
+ umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ _("unsupported chr device type %d"), def->type);
+ break;
+ }
+
+ return ret;
+}
+
+/*
+ * Constructs a argv suitable for launching uml with config defined
+ * for a given virtual machine.
+ */
+int umlBuildCommandLine(virConnectPtr conn,
+ struct uml_driver *driver ATTRIBUTE_UNUSED,
+ virDomainObjPtr vm,
+ const char ***retargv,
+ const char ***retenv,
+ int **tapfds,
+ int *ntapfds) {
+ int i, j;
+ char memory[50];
+ struct utsname ut;
+ int qargc = 0, qarga = 0;
+ const char **qargv = NULL;
+ int qenvc = 0, qenva = 0;
+ const char **qenv = NULL;
+
+ uname(&ut);
+
+#define ADD_ARG_SPACE \
+ do { \
+ if (qargc == qarga) { \
+ qarga += 10; \
+ if (VIR_REALLOC_N(qargv, qarga) < 0) \
+ goto no_memory; \
+ } \
+ } while (0)
+
+#define ADD_ARG(thisarg) \
+ do { \
+ ADD_ARG_SPACE; \
+ qargv[qargc++] = thisarg; \
+ } while (0)
+
+#define ADD_ARG_LIT(thisarg) \
+ do { \
+ ADD_ARG_SPACE; \
+ if ((qargv[qargc++] = strdup(thisarg)) == NULL) \
+ goto no_memory; \
+ } while (0)
+
+#define ADD_ARG_PAIR(key,val) \
+ do { \
+ char *arg; \
+ ADD_ARG_SPACE; \
+ if (asprintf(&arg, "%s=%s", key, val) < 0) \
+ goto no_memory; \
+ qargv[qargc++] = arg; \
+ } while (0)
+
+
+#define ADD_ENV_SPACE \
+ do { \
+ if (qenvc == qenva) { \
+ qenva += 10; \
+ if (VIR_REALLOC_N(qenv, qenva) < 0) \
+ goto no_memory; \
+ } \
+ } while (0)
+
+#define ADD_ENV(thisarg) \
+ do { \
+ ADD_ENV_SPACE; \
+ qenv[qenvc++] = thisarg; \
+ } while (0)
+
+#define ADD_ENV_LIT(thisarg) \
+ do { \
+ ADD_ENV_SPACE; \
+ if ((qenv[qenvc++] = strdup(thisarg)) == NULL) \
+ goto no_memory; \
+ } while (0)
+
+#define ADD_ENV_COPY(envname) \
+ do { \
+ char *val = getenv(envname); \
+ char *envval; \
+ ADD_ENV_SPACE; \
+ if (val != NULL) { \
+ if (asprintf(&envval, "%s=%s", envname, val) < 0) \
+ goto no_memory; \
+ qenv[qenvc++] = envval; \
+ } \
+ } while (0)
+
+ snprintf(memory, sizeof(memory), "%luK", vm->def->memory);
+
+ ADD_ENV_LIT("LC_ALL=C");
+
+ ADD_ENV_COPY("LD_PRELOAD");
+ ADD_ENV_COPY("LD_LIBRARY_PATH");
+ ADD_ENV_COPY("PATH");
+ ADD_ENV_COPY("HOME");
+ ADD_ENV_COPY("USER");
+ ADD_ENV_COPY("LOGNAME");
+ ADD_ENV_COPY("TMPDIR");
+
+ ADD_ARG_LIT(vm->def->os.kernel);
+ //ADD_ARG_PAIR("con0", "fd:0,fd:1");
+ ADD_ARG_PAIR("mem", memory);
+ ADD_ARG_PAIR("umid", vm->def->name);
+
+ if (vm->def->os.root)
+ ADD_ARG_PAIR("root", vm->def->os.root);
+
+ for (i = 0 ; i < vm->def->ndisks ; i++) {
+ virDomainDiskDefPtr disk = vm->def->disks[i];
+
+ if (!STRPREFIX(disk->dst, "ubd")) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ _("unsupported disk type '%s'"), disk->dst);
+ goto error;
+ }
+
+ ADD_ARG_PAIR(disk->dst, disk->src);
+ }
+
+ for (i = 0 ; i < 16 ; i++) {
+ char *ret;
+ if (i == 0 && vm->def->console)
+ ret = umlBuildCommandLineChr(conn, vm->def->console, "con");
+ else
+ if (asprintf(&ret, "con%d=none", i) < 0)
+ goto no_memory;
+ ADD_ARG(ret);
+ }
+
+ for (i = 0 ; i < 16 ; i++) {
+ virDomainChrDefPtr chr = NULL;
+ char *ret;
+ for (j = 0 ; j < vm->def->nserials ; j++)
+ if (vm->def->serials[j]->dstPort == i)
+ chr = vm->def->serials[j];
+ if (chr)
+ ret = umlBuildCommandLineChr(conn, chr, "ssl");
+ else
+ if (asprintf(&ret, "ssl%d=none", i) < 0)
+ goto no_memory;
+ ADD_ARG(ret);
+ }
+
+ ADD_ARG(NULL);
+ ADD_ENV(NULL);
+
+ *retargv = qargv;
+ *retenv = qenv;
+ return 0;
+
+ no_memory:
+ umlReportError(conn, NULL, NULL, VIR_ERR_NO_MEMORY,
+ "%s", _("failed to allocate space for argv string"));
+ error:
+ if (tapfds &&
+ *tapfds) {
+ for (i = 0; i < *ntapfds; i++)
+ close((*tapfds)[i]);
+ VIR_FREE(*tapfds);
+ *ntapfds = 0;
+ }
+ if (qargv) {
+ for (i = 0 ; i < qargc ; i++)
+ VIR_FREE((qargv)[i]);
+ VIR_FREE(qargv);
+ }
+ if (qenv) {
+ for (i = 0 ; i < qenvc ; i++)
+ VIR_FREE((qenv)[i]);
+ VIR_FREE(qenv);
+ }
+ return -1;
+
+#undef ADD_ARG
+#undef ADD_ARG_LIT
+#undef ADD_ARG_SPACE
+#undef ADD_USBDISK
+#undef ADD_ENV
+#undef ADD_ENV_COPY
+#undef ADD_ENV_LIT
+#undef ADD_ENV_SPACE
+}
diff --git a/src/uml_conf.h b/src/uml_conf.h
new file mode 100644
--- /dev/null
+++ b/src/uml_conf.h
@@ -0,0 +1,72 @@
+/*
+ * config.h: VM configuration management
+ *
+ * Copyright (C) 2006, 2007 Red Hat, Inc.
+ * Copyright (C) 2006 Daniel P. Berrange
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Author: Daniel P. Berrange <berrange(a)redhat.com>
+ */
+
+#ifndef __UML_CONF_H
+#define __UML_CONF_H
+
+#include <config.h>
+
+#include "internal.h"
+#include "bridge.h"
+#include "capabilities.h"
+#include "network_conf.h"
+#include "domain_conf.h"
+
+#define umlDebug(fmt, ...) do {} while(0)
+
+#define UML_CPUMASK_LEN CPU_SETSIZE
+
+/* Main driver state */
+struct uml_driver {
+ unsigned int umlVersion;
+ int nextvmid;
+
+ virDomainObjList domains;
+
+ brControl *brctl;
+ char *configDir;
+ char *autostartDir;
+ char *logDir;
+ char *monitorDir;
+
+ int inotifyFD;
+
+ virCapsPtr caps;
+};
+
+
+#define umlReportError(conn, dom, net, code, fmt...) \
+ __virReportErrorHelper(conn, VIR_FROM_UML, code, __FILE__, \
+ __FUNCTION__, __LINE__, fmt)
+
+virCapsPtr umlCapsInit (void);
+
+int umlBuildCommandLine (virConnectPtr conn,
+ struct uml_driver *driver,
+ virDomainObjPtr dom,
+ const char ***retargv,
+ const char ***retenv,
+ int **tapfds,
+ int *ntapfds);
+
+#endif /* __UML_CONF_H */
diff --git a/src/uml_driver.c b/src/uml_driver.c
new file mode 100644
--- /dev/null
+++ b/src/uml_driver.c
@@ -0,0 +1,1771 @@
+/*
+ * driver.c: core driver methods for managing qemu guests
+ *
+ * Copyright (C) 2006, 2007, 2008 Red Hat, Inc.
+ * Copyright (C) 2006-2008 Daniel P. Berrange
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Author: Daniel P. Berrange <berrange(a)redhat.com>
+ */
+
+#include <config.h>
+
+#include <sys/types.h>
+#include <sys/poll.h>
+#include <dirent.h>
+#include <limits.h>
+#include <string.h>
+#include <stdio.h>
+#include <strings.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <errno.h>
+#include <sys/utsname.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <paths.h>
+#include <pwd.h>
+#include <stdio.h>
+#include <sys/wait.h>
+#include <sys/ioctl.h>
+#include <sys/inotify.h>
+
+#if HAVE_NUMACTL
+#include <numa.h>
+#endif
+
+#include "uml_driver.h"
+#include "uml_conf.h"
+#include "c-ctype.h"
+#include "event.h"
+#include "buf.h"
+#include "util.h"
+#include "nodeinfo.h"
+#include "stats_linux.h"
+#include "capabilities.h"
+#include "memory.h"
+#include "uuid.h"
+#include "domain_conf.h"
+
+/* For storing short-lived temporary files. */
+#define TEMPDIR LOCAL_STATE_DIR "/cache/libvirt"
+
+static int umlShutdown(void);
+
+/* umlDebug statements should be changed to use this macro instead. */
+#define DEBUG(fmt,...) VIR_DEBUG(__FILE__, fmt, __VA_ARGS__)
+#define DEBUG0(msg) VIR_DEBUG(__FILE__, "%s", msg)
+
+#define umlLog(level, msg...) fprintf(stderr, msg)
+
+
+static int umlOpenMonitor(virConnectPtr conn,
+ struct uml_driver *driver,
+ virDomainObjPtr vm);
+static int umlReadPidFile(virConnectPtr conn,
+ struct uml_driver *driver,
+ virDomainObjPtr vm);
+
+static int umlSetCloseExec(int fd) {
+ int flags;
+ if ((flags = fcntl(fd, F_GETFD)) < 0)
+ goto error;
+ flags |= FD_CLOEXEC;
+ if ((fcntl(fd, F_SETFD, flags)) < 0)
+ goto error;
+ return 0;
+ error:
+ umlLog(UML_ERR,
+ "%s", _("Failed to set close-on-exec file descriptor flag\n"));
+ return -1;
+}
+
+#if 0
+static int umlSetNonBlock(int fd) {
+ int flags;
+ if ((flags = fcntl(fd, F_GETFL)) < 0)
+ goto error;
+ flags |= O_NONBLOCK;
+ if ((fcntl(fd, F_SETFL, flags)) < 0)
+ goto error;
+ return 0;
+ error:
+ umlLog(UML_ERR,
+ "%s", _("Failed to set non-blocking file descriptor flag\n"));
+ return -1;
+}
+#endif
+
+static int umlStartVMDaemon(virConnectPtr conn,
+ struct uml_driver *driver,
+ virDomainObjPtr vm);
+
+static void umlShutdownVMDaemon(virConnectPtr conn,
+ struct uml_driver *driver,
+ virDomainObjPtr vm);
+
+
+static int umlMonitorCommand (virConnectPtr conn,
+ const struct uml_driver *driver,
+ const virDomainObjPtr vm,
+ const char *cmd,
+ char **reply);
+
+static struct uml_driver *uml_driver = NULL;
+
+
+static void
+umlAutostartConfigs(struct uml_driver *driver) {
+ unsigned int i;
+
+ for (i = 0 ; i < driver->domains.count ; i++) {
+ if (driver->domains.objs[i]->autostart &&
+ !virDomainIsActive(driver->domains.objs[i]) &&
+ umlStartVMDaemon(NULL, driver, driver->domains.objs[i]) < 0) {
+ virErrorPtr err = virGetLastError();
+ umlLog(UML_ERR, _("Failed to autostart VM '%s': %s\n"),
+ driver->domains.objs[i]->def->name, err->message);
+ }
+ }
+}
+
+
+static int
+umlIdentifyOneChrPTY(virConnectPtr conn,
+ struct uml_driver *driver,
+ virDomainObjPtr dom,
+ virDomainChrDefPtr def,
+ const char *dev)
+{
+ char *cmd;
+ char *res = NULL;
+ if (asprintf(&cmd, "config %s%d", dev, def->dstPort) < 0) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_NO_MEMORY, NULL);
+ return -1;
+ }
+ umlMonitorCommand(NULL, driver, dom, cmd, &res);
+ VIR_FREE(cmd);
+
+ if (STRPREFIX(res, "pts:")) {
+ fprintf(stderr, "Got it %s\n", res + 4);
+ VIR_FREE(def->data.file.path);
+ if ((def->data.file.path = strdup(res + 4)) == NULL) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_NO_MEMORY, NULL);
+ VIR_FREE(res);
+ return -1;
+ }
+ }
+ VIR_FREE(res);
+ return 0;
+}
+
+static int
+umlIdentifyChrPTY(virConnectPtr conn,
+ struct uml_driver *driver,
+ virDomainObjPtr dom)
+{
+ int i;
+
+ if (dom->def->console &&
+ dom->def->console->type == VIR_DOMAIN_CHR_TYPE_PTY)
+ if (umlIdentifyOneChrPTY(conn, driver, dom,
+ dom->def->console, "con") < 0)
+ return -1;
+
+ for (i = 0 ; i < dom->def->nserials; i++)
+ if (dom->def->serials[i]->type == VIR_DOMAIN_CHR_TYPE_PTY &&
+ umlIdentifyOneChrPTY(conn, driver, dom,
+ dom->def->serials[i], "ssl") < 0)
+ return -1;
+
+ return 0;
+}
+
+static void
+umlInotifyEvent(int fd,
+ int events ATTRIBUTE_UNUSED,
+ void *data)
+{
+ char buf[1024];
+ struct inotify_event *e;
+ int got;
+ char *tmp, *name;
+ struct uml_driver *driver = data;
+ virDomainObjPtr dom;
+
+ umlLog(UML_INFO, _("got inotify event\n"));
+
+reread:
+ got = read(fd, buf, sizeof(buf));
+ if (got == -1) {
+ if (errno == EINTR)
+ goto reread;
+ return;
+ }
+
+ tmp = buf;
+ while (got) {
+ if (got < sizeof(struct inotify_event))
+ return; /* bad */
+
+ e = (struct inotify_event *)tmp;
+ tmp += sizeof(struct inotify_event);
+ got -= sizeof(struct inotify_event);
+
+ if (got < e->len)
+ return;
+
+ tmp += e->len;
+ got -= e->len;
+
+ name = (char *)&(e->name);
+
+ dom = virDomainFindByName(&driver->domains, name);
+
+ if (!dom) {
+ umlLog (UML_ERR, _("cannot find domain '%s'\n"), name);
+ continue;
+ }
+
+ if (e->mask & IN_DELETE) {
+ umlLog (UML_INFO, _("got delete event %s\n"), name);
+ if (!virDomainIsActive(dom)) {
+ umlLog (UML_ERR, _("domain '%s' not active\n"),
+ name);
+ continue;
+ }
+
+ dom->def->id = -1;
+ dom->pid = -1;
+ if (dom->newDef) {
+ virDomainDefFree(dom->def);
+ dom->def = dom->newDef;
+ }
+ dom->state = VIR_DOMAIN_SHUTOFF;
+ } else if (e->mask & (IN_CREATE | IN_MODIFY)) {
+ umlLog (UML_INFO, _("got create/change event '%s'\n"), name);
+ if (virDomainIsActive(dom)) {
+ umlLog (UML_ERR, _("domain '%s' already active as pid %d\n"),
+ name, dom->pid);
+ continue;
+ }
+
+ if (umlReadPidFile(NULL, driver, dom) < 0) {
+ umlLog (UML_ERR, _("cannot read PID for domain '%s'\n"), name);
+ continue;
+ }
+ umlLog (UML_INFO, _("started domain '%s'"), name);
+ dom->def->id = driver->nextvmid++;
+ dom->state = VIR_DOMAIN_RUNNING;
+
+ if (umlOpenMonitor(NULL, driver, dom) < 0)
+ umlShutdownVMDaemon(NULL, driver, dom);
+
+ if (umlIdentifyChrPTY(NULL, driver, dom) < 0)
+ umlShutdownVMDaemon(NULL, driver, dom);
+ }
+ }
+}
+
+/**
+ * umlStartup:
+ *
+ * Initialization function for the Uml daemon
+ */
+static int
+umlStartup(void) {
+ uid_t uid = geteuid();
+ struct passwd *pw;
+ char *base = NULL;
+ char driverConf[PATH_MAX];
+
+ if (VIR_ALLOC(uml_driver) < 0)
+ return -1;
+
+ /* Don't have a dom0 so start from 1 */
+ uml_driver->nextvmid = 1;
+
+ if (!(pw = getpwuid(uid))) {
+ umlLog(UML_ERR, _("Failed to find user record for uid '%d': %s\n"),
+ uid, strerror(errno));
+ goto out_nouid;
+ }
+
+ if (!uid) {
+ if (asprintf(¨_driver->logDir,
+ "%s/log/libvirt/uml", LOCAL_STATE_DIR) == -1)
+ goto out_of_memory;
+
+ if ((base = strdup (SYSCONF_DIR "/libvirt")) == NULL)
+ goto out_of_memory;
+ } else {
+ if (asprintf(¨_driver->logDir,
+ "%s/.libvirt/uml/log", pw->pw_dir) == -1)
+ goto out_of_memory;
+
+ if (asprintf (&base, "%s/.libvirt", pw->pw_dir) == -1)
+ goto out_of_memory;
+ }
+
+ if (asprintf (¨_driver->monitorDir,
+ "%s/.uml", pw->pw_dir) == -1)
+ goto out_of_memory;
+
+ /* Configuration paths are either ~/.libvirt/uml/... (session) or
+ * /etc/libvirt/uml/... (system).
+ */
+ if (snprintf (driverConf, sizeof(driverConf), "%s/uml.conf", base) == -1)
+ goto out_of_memory;
+ driverConf[sizeof(driverConf)-1] = '\0';
+
+ if (asprintf (¨_driver->configDir, "%s/uml", base) == -1)
+ goto out_of_memory;
+
+ if (asprintf (¨_driver->autostartDir, "%s/uml/autostart", base) == -1)
+ goto out_of_memory;
+
+ VIR_FREE(base);
+
+ if ((uml_driver->caps = umlCapsInit()) == NULL)
+ goto out_of_memory;
+
+ if ((uml_driver->inotifyFD = inotify_init()) < 0) {
+ umlLog(UML_ERR, "%s", _("cannot initialize inotify"));
+ goto out_nouid;
+ }
+
+ if (inotify_add_watch(uml_driver->inotifyFD,
+ uml_driver->monitorDir,
+ IN_CREATE | IN_MODIFY | IN_DELETE) < 0) {
+ umlLog(UML_ERR, _("cannot add watch on %s"),
+ uml_driver->monitorDir);
+ umlShutdown();
+ return -1;
+ }
+
+ if (virEventAddHandle(uml_driver->inotifyFD, POLLIN,
+ umlInotifyEvent, uml_driver) < 0) {
+ umlShutdown();
+ return -1;
+ }
+
+ if (virDomainLoadAllConfigs(NULL,
+ uml_driver->caps,
+ ¨_driver->domains,
+ uml_driver->configDir,
+ uml_driver->autostartDir) < 0) {
+ umlShutdown();
+ return -1;
+ }
+ umlAutostartConfigs(uml_driver);
+
+ return 0;
+
+ out_of_memory:
+ umlLog (UML_ERR,
+ "%s", _("umlStartup: out of memory\n"));
+ out_nouid:
+ VIR_FREE(base);
+ VIR_FREE(uml_driver);
+ return -1;
+}
+
+/**
+ * umlReload:
+ *
+ * Function to restart the Uml daemon, it will recheck the configuration
+ * files and update its state and the networking
+ */
+static int
+umlReload(void) {
+ if (!uml_driver)
+ return 0;
+
+ virDomainLoadAllConfigs(NULL,
+ uml_driver->caps,
+ ¨_driver->domains,
+ uml_driver->configDir,
+ uml_driver->autostartDir);
+
+ umlAutostartConfigs(uml_driver);
+
+ return 0;
+}
+
+/**
+ * umlActive:
+ *
+ * Checks if the Uml daemon is active, i.e. has an active domain or
+ * an active network
+ *
+ * Returns 1 if active, 0 otherwise
+ */
+static int
+umlActive(void) {
+ unsigned int i;
+
+ if (!uml_driver)
+ return 0;
+
+ for (i = 0 ; i < uml_driver->domains.count ; i++)
+ if (virDomainIsActive(uml_driver->domains.objs[i]))
+ return 1;
+
+ /* Otherwise we're happy to deal with a shutdown */
+ return 0;
+}
+
+/**
+ * umlShutdown:
+ *
+ * Shutdown the Uml daemon, it will stop all active domains and networks
+ */
+static int
+umlShutdown(void) {
+ unsigned int i;
+
+ if (!uml_driver)
+ return -1;
+
+ virEventRemoveHandle(uml_driver->inotifyFD);
+ close(uml_driver->inotifyFD);
+ virCapabilitiesFree(uml_driver->caps);
+
+ /* shutdown active VMs */
+ for (i = 0 ; i < uml_driver->domains.count ; i++) {
+ virDomainObjPtr dom = uml_driver->domains.objs[i];
+ if (virDomainIsActive(dom))
+ umlShutdownVMDaemon(NULL, uml_driver, dom);
+ if (!dom->persistent)
+ virDomainRemoveInactive(¨_driver->domains,
+ dom);
+ }
+
+ virDomainObjListFree(¨_driver->domains);
+
+ VIR_FREE(uml_driver->logDir);
+ VIR_FREE(uml_driver->configDir);
+ VIR_FREE(uml_driver->autostartDir);
+ VIR_FREE(uml_driver->monitorDir);
+
+ if (uml_driver->brctl)
+ brShutdown(uml_driver->brctl);
+
+ VIR_FREE(uml_driver);
+
+ return 0;
+}
+
+
+static int umlReadPidFile(virConnectPtr conn,
+ struct uml_driver *driver,
+ virDomainObjPtr vm)
+{
+ int rc = -1;
+ FILE *file;
+ char *pidfile = NULL;
+ int retries = 0;
+
+ vm->pid = -1;
+ if (asprintf(&pidfile, "%s/%s/pid",
+ driver->monitorDir, vm->def->name) < 0) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_NO_MEMORY, NULL);
+ return -1;
+ }
+
+reopen:
+ if (!(file = fopen(pidfile, "r"))) {
+ if (errno == ENOENT &&
+ retries++ < 50) {
+ usleep(1000 * 100);
+ goto reopen;
+ }
+ goto cleanup;
+ }
+
+ if (fscanf(file, "%d", &vm->pid) != 1) {
+ errno = EINVAL;
+ goto cleanup;
+ }
+
+ if (fclose(file) < 0)
+ goto cleanup;
+
+ rc = 0;
+
+ umlLog(UML_INFO, "got UML pid %d\n", vm->pid);
+ cleanup:
+ if (rc != 0)
+ umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ _("failed to read pid: %s: %s"),
+ pidfile, strerror(errno));
+ VIR_FREE(pidfile);
+ return rc;
+}
+
+static int umlMonitorAddress(virConnectPtr conn,
+ const struct uml_driver *driver,
+ virDomainObjPtr vm,
+ struct sockaddr_un *addr) {
+ char *sockname;
+
+ if (asprintf(&sockname, "%s/%s/mconsole",
+ driver->monitorDir, vm->def->name) < 0) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_NO_MEMORY, NULL);
+ return -1;
+ }
+
+ memset(addr, 0, sizeof *addr);
+ addr->sun_family = AF_UNIX;
+ strncpy(addr->sun_path, sockname, sizeof(addr->sun_path)-1);
+ NUL_TERMINATE(addr->sun_path);
+ VIR_FREE(sockname);
+ return 0;
+}
+
+static int umlOpenMonitor(virConnectPtr conn,
+ struct uml_driver *driver,
+ virDomainObjPtr vm) {
+ struct sockaddr_un addr;
+ struct stat sb;
+ int retries = 0;
+
+ if (umlMonitorAddress(conn, driver, vm, &addr) < 0)
+ return -1;
+
+restat:
+ if (stat(addr.sun_path, &sb) < 0) {
+ if (errno == ENOENT &&
+ retries < 50) {
+ usleep(1000 * 100);
+ goto restat;
+ }
+ return -1;
+ }
+
+ if ((vm->monitor = socket(PF_UNIX, SOCK_DGRAM, 0)) < 0) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ _("cannot open socket %s"), strerror(errno));
+ return -1;
+ }
+
+ memset(addr.sun_path, 0, sizeof addr.sun_path);
+ sprintf(addr.sun_path + 1, "%u", getpid());
+ if (bind(vm->monitor, (struct sockaddr *)&addr, sizeof addr) < 0) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ _("cannot bind socket %s"), strerror(errno));
+ close(vm->monitor);
+ vm->monitor = -1;
+ return -1;
+ }
+
+ return 0;
+}
+
+
+#define MONITOR_MAGIC 0xcafebabe
+#define MONITOR_BUFLEN 512
+#define MONITOR_VERSION 2
+
+struct monitor_request {
+ uint32_t magic;
+ uint32_t version;
+ uint32_t length;
+ char data[MONITOR_BUFLEN];
+};
+
+struct monitor_response {
+ uint32_t error;
+ uint32_t extra;
+ uint32_t length;
+ char data[MONITOR_BUFLEN];
+};
+
+
+static int umlMonitorCommand(virConnectPtr conn,
+ const struct uml_driver *driver,
+ const virDomainObjPtr vm,
+ const char *cmd,
+ char **reply)
+{
+ struct monitor_request req;
+ struct monitor_response res;
+ char *retdata = NULL;
+ int retlen = 0, ret = 0;
+ struct sockaddr_un addr;
+ unsigned int addrlen;
+
+ *reply = NULL;
+
+ if (umlMonitorAddress(conn, driver, vm, &addr) < 0)
+ return -1;
+
+ memset(&req, 0, sizeof(req));
+ req.magic = MONITOR_MAGIC;
+ req.version = MONITOR_VERSION;
+ req.length = strlen(cmd);
+ if (req.length > (MONITOR_BUFLEN-1)) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ _("cannot send too long command %s: %s"),
+ cmd, strerror(EINVAL));
+ return -1;
+ }
+ strncpy(req.data, cmd, req.length);
+ req.data[req.length] = '\0';
+
+ if (sendto(vm->monitor, &req, sizeof req, 0,
+ (struct sockaddr *)&addr, sizeof addr) != (sizeof req)) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ _("cannot send command %s: %s"),
+ cmd, strerror(errno));
+ return -1;
+ }
+
+ do {
+ addrlen = sizeof(addr);
+ if (recvfrom(vm->monitor, &res, sizeof res, 0,
+ (struct sockaddr *)&addr, &addrlen) < 0) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ _("cannot read reply %s: %s"),
+ cmd, strerror(errno));
+ goto error;
+ }
+
+ if (VIR_REALLOC_N(retdata, retlen + res.length) < 0) {
+ umlReportError(conn, NULL, NULL,
+ VIR_ERR_NO_MEMORY, NULL);
+ goto error;
+ }
+ memcpy(retdata + retlen, res.data, res.length);
+ retlen += res.length - 1;
+ retdata[retlen] = '\0';
+
+ if (res.error)
+ ret = -1;
+
+ } while (res.extra);
+
+ *reply = retdata;
+
+ return ret;
+
+error:
+ VIR_FREE(retdata);
+ return -1;
+}
+
+
+static int umlStartVMDaemon(virConnectPtr conn,
+ struct uml_driver *driver,
+ virDomainObjPtr vm) {
+ const char **argv = NULL, **tmp;
+ const char **progenv = NULL;
+ int i, ret, pid;
+ char *logfile;
+ int logfd = -1;
+ struct stat sb;
+ int *tapfds = NULL;
+ int ntapfds = 0;
+ fd_set keepfd;
+
+ FD_ZERO(&keepfd);
+
+ if (virDomainIsActive(vm)) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("VM is already active"));
+ return -1;
+ }
+
+ if (!vm->def->os.kernel) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("no kernel specified"));
+ return -1;
+ }
+ /* Make sure the binary we are about to try exec'ing exists.
+ * Technically we could catch the exec() failure, but that's
+ * in a sub-process so its hard to feed back a useful error
+ */
+ if (stat(vm->def->os.kernel, &sb) < 0) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ _("Cannot find UML kernel %s: %s"),
+ vm->def->os.kernel, strerror(errno));
+ return -1;
+ }
+
+ if (virFileMakePath(driver->logDir) < 0) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ _("cannot create log directory %s"),
+ driver->logDir);
+ return -1;
+ }
+
+ if (asprintf(&logfile, "%s/%s.log",
+ driver->logDir, vm->def->name) < 0) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_NO_MEMORY, NULL);
+ return -1;
+ }
+
+ if ((logfd = open(logfile, O_CREAT | O_TRUNC | O_WRONLY,
+ S_IRUSR | S_IWUSR)) < 0) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ _("failed to create logfile %s: %s"),
+ logfile, strerror(errno));
+ VIR_FREE(logfile);
+ return -1;
+ }
+ VIR_FREE(logfile);
+
+ if (umlSetCloseExec(logfd) < 0) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ _("Unable to set VM logfile close-on-exec flag %s"),
+ strerror(errno));
+ close(logfd);
+ return -1;
+ }
+
+ if (umlBuildCommandLine(conn, driver, vm,
+ &argv, &progenv,
+ &tapfds, &ntapfds) < 0) {
+ close(logfd);
+ return -1;
+ }
+
+ tmp = progenv;
+ while (*tmp) {
+ if (safewrite(logfd, *tmp, strlen(*tmp)) < 0)
+ umlLog(UML_WARN, _("Unable to write envv to logfile %d: %s\n"),
+ errno, strerror(errno));
+ if (safewrite(logfd, " ", 1) < 0)
+ umlLog(UML_WARN, _("Unable to write envv to logfile %d: %s\n"),
+ errno, strerror(errno));
+ tmp++;
+ }
+ tmp = argv;
+ while (*tmp) {
+ if (safewrite(logfd, *tmp, strlen(*tmp)) < 0)
+ umlLog(UML_WARN, _("Unable to write argv to logfile %d: %s\n"),
+ errno, strerror(errno));
+ if (safewrite(logfd, " ", 1) < 0)
+ umlLog(UML_WARN, _("Unable to write argv to logfile %d: %s\n"),
+ errno, strerror(errno));
+ tmp++;
+ }
+ if (safewrite(logfd, "\n", 1) < 0)
+ umlLog(UML_WARN, _("Unable to write argv to logfile %d: %s\n"),
+ errno, strerror(errno));
+
+ vm->monitor = -1;
+ vm->stdin_fd = -1;
+ vm->stdout_fd = vm->stderr_fd = logfd;
+
+ for (i = 0 ; i < ntapfds ; i++)
+ FD_SET(tapfds[i], &keepfd);
+
+ ret = virExec(conn, argv, progenv, &keepfd, &pid,
+ vm->stdin_fd, &vm->stdout_fd, &vm->stderr_fd,
+ VIR_EXEC_DAEMON);
+ close(logfd);
+
+ /* Cleanup intermediate proces */
+ if (waitpid(pid, NULL, 0) != pid)
+ umlLog(UML_WARN, _("failed to wait on process: %d: %s\n"),
+ pid, strerror(errno));
+
+ for (i = 0 ; argv[i] ; i++)
+ VIR_FREE(argv[i]);
+ VIR_FREE(argv);
+
+ for (i = 0 ; progenv[i] ; i++)
+ VIR_FREE(progenv[i]);
+ VIR_FREE(progenv);
+
+ if (tapfds) {
+ for (i = 0 ; i < ntapfds ; i++) {
+ close(tapfds[i]);
+ }
+ VIR_FREE(tapfds);
+ }
+
+ /* NB we don't mark it running here - we do that async
+ with inotify */
+
+ return ret;
+}
+
+static void umlShutdownVMDaemon(virConnectPtr conn ATTRIBUTE_UNUSED,
+ struct uml_driver *driver ATTRIBUTE_UNUSED,
+ virDomainObjPtr vm)
+{
+ int ret;
+ if (!virDomainIsActive(vm) ||
+ vm->pid <= 1)
+ return;
+
+ umlLog(UML_INFO, _("Shutting down VM '%d' '%s'\n"),
+ vm->pid, vm->def->name);
+
+ kill(vm->pid, SIGTERM);
+
+ if (vm->monitor != -1)
+ close(vm->monitor);
+ vm->monitor = -1;
+
+ if ((ret = waitpid(vm->pid, NULL, 0)) != vm->pid) {
+ umlLog(UML_WARN,
+ _("Got unexpected pid %d != %d\n"),
+ ret, vm->pid);
+ }
+
+ vm->pid = -1;
+ vm->def->id = -1;
+ vm->state = VIR_DOMAIN_SHUTOFF;
+ VIR_FREE(vm->vcpupids);
+ vm->nvcpupids = 0;
+
+ if (vm->newDef) {
+ virDomainDefFree(vm->def);
+ vm->def = vm->newDef;
+ vm->def->id = -1;
+ vm->newDef = NULL;
+ }
+}
+
+
+
+/**
+ * umlProbe:
+ *
+ * Probe for the availability of the uml driver, assume the
+ * presence of Uml emulation if the binaries are installed
+ */
+static const char *umlProbe(void)
+{
+ if (!access("/usr/bin/uml_mconsole", R_OK | X_OK))
+ return NULL;
+
+ if (getuid() == 0) {
+ return("uml:///system");
+ } else {
+ return("uml:///session");
+ }
+}
+
+static virDrvOpenStatus umlOpen(virConnectPtr conn,
+ xmlURIPtr uri,
+ virConnectAuthPtr auth ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED) {
+ uid_t uid = getuid();
+
+ if (uml_driver == NULL)
+ goto decline;
+
+ if (uri == NULL || uri->scheme == NULL || uri->path == NULL)
+ goto decline;
+
+ if (STRNEQ (uri->scheme, "uml"))
+ goto decline;
+
+ if (uid != 0) {
+ if (STRNEQ (uri->path, "/session"))
+ goto decline;
+ } else { /* root */
+ if (STRNEQ (uri->path, "/system") &&
+ STRNEQ (uri->path, "/session"))
+ goto decline;
+ }
+
+ conn->privateData = uml_driver;
+
+ return VIR_DRV_OPEN_SUCCESS;
+
+ decline:
+ return VIR_DRV_OPEN_DECLINED;
+}
+
+static int umlClose(virConnectPtr conn) {
+ /*struct uml_driver *driver = (struct uml_driver *)conn->privateData;*/
+
+ conn->privateData = NULL;
+
+ return 0;
+}
+
+static const char *umlGetType(virConnectPtr conn ATTRIBUTE_UNUSED) {
+ return "UML";
+}
+
+static int umlGetNodeInfo(virConnectPtr conn,
+ virNodeInfoPtr nodeinfo) {
+ return virNodeInfoPopulate(conn, nodeinfo);
+}
+
+
+static char *umlGetCapabilities(virConnectPtr conn) {
+ struct uml_driver *driver = (struct uml_driver *)conn->privateData;
+ char *xml;
+
+ if ((xml = virCapabilitiesFormatXML(driver->caps)) == NULL) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_NO_MEMORY,
+ "%s", _("failed to allocate space for capabilities support"));
+ return NULL;
+ }
+
+ return xml;
+}
+
+
+#if HAVE_NUMACTL
+static int
+umlNodeGetCellsFreeMemory(virConnectPtr conn,
+ unsigned long long *freeMems,
+ int startCell,
+ int maxCells)
+{
+ int n, lastCell, numCells;
+
+ if (numa_available() < 0) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_NO_SUPPORT,
+ "%s", _("NUMA not supported on this host"));
+ return -1;
+ }
+ lastCell = startCell + maxCells - 1;
+ if (lastCell > numa_max_node())
+ lastCell = numa_max_node();
+
+ for (numCells = 0, n = startCell ; n <= lastCell ; n++) {
+ long long mem;
+ if (numa_node_size64(n, &mem) < 0) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Failed to query NUMA free memory"));
+ return -1;
+ }
+ freeMems[numCells++] = mem;
+ }
+ return numCells;
+}
+
+static unsigned long long
+umlNodeGetFreeMemory (virConnectPtr conn)
+{
+ unsigned long long freeMem = 0;
+ int n;
+ if (numa_available() < 0) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_NO_SUPPORT,
+ "%s", _("NUMA not supported on this host"));
+ return -1;
+ }
+
+ for (n = 0 ; n <= numa_max_node() ; n++) {
+ long long mem;
+ if (numa_node_size64(n, &mem) < 0) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("Failed to query NUMA free memory"));
+ return -1;
+ }
+ freeMem += mem;
+ }
+
+ return freeMem;
+}
+
+#endif
+
+static int umlGetProcessInfo(unsigned long long *cpuTime, int pid) {
+ char proc[PATH_MAX];
+ FILE *pidinfo;
+ unsigned long long usertime, systime;
+
+ if (snprintf(proc, sizeof(proc), "/proc/%d/stat", pid) >= (int)sizeof(proc)) {
+ return -1;
+ }
+
+ if (!(pidinfo = fopen(proc, "r"))) {
+ /*printf("cannot read pid info");*/
+ /* VM probably shut down, so fake 0 */
+ *cpuTime = 0;
+ return 0;
+ }
+
+ if (fscanf(pidinfo, "%*d %*s %*c %*d %*d %*d %*d %*d %*u %*u %*u %*u %*u %llu %llu", &usertime, &systime) != 2) {
+ umlDebug("not enough arg");
+ return -1;
+ }
+
+ /* We got jiffies
+ * We want nanoseconds
+ * _SC_CLK_TCK is jiffies per second
+ * So calulate thus....
+ */
+ *cpuTime = 1000ull * 1000ull * 1000ull * (usertime + systime) / (unsigned long long)sysconf(_SC_CLK_TCK);
+
+ umlDebug("Got %llu %llu %llu", usertime, systime, *cpuTime);
+
+ fclose(pidinfo);
+
+ return 0;
+}
+
+
+static virDomainPtr umlDomainLookupByID(virConnectPtr conn,
+ int id) {
+ struct uml_driver *driver = (struct uml_driver *)conn->privateData;
+ virDomainObjPtr vm = virDomainFindByID(&driver->domains, id);
+ virDomainPtr dom;
+
+ if (!vm) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_NO_DOMAIN, NULL);
+ return NULL;
+ }
+
+ dom = virGetDomain(conn, vm->def->name, vm->def->uuid);
+ if (dom) dom->id = vm->def->id;
+ return dom;
+}
+static virDomainPtr umlDomainLookupByUUID(virConnectPtr conn,
+ const unsigned char *uuid) {
+ struct uml_driver *driver = (struct uml_driver *)conn->privateData;
+ virDomainObjPtr vm = virDomainFindByUUID(&driver->domains, uuid);
+ virDomainPtr dom;
+
+ if (!vm) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_NO_DOMAIN, NULL);
+ return NULL;
+ }
+
+ dom = virGetDomain(conn, vm->def->name, vm->def->uuid);
+ if (dom) dom->id = vm->def->id;
+ return dom;
+}
+static virDomainPtr umlDomainLookupByName(virConnectPtr conn,
+ const char *name) {
+ struct uml_driver *driver = (struct uml_driver *)conn->privateData;
+ virDomainObjPtr vm = virDomainFindByName(&driver->domains, name);
+ virDomainPtr dom;
+
+ if (!vm) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_NO_DOMAIN, NULL);
+ return NULL;
+ }
+
+ dom = virGetDomain(conn, vm->def->name, vm->def->uuid);
+ if (dom) dom->id = vm->def->id;
+ return dom;
+}
+
+static int umlGetVersion(virConnectPtr conn, unsigned long *version) {
+ struct utsname ut;
+ int major, minor, micro;
+
+ uname(&ut);
+
+ if (sscanf(ut.release, "%u.%u.%u",
+ &major, &minor, µ) != 3) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ _("cannot parse version %s"), ut.release);
+ return -1;
+ }
+
+ *version = uml_driver->umlVersion;
+ return 0;
+}
+
+static char *
+umlGetHostname (virConnectPtr conn)
+{
+ int r;
+ char hostname[HOST_NAME_MAX+1], *str;
+
+ r = gethostname (hostname, HOST_NAME_MAX+1);
+ if (r == -1) {
+ umlReportError (conn, NULL, NULL, VIR_ERR_SYSTEM_ERROR,
+ "%s", strerror (errno));
+ return NULL;
+ }
+ /* Caller frees this string. */
+ str = strdup (hostname);
+ if (str == NULL) {
+ umlReportError (conn, NULL, NULL, VIR_ERR_SYSTEM_ERROR,
+ "%s", strerror (errno));
+ return NULL;
+ }
+ return str;
+}
+
+static int umlListDomains(virConnectPtr conn, int *ids, int nids) {
+ struct uml_driver *driver = (struct uml_driver *)conn->privateData;
+ int got = 0, i;
+
+ for (i = 0 ; i < driver->domains.count && got < nids ; i++)
+ if (virDomainIsActive(driver->domains.objs[i]))
+ ids[got++] = driver->domains.objs[i]->def->id;
+
+ return got;
+}
+static int umlNumDomains(virConnectPtr conn) {
+ struct uml_driver *driver = (struct uml_driver *)conn->privateData;
+ int n = 0, i;
+
+ for (i = 0 ; i < driver->domains.count ; i++)
+ if (virDomainIsActive(driver->domains.objs[i]))
+ n++;
+
+ return n;
+}
+static virDomainPtr umlDomainCreate(virConnectPtr conn, const char *xml,
+ unsigned int flags ATTRIBUTE_UNUSED) {
+ virDomainDefPtr def;
+ virDomainObjPtr vm;
+ virDomainPtr dom;
+ struct uml_driver *driver = (struct uml_driver *)conn->privateData;
+
+ if (!(def = virDomainDefParseString(conn, driver->caps, xml)))
+ return NULL;
+
+ vm = virDomainFindByName(&driver->domains, def->name);
+ if (vm) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_OPERATION_FAILED,
+ _("domain '%s' is already defined"),
+ def->name);
+ virDomainDefFree(def);
+ return NULL;
+ }
+ vm = virDomainFindByUUID(&driver->domains, def->uuid);
+ if (vm) {
+ char uuidstr[VIR_UUID_STRING_BUFLEN];
+
+ virUUIDFormat(def->uuid, uuidstr);
+ umlReportError(conn, NULL, NULL, VIR_ERR_OPERATION_FAILED,
+ _("domain with uuid '%s' is already defined"),
+ uuidstr);
+ virDomainDefFree(def);
+ return NULL;
+ }
+
+ if (!(vm = virDomainAssignDef(conn,
+ &driver->domains,
+ def))) {
+ virDomainDefFree(def);
+ return NULL;
+ }
+
+ if (umlStartVMDaemon(conn, driver, vm) < 0) {
+ virDomainRemoveInactive(&driver->domains,
+ vm);
+ return NULL;
+ }
+
+ dom = virGetDomain(conn, vm->def->name, vm->def->uuid);
+ if (dom) dom->id = vm->def->id;
+ return dom;
+}
+
+
+static int umlDomainShutdown(virDomainPtr dom) {
+ struct uml_driver *driver = (struct uml_driver *)dom->conn->privateData;
+ virDomainObjPtr vm = virDomainFindByID(&driver->domains, dom->id);
+ char* info;
+
+ if (!vm) {
+ umlReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
+ _("no domain with matching id %d"), dom->id);
+ return -1;
+ }
+
+#if 0
+ if (umlMonitorCommand(driver, vm, "system_powerdown", &info) < 0) {
+ umlReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
+ "%s", _("shutdown operation failed"));
+ return -1;
+ }
+#endif
+ VIR_FREE(info);
+ return 0;
+
+}
+
+
+static int umlDomainDestroy(virDomainPtr dom) {
+ struct uml_driver *driver = (struct uml_driver *)dom->conn->privateData;
+ virDomainObjPtr vm = virDomainFindByID(&driver->domains, dom->id);
+
+ if (!vm) {
+ umlReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
+ _("no domain with matching id %d"), dom->id);
+ return -1;
+ }
+
+ umlShutdownVMDaemon(dom->conn, driver, vm);
+ if (!vm->persistent)
+ virDomainRemoveInactive(&driver->domains,
+ vm);
+
+ return 0;
+}
+
+
+static char *umlDomainGetOSType(virDomainPtr dom) {
+ struct uml_driver *driver = (struct uml_driver *)dom->conn->privateData;
+ virDomainObjPtr vm = virDomainFindByUUID(&driver->domains, dom->uuid);
+ char *type;
+
+ if (!vm) {
+ umlReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
+ "%s", _("no domain with matching uuid"));
+ return NULL;
+ }
+
+ if (!(type = strdup(vm->def->os.type))) {
+ umlReportError(dom->conn, dom, NULL, VIR_ERR_NO_MEMORY,
+ "%s", _("failed to allocate space for ostype"));
+ return NULL;
+ }
+ return type;
+}
+
+/* Returns max memory in kb, 0 if error */
+static unsigned long umlDomainGetMaxMemory(virDomainPtr dom) {
+ struct uml_driver *driver = (struct uml_driver *)dom->conn->privateData;
+ virDomainObjPtr vm = virDomainFindByUUID(&driver->domains, dom->uuid);
+
+ if (!vm) {
+ char uuidstr[VIR_UUID_STRING_BUFLEN];
+
+ virUUIDFormat(dom->uuid, uuidstr);
+ umlReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
+ _("no domain with matching uuid '%s'"), uuidstr);
+ return 0;
+ }
+
+ return vm->def->maxmem;
+}
+
+static int umlDomainSetMaxMemory(virDomainPtr dom, unsigned long newmax) {
+ struct uml_driver *driver = (struct uml_driver *)dom->conn->privateData;
+ virDomainObjPtr vm = virDomainFindByUUID(&driver->domains, dom->uuid);
+
+ if (!vm) {
+ char uuidstr[VIR_UUID_STRING_BUFLEN];
+
+ virUUIDFormat(dom->uuid, uuidstr);
+ umlReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
+ _("no domain with matching uuid '%s'"), uuidstr);
+ return -1;
+ }
+
+ if (newmax < vm->def->memory) {
+ umlReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_ARG,
+ "%s", _("cannot set max memory lower than current memory"));
+ return -1;
+ }
+
+ vm->def->maxmem = newmax;
+ return 0;
+}
+
+static int umlDomainSetMemory(virDomainPtr dom, unsigned long newmem) {
+ struct uml_driver *driver = (struct uml_driver *)dom->conn->privateData;
+ virDomainObjPtr vm = virDomainFindByUUID(&driver->domains, dom->uuid);
+
+ if (!vm) {
+ char uuidstr[VIR_UUID_STRING_BUFLEN];
+
+ virUUIDFormat(dom->uuid, uuidstr);
+ umlReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
+ _("no domain with matching uuid '%s'"), uuidstr);
+ return -1;
+ }
+
+ if (virDomainIsActive(vm)) {
+ umlReportError(dom->conn, dom, NULL, VIR_ERR_NO_SUPPORT,
+ "%s", _("cannot set memory of an active domain"));
+ return -1;
+ }
+
+ if (newmem > vm->def->maxmem) {
+ umlReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_ARG,
+ "%s", _("cannot set memory higher than max memory"));
+ return -1;
+ }
+
+ vm->def->memory = newmem;
+ return 0;
+}
+
+static int umlDomainGetInfo(virDomainPtr dom,
+ virDomainInfoPtr info) {
+ struct uml_driver *driver = (struct uml_driver *)dom->conn->privateData;
+ virDomainObjPtr vm = virDomainFindByUUID(&driver->domains, dom->uuid);
+ if (!vm) {
+ umlReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
+ "%s", _("no domain with matching uuid"));
+ return -1;
+ }
+
+ info->state = vm->state;
+
+ if (!virDomainIsActive(vm)) {
+ info->cpuTime = 0;
+ } else {
+ if (umlGetProcessInfo(&(info->cpuTime), vm->pid) < 0) {
+ umlReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED, ("cannot read cputime for domain"));
+ return -1;
+ }
+ }
+
+ info->maxMem = vm->def->maxmem;
+ info->memory = vm->def->memory;
+ info->nrVirtCpu = vm->def->vcpus;
+ return 0;
+}
+
+#if 0
+static char *umlEscape(const char *in, int shell)
+{
+ int len = 0;
+ int i, j;
+ char *out;
+
+ /* To pass through the UML monitor, we need to use escape
+ sequences: \r, \n, \", \\
+
+ To pass through both UML + the shell, we need to escape
+ the single character ' as the five characters '\\''
+ */
+
+ for (i = 0; in[i] != '\0'; i++) {
+ switch(in[i]) {
+ case '\r':
+ case '\n':
+ case '"':
+ case '\\':
+ len += 2;
+ break;
+ case '\'':
+ if (shell)
+ len += 5;
+ else
+ len += 1;
+ break;
+ default:
+ len += 1;
+ break;
+ }
+ }
+
+ if (VIR_ALLOC_N(out, len + 1) < 0)
+ return NULL;
+
+ for (i = j = 0; in[i] != '\0'; i++) {
+ switch(in[i]) {
+ case '\r':
+ out[j++] = '\\';
+ out[j++] = 'r';
+ break;
+ case '\n':
+ out[j++] = '\\';
+ out[j++] = 'n';
+ break;
+ case '"':
+ case '\\':
+ out[j++] = '\\';
+ out[j++] = in[i];
+ break;
+ case '\'':
+ if (shell) {
+ out[j++] = '\'';
+ out[j++] = '\\';
+ out[j++] = '\\';
+ out[j++] = '\'';
+ out[j++] = '\'';
+ } else {
+ out[j++] = in[i];
+ }
+ break;
+ default:
+ out[j++] = in[i];
+ break;
+ }
+ }
+ out[j] = '\0';
+
+ return out;
+}
+
+static char *umlEscapeMonitorArg(const char *in)
+{
+ return umlEscape(in, 0);
+}
+
+static char *umlEscapeShellArg(const char *in)
+{
+ return umlEscape(in, 1);
+}
+#endif
+
+static char *umlDomainDumpXML(virDomainPtr dom,
+ int flags ATTRIBUTE_UNUSED) {
+ struct uml_driver *driver = (struct uml_driver *)dom->conn->privateData;
+ virDomainObjPtr vm = virDomainFindByUUID(&driver->domains, dom->uuid);
+ if (!vm) {
+ umlReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
+ "%s", _("no domain with matching uuid"));
+ return NULL;
+ }
+
+ return virDomainDefFormat(dom->conn,
+ (flags & VIR_DOMAIN_XML_INACTIVE) && vm->newDef ?
+ vm->newDef : vm->def,
+ flags);
+}
+
+
+static int umlListDefinedDomains(virConnectPtr conn,
+ char **const names, int nnames) {
+ struct uml_driver *driver = (struct uml_driver *)conn->privateData;
+ int got = 0, i;
+
+ for (i = 0 ; i < driver->domains.count && got < nnames ; i++) {
+ if (!virDomainIsActive(driver->domains.objs[i])) {
+ if (!(names[got++] = strdup(driver->domains.objs[i]->def->name))) {
+ umlReportError(conn, NULL, NULL, VIR_ERR_NO_MEMORY,
+ "%s", _("failed to allocate space for VM name string"));
+ goto cleanup;
+ }
+ }
+ }
+
+ return got;
+
+ cleanup:
+ for (i = 0 ; i < got ; i++)
+ VIR_FREE(names[i]);
+ return -1;
+}
+
+static int umlNumDefinedDomains(virConnectPtr conn) {
+ struct uml_driver *driver = (struct uml_driver *)conn->privateData;
+ int n = 0, i;
+
+ for (i = 0 ; i < driver->domains.count ; i++)
+ if (!virDomainIsActive(driver->domains.objs[i]))
+ n++;
+
+ return n;
+}
+
+
+static int umlDomainStart(virDomainPtr dom) {
+ struct uml_driver *driver = (struct uml_driver *)dom->conn->privateData;
+ virDomainObjPtr vm = virDomainFindByUUID(&driver->domains, dom->uuid);
+
+ if (!vm) {
+ umlReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
+ "%s", _("no domain with matching uuid"));
+ return -1;
+ }
+
+ return umlStartVMDaemon(dom->conn, driver, vm);
+}
+
+
+static virDomainPtr umlDomainDefine(virConnectPtr conn, const char *xml) {
+ struct uml_driver *driver = (struct uml_driver *)conn->privateData;
+ virDomainDefPtr def;
+ virDomainObjPtr vm;
+ virDomainPtr dom;
+
+ if (!(def = virDomainDefParseString(conn, driver->caps, xml)))
+ return NULL;
+
+ if (!(vm = virDomainAssignDef(conn,
+ &driver->domains,
+ def))) {
+ virDomainDefFree(def);
+ return NULL;
+ }
+ vm->persistent = 1;
+
+ if (virDomainSaveConfig(conn,
+ driver->configDir,
+ vm->newDef ? vm->newDef : vm->def) < 0) {
+ virDomainRemoveInactive(&driver->domains,
+ vm);
+ return NULL;
+ }
+
+ dom = virGetDomain(conn, vm->def->name, vm->def->uuid);
+ if (dom) dom->id = vm->def->id;
+ return dom;
+}
+
+static int umlDomainUndefine(virDomainPtr dom) {
+ struct uml_driver *driver = (struct uml_driver *)dom->conn->privateData;
+ virDomainObjPtr vm = virDomainFindByUUID(&driver->domains, dom->uuid);
+
+ if (!vm) {
+ umlReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
+ "%s", _("no domain with matching uuid"));
+ return -1;
+ }
+
+ if (virDomainIsActive(vm)) {
+ umlReportError(dom->conn, dom, NULL, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("cannot delete active domain"));
+ return -1;
+ }
+
+ if (!vm->persistent) {
+ umlReportError(dom->conn, dom, NULL, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("cannot undefine transient domain"));
+ return -1;
+ }
+
+ if (virDomainDeleteConfig(dom->conn, driver->configDir, driver->autostartDir, vm) < 0)
+ return -1;
+
+ virDomainRemoveInactive(&driver->domains,
+ vm);
+
+ return 0;
+}
+
+
+
+static int umlDomainGetAutostart(virDomainPtr dom,
+ int *autostart) {
+ struct uml_driver *driver = (struct uml_driver *)dom->conn->privateData;
+ virDomainObjPtr vm = virDomainFindByUUID(&driver->domains, dom->uuid);
+
+ if (!vm) {
+ umlReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
+ "%s", _("no domain with matching uuid"));
+ return -1;
+ }
+
+ *autostart = vm->autostart;
+
+ return 0;
+}
+
+static int umlDomainSetAutostart(virDomainPtr dom,
+ int autostart) {
+ struct uml_driver *driver = (struct uml_driver *)dom->conn->privateData;
+ virDomainObjPtr vm = virDomainFindByUUID(&driver->domains, dom->uuid);
+ char *configFile = NULL, *autostartLink = NULL;
+ int ret = -1;
+
+ if (!vm) {
+ umlReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
+ "%s", _("no domain with matching uuid"));
+ return -1;
+ }
+
+ if (!vm->persistent) {
+ umlReportError(dom->conn, dom, NULL, VIR_ERR_INTERNAL_ERROR,
+ "%s", _("cannot set autostart for transient domain"));
+ return -1;
+ }
+
+ autostart = (autostart != 0);
+
+ if (vm->autostart == autostart)
+ return 0;
+
+ if ((configFile = virDomainConfigFile(dom->conn, driver->configDir, vm->def->name)) == NULL)
+ goto cleanup;
+ if ((autostartLink = virDomainConfigFile(dom->conn, driver->autostartDir, vm->def->name)) == NULL)
+ goto cleanup;
+
+ if (autostart) {
+ int err;
+
+ if ((err = virFileMakePath(driver->autostartDir))) {
+ umlReportError(dom->conn, dom, NULL, VIR_ERR_INTERNAL_ERROR,
+ _("cannot create autostart directory %s: %s"),
+ driver->autostartDir, strerror(err));
+ goto cleanup;
+ }
+
+ if (symlink(configFile, autostartLink) < 0) {
+ umlReportError(dom->conn, dom, NULL, VIR_ERR_INTERNAL_ERROR,
+ _("Failed to create symlink '%s to '%s': %s"),
+ autostartLink, configFile, strerror(errno));
+ goto cleanup;
+ }
+ } else {
+ if (unlink(autostartLink) < 0 && errno != ENOENT && errno != ENOTDIR) {
+ umlReportError(dom->conn, dom, NULL, VIR_ERR_INTERNAL_ERROR,
+ _("Failed to delete symlink '%s': %s"),
+ autostartLink, strerror(errno));
+ goto cleanup;
+ }
+ }
+
+ vm->autostart = autostart;
+ ret = 0;
+
+cleanup:
+ VIR_FREE(configFile);
+ VIR_FREE(autostartLink);
+
+ return ret;
+}
+
+
+static int
+umlDomainBlockPeek (virDomainPtr dom,
+ const char *path,
+ unsigned long long offset, size_t size,
+ void *buffer,
+ unsigned int flags ATTRIBUTE_UNUSED)
+{
+ struct uml_driver *driver = (struct uml_driver *)dom->conn->privateData;
+ virDomainObjPtr vm = virDomainFindByUUID(&driver->domains, dom->uuid);
+ int fd, ret = -1, i;
+
+ if (!vm) {
+ umlReportError (dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
+ _("no domain with matching uuid"));
+ return -1;
+ }
+
+ if (!path || path[0] == '\0') {
+ umlReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_ARG,
+ _("NULL or empty path"));
+ return -1;
+ }
+
+ /* Check the path belongs to this domain. */
+ for (i = 0 ; i < vm->def->ndisks ; i++) {
+ if (vm->def->disks[i]->src != NULL &&
+ STREQ (vm->def->disks[i]->src, path))
+ goto found;
+ }
+ umlReportError (dom->conn, dom, NULL, VIR_ERR_INVALID_ARG,
+ _("invalid path"));
+ return -1;
+
+found:
+ /* The path is correct, now try to open it and get its size. */
+ fd = open (path, O_RDONLY);
+ if (fd == -1) {
+ umlReportError (dom->conn, dom, NULL, VIR_ERR_SYSTEM_ERROR,
+ "%s", strerror (errno));
+ goto done;
+ }
+
+ /* Seek and read. */
+ /* NB. Because we configure with AC_SYS_LARGEFILE, off_t should
+ * be 64 bits on all platforms.
+ */
+ if (lseek (fd, offset, SEEK_SET) == (off_t) -1 ||
+ saferead (fd, buffer, size) == (ssize_t) -1) {
+ umlReportError (dom->conn, dom, NULL, VIR_ERR_SYSTEM_ERROR,
+ "%s", strerror (errno));
+ goto done;
+ }
+
+ ret = 0;
+ done:
+ if (fd >= 0) close (fd);
+ return ret;
+}
+
+
+
+static virDriver umlDriver = {
+ VIR_DRV_UML,
+ "UML",
+ LIBVIR_VERSION_NUMBER,
+ umlProbe, /* probe */
+ umlOpen, /* open */
+ umlClose, /* close */
+ NULL, /* supports_feature */
+ umlGetType, /* type */
+ umlGetVersion, /* version */
+ umlGetHostname, /* hostname */
+ NULL, /* URI */
+ NULL, /* getMaxVcpus */
+ umlGetNodeInfo, /* nodeGetInfo */
+ umlGetCapabilities, /* getCapabilities */
+ umlListDomains, /* listDomains */
+ umlNumDomains, /* numOfDomains */
+ umlDomainCreate, /* domainCreateXML */
+ umlDomainLookupByID, /* domainLookupByID */
+ umlDomainLookupByUUID, /* domainLookupByUUID */
+ umlDomainLookupByName, /* domainLookupByName */
+ NULL, /* domainSuspend */
+ NULL, /* domainResume */
+ umlDomainShutdown, /* domainShutdown */
+ NULL, /* domainReboot */
+ umlDomainDestroy, /* domainDestroy */
+ umlDomainGetOSType, /* domainGetOSType */
+ umlDomainGetMaxMemory, /* domainGetMaxMemory */
+ umlDomainSetMaxMemory, /* domainSetMaxMemory */
+ umlDomainSetMemory, /* domainSetMemory */
+ umlDomainGetInfo, /* domainGetInfo */
+ NULL, /* domainSave */
+ NULL, /* domainRestore */
+ NULL, /* domainCoreDump */
+ NULL, /* domainSetVcpus */
+ NULL, /* domainPinVcpu */
+ NULL, /* domainGetVcpus */
+ NULL, /* domainGetMaxVcpus */
+ umlDomainDumpXML, /* domainDumpXML */
+ umlListDefinedDomains, /* listDomains */
+ umlNumDefinedDomains, /* numOfDomains */
+ umlDomainStart, /* domainCreate */
+ umlDomainDefine, /* domainDefineXML */
+ umlDomainUndefine, /* domainUndefine */
+ NULL, /* domainAttachDevice */
+ NULL, /* domainDetachDevice */
+ umlDomainGetAutostart, /* domainGetAutostart */
+ umlDomainSetAutostart, /* domainSetAutostart */
+ NULL, /* domainGetSchedulerType */
+ NULL, /* domainGetSchedulerParameters */
+ NULL, /* domainSetSchedulerParameters */
+ NULL, /* domainMigratePrepare */
+ NULL, /* domainMigratePerform */
+ NULL, /* domainMigrateFinish */
+ NULL, /* domainBlockStats */
+ NULL, /* domainInterfaceStats */
+ umlDomainBlockPeek, /* domainBlockPeek */
+ NULL, /* domainMemoryPeek */
+#if HAVE_NUMACTL
+ umlNodeGetCellsFreeMemory, /* nodeGetCellsFreeMemory */
+ umlNodeGetFreeMemory, /* getFreeMemory */
+#else
+ NULL, /* nodeGetCellsFreeMemory */
+ NULL, /* getFreeMemory */
+#endif
+};
+
+
+static virStateDriver umlStateDriver = {
+ .initialize = umlStartup,
+ .cleanup = umlShutdown,
+ .reload = umlReload,
+ .active = umlActive,
+};
+
+int umlRegister(void) {
+ virRegisterDriver(¨Driver);
+ virRegisterStateDriver(¨StateDriver);
+ return 0;
+}
+
diff --git a/src/uml_driver.h b/src/uml_driver.h
new file mode 100644
--- /dev/null
+++ b/src/uml_driver.h
@@ -0,0 +1,34 @@
+/*
+ * uml_driver.h: user mode Linux driver
+ *
+ * Copyright (C) 2006, 2007 Red Hat, Inc.
+ * Copyright (C) 2006-2008 Daniel P. Berrange
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * Author: Daniel P. Berrange <berrange(a)redhat.com>
+ */
+
+
+#ifndef UML_DRIVER_H
+#define UML_DRIVER_H
+
+#include <config.h>
+
+#include "internal.h"
+
+int umlRegister(void);
+
+#endif /* UML_DRIVER_H */
diff --git a/src/virterror.c b/src/virterror.c
--- a/src/virterror.c
+++ b/src/virterror.c
@@ -310,7 +310,9 @@ virDefaultErrorFunc(virErrorPtr err)
case VIR_FROM_DOMAIN:
dom = "Domain Config ";
break;
-
+ case VIR_FROM_UML:
+ dom = "UML ";
+ break;
}
if ((err->dom != NULL) && (err->code != VIR_ERR_INVALID_DOMAIN)) {
domain = err->dom->name;
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
2
2
I just committed this:
+Thu Oct 16 15:41:00 CEST 2008 Chris Lalancette <clalance(a)redhat.com>
+ * Compiling with -Werror showed a possible use before initialization
+ in src/qemu_driver.c. Make sure to initialize the olddisk ptr to
+ NULL.
+
Index: src/qemu_driver.c
===================================================================
RCS file: /data/cvs/libvirt/src/qemu_driver.c,v
retrieving revision 1.135
diff -u -r1.135 qemu_driver.c
--- src/qemu_driver.c 13 Oct 2008 16:46:28 -0000 1.135
+++ src/qemu_driver.c 16 Oct 2008 13:42:17 -0000
@@ -2401,6 +2401,7 @@
return -1;
}
+ origdisk = NULL;
newdisk = dev->data.disk;
for (i = 0 ; i < vm->def->ndisks ; i++) {
if (vm->def->disks[i]->bus == newdisk->bus &&
--
Chris Lalancette
1
0
16 Oct '08
One of the new (binary) .ico files has a TAB just before a newline,
and that triggers a "make syntax-check" failure.
This gives all *.ico files a free pass.
(also sorted the file)
>From 11096480dfb54fc179b3854d3f81739f2d2ef273 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Thu, 16 Oct 2008 15:05:16 +0200
Subject: [PATCH] build: exempt *.ico files from the trailing blank check
* .x-sc_trailing_blank: Add \.ico$ to the list.
---
.x-sc_trailing_blank | 5 +++--
ChangeLog | 5 +++++
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/.x-sc_trailing_blank b/.x-sc_trailing_blank
index 8b3ec89..de3369e 100644
--- a/.x-sc_trailing_blank
+++ b/.x-sc_trailing_blank
@@ -1,6 +1,7 @@
-\.png$
\.fig$
\.gif$
-^NEWS$
+\.ico$
+\.png$
^ChangeLog$
+^NEWS$
^docs/.*
diff --git a/ChangeLog b/ChangeLog
index 2aff530..322f837 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Oct 16 15:04:36 +0200 Jim Meyering <meyering(a)redhat.com>
+
+ build: exempt *.ico files from the trailing blank check
+ * .x-sc_trailing_blank: Add \.ico$ to the list.
+
Wed Oct 16 14:03:00 CEST 2008 Chris Lalancette <clalance(a)redhat.com>
* "make syntax-check" was complaining that network_driver.c was
--
1.6.0.2.98.gc82e
2
1
Hi
I have tested migration function VirDomain object by migrating with in
localhost(for testing purpose).
System details are
KVM hypervisor.
Intel VT 64 bit centos.
libvirt 0.4.6. (compiled from source)
vs i am running is Win 2003 64 bit...
Host is also 64 bit....
but when i tried to use the migrate function of virDomain object. it
throws the following error....
libvirt.libvirtError: virDomainMigrate() failed this function is not
supported by the hypervisor: virDomainMigrate
i read in kvm wiki that they do support migration....
Can anyone point out the problem....
here comes the python code....
>>> vsobj.migrate(conn,libvirt.VIR_MIGRATE_LIVE,None,conn.getURI(),0)
libvir: error : this function is not supported by the hypervisor:
virDomainMigrate
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib64/python2.4/site-packages/libvirt.py", line 301, in migrate
if ret is None:raise libvirtError('virDomainMigrate() failed', dom=self)
libvirt.libvirtError: virDomainMigrate() failed this function is not
supported by the hypervisor: virDomainMigrate
>>>
Thanks for any suggestion
-- Shan
2
1
I just committed this change:
Wed Oct 16 14:03:00 CEST 2008 Chris Lalancette <clalance(a)redhat.com>
* "make syntax-check" was complaining that network_driver.c was
missing from POTFILES.in. Add it, and then fix up one warning about
included c-ctypes.h that wasn't being used.
Since make syntax-check was complaining about the lack of network_driver.c.
Yes, I know today is Thursday, Oct. 16, I just noticed my silliness. Anyway,
just wanted to give a heads up.
--
Chris Lalancette
1
0
The following patch series implements the Events API discussed here previously in this thread:
http://www.redhat.com/archives/libvir-list/2008-September/msg00321.html
This is a rather large patch, and touches quite a few files, but in the end, accomplishes the goal of event delivery of notificaton of domain events.
It does so in a manner that is able to co-exist with older clients, or older libvirtd implementations.
In the former case, events will never be delivered to a client that does not request them.
In the latter case, we will fail registration, and so events will not be available.
I have broken this up into 3 patches in the following manner:
1/3 - events.patch
This is the bulk of the work. It emits, and delivers events to clients that are supported, and have registered to recieve the events.
2/3 - events-xen.patch
These changes are currently untested (as I did my development with KVM), but are the changes that will be necessary to monitor xenstore for changes in domain states
3/3 - events-test.patch
This is a test harness implemented to receive (and print) when domain events occur. I was unsure where this should live in the tree - so it currently is an independant patch (.c and Makefile in its own dir)
Please note that I have not yet made any effort to generate any Python, or Java bindings, but wanted to get this out on the list first.
NOTES:
Thread safeness:
We know that there are 2 data structures that need protection against concurrent access
_virDriver.conns and
_virConnect.domainEventCallbacks
However, we have not addressed these issues at this juncture.
We are considering recursive mutexes (specifically making conn->lock one) to avoid deadlocks in a vir* call from within a callback. We plan on addressing this with the next version of this code, after addressing any other issues the list may come up with, as well.
4
12
15 Oct '08
This patch adds a Windows resource icon to virsh.exe (on Windows only,
obviously).
I've generated 16x16, 32x32, 48x48 and 64x64 MS .ico files, starting
from Diana Fong / Tim Allen's libvirtLogo.png in the docs directory,
scaling it down to the required size, and adding an alpha mask.
The *.ico files have to go into the src directory, because of
limitations of the Microsoft resource editor file format itself. I
propose to add the 64x64 PNG file into the docs directory, or perhaps
not bother adding it at all -- it's not actually used and can be quite
trivially recreated.
My graphical attempts are fairly lame. This is partly because these
icons really need to be tweaked by hand for legibility at small sizes,
and partly because Windows itself does some quantization on the .ico
files after loading them. This quantization I don't understand and
isn't documented anywhere. Nevertheless the icon looks not totally
unreasonable, as you can see from the final screenshot attached.
Rich.
--
Richard Jones, Emerging Technologies, Red Hat http://et.redhat.com/~rjones
Read my OCaml programming blog: http://camltastic.blogspot.com/
Fedora now supports 68 OCaml packages (the OPEN alternative to F#)
http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora
2
3
[libvirt] [PATCH] openvz: swap <source bridge=...> with <target dev=...>
by Anton Protopopov 14 Oct '08
by Anton Protopopov 14 Oct '08
14 Oct '08
2008/9/29 Evgeniy V. Sokolov <evg(a)parallels.com>
>
>
>> This behaviour contradicts with description found in docs (in which
>> <source> tag specify interface in host, not in container). I think,
>> the previous bridge must be specified as
>> <interface type='bridge'>
>> <mac address='00:16:3e:34:21:9e'/>
>> - <source bridge='eth10'/>
>> + <target dev='eth10'/>
>> </interface>
>>
>> You are right. It is bug.
>>
>> Well, here is the patch, that fixes that behaviour.
>>
>
> Your patch is half of fix. It require to fix openvzReadNetworkConf() in
> openvz_conf.c.
>
Here is a new one. Check it, please.
4
24
The change to use arrays instead of linked-lists exposed a tiny bug in
the virReallocN function. The realloc() contract says that if size is
zero, then its semantics are the same as free(). virReallocN wasn't
matching this, instead returning failure, and not setting the original
pointer to NULL as expected. I've just committed this patch to fix this
bug which was causing test suite crashes
$ cvs -q diff -up memory.c
Index: memory.c
===================================================================
RCS file: /data/cvs/libvirt/src/memory.c,v
retrieving revision 1.8
diff -u -p -r1.8 memory.c
--- memory.c 19 Jun 2008 11:58:49 -0000 1.8
+++ memory.c 10 Oct 2008 18:16:43 -0000
@@ -158,7 +158,7 @@ int __virReallocN(void *ptrptr, size_t s
return -1;
}
tmp = realloc(*(void**)ptrptr, size * count);
- if (!tmp)
+ if (!tmp && (size * count))
return -1;
*(void**)ptrptr = tmp;
return 0;
Daniel
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
2
1
Rather than manually editing 140+ diagnostics in 20 files (tedious
and error-prone), I wrote a script to do the job (fun and reusable).
There was only one change that required manual intervention,
and that was because gcc doesn't yet know about the glibc/printf-
specific %m format specifier.
One disadvantage of doing it this way is that lines can only get longer
since I added no code to wrap them, but that is outweighed by being
able to automate the process. And who knows... maybe someone will be
motivated to teach this little script how to break+reindent long lines.
#!/usr/bin/perl
use strict;
use warnings;
(my $ME = $0) =~ s|.*/||;
# collect name/lineno pairs from output of gcc -W...
my $w = 'warning: format not a string literal and no format arguments';
my $lineno = {};
while (<>)
{
/^(\S+?\.c):(\d+): $w/
or next;
$lineno->{$1} ||= {};
$lineno->{$1}->{$2} = undef
}
foreach my $file (sort keys %$lineno)
{
# Read in all lines of $file.
open FH, '<', $file
or die "$ME: can't open `$file' for reading: $!\n";
my @line = <FH>;
close FH;
my $h = $lineno->{$file};
my @line_nums = sort { $a <=> $b } keys %$h;
# Perform required substitutions.
foreach my $k (@line_nums)
{
# Handle 3 cases:
# 1: ... f(arg, arg2, ..., _("...")
# 2: ... _("...")
# 3: ... f(arg, arg2,\n
# _("...")
# print "$file: $k: $line[$k-1]";
$line[$k-1] =~ /(.*, )(_\(.*)/
and ($line[$k-1] = qq!$1"%s", $2\n!), next;
$line[$k-1] =~ /^( *)(_\(.*)/
and ($line[$k-1] = qq!$1"%s", $2\n!), next;
defined $line[$k] && $line[$k] =~ /^( *)(_\(.*)/
and ($line[$k] = qq!$1"%s", $2\n!), next;
warn "$file:$k: no match\n";
}
# Write them to temp file.
my $tmp = "$file-t";
open FH, '>', $tmp
or die "$ME: can't open `$tmp' for writing: $!\n";
print FH @line;
close FH
or die "$ME: failed to write `$tmp': $!\n";
# Move temp file back onto original.
rename $tmp, $file
or die "$ME: failed to rename: `$tmp' -> `$file': $!\n";
}
# Local variables:
# indent-tabs-mode: nil
# End:
>From 18a0f97ae36c4ba31f1f0262558c09683b788c4d Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Mon, 13 Oct 2008 14:12:01 +0200
Subject: [PATCH] avoid many format string warnings
Building with --disable-nls exposed many new warnings like these:
virsh.c:4952: warning: format not a string literal and no format ...
util.c:163: warning: format not a string literal and no format arguments
All but one of the following changes add a "%s" argument before
the offending _(...) argument.
This was the only manual change:
* src/lxc_driver.c (lxcVersion): Use %s and strerror(errno)
rather than %m, to avoid a warning from gcc -Wformat-security.
Add "%s" before each warned about format-string-with-no-%-directive:
* src/domain_conf.c (virDomainHostdevSubsysUsbDefParseXML)
(virDomainDefParseString, virDomainDefParseFile):
* src/hash.c (virGetConnect, __virGetDomain, virReleaseDomain)
(__virGetNetwork, virReleaseNetwork, __virGetStoragePool)
(virReleaseStoragePool, __virGetStorageVol, virReleaseStorageVol):
* src/lxc_container.c (lxcContainerChild):
* src/lxc_driver.c (lxcDomainDefine, lxcDomainUndefine)
(lxcDomainGetInfo, lxcGetOSType, lxcDomainDumpXML)
(lxcSetupInterfaces, lxcDomainStart, lxcDomainCreateAndStart)
(lxcVersion, lxcGetSchedulerParameters):
* src/network_conf.c (virNetworkDefParseString)
(virNetworkDefParseFile):
* src/openvz_conf.c (openvzReadNetworkConf, openvzLoadDomains):
* src/openvz_driver.c (openvzDomainDefineCmd)
(openvzDomainGetInfo, openvzDomainDumpXML, openvzDomainShutdown)
(openvzDomainReboot, ADD_ARG_LIT, openvzDomainDefineXML)
(openvzDomainCreateXML, openvzDomainCreate, openvzDomainUndefine)
(openvzDomainSetAutostart, openvzDomainGetAutostart)
(openvzDomainSetVcpus):
* src/qemu_driver.c (qemudDomainBlockPeek, qemudDomainMemoryPeek):
* src/remote_internal.c (remoteDomainBlockPeek)
(remoteDomainMemoryPeek, remoteAuthPolkit):
* src/sexpr.c (sexpr_new, _string2sexpr):
* src/storage_backend_disk.c (virStorageBackendDiskMakeDataVol)
(virStorageBackendDiskCreateVol):
* src/storage_backend_fs.c
(virStorageBackendFileSystemNetFindPoolSources):
* src/storage_backend_logical.c (virStorageBackendLogicalFindLVs)
(virStorageBackendLogicalFindPoolSources):
* src/test.c (testOpenDefault, testOpenFromFile, testOpen)
(testGetDomainInfo, testDomainRestore)
(testNodeGetCellsFreeMemory):
* src/util.c (virExec):
* src/virsh.c (cmdAttachDevice, cmdDetachDevice)
(cmdAttachInterface, cmdDetachInterface, cmdAttachDisk)
(cmdDetachDisk, cmdEdit):
* src/xend_internal.c (do_connect, wr_sync, xend_op_ext)
(urlencode, xenDaemonDomainCreateXML)
(xenDaemonDomainLookupByName_ids, xenDaemonDomainLookupByID)
(xenDaemonParseSxprOS, xend_parse_sexp_desc_char)
(xenDaemonParseSxprChar, xenDaemonParseSxprDisks)
(xenDaemonParseSxpr, sexpr_to_xend_topology, sexpr_to_domain)
(xenDaemonDomainFetch, xenDaemonDomainGetAutostart)
(xenDaemonDomainSetAutostart, xenDaemonDomainMigratePerform)
(xenDaemonDomainDefineXML, xenDaemonGetSchedulerType)
(xenDaemonGetSchedulerParameters)
(xenDaemonSetSchedulerParameters, xenDaemonDomainBlockPeek)
(xenDaemonFormatSxprChr, virDomainXMLDevID):
* src/xm_internal.c (xenXMConfigCacheRefresh, xenXMDomainPinVcpu)
(xenXMDomainCreate, xenXMDomainDefineXML)
(xenXMDomainAttachDevice, xenXMDomainDetachDevice):
* src/xml.c (virXPathString, virXPathNumber, virXPathLong)
(virXPathULong, virXPathBoolean, virXPathNode, virXPathNodeSet):
* src/xs_internal.c (xenStoreOpen):
---
src/domain_conf.c | 8 +-
src/hash.c | 36 +++++-----
src/lxc_container.c | 2 +-
src/lxc_driver.c | 24 ++++----
src/network_conf.c | 4 +-
src/openvz_conf.c | 12 ++--
src/openvz_driver.c | 50 +++++++-------
src/qemu_driver.c | 8 +-
src/remote_internal.c | 6 +-
src/sexpr.c | 6 +-
src/storage_backend_disk.c | 20 +++---
src/storage_backend_fs.c | 2 +-
src/storage_backend_logical.c | 4 +-
src/test.c | 50 +++++++-------
src/util.c | 8 +-
src/virsh.c | 14 ++--
src/xend_internal.c | 142 ++++++++++++++++++++--------------------
src/xm_internal.c | 38 ++++++------
src/xml.c | 16 ++--
src/xs_internal.c | 2 +-
20 files changed, 226 insertions(+), 226 deletions(-)
diff --git a/src/domain_conf.c b/src/domain_conf.c
index f57fb2d..82140f8 100644
--- a/src/domain_conf.c
+++ b/src/domain_conf.c
@@ -1523,13 +1523,13 @@ virDomainHostdevSubsysUsbDefParseXML(virConnectPtr conn,
if (def->source.subsys.usb.vendor == 0 &&
def->source.subsys.usb.product != 0) {
virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
- _("missing vendor"));
+ "%s", _("missing vendor"));
goto out;
}
if (def->source.subsys.usb.vendor != 0 &&
def->source.subsys.usb.product == 0) {
virDomainReportError(conn, VIR_ERR_INTERNAL_ERROR,
- _("missing product"));
+ "%s", _("missing product"));
goto out;
}
@@ -2243,7 +2243,7 @@ virDomainDefPtr virDomainDefParseString(virConnectPtr conn,
if (!xml) {
if (conn && conn->err.code == VIR_ERR_NONE)
virDomainReportError(conn, VIR_ERR_XML_ERROR,
- _("failed to parse xml document"));
+ "%s", _("failed to parse xml document"));
goto cleanup;
}
@@ -2284,7 +2284,7 @@ virDomainDefPtr virDomainDefParseFile(virConnectPtr conn,
if (!xml) {
if (conn && conn->err.code == VIR_ERR_NONE)
virDomainReportError(conn, VIR_ERR_XML_ERROR,
- _("failed to parse xml document"));
+ "%s", _("failed to parse xml document"));
goto cleanup;
}
diff --git a/src/hash.c b/src/hash.c
index 3efda2c..0a5bdcd 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -667,7 +667,7 @@ virGetConnect(void) {
virConnectPtr ret;
if (VIR_ALLOC(ret) < 0) {
- virHashError(NULL, VIR_ERR_NO_MEMORY, _("allocating connection"));
+ virHashError(NULL, VIR_ERR_NO_MEMORY, "%s", _("allocating connection"));
goto failed;
}
ret->magic = VIR_CONNECT_MAGIC;
@@ -801,12 +801,12 @@ __virGetDomain(virConnectPtr conn, const char *name, const unsigned char *uuid)
/* TODO check the UUID */
if (ret == NULL) {
if (VIR_ALLOC(ret) < 0) {
- virHashError(conn, VIR_ERR_NO_MEMORY, _("allocating domain"));
+ virHashError(conn, VIR_ERR_NO_MEMORY, "%s", _("allocating domain"));
goto error;
}
ret->name = strdup(name);
if (ret->name == NULL) {
- virHashError(conn, VIR_ERR_NO_MEMORY, _("allocating domain"));
+ virHashError(conn, VIR_ERR_NO_MEMORY, "%s", _("allocating domain"));
goto error;
}
ret->magic = VIR_DOMAIN_MAGIC;
@@ -817,7 +817,7 @@ __virGetDomain(virConnectPtr conn, const char *name, const unsigned char *uuid)
if (virHashAddEntry(conn->domains, name, ret) < 0) {
virHashError(conn, VIR_ERR_INTERNAL_ERROR,
- _("failed to add domain to connection hash table"));
+ "%s", _("failed to add domain to connection hash table"));
goto error;
}
conn->refs++;
@@ -858,7 +858,7 @@ virReleaseDomain(virDomainPtr domain) {
/* TODO search by UUID first as they are better differenciators */
if (virHashRemoveEntry(conn->domains, domain->name, NULL) < 0)
virHashError(conn, VIR_ERR_INTERNAL_ERROR,
- _("domain missing from connection hash table"));
+ "%s", _("domain missing from connection hash table"));
if (conn->err.dom == domain)
conn->err.dom = NULL;
@@ -941,12 +941,12 @@ __virGetNetwork(virConnectPtr conn, const char *name, const unsigned char *uuid)
/* TODO check the UUID */
if (ret == NULL) {
if (VIR_ALLOC(ret) < 0) {
- virHashError(conn, VIR_ERR_NO_MEMORY, _("allocating network"));
+ virHashError(conn, VIR_ERR_NO_MEMORY, "%s", _("allocating network"));
goto error;
}
ret->name = strdup(name);
if (ret->name == NULL) {
- virHashError(conn, VIR_ERR_NO_MEMORY, _("allocating network"));
+ virHashError(conn, VIR_ERR_NO_MEMORY, "%s", _("allocating network"));
goto error;
}
ret->magic = VIR_NETWORK_MAGIC;
@@ -956,7 +956,7 @@ __virGetNetwork(virConnectPtr conn, const char *name, const unsigned char *uuid)
if (virHashAddEntry(conn->networks, name, ret) < 0) {
virHashError(conn, VIR_ERR_INTERNAL_ERROR,
- _("failed to add network to connection hash table"));
+ "%s", _("failed to add network to connection hash table"));
goto error;
}
conn->refs++;
@@ -994,7 +994,7 @@ virReleaseNetwork(virNetworkPtr network) {
/* TODO search by UUID first as they are better differenciators */
if (virHashRemoveEntry(conn->networks, network->name, NULL) < 0)
virHashError(conn, VIR_ERR_INTERNAL_ERROR,
- _("network missing from connection hash table"));
+ "%s", _("network missing from connection hash table"));
if (conn->err.net == network)
conn->err.net = NULL;
@@ -1078,12 +1078,12 @@ __virGetStoragePool(virConnectPtr conn, const char *name, const unsigned char *u
/* TODO check the UUID */
if (ret == NULL) {
if (VIR_ALLOC(ret) < 0) {
- virHashError(conn, VIR_ERR_NO_MEMORY, _("allocating storage pool"));
+ virHashError(conn, VIR_ERR_NO_MEMORY, "%s", _("allocating storage pool"));
goto error;
}
ret->name = strdup(name);
if (ret->name == NULL) {
- virHashError(conn, VIR_ERR_NO_MEMORY, _("allocating storage pool"));
+ virHashError(conn, VIR_ERR_NO_MEMORY, "%s", _("allocating storage pool"));
goto error;
}
ret->magic = VIR_STORAGE_POOL_MAGIC;
@@ -1093,7 +1093,7 @@ __virGetStoragePool(virConnectPtr conn, const char *name, const unsigned char *u
if (virHashAddEntry(conn->storagePools, name, ret) < 0) {
virHashError(conn, VIR_ERR_INTERNAL_ERROR,
- _("failed to add storage pool to connection hash table"));
+ "%s", _("failed to add storage pool to connection hash table"));
goto error;
}
conn->refs++;
@@ -1132,7 +1132,7 @@ virReleaseStoragePool(virStoragePoolPtr pool) {
/* TODO search by UUID first as they are better differenciators */
if (virHashRemoveEntry(conn->storagePools, pool->name, NULL) < 0)
virHashError(conn, VIR_ERR_INTERNAL_ERROR,
- _("pool missing from connection hash table"));
+ "%s", _("pool missing from connection hash table"));
pool->magic = -1;
VIR_FREE(pool->name);
@@ -1209,17 +1209,17 @@ __virGetStorageVol(virConnectPtr conn, const char *pool, const char *name, const
ret = (virStorageVolPtr) virHashLookup(conn->storageVols, key);
if (ret == NULL) {
if (VIR_ALLOC(ret) < 0) {
- virHashError(conn, VIR_ERR_NO_MEMORY, _("allocating storage vol"));
+ virHashError(conn, VIR_ERR_NO_MEMORY, "%s", _("allocating storage vol"));
goto error;
}
ret->pool = strdup(pool);
if (ret->pool == NULL) {
- virHashError(conn, VIR_ERR_NO_MEMORY, _("allocating storage vol"));
+ virHashError(conn, VIR_ERR_NO_MEMORY, "%s", _("allocating storage vol"));
goto error;
}
ret->name = strdup(name);
if (ret->name == NULL) {
- virHashError(conn, VIR_ERR_NO_MEMORY, _("allocating storage vol"));
+ virHashError(conn, VIR_ERR_NO_MEMORY, "%s", _("allocating storage vol"));
goto error;
}
strncpy(ret->key, key, sizeof(ret->key)-1);
@@ -1229,7 +1229,7 @@ __virGetStorageVol(virConnectPtr conn, const char *pool, const char *name, const
if (virHashAddEntry(conn->storageVols, key, ret) < 0) {
virHashError(conn, VIR_ERR_INTERNAL_ERROR,
- _("failed to add storage vol to connection hash table"));
+ "%s", _("failed to add storage vol to connection hash table"));
goto error;
}
conn->refs++;
@@ -1269,7 +1269,7 @@ virReleaseStorageVol(virStorageVolPtr vol) {
/* TODO search by UUID first as they are better differenciators */
if (virHashRemoveEntry(conn->storageVols, vol->key, NULL) < 0)
virHashError(conn, VIR_ERR_INTERNAL_ERROR,
- _("vol missing from connection hash table"));
+ "%s", _("vol missing from connection hash table"));
vol->magic = -1;
VIR_FREE(vol->name);
diff --git a/src/lxc_container.c b/src/lxc_container.c
index 379e0af..e94b2d5 100644
--- a/src/lxc_container.c
+++ b/src/lxc_container.c
@@ -547,7 +547,7 @@ static int lxcContainerChild( void *data )
if (NULL == vmDef) {
lxcError(NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- _("lxcChild() passed invalid vm definition"));
+ "%s", _("lxcChild() passed invalid vm definition"));
return -1;
}
diff --git a/src/lxc_driver.c b/src/lxc_driver.c
index e5e1d6a..c598d1d 100644
--- a/src/lxc_driver.c
+++ b/src/lxc_driver.c
@@ -230,7 +230,7 @@ static virDomainPtr lxcDomainDefine(virConnectPtr conn, const char *xml)
if ((def->nets != NULL) && !(driver->have_netns)) {
lxcError(conn, NULL, VIR_ERR_NO_SUPPORT,
- _("System lacks NETNS support"));
+ "%s", _("System lacks NETNS support"));
virDomainDefFree(def);
return NULL;
}
@@ -263,13 +263,13 @@ static int lxcDomainUndefine(virDomainPtr dom)
if (!vm) {
lxcError(dom->conn, dom, VIR_ERR_INVALID_DOMAIN,
- _("no domain with matching uuid"));
+ "%s", _("no domain with matching uuid"));
return -1;
}
if (virDomainIsActive(vm)) {
lxcError(dom->conn, dom, VIR_ERR_INTERNAL_ERROR,
- _("cannot delete active domain"));
+ "%s", _("cannot delete active domain"));
return -1;
}
@@ -298,7 +298,7 @@ static int lxcDomainGetInfo(virDomainPtr dom,
if (!vm) {
lxcError(dom->conn, dom, VIR_ERR_INVALID_DOMAIN,
- _("no domain with matching uuid"));
+ "%s", _("no domain with matching uuid"));
return -1;
}
@@ -324,7 +324,7 @@ static char *lxcGetOSType(virDomainPtr dom)
if (!vm) {
lxcError(dom->conn, dom, VIR_ERR_INVALID_DOMAIN,
- _("no domain with matching uuid"));
+ "%s", _("no domain with matching uuid"));
return NULL;
}
@@ -339,7 +339,7 @@ static char *lxcDomainDumpXML(virDomainPtr dom,
if (!vm) {
lxcError(dom->conn, dom, VIR_ERR_INVALID_DOMAIN,
- _("no domain with matching uuid"));
+ "%s", _("no domain with matching uuid"));
return NULL;
}
@@ -458,7 +458,7 @@ static int lxcSetupInterfaces(virConnectPtr conn,
DEBUG("bridge: %s", bridge);
if (NULL == bridge) {
lxcError(conn, NULL, VIR_ERR_INTERNAL_ERROR,
- _("failed to get bridge for interface"));
+ "%s", _("failed to get bridge for interface"));
goto error_exit;
}
@@ -482,7 +482,7 @@ static int lxcSetupInterfaces(virConnectPtr conn,
if (NULL == def->nets[i]->ifname) {
lxcError(NULL, NULL, VIR_ERR_INTERNAL_ERROR,
- _("failed to allocate veth names"));
+ "%s", _("failed to allocate veth names"));
goto error_exit;
}
@@ -861,7 +861,7 @@ static int lxcDomainStart(virDomainPtr dom)
if ((vm->def->nets != NULL) && !(driver->have_netns)) {
lxcError(conn, NULL, VIR_ERR_NO_SUPPORT,
- _("System lacks NETNS support"));
+ "%s", _("System lacks NETNS support"));
goto cleanup;
}
@@ -896,7 +896,7 @@ lxcDomainCreateAndStart(virConnectPtr conn,
if ((def->nets != NULL) && !(driver->have_netns)) {
virDomainDefFree(def);
lxcError(conn, NULL, VIR_ERR_NO_SUPPORT,
- _("System lacks NETNS support"));
+ "%s", _("System lacks NETNS support"));
goto return_point;
}
@@ -1113,7 +1113,7 @@ static int lxcVersion(virConnectPtr conn, unsigned long *version)
if (uname(&ver) != 0) {
lxcError(conn, NULL, VIR_ERR_INTERNAL_ERROR,
- _("uname(): %m"));
+ _("uname(): %s"), strerror(errno));
return -1;
}
@@ -1193,7 +1193,7 @@ static int lxcGetSchedulerParameters(virDomainPtr _domain,
if ((*nparams) != 1) {
lxcError(NULL, _domain, VIR_ERR_INVALID_ARG,
- _("Invalid parameter count"));
+ "%s", _("Invalid parameter count"));
return -1;
}
diff --git a/src/network_conf.c b/src/network_conf.c
index 8107b39..4c32fa1 100644
--- a/src/network_conf.c
+++ b/src/network_conf.c
@@ -452,7 +452,7 @@ virNetworkDefPtr virNetworkDefParseString(virConnectPtr conn,
if (!xml) {
if (conn && conn->err.code == VIR_ERR_NONE)
virNetworkReportError(conn, VIR_ERR_XML_ERROR,
- _("failed to parse xml document"));
+ "%s", _("failed to parse xml document"));
goto cleanup;
}
@@ -492,7 +492,7 @@ virNetworkDefPtr virNetworkDefParseFile(virConnectPtr conn,
if (!xml) {
if (conn && conn->err.code == VIR_ERR_NONE)
virNetworkReportError(conn, VIR_ERR_XML_ERROR,
- _("failed to parse xml document"));
+ "%s", _("failed to parse xml document"));
goto cleanup;
}
diff --git a/src/openvz_conf.c b/src/openvz_conf.c
index a2553d0..afd18a6 100644
--- a/src/openvz_conf.c
+++ b/src/openvz_conf.c
@@ -222,7 +222,7 @@ openvzReadNetworkConf(virConnectPtr conn,
len = next - p;
if (len > 16) {
openvzError(conn, VIR_ERR_INTERNAL_ERROR,
- _("Too long network device name"));
+ "%s", _("Too long network device name"));
goto error;
}
@@ -239,14 +239,14 @@ openvzReadNetworkConf(virConnectPtr conn,
len = next - p;
if (len != 17) { //should be 17
openvzError(conn, VIR_ERR_INTERNAL_ERROR,
- _("Wrong length MAC address"));
+ "%s", _("Wrong length MAC address"));
goto error;
}
strncpy(cpy_temp, p, len);
cpy_temp[len] = '\0';
if (openvzParseMac(cpy_temp, net->mac)<0) {
openvzError(conn, VIR_ERR_INTERNAL_ERROR,
- _("Wrong MAC address"));
+ "%s", _("Wrong MAC address"));
goto error;
}
} else if (STRPREFIX(p, "host_mac=")) {
@@ -299,7 +299,7 @@ int openvzLoadDomains(struct openvz_driver *driver) {
return -1;
if ((fp = popen(VZLIST " -a -ovpsid,status -H 2>/dev/null", "r")) == NULL) {
- openvzError(NULL, VIR_ERR_INTERNAL_ERROR, _("popen failed"));
+ openvzError(NULL, VIR_ERR_INTERNAL_ERROR, "%s", _("popen failed"));
return -1;
}
@@ -309,7 +309,7 @@ int openvzLoadDomains(struct openvz_driver *driver) {
break;
openvzError(NULL, VIR_ERR_INTERNAL_ERROR,
- _("Failed to parse vzlist output"));
+ "%s", _("Failed to parse vzlist output"));
goto cleanup;
}
@@ -335,7 +335,7 @@ int openvzLoadDomains(struct openvz_driver *driver) {
if (ret == -1) {
openvzError(NULL, VIR_ERR_INTERNAL_ERROR,
- _("UUID in config file malformed"));
+ "%s", _("UUID in config file malformed"));
goto cleanup;
}
diff --git a/src/openvz_driver.c b/src/openvz_driver.c
index e3e3cc7..b82d0df 100644
--- a/src/openvz_driver.c
+++ b/src/openvz_driver.c
@@ -92,7 +92,7 @@ static int openvzDomainDefineCmd(virConnectPtr conn,
if (vmdef == NULL){
openvzError(conn, VIR_ERR_INTERNAL_ERROR,
- _("Container is not defined"));
+ "%s", _("Container is not defined"));
return -1;
}
@@ -235,7 +235,7 @@ static int openvzDomainGetInfo(virDomainPtr dom,
if (!vm) {
openvzError(dom->conn, VIR_ERR_INVALID_DOMAIN,
- _("no domain with matching uuid"));
+ "%s", _("no domain with matching uuid"));
return -1;
}
@@ -264,7 +264,7 @@ static char *openvzDomainDumpXML(virDomainPtr dom, int flags) {
if (!vm) {
openvzError(dom->conn, VIR_ERR_INVALID_DOMAIN,
- _("no domain with matching uuid"));
+ "%s", _("no domain with matching uuid"));
return NULL;
}
@@ -280,13 +280,13 @@ static int openvzDomainShutdown(virDomainPtr dom) {
if (!vm) {
openvzError(dom->conn, VIR_ERR_INVALID_DOMAIN,
- _("no domain with matching uuid"));
+ "%s", _("no domain with matching uuid"));
return -1;
}
if (vm->state != VIR_DOMAIN_RUNNING) {
openvzError(dom->conn, VIR_ERR_INTERNAL_ERROR,
- _("domain is not in running state"));
+ "%s", _("domain is not in running state"));
return -1;
}
@@ -307,13 +307,13 @@ static int openvzDomainReboot(virDomainPtr dom,
if (!vm) {
openvzError(dom->conn, VIR_ERR_INVALID_DOMAIN,
- _("no domain with matching uuid"));
+ "%s", _("no domain with matching uuid"));
return -1;
}
if (vm->state != VIR_DOMAIN_RUNNING) {
openvzError(dom->conn, VIR_ERR_INTERNAL_ERROR,
- _("domain is not in running state"));
+ "%s", _("domain is not in running state"));
return -1;
}
@@ -344,7 +344,7 @@ openvzDomainSetNetwork(virConnectPtr conn, const char *vpsid,
return 0;
if (vpsid == NULL) {
openvzError(conn, VIR_ERR_INTERNAL_ERROR,
- _("Container ID is not specified"));
+ "%s", _("Container ID is not specified"));
return -1;
}
@@ -444,7 +444,7 @@ openvzDomainDefineXML(virConnectPtr conn, const char *xml)
if (openvzDomainDefineCmd(conn, prog, OPENVZ_MAX_ARG, vmdef) < 0) {
openvzError(conn, VIR_ERR_INTERNAL_ERROR,
- _("Error creating command for container"));
+ "%s", _("Error creating command for container"));
goto exit;
}
@@ -458,7 +458,7 @@ openvzDomainDefineXML(virConnectPtr conn, const char *xml)
if (openvzSetDefinedUUID(strtoI(vmdef->name), vmdef->uuid) < 0) {
openvzError(conn, VIR_ERR_INTERNAL_ERROR,
- _("Could not set UUID"));
+ "%s", _("Could not set UUID"));
goto exit;
}
@@ -469,7 +469,7 @@ openvzDomainDefineXML(virConnectPtr conn, const char *xml)
for (i = 0 ; i < vmdef->nnets ; i++) {
if (openvzDomainSetNetwork(conn, vmdef->name, vmdef->nets[i]) < 0) {
openvzError(conn, VIR_ERR_INTERNAL_ERROR,
- _("Could not configure network"));
+ "%s", _("Could not configure network"));
goto exit;
}
}
@@ -477,7 +477,7 @@ openvzDomainDefineXML(virConnectPtr conn, const char *xml)
if (vmdef->vcpus > 0) {
if (openvzDomainSetVcpus(dom, vmdef->vcpus) < 0) {
openvzError(conn, VIR_ERR_INTERNAL_ERROR,
- _("Could not set number of virtual cpu"));
+ "%s", _("Could not set number of virtual cpu"));
goto exit;
}
}
@@ -524,7 +524,7 @@ openvzDomainCreateXML(virConnectPtr conn, const char *xml,
if (openvzDomainDefineCmd(conn, progcreate, OPENVZ_MAX_ARG, vmdef) < 0) {
openvzError(conn, VIR_ERR_INTERNAL_ERROR,
- _("Error creating command for container"));
+ "%s", _("Error creating command for container"));
goto exit;
}
@@ -536,14 +536,14 @@ openvzDomainCreateXML(virConnectPtr conn, const char *xml,
if (openvzSetDefinedUUID(strtoI(vmdef->name), vmdef->uuid) < 0) {
openvzError(conn, VIR_ERR_INTERNAL_ERROR,
- _("Could not set UUID"));
+ "%s", _("Could not set UUID"));
goto exit;
}
for (i = 0 ; i < vmdef->nnets ; i++) {
if (openvzDomainSetNetwork(conn, vmdef->name, vmdef->nets[i]) < 0) {
openvzError(conn, VIR_ERR_INTERNAL_ERROR,
- _("Could not configure network"));
+ "%s", _("Could not configure network"));
goto exit;
}
}
@@ -567,7 +567,7 @@ openvzDomainCreateXML(virConnectPtr conn, const char *xml,
if (vmdef->vcpus > 0) {
if (openvzDomainSetVcpus(dom, vmdef->vcpus) < 0) {
openvzError(conn, VIR_ERR_INTERNAL_ERROR,
- _("Could not set number of virtual cpu"));
+ "%s", _("Could not set number of virtual cpu"));
goto exit;
}
}
@@ -586,13 +586,13 @@ openvzDomainCreate(virDomainPtr dom)
if (!vm) {
openvzError(dom->conn, VIR_ERR_INVALID_DOMAIN,
- _("no domain with matching id"));
+ "%s", _("no domain with matching id"));
return -1;
}
if (vm->state != VIR_DOMAIN_SHUTOFF) {
openvzError(dom->conn, VIR_ERR_OPERATION_DENIED,
- _("domain is not in shutoff state"));
+ "%s", _("domain is not in shutoff state"));
return -1;
}
@@ -618,12 +618,12 @@ openvzDomainUndefine(virDomainPtr dom)
const char *prog[] = { VZCTL, "--quiet", "destroy", vm ? vm->def->name : NULL, NULL };
if (!vm) {
- openvzError(conn, VIR_ERR_INVALID_DOMAIN, _("no domain with matching uuid"));
+ openvzError(conn, VIR_ERR_INVALID_DOMAIN, "%s", _("no domain with matching uuid"));
return -1;
}
if (virDomainIsActive(vm)) {
- openvzError(conn, VIR_ERR_INTERNAL_ERROR, _("cannot delete active domain"));
+ openvzError(conn, VIR_ERR_INTERNAL_ERROR, "%s", _("cannot delete active domain"));
return -1;
}
@@ -649,7 +649,7 @@ openvzDomainSetAutostart(virDomainPtr dom, int autostart)
"--save", NULL };
if (!vm) {
- openvzError(conn, VIR_ERR_INVALID_DOMAIN, _("no domain with matching uuid"));
+ openvzError(conn, VIR_ERR_INVALID_DOMAIN, "%s", _("no domain with matching uuid"));
return -1;
}
@@ -670,12 +670,12 @@ openvzDomainGetAutostart(virDomainPtr dom, int *autostart)
char value[1024];
if (!vm) {
- openvzError(conn, VIR_ERR_INVALID_DOMAIN, _("no domain with matching uuid"));
+ openvzError(conn, VIR_ERR_INVALID_DOMAIN, "%s", _("no domain with matching uuid"));
return -1;
}
if (openvzReadConfigParam(strtoI(vm->def->name), "ONBOOT", value, sizeof(value)) < 0) {
- openvzError(conn, VIR_ERR_INTERNAL_ERROR, _("Could not read container config"));
+ openvzError(conn, VIR_ERR_INTERNAL_ERROR, "%s", _("Could not read container config"));
return -1;
}
@@ -711,13 +711,13 @@ static int openvzDomainSetVcpus(virDomainPtr dom, unsigned int nvcpus) {
if (!vm) {
openvzError(conn, VIR_ERR_INVALID_DOMAIN,
- _("no domain with matching uuid"));
+ "%s", _("no domain with matching uuid"));
return -1;
}
if (nvcpus <= 0) {
openvzError(conn, VIR_ERR_INTERNAL_ERROR,
- _("VCPUs should be >= 1"));
+ "%s", _("VCPUs should be >= 1"));
return -1;
}
diff --git a/src/qemu_driver.c b/src/qemu_driver.c
index 689c992..624c8d8 100644
--- a/src/qemu_driver.c
+++ b/src/qemu_driver.c
@@ -2941,13 +2941,13 @@ qemudDomainBlockPeek (virDomainPtr dom,
if (!vm) {
qemudReportError (dom->conn, dom, NULL, VIR_ERR_INVALID_DOMAIN,
- _("no domain with matching uuid"));
+ "%s", _("no domain with matching uuid"));
return -1;
}
if (!path || path[0] == '\0') {
qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_ARG,
- _("NULL or empty path"));
+ "%s", _("NULL or empty path"));
return -1;
}
@@ -2958,7 +2958,7 @@ qemudDomainBlockPeek (virDomainPtr dom,
goto found;
}
qemudReportError (dom->conn, dom, NULL, VIR_ERR_INVALID_ARG,
- _("invalid path"));
+ "%s", _("invalid path"));
return -1;
found:
@@ -3001,7 +3001,7 @@ qemudDomainMemoryPeek (virDomainPtr dom,
if (flags != VIR_MEMORY_VIRTUAL) {
qemudReportError (dom->conn, dom, NULL, VIR_ERR_INVALID_ARG,
- _("QEMU driver only supports virtual memory addrs"));
+ "%s", _("QEMU driver only supports virtual memory addrs"));
return -1;
}
diff --git a/src/remote_internal.c b/src/remote_internal.c
index 2f3a261..35b7b4b 100644
--- a/src/remote_internal.c
+++ b/src/remote_internal.c
@@ -2364,7 +2364,7 @@ remoteDomainBlockPeek (virDomainPtr domain,
if (ret.buffer.buffer_len != size) {
errorf (domain->conn, VIR_ERR_RPC,
- _("returned buffer is not same size as requested"));
+ "%s", _("returned buffer is not same size as requested"));
free (ret.buffer.buffer_val);
return -1;
}
@@ -2408,7 +2408,7 @@ remoteDomainMemoryPeek (virDomainPtr domain,
if (ret.buffer.buffer_len != size) {
errorf (domain->conn, VIR_ERR_RPC,
- _("returned buffer is not same size as requested"));
+ "%s", _("returned buffer is not same size as requested"));
free (ret.buffer.buffer_val);
return -1;
}
@@ -4267,7 +4267,7 @@ remoteAuthPolkit (virConnectPtr conn, struct private_data *priv, int in_open,
if ((*(auth->cb))(&cred, 1, auth->cbdata) < 0) {
__virRaiseError (in_open ? NULL : conn, NULL, NULL, VIR_FROM_REMOTE,
VIR_ERR_AUTH_FAILED, VIR_ERR_ERROR, NULL, NULL, NULL, 0, 0,
- _("Failed to collect auth credentials"));
+ "%s", _("Failed to collect auth credentials"));
return -1;
}
} else {
diff --git a/src/sexpr.c b/src/sexpr.c
index c168754..355c5a6 100644
--- a/src/sexpr.c
+++ b/src/sexpr.c
@@ -40,7 +40,7 @@ sexpr_new(void)
struct sexpr *ret;
if (VIR_ALLOC(ret) < 0) {
- virSexprError(VIR_ERR_NO_MEMORY, _("failed to allocate a node"));
+ virSexprError(VIR_ERR_NO_MEMORY, "%s", _("failed to allocate a node"));
return (NULL);
}
ret->kind = SEXPR_NIL;
@@ -344,7 +344,7 @@ _string2sexpr(const char *buffer, size_t * end)
ret->u.value = strndup(start, ptr - start);
if (ret->u.value == NULL) {
virSexprError(VIR_ERR_NO_MEMORY,
- _("failed to copy a string"));
+ "%s", _("failed to copy a string"));
goto error;
}
@@ -361,7 +361,7 @@ _string2sexpr(const char *buffer, size_t * end)
ret->u.value = strndup(start, ptr - start);
if (ret->u.value == NULL) {
virSexprError(VIR_ERR_NO_MEMORY,
- _("failed to copy a string"));
+ "%s", _("failed to copy a string"));
goto error;
}
}
diff --git a/src/storage_backend_disk.c b/src/storage_backend_disk.c
index bb134c7..729cbef 100644
--- a/src/storage_backend_disk.c
+++ b/src/storage_backend_disk.c
@@ -178,13 +178,13 @@ virStorageBackendDiskMakeDataVol(virConnectPtr conn,
if (vol == NULL) {
if (VIR_ALLOC(vol) < 0) {
- virStorageReportError(conn, VIR_ERR_NO_MEMORY, _("volume"));
+ virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("volume"));
return -1;
}
if (VIR_REALLOC_N(pool->volumes.objs,
pool->volumes.count+1) < 0) {
- virStorageReportError(conn, VIR_ERR_NO_MEMORY, _("volume"));
+ virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("volume"));
virStorageVolDefFree(vol);
return -1;
}
@@ -195,14 +195,14 @@ virStorageBackendDiskMakeDataVol(virConnectPtr conn,
*/
tmp = strrchr(groups[0], '/');
if ((vol->name = strdup(tmp ? tmp + 1 : groups[0])) == NULL) {
- virStorageReportError(conn, VIR_ERR_NO_MEMORY, _("volume"));
+ virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("volume"));
return -1;
}
}
if (vol->target.path == NULL) {
if ((devpath = strdup(groups[0])) == NULL) {
- virStorageReportError(conn, VIR_ERR_NO_MEMORY, _("volume"));
+ virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("volume"));
return -1;
}
@@ -224,7 +224,7 @@ virStorageBackendDiskMakeDataVol(virConnectPtr conn,
if (vol->key == NULL) {
/* XXX base off a unique key of the underlying disk */
if ((vol->key = strdup(vol->target.path)) == NULL) {
- virStorageReportError(conn, VIR_ERR_NO_MEMORY, _("volume"));
+ virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("volume"));
return -1;
}
}
@@ -232,7 +232,7 @@ virStorageBackendDiskMakeDataVol(virConnectPtr conn,
if (vol->source.extents == NULL) {
if (VIR_ALLOC(vol->source.extents) < 0) {
virStorageReportError(conn, VIR_ERR_NO_MEMORY,
- _("volume extents"));
+ "%s", _("volume extents"));
return -1;
}
vol->source.nextent = 1;
@@ -240,20 +240,20 @@ virStorageBackendDiskMakeDataVol(virConnectPtr conn,
if (virStrToLong_ull(groups[3], NULL, 10,
&vol->source.extents[0].start) < 0) {
virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
- _("cannot parse device start location"));
+ "%s", _("cannot parse device start location"));
return -1;
}
if (virStrToLong_ull(groups[4], NULL, 10,
&vol->source.extents[0].end) < 0) {
virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
- _("cannot parse device end location"));
+ "%s", _("cannot parse device end location"));
return -1;
}
if ((vol->source.extents[0].path =
strdup(pool->def->source.devices[0].path)) == NULL) {
- virStorageReportError(conn, VIR_ERR_NO_MEMORY, _("extents"));
+ virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("extents"));
return -1;
}
}
@@ -460,7 +460,7 @@ virStorageBackendDiskCreateVol(virConnectPtr conn,
}
if (smallestExtent == -1) {
virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
- _("no large enough free extent"));
+ "%s", _("no large enough free extent"));
return -1;
}
startOffset = dev->freeExtents[smallestExtent].start;
diff --git a/src/storage_backend_fs.c b/src/storage_backend_fs.c
index d3f4196..329505f 100644
--- a/src/storage_backend_fs.c
+++ b/src/storage_backend_fs.c
@@ -556,7 +556,7 @@ virStorageBackendFileSystemNetFindPoolSources(virConnectPtr conn,
retval = virStringListJoin(state.list, SOURCES_START_TAG, SOURCES_END_TAG, "\n");
if (retval == NULL) {
- virStorageReportError(conn, VIR_ERR_NO_MEMORY, _("retval"));
+ virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("retval"));
goto cleanup;
}
diff --git a/src/storage_backend_logical.c b/src/storage_backend_logical.c
index c549f26..e7ec6b4 100644
--- a/src/storage_backend_logical.c
+++ b/src/storage_backend_logical.c
@@ -233,7 +233,7 @@ virStorageBackendLogicalFindLVs(virConnectPtr conn,
vol,
&exitstatus) < 0) {
virStorageReportError(conn, VIR_ERR_INTERNAL_ERROR,
- _("lvs command failed"));
+ "%s", _("lvs command failed"));
return -1;
}
@@ -321,7 +321,7 @@ virStorageBackendLogicalFindPoolSources(virConnectPtr conn,
retval = virStringListJoin(descs, SOURCES_START_TAG, SOURCES_END_TAG, "\n");
if (retval == NULL) {
- virStorageReportError(conn, VIR_ERR_NO_MEMORY, _("retval"));
+ virStorageReportError(conn, VIR_ERR_NO_MEMORY, "%s", _("retval"));
goto cleanup;
}
diff --git a/src/test.c b/src/test.c
index 58d3559..aab74e4 100644
--- a/src/test.c
+++ b/src/test.c
@@ -213,7 +213,7 @@ static int testOpenDefault(virConnectPtr conn) {
conn->privateData = privconn;
if (gettimeofday(&tv, NULL) < 0) {
- testError(NULL, VIR_ERR_INTERNAL_ERROR, _("getting time of day"));
+ testError(NULL, VIR_ERR_INTERNAL_ERROR, "%s", _("getting time of day"));
goto error;
}
@@ -311,14 +311,14 @@ static int testOpenFromFile(virConnectPtr conn,
goto error;
if ((fd = open(file, O_RDONLY)) < 0) {
- testError(NULL, VIR_ERR_INTERNAL_ERROR, _("loading host definition file"));
+ testError(NULL, VIR_ERR_INTERNAL_ERROR, "%s", _("loading host definition file"));
goto error;
}
if (!(xml = xmlReadFd(fd, file, NULL,
XML_PARSE_NOENT | XML_PARSE_NONET |
XML_PARSE_NOERROR | XML_PARSE_NOWARNING))) {
- testError(NULL, VIR_ERR_INTERNAL_ERROR, _("host"));
+ testError(NULL, VIR_ERR_INTERNAL_ERROR, "%s", _("host"));
goto error;
}
close(fd);
@@ -326,13 +326,13 @@ static int testOpenFromFile(virConnectPtr conn,
root = xmlDocGetRootElement(xml);
if ((root == NULL) || (!xmlStrEqual(root->name, BAD_CAST "node"))) {
- testError(NULL, VIR_ERR_XML_ERROR, _("node"));
+ testError(NULL, VIR_ERR_XML_ERROR, "%s", _("node"));
goto error;
}
ctxt = xmlXPathNewContext(xml);
if (ctxt == NULL) {
- testError(NULL, VIR_ERR_INTERNAL_ERROR, _("creating xpath context"));
+ testError(NULL, VIR_ERR_INTERNAL_ERROR, "%s", _("creating xpath context"));
goto error;
}
@@ -347,7 +347,7 @@ static int testOpenFromFile(virConnectPtr conn,
if (ret == 0) {
nodeInfo->nodes = l;
} else if (ret == -2) {
- testError(NULL, VIR_ERR_XML_ERROR, _("node cpu numa nodes"));
+ testError(NULL, VIR_ERR_XML_ERROR, "%s", _("node cpu numa nodes"));
goto error;
}
@@ -355,7 +355,7 @@ static int testOpenFromFile(virConnectPtr conn,
if (ret == 0) {
nodeInfo->sockets = l;
} else if (ret == -2) {
- testError(NULL, VIR_ERR_XML_ERROR, _("node cpu sockets"));
+ testError(NULL, VIR_ERR_XML_ERROR, "%s", _("node cpu sockets"));
goto error;
}
@@ -363,7 +363,7 @@ static int testOpenFromFile(virConnectPtr conn,
if (ret == 0) {
nodeInfo->cores = l;
} else if (ret == -2) {
- testError(NULL, VIR_ERR_XML_ERROR, _("node cpu cores"));
+ testError(NULL, VIR_ERR_XML_ERROR, "%s", _("node cpu cores"));
goto error;
}
@@ -371,7 +371,7 @@ static int testOpenFromFile(virConnectPtr conn,
if (ret == 0) {
nodeInfo->threads = l;
} else if (ret == -2) {
- testError(NULL, VIR_ERR_XML_ERROR, _("node cpu threads"));
+ testError(NULL, VIR_ERR_XML_ERROR, "%s", _("node cpu threads"));
goto error;
}
@@ -382,14 +382,14 @@ static int testOpenFromFile(virConnectPtr conn,
nodeInfo->cpus = l;
}
} else if (ret == -2) {
- testError(NULL, VIR_ERR_XML_ERROR, _("node active cpu"));
+ testError(NULL, VIR_ERR_XML_ERROR, "%s", _("node active cpu"));
goto error;
}
ret = virXPathLong(conn, "string(/node/cpu/mhz[1])", ctxt, &l);
if (ret == 0) {
nodeInfo->mhz = l;
} else if (ret == -2) {
- testError(NULL, VIR_ERR_XML_ERROR, _("node cpu mhz"));
+ testError(NULL, VIR_ERR_XML_ERROR, "%s", _("node cpu mhz"));
goto error;
}
@@ -404,13 +404,13 @@ static int testOpenFromFile(virConnectPtr conn,
if (ret == 0) {
nodeInfo->memory = l;
} else if (ret == -2) {
- testError(NULL, VIR_ERR_XML_ERROR, _("node memory"));
+ testError(NULL, VIR_ERR_XML_ERROR, "%s", _("node memory"));
goto error;
}
ret = virXPathNodeSet(conn, "/node/domain", ctxt, &domains);
if (ret < 0) {
- testError(NULL, VIR_ERR_XML_ERROR, _("node domain list"));
+ testError(NULL, VIR_ERR_XML_ERROR, "%s", _("node domain list"));
goto error;
}
@@ -421,7 +421,7 @@ static int testOpenFromFile(virConnectPtr conn,
char *absFile = testBuildFilename(file, relFile);
VIR_FREE(relFile);
if (!absFile) {
- testError(NULL, VIR_ERR_INTERNAL_ERROR, _("resolving domain filename"));
+ testError(NULL, VIR_ERR_INTERNAL_ERROR, "%s", _("resolving domain filename"));
goto error;
}
def = virDomainDefParseFile(conn, privconn->caps, absFile);
@@ -447,7 +447,7 @@ static int testOpenFromFile(virConnectPtr conn,
ret = virXPathNodeSet(conn, "/node/network", ctxt, &networks);
if (ret < 0) {
- testError(NULL, VIR_ERR_XML_ERROR, _("node network list"));
+ testError(NULL, VIR_ERR_XML_ERROR, "%s", _("node network list"));
goto error;
}
for (i = 0 ; i < ret ; i++) {
@@ -457,7 +457,7 @@ static int testOpenFromFile(virConnectPtr conn,
char *absFile = testBuildFilename(file, relFile);
VIR_FREE(relFile);
if (!absFile) {
- testError(NULL, VIR_ERR_INTERNAL_ERROR, _("resolving network filename"));
+ testError(NULL, VIR_ERR_INTERNAL_ERROR, "%s", _("resolving network filename"));
goto error;
}
@@ -525,7 +525,7 @@ static int testOpen(virConnectPtr conn,
|| uri->path[0] == '\0'
|| (uri->path[0] == '/' && uri->path[1] == '\0')) {
testError (NULL, VIR_ERR_INVALID_ARG,
- _("testOpen: supply a path or use test:///default"));
+ "%s", _("testOpen: supply a path or use test:///default"));
return VIR_DRV_OPEN_ERROR;
}
@@ -837,7 +837,7 @@ static int testGetDomainInfo (virDomainPtr domain,
if (gettimeofday(&tv, NULL) < 0) {
testError(domain->conn, VIR_ERR_INTERNAL_ERROR,
- _("getting time of day"));
+ "%s", _("getting time of day"));
return (-1);
}
@@ -925,30 +925,30 @@ static int testDomainRestore(virConnectPtr conn,
if ((fd = open(path, O_RDONLY)) < 0) {
testError(conn, VIR_ERR_INTERNAL_ERROR,
- _("cannot read domain image"));
+ "%s", _("cannot read domain image"));
return (-1);
}
if (read(fd, magic, sizeof(magic)) != sizeof(magic)) {
testError(conn, VIR_ERR_INTERNAL_ERROR,
- _("incomplete save header"));
+ "%s", _("incomplete save header"));
close(fd);
return (-1);
}
if (memcmp(magic, TEST_SAVE_MAGIC, sizeof(magic))) {
testError(conn, VIR_ERR_INTERNAL_ERROR,
- _("mismatched header magic"));
+ "%s", _("mismatched header magic"));
close(fd);
return (-1);
}
if (read(fd, (char*)&len, sizeof(len)) != sizeof(len)) {
testError(conn, VIR_ERR_INTERNAL_ERROR,
- _("failed to read metadata length"));
+ "%s", _("failed to read metadata length"));
close(fd);
return (-1);
}
if (len < 1 || len > 8192) {
testError(conn, VIR_ERR_INTERNAL_ERROR,
- _("length of metadata out of range"));
+ "%s", _("length of metadata out of range"));
close(fd);
return (-1);
}
@@ -959,7 +959,7 @@ static int testDomainRestore(virConnectPtr conn,
}
if (read(fd, xml, len) != len) {
testError(conn, VIR_ERR_INTERNAL_ERROR,
- _("incomplete metdata"));
+ "%s", _("incomplete metdata"));
close(fd);
return (-1);
}
@@ -1147,7 +1147,7 @@ static int testNodeGetCellsFreeMemory(virConnectPtr conn,
if (startCell > privconn->numCells) {
testError(conn, VIR_ERR_INVALID_ARG,
- _("Range exceeds available cells"));
+ "%s", _("Range exceeds available cells"));
return -1;
}
diff --git a/src/util.c b/src/util.c
index 915e738..aa21653 100644
--- a/src/util.c
+++ b/src/util.c
@@ -155,13 +155,13 @@ virExec(virConnectPtr conn,
if ((flags & VIR_EXEC_NONBLOCK) &&
virSetNonBlock(pipeout[0]) == -1) {
ReportError(conn, VIR_ERR_INTERNAL_ERROR,
- _("Failed to set non-blocking file descriptor flag"));
+ "%s", _("Failed to set non-blocking file descriptor flag"));
goto cleanup;
}
if (virSetCloseExec(pipeout[0]) == -1) {
ReportError(conn, VIR_ERR_INTERNAL_ERROR,
- _("Failed to set close-on-exec file descriptor flag"));
+ "%s", _("Failed to set close-on-exec file descriptor flag"));
goto cleanup;
}
@@ -186,13 +186,13 @@ virExec(virConnectPtr conn,
if ((flags & VIR_EXEC_NONBLOCK) &&
virSetNonBlock(pipeerr[0]) == -1) {
ReportError(conn, VIR_ERR_INTERNAL_ERROR,
- _("Failed to set non-blocking file descriptor flag"));
+ "%s", _("Failed to set non-blocking file descriptor flag"));
goto cleanup;
}
if (virSetCloseExec(pipeerr[0]) == -1) {
ReportError(conn, VIR_ERR_INTERNAL_ERROR,
- _("Failed to set close-on-exec file descriptor flag"));
+ "%s", _("Failed to set close-on-exec file descriptor flag"));
goto cleanup;
}
diff --git a/src/virsh.c b/src/virsh.c
index 2dd7dd2..89aa4fa 100644
--- a/src/virsh.c
+++ b/src/virsh.c
@@ -4660,7 +4660,7 @@ cmdAttachDevice(vshControl *ctl, const vshCmd *cmd)
virDomainFree(dom);
return FALSE;
} else {
- vshPrint(ctl, _("Device attached successfully\n"));
+ vshPrint(ctl, "%s", _("Device attached successfully\n"));
}
virDomainFree(dom);
@@ -4719,7 +4719,7 @@ cmdDetachDevice(vshControl *ctl, const vshCmd *cmd)
virDomainFree(dom);
return FALSE;
} else {
- vshPrint(ctl, _("Device detached successfully\n"));
+ vshPrint(ctl, "%s", _("Device detached successfully\n"));
}
virDomainFree(dom);
@@ -4831,7 +4831,7 @@ cmdAttachInterface(vshControl *ctl, const vshCmd *cmd)
if (virDomainAttachDevice(dom, buf)) {
goto cleanup;
} else {
- vshPrint(ctl, _("Interface attached successfully\n"));
+ vshPrint(ctl, "%s", _("Interface attached successfully\n"));
}
ret = TRUE;
@@ -4949,7 +4949,7 @@ cmdDetachInterface(vshControl *ctl, const vshCmd *cmd)
if (ret != 0)
ret = FALSE;
else {
- vshPrint(ctl, _("Interface detached successfully\n"));
+ vshPrint(ctl, "%s", _("Interface detached successfully\n"));
ret = TRUE;
}
@@ -5118,7 +5118,7 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd)
if (virDomainAttachDevice(dom, buf))
goto cleanup;
else
- vshPrint(ctl, _("Disk attached successfully\n"));
+ vshPrint(ctl, "%s", _("Disk attached successfully\n"));
ret = TRUE;
@@ -5227,7 +5227,7 @@ cmdDetachDisk(vshControl *ctl, const vshCmd *cmd)
if (ret != 0)
ret = FALSE;
else {
- vshPrint(ctl, _("Disk detached successfully\n"));
+ vshPrint(ctl, "%s", _("Disk detached successfully\n"));
ret = TRUE;
}
@@ -5433,7 +5433,7 @@ cmdEdit (vshControl *ctl, const vshCmd *cmd)
if (STRNEQ (doc, doc_reread)) {
vshError (ctl, FALSE,
- _("ERROR: the XML configuration was changed by another user"));
+ "%s", _("ERROR: the XML configuration was changed by another user"));
goto cleanup;
}
diff --git a/src/xend_internal.c b/src/xend_internal.c
index 65564d8..eb67235 100644
--- a/src/xend_internal.c
+++ b/src/xend_internal.c
@@ -130,7 +130,7 @@ do_connect(virConnectPtr xend)
s = socket(priv->type, SOCK_STREAM, 0);
if (s == -1) {
virXendError(xend, VIR_ERR_INTERNAL_ERROR,
- _("failed to create a socket"));
+ "%s", _("failed to create a socket"));
return -1;
}
@@ -152,7 +152,7 @@ do_connect(virConnectPtr xend)
*/
if (getuid() == 0) {
virXendError(xend, VIR_ERR_INTERNAL_ERROR,
- _("failed to connect to xend"));
+ "%s", _("failed to connect to xend"));
}
}
@@ -199,10 +199,10 @@ wr_sync(virConnectPtr xend, int fd, void *buffer, size_t size, int do_read)
if (len == -1) {
if (do_read)
virXendError(xend, VIR_ERR_INTERNAL_ERROR,
- _("failed to read from Xen Daemon"));
+ "%s", _("failed to read from Xen Daemon"));
else
virXendError(xend, VIR_ERR_INTERNAL_ERROR,
- _("failed to read from Xen Daemon"));
+ "%s", _("failed to read from Xen Daemon"));
return (-1);
}
@@ -529,7 +529,7 @@ xend_op_ext(virConnectPtr xend, const char *path, char *error,
}
if (virBufferError(&buf)) {
- virXendError(NULL, VIR_ERR_NO_MEMORY, _("allocate buffer"));
+ virXendError(NULL, VIR_ERR_NO_MEMORY, "%s", _("allocate buffer"));
return -1;
}
@@ -709,7 +709,7 @@ urlencode(const char *string)
size_t i;
if (VIR_ALLOC_N(buffer, len * 3 + 1) < 0) {
- virXendError(NULL, VIR_ERR_NO_MEMORY, _("allocate new buffer"));
+ virXendError(NULL, VIR_ERR_NO_MEMORY, "%s", _("allocate new buffer"));
return (NULL);
}
ptr = buffer;
@@ -963,7 +963,7 @@ xenDaemonDomainCreateXML(virConnectPtr xend, const char *sexpr)
if (ptr == NULL) {
/* this should be caught at the interface but ... */
virXendError(xend, VIR_ERR_INTERNAL_ERROR,
- _("failed to urlencode the create S-Expr"));
+ "%s", _("failed to urlencode the create S-Expr"));
return (-1);
}
@@ -1004,18 +1004,18 @@ xenDaemonDomainLookupByName_ids(virConnectPtr xend, const char *domname,
value = sexpr_node(root, "domain/domid");
if (value == NULL) {
virXendError(xend, VIR_ERR_INTERNAL_ERROR,
- _("domain information incomplete, missing domid"));
+ "%s", _("domain information incomplete, missing domid"));
goto error;
}
ret = strtol(value, NULL, 0);
if ((ret == 0) && (value[0] != '0')) {
virXendError(xend, VIR_ERR_INTERNAL_ERROR,
- _("domain information incorrect domid not numeric"));
+ "%s", _("domain information incorrect domid not numeric"));
ret = -1;
} else if (uuid != NULL) {
if (sexpr_uuid(uuid, root, "domain/uuid") < 0) {
virXendError(xend, VIR_ERR_INTERNAL_ERROR,
- _("domain information incomplete, missing uuid"));
+ "%s", _("domain information incomplete, missing uuid"));
}
}
@@ -1054,7 +1054,7 @@ xenDaemonDomainLookupByID(virConnectPtr xend,
name = sexpr_node(root, "domain/name");
if (name == NULL) {
virXendError(xend, VIR_ERR_INTERNAL_ERROR,
- _("domain information incomplete, missing name"));
+ "%s", _("domain information incomplete, missing name"));
goto error;
}
if (domname)
@@ -1062,7 +1062,7 @@ xenDaemonDomainLookupByID(virConnectPtr xend,
if (sexpr_uuid(uuid, root, "domain/uuid") < 0) {
virXendError(xend, VIR_ERR_INTERNAL_ERROR,
- _("domain information incomplete, missing uuid"));
+ "%s", _("domain information incomplete, missing uuid"));
goto error;
}
@@ -1143,7 +1143,7 @@ xenDaemonParseSxprOS(virConnectPtr xend,
if (def->os.loader == NULL) {
virXendError(xend, VIR_ERR_INTERNAL_ERROR,
- _("domain information incomplete, missing HVM loader"));
+ "%s", _("domain information incomplete, missing HVM loader"));
return(-1);
}
} else {
@@ -1197,7 +1197,7 @@ xenDaemonParseSxprOS(virConnectPtr xend,
!def->os.kernel &&
!def->os.bootloader) {
virXendError(xend, VIR_ERR_INTERNAL_ERROR,
- _("domain information incomplete, missing kernel & bootloader"));
+ "%s", _("domain information incomplete, missing kernel & bootloader"));
return -1;
}
@@ -1261,7 +1261,7 @@ xend_parse_sexp_desc_char(virConnectPtr conn,
value += sizeof("unix:")-1;
} else {
virXendError(conn, VIR_ERR_INTERNAL_ERROR,
- _("Unknown char device type"));
+ "%s", _("Unknown char device type"));
return -1;
}
@@ -1295,7 +1295,7 @@ xend_parse_sexp_desc_char(virConnectPtr conn,
if (offset == NULL) {
virXendError(conn, VIR_ERR_INTERNAL_ERROR,
- _("malformed char device string"));
+ "%s", _("malformed char device string"));
goto error;
}
@@ -1335,7 +1335,7 @@ xend_parse_sexp_desc_char(virConnectPtr conn,
if (offset == NULL) {
virXendError(conn, VIR_ERR_INTERNAL_ERROR,
- _("malformed char device string"));
+ "%s", _("malformed char device string"));
goto error;
}
@@ -1351,7 +1351,7 @@ xend_parse_sexp_desc_char(virConnectPtr conn,
offset3 = strchr(offset2, ':');
if (offset3 == NULL) {
virXendError(conn, VIR_ERR_INTERNAL_ERROR,
- _("malformed char device string"));
+ "%s", _("malformed char device string"));
goto error;
}
@@ -1418,7 +1418,7 @@ xend_parse_sexp_desc_char(virConnectPtr conn,
if (ret == -1) {
no_memory:
virXendError(conn, VIR_ERR_NO_MEMORY,
- _("no memory for char device config"));
+ "%s", _("no memory for char device config"));
}
error:
@@ -1490,7 +1490,7 @@ xenDaemonParseSxprChar(virConnectPtr conn,
if (offset == NULL) {
virXendError(conn, VIR_ERR_INTERNAL_ERROR,
- _("malformed char device string"));
+ "%s", _("malformed char device string"));
goto error;
}
@@ -1518,7 +1518,7 @@ xenDaemonParseSxprChar(virConnectPtr conn,
if (offset == NULL) {
virXendError(conn, VIR_ERR_INTERNAL_ERROR,
- _("malformed char device string"));
+ "%s", _("malformed char device string"));
goto error;
}
@@ -1534,7 +1534,7 @@ xenDaemonParseSxprChar(virConnectPtr conn,
offset3 = strchr(offset2, ':');
if (offset3 == NULL) {
virXendError(conn, VIR_ERR_INTERNAL_ERROR,
- _("malformed char device string"));
+ "%s", _("malformed char device string"));
goto error;
}
@@ -1625,7 +1625,7 @@ xenDaemonParseSxprDisks(virConnectPtr conn,
if (dst == NULL) {
virXendError(conn, VIR_ERR_INTERNAL_ERROR,
- _("domain information incomplete, vbd has no dev"));
+ "%s", _("domain information incomplete, vbd has no dev"));
goto error;
}
@@ -1636,7 +1636,7 @@ xenDaemonParseSxprDisks(virConnectPtr conn,
!hvm ||
STRNEQ(offset, ":cdrom")) {
virXendError(conn, VIR_ERR_INTERNAL_ERROR,
- _("domain information incomplete, vbd has no src"));
+ "%s", _("domain information incomplete, vbd has no src"));
goto error;
}
}
@@ -1645,7 +1645,7 @@ xenDaemonParseSxprDisks(virConnectPtr conn,
offset = strchr(src, ':');
if (!offset) {
virXendError(conn, VIR_ERR_INTERNAL_ERROR,
- _("cannot parse vbd filename, missing driver name"));
+ "%s", _("cannot parse vbd filename, missing driver name"));
goto error;
}
@@ -1660,7 +1660,7 @@ xenDaemonParseSxprDisks(virConnectPtr conn,
offset = strchr(src, ':');
if (!offset) {
virXendError(conn, VIR_ERR_INTERNAL_ERROR,
- _("cannot parse vbd filename, missing driver type"));
+ "%s", _("cannot parse vbd filename, missing driver type"));
goto error;
}
@@ -2143,7 +2143,7 @@ xenDaemonParseSxpr(virConnectPtr conn,
tmp = sexpr_node(root, "domain/domid");
if (tmp == NULL && xendConfigVersion < 3) { /* Old XenD, domid was mandatory */
virXendError(conn, VIR_ERR_INTERNAL_ERROR,
- _("domain information incomplete, missing id"));
+ "%s", _("domain information incomplete, missing id"));
goto error;
}
def->virtType = VIR_DOMAIN_VIRT_XEN;
@@ -2156,14 +2156,14 @@ xenDaemonParseSxpr(virConnectPtr conn,
goto no_memory;
if (def->name == NULL) {
virXendError(conn, VIR_ERR_INTERNAL_ERROR,
- _("domain information incomplete, missing name"));
+ "%s", _("domain information incomplete, missing name"));
goto error;
}
tmp = sexpr_node(root, "domain/uuid");
if (tmp == NULL) {
virXendError(conn, VIR_ERR_INTERNAL_ERROR,
- _("domain information incomplete, missing name"));
+ "%s", _("domain information incomplete, missing name"));
goto error;
}
virUUIDParse(tmp, def->uuid);
@@ -2553,7 +2553,7 @@ sexpr_to_xend_topology(virConnectPtr conn,
nodeToCpu = sexpr_node(root, "node/node_to_cpu");
if (nodeToCpu == NULL) {
virXendError(conn, VIR_ERR_INTERNAL_ERROR,
- _("failed to parse topology information"));
+ "%s", _("failed to parse topology information"));
return -1;
}
@@ -2607,7 +2607,7 @@ sexpr_to_xend_topology(virConnectPtr conn,
return (0);
parse_error:
- virXendError(conn, VIR_ERR_XEN_CALL, _("topology syntax error"));
+ virXendError(conn, VIR_ERR_XEN_CALL, "%s", _("topology syntax error"));
error:
VIR_FREE(cpuNums);
VIR_FREE(cpuset);
@@ -2617,7 +2617,7 @@ sexpr_to_xend_topology(virConnectPtr conn,
memory_error:
VIR_FREE(cpuNums);
VIR_FREE(cpuset);
- virXendError(conn, VIR_ERR_NO_MEMORY, _("allocate buffer"));
+ virXendError(conn, VIR_ERR_NO_MEMORY, "%s", _("allocate buffer"));
return (-1);
}
@@ -2671,7 +2671,7 @@ sexpr_to_domain(virConnectPtr conn, const struct sexpr *root)
error:
virXendError(conn, VIR_ERR_INTERNAL_ERROR,
- _("failed to parse Xend domain information"));
+ "%s", _("failed to parse Xend domain information"));
if (ret != NULL)
virUnrefDomain(ret);
return(NULL);
@@ -3153,7 +3153,7 @@ xenDaemonDomainFetch(virConnectPtr conn,
root = sexpr_get(conn, "/xend/domain/%d?detail=1", domid);
if (root == NULL) {
virXendError (conn, VIR_ERR_XEN_CALL,
- _("xenDaemonDomainFetch failed to"
+ "%s", _("xenDaemonDomainFetch failed to"
" find this domain"));
return (NULL);
}
@@ -3980,7 +3980,7 @@ xenDaemonDomainGetAutostart(virDomainPtr domain,
root = sexpr_get(domain->conn, "/xend/domain/%s?detail=1", domain->name);
if (root == NULL) {
virXendError (domain->conn, VIR_ERR_XEN_CALL,
- _("xenDaemonGetAutostart failed to find this domain"));
+ "%s", _("xenDaemonGetAutostart failed to find this domain"));
return (-1);
}
@@ -4021,7 +4021,7 @@ xenDaemonDomainSetAutostart(virDomainPtr domain,
root = sexpr_get(domain->conn, "/xend/domain/%s?detail=1", domain->name);
if (root == NULL) {
virXendError (domain->conn, VIR_ERR_XEN_CALL,
- _("xenDaemonSetAutostart failed to find this domain"));
+ "%s", _("xenDaemonSetAutostart failed to find this domain"));
return (-1);
}
@@ -4029,7 +4029,7 @@ xenDaemonDomainSetAutostart(virDomainPtr domain,
if (autostr) {
if (!STREQ(autostr, "ignore") && !STREQ(autostr, "start")) {
virXendError(domain->conn, VIR_ERR_INTERNAL_ERROR,
- _("unexpected value from on_xend_start"));
+ "%s", _("unexpected value from on_xend_start"));
goto error;
}
@@ -4040,23 +4040,23 @@ xenDaemonDomainSetAutostart(virDomainPtr domain,
: strdup("ignore"));
if (!(autonode->u.s.car->u.value)) {
virXendError(domain->conn, VIR_ERR_INTERNAL_ERROR,
- _("no memory"));
+ "%s", _("no memory"));
goto error;
}
if (sexpr2string(root, buf, sizeof(buf)) == 0) {
virXendError(domain->conn, VIR_ERR_INTERNAL_ERROR,
- _("sexpr2string failed"));
+ "%s", _("sexpr2string failed"));
goto error;
}
if (xend_op(domain->conn, "", "op", "new", "config", buf, NULL) != 0) {
virXendError(domain->conn, VIR_ERR_XEN_CALL,
- _("Failed to redefine sexpr"));
+ "%s", _("Failed to redefine sexpr"));
goto error;
}
} else {
virXendError(domain->conn, VIR_ERR_INTERNAL_ERROR,
- _("on_xend_start not present in sexpr"));
+ "%s", _("on_xend_start not present in sexpr"));
goto error;
}
@@ -4124,7 +4124,7 @@ xenDaemonDomainMigratePerform (virDomainPtr domain,
/* Xen doesn't support renaming domains during migration. */
if (dname) {
virXendError (conn, VIR_ERR_NO_SUPPORT,
- _("xenDaemonDomainMigrate: Xen does not support"
+ "%s", _("xenDaemonDomainMigrate: Xen does not support"
" renaming domains during migration"));
return -1;
}
@@ -4134,7 +4134,7 @@ xenDaemonDomainMigratePerform (virDomainPtr domain,
*/
if (bandwidth) {
virXendError (conn, VIR_ERR_NO_SUPPORT,
- _("xenDaemonDomainMigrate: Xen does not support"
+ "%s", _("xenDaemonDomainMigrate: Xen does not support"
" bandwidth limits during migration"));
return -1;
}
@@ -4146,7 +4146,7 @@ xenDaemonDomainMigratePerform (virDomainPtr domain,
}
if (flags != 0) {
virXendError (conn, VIR_ERR_NO_SUPPORT,
- _("xenDaemonDomainMigrate: unsupported flag"));
+ "%s", _("xenDaemonDomainMigrate: unsupported flag"));
return -1;
}
@@ -4159,26 +4159,26 @@ xenDaemonDomainMigratePerform (virDomainPtr domain,
xmlURIPtr uriptr = xmlParseURI (uri);
if (!uriptr) {
virXendError (conn, VIR_ERR_INVALID_ARG,
- _("xenDaemonDomainMigrate: invalid URI"));
+ "%s", _("xenDaemonDomainMigrate: invalid URI"));
return -1;
}
if (uriptr->scheme && STRCASENEQ (uriptr->scheme, "xenmigr")) {
virXendError (conn, VIR_ERR_INVALID_ARG,
- _("xenDaemonDomainMigrate: only xenmigr://"
+ "%s", _("xenDaemonDomainMigrate: only xenmigr://"
" migrations are supported by Xen"));
xmlFreeURI (uriptr);
return -1;
}
if (!uriptr->server) {
virXendError (conn, VIR_ERR_INVALID_ARG,
- _("xenDaemonDomainMigrate: a hostname must be"
+ "%s", _("xenDaemonDomainMigrate: a hostname must be"
" specified in the URI"));
xmlFreeURI (uriptr);
return -1;
}
hostname = strdup (uriptr->server);
if (!hostname) {
- virXendError (conn, VIR_ERR_NO_MEMORY, _("strdup failed"));
+ virXendError (conn, VIR_ERR_NO_MEMORY, "%s", _("strdup failed"));
xmlFreeURI (uriptr);
return -1;
}
@@ -4191,7 +4191,7 @@ xenDaemonDomainMigratePerform (virDomainPtr domain,
if (sscanf (p+1, "%d", &port_nr) != 1) {
virXendError (conn, VIR_ERR_INVALID_ARG,
- _("xenDaemonDomainMigrate: invalid port number"));
+ "%s", _("xenDaemonDomainMigrate: invalid port number"));
return -1;
}
snprintf (port, sizeof port, "%d", port_nr);
@@ -4200,7 +4200,7 @@ xenDaemonDomainMigratePerform (virDomainPtr domain,
n = p - uri; /* n = Length of hostname in bytes. */
hostname = strdup (uri);
if (!hostname) {
- virXendError (conn, VIR_ERR_NO_MEMORY, _("strdup failed"));
+ virXendError (conn, VIR_ERR_NO_MEMORY, "%s", _("strdup failed"));
return -1;
}
hostname[n] = '\0';
@@ -4208,7 +4208,7 @@ xenDaemonDomainMigratePerform (virDomainPtr domain,
else { /* "hostname" (or IP address) */
hostname = strdup (uri);
if (!hostname) {
- virXendError (conn, VIR_ERR_NO_MEMORY, _("strdup failed"));
+ virXendError (conn, VIR_ERR_NO_MEMORY, "%s", _("strdup failed"));
return -1;
}
}
@@ -4244,13 +4244,13 @@ virDomainPtr xenDaemonDomainDefineXML(virConnectPtr conn, const char *xmlDesc) {
if (!(def = virDomainDefParseString(conn, priv->caps, xmlDesc))) {
virXendError(conn, VIR_ERR_XML_ERROR,
- _("failed to parse domain description"));
+ "%s", _("failed to parse domain description"));
return (NULL);
}
if (!(sexpr = xenDaemonFormatSxpr(conn, def, priv->xendConfigVersion))) {
virXendError(conn, VIR_ERR_XML_ERROR,
- _("failed to build sexpr"));
+ "%s", _("failed to build sexpr"));
goto error;
}
@@ -4416,7 +4416,7 @@ xenDaemonGetSchedulerType(virDomainPtr domain, int *nparams)
priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
if (priv->xendConfigVersion < 4) {
virXendError (domain->conn, VIR_ERR_NO_SUPPORT,
- _("unsupported in xendConfigVersion < 4"));
+ "%s", _("unsupported in xendConfigVersion < 4"));
return NULL;
}
@@ -4428,25 +4428,25 @@ xenDaemonGetSchedulerType(virDomainPtr domain, int *nparams)
ret = sexpr_node(root, "node/xen_scheduler");
if (ret == NULL){
virXendError(domain->conn, VIR_ERR_INTERNAL_ERROR,
- _("node information incomplete, missing scheduler name"));
+ "%s", _("node information incomplete, missing scheduler name"));
goto error;
}
if (STREQ (ret, "credit")) {
schedulertype = strdup("credit");
if (schedulertype == NULL){
- virXendError(domain->conn, VIR_ERR_SYSTEM_ERROR, _("strdup failed"));
+ virXendError(domain->conn, VIR_ERR_SYSTEM_ERROR, "%s", _("strdup failed"));
goto error;
}
*nparams = XEN_SCHED_CRED_NPARAM;
} else if (STREQ (ret, "sedf")) {
schedulertype = strdup("sedf");
if (schedulertype == NULL){
- virXendError(domain->conn, VIR_ERR_SYSTEM_ERROR, _("strdup failed"));
+ virXendError(domain->conn, VIR_ERR_SYSTEM_ERROR, "%s", _("strdup failed"));
goto error;
}
*nparams = XEN_SCHED_SEDF_NPARAM;
} else {
- virXendError(domain->conn, VIR_ERR_INTERNAL_ERROR, _("Unknown scheduler"));
+ virXendError(domain->conn, VIR_ERR_INTERNAL_ERROR, "%s", _("Unknown scheduler"));
goto error;
}
@@ -4492,7 +4492,7 @@ xenDaemonGetSchedulerParameters(virDomainPtr domain,
priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
if (priv->xendConfigVersion < 4) {
virXendError (domain->conn, VIR_ERR_NO_SUPPORT,
- _("unsupported in xendConfigVersion < 4"));
+ "%s", _("unsupported in xendConfigVersion < 4"));
return (-1);
}
@@ -4505,7 +4505,7 @@ xenDaemonGetSchedulerParameters(virDomainPtr domain,
sched_type = xenDaemonGetSchedulerType(domain, &sched_nparam);
if (sched_type == NULL) {
virXendError(domain->conn, VIR_ERR_INTERNAL_ERROR,
- _("Failed to get a scheduler name"));
+ "%s", _("Failed to get a scheduler name"));
goto error;
}
@@ -4518,12 +4518,12 @@ xenDaemonGetSchedulerParameters(virDomainPtr domain,
/* get cpu_weight/cpu_cap from xend/domain */
if (sexpr_node(root, "domain/cpu_weight") == NULL) {
virXendError(domain->conn, VIR_ERR_INTERNAL_ERROR,
- _("domain information incomplete, missing cpu_weight"));
+ "%s", _("domain information incomplete, missing cpu_weight"));
goto error;
}
if (sexpr_node(root, "domain/cpu_cap") == NULL) {
virXendError(domain->conn, VIR_ERR_INTERNAL_ERROR,
- _("domain information incomplete, missing cpu_cap"));
+ "%s", _("domain information incomplete, missing cpu_cap"));
goto error;
}
@@ -4540,7 +4540,7 @@ xenDaemonGetSchedulerParameters(virDomainPtr domain,
ret = 0;
break;
default:
- virXendError(domain->conn, VIR_ERR_INTERNAL_ERROR, _("Unknown scheduler"));
+ virXendError(domain->conn, VIR_ERR_INTERNAL_ERROR, "%s", _("Unknown scheduler"));
goto error;
}
@@ -4582,7 +4582,7 @@ xenDaemonSetSchedulerParameters(virDomainPtr domain,
priv = (xenUnifiedPrivatePtr) domain->conn->privateData;
if (priv->xendConfigVersion < 4) {
virXendError (domain->conn, VIR_ERR_NO_SUPPORT,
- _("unsupported in xendConfigVersion < 4"));
+ "%s", _("unsupported in xendConfigVersion < 4"));
return (-1);
}
@@ -4595,7 +4595,7 @@ xenDaemonSetSchedulerParameters(virDomainPtr domain,
sched_type = xenDaemonGetSchedulerType(domain, &sched_nparam);
if (sched_type == NULL) {
virXendError(domain->conn, VIR_ERR_INTERNAL_ERROR,
- _("Failed to get a scheduler name"));
+ "%s", _("Failed to get a scheduler name"));
goto error;
}
@@ -4631,7 +4631,7 @@ xenDaemonSetSchedulerParameters(virDomainPtr domain,
weight = sexpr_node(root, "domain/cpu_weight");
if (weight == NULL) {
virXendError(domain->conn, VIR_ERR_INTERNAL_ERROR,
- _("domain information incomplete, missing cpu_weight"));
+ "%s", _("domain information incomplete, missing cpu_weight"));
goto error;
}
snprintf(buf_weight, sizeof(buf_weight), "%s", weight);
@@ -4640,7 +4640,7 @@ xenDaemonSetSchedulerParameters(virDomainPtr domain,
cap = sexpr_node(root, "domain/cpu_cap");
if (cap == NULL) {
virXendError(domain->conn, VIR_ERR_INTERNAL_ERROR,
- _("domain information incomplete, missing cpu_cap"));
+ "%s", _("domain information incomplete, missing cpu_cap"));
goto error;
}
snprintf(buf_cap, sizeof(buf_cap), "%s", cap);
@@ -4652,7 +4652,7 @@ xenDaemonSetSchedulerParameters(virDomainPtr domain,
break;
}
default:
- virXendError(domain->conn, VIR_ERR_INTERNAL_ERROR, _("Unknown scheduler"));
+ virXendError(domain->conn, VIR_ERR_INTERNAL_ERROR, "%s", _("Unknown scheduler"));
goto error;
}
@@ -4698,7 +4698,7 @@ xenDaemonDomainBlockPeek (virDomainPtr domain, const char *path,
else {
/* This call always fails for dom0. */
virXendError (domain->conn, VIR_ERR_NO_SUPPORT,
- _("domainBlockPeek is not supported for dom0"));
+ "%s", _("domainBlockPeek is not supported for dom0"));
return -1;
}
@@ -4911,7 +4911,7 @@ xenDaemonFormatSxprChr(virConnectPtr conn,
if (!type) {
virXendError(conn, VIR_ERR_INTERNAL_ERROR,
- _("unexpected chr device type"));
+ "%s", _("unexpected chr device type"));
return -1;
}
@@ -5488,7 +5488,7 @@ virDomainXMLDevID(virDomainPtr domain,
ref[ref_len - 1] = '\0';
} else {
virXendError(NULL, VIR_ERR_NO_SUPPORT,
- _("hotplug of device type not supported"));
+ "%s", _("hotplug of device type not supported"));
return -1;
}
diff --git a/src/xm_internal.c b/src/xm_internal.c
index e117a36..6c84b91 100644
--- a/src/xm_internal.c
+++ b/src/xm_internal.c
@@ -487,7 +487,7 @@ static int xenXMConfigCacheRefresh (virConnectPtr conn) {
virDomainDefFree(entry->def);
VIR_FREE(entry);
xenXMError (conn, VIR_ERR_INTERNAL_ERROR,
- _("xenXMConfigCacheRefresh: virHashAddEntry"));
+ "%s", _("xenXMConfigCacheRefresh: virHashAddEntry"));
goto cleanup;
}
}
@@ -1419,22 +1419,22 @@ int xenXMDomainPinVcpu(virDomainPtr domain,
}
if (domain->conn->flags & VIR_CONNECT_RO) {
xenXMError (domain->conn, VIR_ERR_INVALID_ARG,
- _("read only connection"));
+ "%s", _("read only connection"));
return -1;
}
if (domain->id != -1) {
xenXMError (domain->conn, VIR_ERR_INVALID_ARG,
- _("not inactive domain"));
+ "%s", _("not inactive domain"));
return -1;
}
if (!(filename = virHashLookup(nameConfigMap, domain->name))) {
- xenXMError (domain->conn, VIR_ERR_INTERNAL_ERROR, _("virHashLookup"));
+ xenXMError (domain->conn, VIR_ERR_INTERNAL_ERROR, "%s", _("virHashLookup"));
return -1;
}
if (!(entry = virHashLookup(configCache, filename))) {
xenXMError (domain->conn, VIR_ERR_INTERNAL_ERROR,
- _("can't retrieve config file for domain"));
+ "%s", _("can't retrieve config file for domain"));
return -1;
}
@@ -1452,14 +1452,14 @@ int xenXMDomainPinVcpu(virDomainPtr domain,
}
if (virBufferError(&mapbuf)) {
- xenXMError(domain->conn, VIR_ERR_NO_MEMORY, _("allocate buffer"));
+ xenXMError(domain->conn, VIR_ERR_NO_MEMORY, "%s", _("allocate buffer"));
return -1;
}
mapstr = virBufferContentAndReset(&mapbuf);
if (VIR_ALLOC_N(cpuset, maxcpu) < 0) {
- xenXMError(domain->conn, VIR_ERR_NO_MEMORY, _("allocate buffer"));
+ xenXMError(domain->conn, VIR_ERR_NO_MEMORY, "%s", _("allocate buffer"));
goto cleanup;
}
if (virDomainCpuSetParse(domain->conn,
@@ -1594,7 +1594,7 @@ int xenXMDomainCreate(virDomainPtr domain) {
if (!(sexpr = xenDaemonFormatSxpr(domain->conn, entry->def, priv->xendConfigVersion))) {
xenXMError(domain->conn, VIR_ERR_XML_ERROR,
- _("failed to build sexpr"));
+ "%s", _("failed to build sexpr"));
return (-1);
}
@@ -2216,13 +2216,13 @@ virDomainPtr xenXMDomainDefineXML(virConnectPtr conn, const char *xml) {
if (!(oldfilename = (char *)virHashLookup(nameConfigMap, def->name))) {
xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
- _("can't retrieve config filename for domain to overwrite"));
+ "%s", _("can't retrieve config filename for domain to overwrite"));
goto error;
}
if (!(entry = virHashLookup(configCache, oldfilename))) {
xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
- _("can't retrieve config entry for domain to overwrite"));
+ "%s", _("can't retrieve config entry for domain to overwrite"));
goto error;
}
@@ -2233,14 +2233,14 @@ virDomainPtr xenXMDomainDefineXML(virConnectPtr conn, const char *xml) {
/* Remove the name -> filename mapping */
if (virHashRemoveEntry(nameConfigMap, def->name, NULL) < 0) {
xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
- _("failed to remove old domain from config map"));
+ "%s", _("failed to remove old domain from config map"));
goto error;
}
/* Remove the config record itself */
if (virHashRemoveEntry(configCache, oldfilename, xenXMConfigFree) < 0) {
xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
- _("failed to remove old domain from config map"));
+ "%s", _("failed to remove old domain from config map"));
goto error;
}
@@ -2249,7 +2249,7 @@ virDomainPtr xenXMDomainDefineXML(virConnectPtr conn, const char *xml) {
if ((strlen(configDir) + 1 + strlen(def->name) + 1) > PATH_MAX) {
xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
- _("config file name is too long"));
+ "%s", _("config file name is too long"));
goto error;
}
@@ -2261,13 +2261,13 @@ virDomainPtr xenXMDomainDefineXML(virConnectPtr conn, const char *xml) {
goto error;
if (VIR_ALLOC(entry) < 0) {
- xenXMError(conn, VIR_ERR_NO_MEMORY, _("config"));
+ xenXMError(conn, VIR_ERR_NO_MEMORY, "%s", _("config"));
goto error;
}
if ((entry->refreshedAt = time(NULL)) == ((time_t)-1)) {
xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
- _("unable to get current time"));
+ "%s", _("unable to get current time"));
goto error;
}
@@ -2276,14 +2276,14 @@ virDomainPtr xenXMDomainDefineXML(virConnectPtr conn, const char *xml) {
if (virHashAddEntry(configCache, filename, entry) < 0) {
xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
- _("unable to store config file handle"));
+ "%s", _("unable to store config file handle"));
goto error;
}
if (virHashAddEntry(nameConfigMap, def->name, entry->filename) < 0) {
virHashRemoveEntry(configCache, filename, NULL);
xenXMError(conn, VIR_ERR_INTERNAL_ERROR,
- _("unable to store config file handle"));
+ "%s", _("unable to store config file handle"));
goto error;
}
@@ -2471,7 +2471,7 @@ xenXMDomainAttachDevice(virDomainPtr domain, const char *xml) {
default:
xenXMError(domain->conn, VIR_ERR_XML_ERROR,
- _("unknown device"));
+ "%s", _("unknown device"));
goto cleanup;
}
@@ -2586,7 +2586,7 @@ xenXMDomainDetachDevice(virDomainPtr domain, const char *xml) {
}
default:
xenXMError(domain->conn, VIR_ERR_XML_ERROR,
- _("unknown device"));
+ "%s", _("unknown device"));
goto cleanup;
}
diff --git a/src/xml.c b/src/xml.c
index 3536216..6f2fa8b 100644
--- a/src/xml.c
+++ b/src/xml.c
@@ -54,7 +54,7 @@ virXPathString(virConnectPtr conn,
if ((ctxt == NULL) || (xpath == NULL)) {
virXMLError(conn, VIR_ERR_INTERNAL_ERROR,
- _("Invalid parameter to virXPathString()"));
+ "%s", _("Invalid parameter to virXPathString()"));
return (NULL);
}
relnode = ctxt->node;
@@ -67,7 +67,7 @@ virXPathString(virConnectPtr conn,
ret = strdup((char *) obj->stringval);
xmlXPathFreeObject(obj);
if (ret == NULL) {
- virXMLError(conn, VIR_ERR_NO_MEMORY, _("strdup failed"));
+ virXMLError(conn, VIR_ERR_NO_MEMORY, "%s", _("strdup failed"));
}
ctxt->node = relnode;
return (ret);
@@ -95,7 +95,7 @@ virXPathNumber(virConnectPtr conn,
if ((ctxt == NULL) || (xpath == NULL) || (value == NULL)) {
virXMLError(conn, VIR_ERR_INTERNAL_ERROR,
- _("Invalid parameter to virXPathNumber()"));
+ "%s", _("Invalid parameter to virXPathNumber()"));
return (-1);
}
relnode = ctxt->node;
@@ -137,7 +137,7 @@ virXPathLong(virConnectPtr conn,
if ((ctxt == NULL) || (xpath == NULL) || (value == NULL)) {
virXMLError(conn, VIR_ERR_INTERNAL_ERROR,
- _("Invalid parameter to virXPathNumber()"));
+ "%s", _("Invalid parameter to virXPathNumber()"));
return (-1);
}
relnode = ctxt->node;
@@ -192,7 +192,7 @@ virXPathULong(virConnectPtr conn,
if ((ctxt == NULL) || (xpath == NULL) || (value == NULL)) {
virXMLError(conn, VIR_ERR_INTERNAL_ERROR,
- _("Invalid parameter to virXPathNumber()"));
+ "%s", _("Invalid parameter to virXPathNumber()"));
return (-1);
}
relnode = ctxt->node;
@@ -250,7 +250,7 @@ virXPathBoolean(virConnectPtr conn,
if ((ctxt == NULL) || (xpath == NULL)) {
virXMLError(conn, VIR_ERR_INTERNAL_ERROR,
- _("Invalid parameter to virXPathBoolean()"));
+ "%s", _("Invalid parameter to virXPathBoolean()"));
return (-1);
}
relnode = ctxt->node;
@@ -288,7 +288,7 @@ virXPathNode(virConnectPtr conn,
if ((ctxt == NULL) || (xpath == NULL)) {
virXMLError(conn, VIR_ERR_INTERNAL_ERROR,
- _("Invalid parameter to virXPathNode()"));
+ "%s", _("Invalid parameter to virXPathNode()"));
return (NULL);
}
relnode = ctxt->node;
@@ -330,7 +330,7 @@ virXPathNodeSet(virConnectPtr conn,
if ((ctxt == NULL) || (xpath == NULL)) {
virXMLError(conn, VIR_ERR_INTERNAL_ERROR,
- _("Invalid parameter to virXPathNodeSet()"));
+ "%s", _("Invalid parameter to virXPathNodeSet()"));
return (-1);
}
diff --git a/src/xs_internal.c b/src/xs_internal.c
index ca6277d..d9e8123 100644
--- a/src/xs_internal.c
+++ b/src/xs_internal.c
@@ -298,7 +298,7 @@ xenStoreOpen(virConnectPtr conn,
*/
if (getuid() == 0) {
virXenStoreError(NULL, VIR_ERR_NO_XEN,
- _("failed to connect to Xen Store"));
+ "%s", _("failed to connect to Xen Store"));
}
return (-1);
}
--
1.6.0.2.307.gc4275
3
4