[libvirt] [PATCH 0/3] LXC misc fixes and cleanups
by Ryota Ozaki
This patch series fix and cleanup over whole lxc codes.
I want to clean up before adding more in them.
Thanks,
ozaki-r
Ryota Ozaki (3):
LXC fix wrong or out-of-date function descriptions
LXC cleanup and fix lxcError
LXC cleanup deep indentation in lxcDomainSetAutostart
src/lxc/lxc_container.c | 85 +++++++++++-----------
src/lxc/lxc_controller.c | 40 ++++++-----
src/lxc/lxc_driver.c | 177 +++++++++++++++++++++++++---------------------
src/lxc/veth.c | 8 +-
4 files changed, 164 insertions(+), 146 deletions(-)
15 years, 1 month
[libvirt] flush guest page cache and suspend?
by Marco Colombo
Hi,
I'm new to this list. I've searched the archives (and google) but I
haven't found an answer.
Recently I moved to CentOS 5.4, with libvirt-0.6.3 and kvm-83. They are
rather new compared to 5.3 ones, so I'm still investigating on the new
capabilities.
My guests disk images are LV single devices, /dev/vg_virt/<guestname>,
usually with two partitions, the root fs and swap space.
I'd like to run backups on the node only, taking snapshots of the LVs.
I'm already doing that, actually. Everything works fine, using bacula
(with one minor glitch, but that's for another list).
Now I wonder if it makes sense to suspend the guest before creating the
snapshot:
virsh suspend <guestname>
lvcreate --snapshot ...
virsh resume <guestname>
... perform backup ...
lvremove -f <the snapshot>
but thinking about it a second time it seems it doesn't add anything to
the equation, the filesystem is still potentially unclean, with data to
be written still in the guest page cache. The filesystem is ext3, so
it's not that bad (recovers a consistent state from the journal, with
standard options even data-consistent, not just metadata-consistent).
Yet it's like doing a backup of a (potentially badly) crashed
filesystem. While I trust the recovery step of ext3, my feeling is that
it can't be 100% reliable. I have (rarely) seen ext3 crash and ask for
fsck at boot, journal or not (for truth's sake, I can't rule out an hard
disk problem in those cases).
So, first question: does the suspend command cause a flush in the guest
OS (details: both guest and node are CentOS 5.4, hypervisor is qemu-kvm)?
I guess not (otherwise I won't be here). So if not, what are the options
to force the sync?
Ideally, there should be a single atomic 'sync & suspend'. In practice,
I can think of some workarounds: ssh <guest> -c sync, or the very
old-fashioned way of enabling the 'sync' user and logging in from the
serial console, or issuing a sysrq-s, again on the console.
I'm interested in the latter, but I wasn't able to trigger the sysrq
from either 'virsh console <guestname>' or 'screen `virsh ttyconsole
<guestname>` (tried minicom, too). The serial console is on pty, I'm not
even sure you can generate a break on a pty. (and yes, I remembered to
sysctl -w kernel.sysrq=1 on the guest).
I know XEN has 'xm sysrq', but this is kvm. Is there anything similar? I
think it can be done if you invoke qemu-kvm from the command line with
-nographics (it multiplexes the console and the monitor lines on
stdin/out, and you can send a 'break' with C-a b I think, I've never tried).
So question 2): is there a way to send a sysrq-s to the guest?
My fallback plan is to try and map the serial line over telnet instead
of pty, and the figure out a way to send the break (which I think is
part of the telnet protocol) from the command line. I'd rather not mess
with telnet and local port assignment to the guests, if not necessary.
My really fallback plan is to revert to shutdown/snapshot/create, which
is overkill for a daily backup.
Question 3): does it _really_ make sense to try and sync the guest OS
page cache before taking the snapshot? Or is it just me being paranoid?
For reference, here's the qemu cmdline of one of the guests:
/usr/libexec/qemu-kvm -S -M pc -m 512 -smp 1 -name wtitv -uuid
445d0fe5-c1b6-4baf-a186-da1fe021158c -monitor pty -pidfile
/var/run/libvirt/qemu//wtitv.pid -boot c -drive
file=/dev/vg_virt/wtitv,if=ide,index=0,boot=on -net
nic,macaddr=00:16:3e:57:45:4f,vlan=0,model=e1000 -net
tap,fd=14,script=,vlan=0,ifname=vnet0 -serial pty -parallel none -usb
-usbdevice tablet -vnc 127.0.0.1:0
and here's the xml config file for libvirt, same guest:
<domain type='kvm'>
<name>wtitv</name>
<uuid>445d0fe5-c1b6-4baf-a186-da1fe021158c</uuid>
<memory>524288</memory>
<currentMemory>524288</currentMemory>
<vcpu>1</vcpu>
<os>
<type arch='x86_64' machine='pc'>hvm</type>
<boot dev='hd'/>
</os>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<features>
<acpi/>
</features>
<devices>
<emulator>/usr/libexec/qemu-kvm</emulator>
<disk type='block' device='disk'>
<source dev='/dev/vg_virt/wtitv'/>
<target dev='hda' bus='ide'/>
</disk>
<interface type='bridge'>
<mac address='00:16:3e:57:45:4f'/>
<source bridge='br1'/>
<model type='e1000'/>
</interface>
<console type='pty'>
<target port='0'/>
</console>
<input type='tablet' bus='usb'/>
<graphics type='vnc' autoport='yes'/>
</devices>
</domain>
TIA,
.TM.
15 years, 1 month
[libvirt] [PATCH 0/2] CPU flags capabilities and domain configuration
by Jiri Denemark
Hi,
These are two initial patches for CPU flags/masks support for libvirt.
The first patch contains changes to schemas and describes semantics of
new elements and attributes.
The second patch introduces internal API functions for XML parsing and
formating.
Jiri Denemark (2):
XML schema for CPU flags
XML parsing/formating code for CPU flags
docs/schemas/capability.rng | 30 ++++
docs/schemas/domain.rng | 49 ++++++
include/libvirt/virterror.h | 1 +
src/Makefile.am | 9 +-
src/conf/capabilities.c | 31 ++++-
src/conf/capabilities.h | 6 +
src/conf/cpu_conf.c | 345 +++++++++++++++++++++++++++++++++++++++++++
src/conf/cpu_conf.h | 110 ++++++++++++++
src/conf/domain_conf.c | 15 ++
src/conf/domain_conf.h | 2 +
src/libvirt_private.syms | 8 +
src/util/virterror.c | 3 +
12 files changed, 606 insertions(+), 3 deletions(-)
create mode 100644 src/conf/cpu_conf.c
create mode 100644 src/conf/cpu_conf.h
15 years, 1 month
[libvirt] F12beta guest will not connect to LAN via bridge
by Gerry Reno
Setup:
HOST: F11 x86_64
GUEST: F12beta x86_64
I have a number of guests setup on this host and all connect without a
problem with the 'br0' bridge on the host. I created a new guest and
loaded F12beta on it. I defined it to also use 'br0' networking but
this guest cannot ping anything on the LAN. All the other guests have
no problems communicating to addresses on the LAN.
Details:
### on HOST:
# brctl showmacs br0
port no mac addr is local? ageing timer
1 00:0b:82:11:bc:cb no 15.88
3 00:0c:01:30:50:00 no 16.37
2 00:0c:01:40:50:00 no 2.51
1 00:0c:29:e3:bc:ee no 0.49
1 00:18:f8:48:27:15 no 2.51
1 00:18:f8:9b:ba:b4 no 116.39
1 00:18:f8:9b:ba:b5 no 20.60
1 00:1a:4d:5e:f6:36 no 156.43
1 00:24:1d:19:05:cf yes 0.00
3 06:1d:1d:7a:31:9b yes 0.00
2 06:ba:11:dd:7b:08 yes 0.00
1 54:52:00:24:5e:cf no 28.93
# EXISTING GUEST: network interface in xml file:
<interface type='bridge'>
<mac address='00:0c:01:30:50:00'/>
<source bridge='br0'/>
<target dev='vnet0'/>
<model type='virtio'/>
</interface>
# NEW GUEST: network interface in xml file:
<interface type='bridge'>
<mac address='00:0c:01:40:50:00'/>
<source bridge='br0'/>
<target dev='vnet0'/>
<model type='virtio'/>
</interface>
### on EXISTING GUEST:
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
HWADDR=00:0c:01:30:50:00
IPADDR=192.168.1.200
NETMASK=255.255.255.0
NETWORK=192.168.1.0
### on NEW GUEST:
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=static
HWADDR=00:0c:01:40:50:00
IPADDR=192.168.1.210
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
NETWORK=192.168.1.0
TYPE=Ethernet
IPV6INIT=no
USERCTL=no
### on EXISTING GUEST:
# ping 192.168.1.1
succeeds
### on NEW GUEST:
# ping 192.168.1.1
fails with Destination Host Unreachable
Is there something else I need to configure in F12beta to get this working?
-Gerry
15 years, 1 month
[libvirt] Minor doc fix for <clock>
by Cole Robinson
FYI, I just pushed this minor docs fix:
commit 45bd290b64c9f911ebb6e0990f8fcef249576436
Author: Cole Robinson <crobinso(a)redhat.com>
Date: Wed Nov 4 13:26:28 2009 -0500
docs: <clock> property is 'offset', not 'sync'
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index 53cd960..d26ce75 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -300,7 +300,7 @@
<dl>
<dt><code>clock</code></dt>
- <dd>The <code>sync</code> attribute takes either "utc" or
+ <dd>The <code>offset</code> attribute takes either "utc" or
"localtime" to specify how the guest clock is initialized
in relation to the host OS.
</dd>
Thanks,
Cole
15 years, 1 month
[libvirt] ESX with Python binding
by Dave Bryson
I'm new to libvirt. Is it possible to use the python binding with the
latest ESX support? If so, does anyone have a simple example I can try?
Thanks in advance!
Dave
15 years, 1 month
[libvirt] [RFC][PATCH] LXC allow a container to have ethN named interfaces
by Ryota Ozaki
Note that this patch is not mature yet and still proof-
of-concept prototype, although it actually works.
Current implementation of lxc driver creates vethN named
interface(s) in the host and passes as it is to a container.
The reason why it doesn't use ethN is due to the limitation
that one namespace cannot have multiple iterfaces that have
an identical name so that we give up creating ethN named
interface in the host for the container.
However, we should be able to allow the container to have
ethN by changing the name after clone(CLONE_NEWNET) in
controller.
To this end, this patch extends --veth argument of
controller to be able to have two names; one is the name
of a created veth, and the other is a new name. The format
is:
--veth veth1,eth0 --veth veth3,eth1 ...
where veth1 is old name and eth0 is new one. The implementation
also allows a single name, in that case, controller does not
do nothing for the interface, which is the original behavior.
The numbering of the new names is simply ascending order
from zero. So if there is one interface, its name will
be eth0.
---
src/lxc/lxc_container.c | 23 ++++++++++++++++++-----
src/lxc/lxc_container.h | 1 +
src/lxc/lxc_controller.c | 30 ++++++++++++++++++++++++++++--
src/lxc/lxc_driver.c | 30 +++++++++++++++++++++++++-----
src/lxc/veth.c | 20 ++++++++++++++++++++
src/lxc/veth.h | 1 +
6 files changed, 93 insertions(+), 12 deletions(-)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index f4381e7..f065788 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -84,6 +84,7 @@ struct __lxc_child_argv {
virDomainDefPtr config;
unsigned int nveths;
char **veths;
+ char **newveths;
int monitor;
char *ttyPath;
};
@@ -233,14 +234,23 @@ static int lxcContainerWaitForContinue(int control)
* Returns 0 on success or nonzero in case of error
*/
static int lxcContainerEnableInterfaces(unsigned int nveths,
- char **veths)
+ char **veths, char **newveths)
{
int rc = 0;
unsigned int i;
for (i = 0 ; i < nveths ; i++) {
- DEBUG("Enabling %s", veths[i]);
- rc = vethInterfaceUpOrDown(veths[i], 1);
+ char *veth = veths[i];
+ if (newveths[i] && !STREQ(veths[i], newveths[i])) {
+ DEBUG("changing %s", veths[i]);
+ rc = setInterfaceName(veths[i], newveths[i]);
+ if (0 != rc) {
+ goto error_out;
+ }
+ veth = newveths[i];
+ }
+ DEBUG("Enabling %s", veth);
+ rc = vethInterfaceUpOrDown(veth, 1);
if (0 != rc) {
goto error_out;
}
@@ -758,7 +768,9 @@ static int lxcContainerChild( void *data )
return -1;
/* enable interfaces */
- if (lxcContainerEnableInterfaces(argv->nveths, argv->veths) < 0)
+ if (lxcContainerEnableInterfaces(argv->nveths,
+ argv->veths,
+ argv->newveths) < 0)
return -1;
/* drop a set of root capabilities */
@@ -786,6 +798,7 @@ static int userns_supported(void)
int lxcContainerStart(virDomainDefPtr def,
unsigned int nveths,
char **veths,
+ char **newveths,
int control,
char *ttyPath)
{
@@ -793,7 +806,7 @@ int lxcContainerStart(virDomainDefPtr def,
int flags;
int stacksize = getpagesize() * 4;
char *stack, *stacktop;
- lxc_child_argv_t args = { def, nveths, veths, control, ttyPath };
+ lxc_child_argv_t args = { def, nveths, veths, newveths, control, ttyPath };
/* allocate a stack for the container */
if (VIR_ALLOC_N(stack, stacksize) < 0) {
diff --git a/src/lxc/lxc_container.h b/src/lxc/lxc_container.h
index a1dd5a1..d796380 100644
--- a/src/lxc/lxc_container.h
+++ b/src/lxc/lxc_container.h
@@ -49,6 +49,7 @@ int lxcContainerSendContinue(int control);
int lxcContainerStart(virDomainDefPtr def,
unsigned int nveths,
char **veths,
+ char **newveths,
int control,
char *ttyPath);
diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
index 545f718..75dd73a 100644
--- a/src/lxc/lxc_controller.c
+++ b/src/lxc/lxc_controller.c
@@ -493,6 +493,7 @@ static int
lxcControllerRun(virDomainDefPtr def,
unsigned int nveths,
char **veths,
+ char **newveths,
int monitor,
int client,
int appPty)
@@ -603,6 +604,7 @@ lxcControllerRun(virDomainDefPtr def,
if ((container = lxcContainerStart(def,
nveths,
veths,
+ newveths,
control[1],
containerPtyPath)) < 0)
goto cleanup;
@@ -649,6 +651,7 @@ int main(int argc, char *argv[])
char *name = NULL;
int nveths = 0;
char **veths = NULL;
+ char **newveths = NULL;
int monitor = -1;
int appPty = -1;
int bg = 0;
@@ -691,10 +694,33 @@ int main(int argc, char *argv[])
virReportOOMError(NULL);
goto cleanup;
}
- if ((veths[nveths++] = strdup(optarg)) == NULL) {
+ if (VIR_REALLOC_N(newveths, nveths+1) < 0) {
virReportOOMError(NULL);
goto cleanup;
}
+ {
+ char *sep = strchr(optarg, ',');
+ if (sep) {
+ *sep = '\0';
+ sep++;
+ if ((veths[nveths] = strdup(optarg)) == NULL) {
+ virReportOOMError(NULL);
+ goto cleanup;
+ }
+ if ((newveths[nveths] = strdup(sep)) == NULL) {
+ virReportOOMError(NULL);
+ goto cleanup;
+ }
+ nveths++;
+ } else {
+ if ((veths[nveths] = strdup(optarg)) == NULL) {
+ virReportOOMError(NULL);
+ goto cleanup;
+ }
+ newveths[nveths] = NULL;
+ nveths++;
+ }
+ }
break;
case 'c':
@@ -803,7 +829,7 @@ int main(int argc, char *argv[])
goto cleanup;
}
- rc = lxcControllerRun(def, nveths, veths, monitor, client, appPty);
+ rc = lxcControllerRun(def, nveths, veths, newveths, monitor, client, appPty);
cleanup:
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 4f0787b..1323cff 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -693,13 +693,15 @@ static int lxcVMCleanup(virConnectPtr conn,
static int lxcSetupInterfaces(virConnectPtr conn,
virDomainDefPtr def,
unsigned int *nveths,
- char ***veths)
+ char ***veths,
+ char ***newveths)
{
int rc = -1, i;
char *bridge = NULL;
char parentVeth[PATH_MAX] = "";
char containerVeth[PATH_MAX] = "";
brControl *brctl = NULL;
+ char *newveth;
if (brInit(&brctl) != 0)
return -1;
@@ -744,10 +746,20 @@ static int lxcSetupInterfaces(virConnectPtr conn,
if (NULL == def->nets[i]->ifname) {
def->nets[i]->ifname = strdup(parentVeth);
}
+
if (VIR_REALLOC_N(*veths, (*nveths)+1) < 0)
goto error_exit;
- if (((*veths)[(*nveths)++] = strdup(containerVeth)) == NULL)
+ if (VIR_REALLOC_N(*newveths, (*nveths)+1) < 0)
+ goto error_exit;
+
+ if (((*veths)[*nveths] = strdup(containerVeth)) == NULL)
+ goto error_exit;
+ if (virAsprintf(&newveth, "eth%d", i) < 0)
goto error_exit;
+ if (((*newveths)[*nveths] = strdup(newveth)) == NULL)
+ goto error_exit;
+ (*nveths)++;
+ VIR_FREE(newveth);
if (NULL == def->nets[i]->ifname) {
lxcError(NULL, NULL, VIR_ERR_INTERNAL_ERROR,
@@ -906,6 +918,7 @@ static int lxcControllerStart(virConnectPtr conn,
virDomainObjPtr vm,
int nveths,
char **veths,
+ char **newveths,
int appPty,
int logfd)
{
@@ -1029,7 +1042,13 @@ static int lxcControllerStart(virConnectPtr conn,
for (i = 0 ; i < nveths ; i++) {
ADD_ARG_LIT("--veth");
- ADD_ARG_LIT(veths[i]);
+ if (newveths[i]) {
+ if (virAsprintf(&tmp, "%s,%s", veths[i], newveths[i]) < 0)
+ goto no_memory;
+ ADD_ARG_LIT(tmp);
+ } else {
+ ADD_ARG_LIT(veths[i]);
+ }
}
ADD_ARG(NULL);
@@ -1107,6 +1126,7 @@ static int lxcVmStart(virConnectPtr conn,
int logfd = -1;
unsigned int nveths = 0;
char **veths = NULL;
+ char **newveths = NULL;
if ((r = virFileMakePath(driver->logDir)) < 0) {
virReportSystemError(conn, r,
@@ -1135,7 +1155,7 @@ static int lxcVmStart(virConnectPtr conn,
VIR_FREE(parentTtyPath);
}
- if (lxcSetupInterfaces(conn, vm->def, &nveths, &veths) != 0)
+ if (lxcSetupInterfaces(conn, vm->def, &nveths, &veths, &newveths) != 0)
goto cleanup;
/* Persist the live configuration now we have veth & tty info */
@@ -1152,7 +1172,7 @@ static int lxcVmStart(virConnectPtr conn,
if (lxcControllerStart(conn,
vm,
- nveths, veths,
+ nveths, veths, newveths,
parentTty, logfd) < 0)
goto cleanup;
diff --git a/src/lxc/veth.c b/src/lxc/veth.c
index b15df8d..fbd1195 100644
--- a/src/lxc/veth.c
+++ b/src/lxc/veth.c
@@ -247,3 +247,23 @@ int setMacAddr(const char* iface, const char* macaddr)
error_out:
return rc;
}
+
+int setInterfaceName(const char* iface, const char* new)
+{
+ int rc = -1;
+ const char *argv[] = {
+ "ip", "link", "set", iface, "name", new, NULL
+ };
+ int cmdResult;
+
+ if (NULL == iface || NULL == new) {
+ goto error_out;
+ }
+
+ rc = virRun(NULL, argv, &cmdResult);
+ if (0 == rc)
+ rc = cmdResult;
+
+error_out:
+ return rc;
+}
diff --git a/src/lxc/veth.h b/src/lxc/veth.h
index 8f2f514..8075a5e 100644
--- a/src/lxc/veth.h
+++ b/src/lxc/veth.h
@@ -21,5 +21,6 @@ int vethDelete(const char* veth);
int vethInterfaceUpOrDown(const char* veth, int upOrDown);
int moveInterfaceToNetNs(const char *iface, int pidInNs);
int setMacAddr(const char* iface, const char* macaddr);
+int setInterfaceName(const char* iface, const char* new);
#endif /* VETH_H */
--
1.6.2.5
15 years, 1 month
[libvirt] starting vm using virsh somewhat fails
by Ricardo Tiago
Hi all,
I have started a vm using virsh create domain.xml and it starts for a
second and then its destroyed automatically. When I do xm create -f
<xm cfg> it works fine.
I don't know if this is relevant but
virsh net-list --all
Name State Autostart
-----------------------------------------
default inactive yes
virsh net-start default
error: Failed to start network default
error: Failed to open file '/etc/sysconfig/system-config-firewall': No
such file or directory
Can this be the problem? Why do I need /etc/sysconfig/system-config-firewall?
Domain XML Description: (converted from a xm cfg file)
<domain type='xen'>
<name>rtiago_test</name>
<uuid>8f07fe28-753f-2729-d76d-bdbd892f949a</uuid>
<memory>2560000</memory>
<currentMemory>200000</currentMemory>
<vcpu>8</vcpu>
<bootloader>/usr/bin/pygrub</bootloader>
<os>
<type arch='x86_64' machine='xenpv'>linux</type>
<cmdline>rtiago</cmdline>
</os>
<clock offset='utc'/>
<on_poweroff>restart</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<devices>
<disk type='file' device='disk'>
<driver name='file'/>
<source file='/images/fc-6.img'/>
<target dev='xvda1' bus='xen'/>
</disk>
</domain>
15 years, 1 month
[libvirt] [PATCH] network utilities: Allocate space for terminating NUL in virSocketFormatAddr
by Matthew Booth
* src/util/network.c: Allocate an additional byte for virSocketFormatAddr's
return buffer
---
src/util/network.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/util/network.c b/src/util/network.c
index 56426e7..f6588c7 100644
--- a/src/util/network.c
+++ b/src/util/network.c
@@ -135,12 +135,12 @@ virSocketFormatAddr(virSocketAddrPtr addr) {
return NULL;
if (addr->stor.ss_family == AF_INET) {
- outlen = INET_ADDRSTRLEN;
+ outlen = INET_ADDRSTRLEN + 1;
inaddr = &addr->inet4.sin_addr;
}
else if (addr->stor.ss_family == AF_INET6) {
- outlen = INET6_ADDRSTRLEN;
+ outlen = INET6_ADDRSTRLEN + 1;
inaddr = &addr->inet6.sin6_addr;
}
--
1.6.2.5
15 years, 1 month
[libvirt] [PATCH] Fix up NLS warnings.
by Chris Lalancette
When building with --disable-nls, I got a few messages like this:
storage/storage_backend.c: In function 'virStorageBackendCreateQemuImg':
storage/storage_backend.c:571: warning: format not a string literal and no format arguments
Fix these up.
Signed-off-by: Chris Lalancette <clalance(a)redhat.com>
---
src/conf/domain_conf.c | 2 +-
src/lxc/lxc_driver.c | 2 +-
src/qemu/qemu_driver.c | 6 +++---
src/storage/storage_backend.c | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index ba6b28d..a9c8573 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -1813,7 +1813,7 @@ virDomainWatchdogDefParseXML(virConnectPtr conn,
model = virXMLPropString (node, "model");
if (model == NULL) {
- virDomainReportError (conn, VIR_ERR_INTERNAL_ERROR,
+ virDomainReportError (conn, VIR_ERR_INTERNAL_ERROR, "%s",
_("watchdog must contain model name"));
goto error;
}
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 9a5c43a..1e984c5 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -1858,7 +1858,7 @@ static int lxcSetSchedulerParameters(virDomainPtr domain,
for (i = 0; i < nparams; i++) {
virSchedParameterPtr param = ¶ms[i];
if (param->type != VIR_DOMAIN_SCHED_FIELD_ULLONG) {
- lxcError(NULL, domain, VIR_ERR_INVALID_ARG,
+ lxcError(NULL, domain, VIR_ERR_INVALID_ARG, "%s",
_("invalid type for cpu_shares tunable, expected a 'ullong'"));
goto cleanup;
}
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 38fe19e..7295641 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -5299,7 +5299,7 @@ static int qemuSetSchedulerParameters(virDomainPtr dom,
if (STREQ(param->field, "cpu_shares")) {
int rc;
if (param->type != VIR_DOMAIN_SCHED_FIELD_ULLONG) {
- qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_ARG,
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_INVALID_ARG, "%s",
_("invalid type for cpu_shares tunable, expected a 'ullong'"));
goto cleanup;
}
@@ -6479,7 +6479,7 @@ static int doTunnelSendAll(virDomainPtr dom,
break;
if (virStreamSend(st, buffer, nbytes) < 0) {
- qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED,
+ qemudReportError(dom->conn, dom, NULL, VIR_ERR_OPERATION_FAILED, "%s",
_("Failed to write migration data to remote libvirtd"));
return -1;
}
@@ -6701,7 +6701,7 @@ static int doNonTunnelMigrate(virDomainPtr dom,
goto cleanup;
if (uri_out == NULL) {
- qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
+ qemudReportError(NULL, NULL, NULL, VIR_ERR_INTERNAL_ERROR, "%s",
_("domainMigratePrepare2 did not set uri"));
}
diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c
index 18a69be..bb926cd 100644
--- a/src/storage/storage_backend.c
+++ b/src/storage/storage_backend.c
@@ -568,7 +568,7 @@ virStorageBackendCreateQemuImg(virConnectPtr conn,
return -1;
}
if (enc->nsecrets > 1) {
- virStorageReportError(conn, VIR_ERR_INVALID_STORAGE_VOL,
+ virStorageReportError(conn, VIR_ERR_INVALID_STORAGE_VOL, "%s",
_("too many secrets for qcow encryption"));
return -1;
}
--
1.6.0.6
15 years, 1 month