[libvirt] [PATCH] Document <cpu> elements in capabilities and domain XML
by Jiri Denemark
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
docs/formatcaps.html.in | 13 +++++-
docs/formatdomain.html.in | 93 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 103 insertions(+), 3 deletions(-)
diff --git a/docs/formatcaps.html.in b/docs/formatcaps.html.in
index 36718d9..525a331 100644
--- a/docs/formatcaps.html.in
+++ b/docs/formatcaps.html.in
@@ -21,6 +21,11 @@ BIOS you will see</p>
<features>
<vmx/>
</features>
+ <model>core2duo</model>
+ <topology sockets="1" cores="2" threads="1"/>
+ <feature name="lahf_lm"/>
+ <feature name='xtpr'/>
+ ...
</cpu>
</host></span>
@@ -48,15 +53,17 @@ BIOS you will see</p>
<loader>/usr/lib/xen/boot/hvmloader</loader>
</arch>
<features>
+ <cpuselection/>
</features>
</guest></span>
...
</capabilities></pre>
<p>The first block (in red) indicates the host hardware capabilities, currently
it is limited to the CPU properties but other information may be available,
-it shows the CPU architecture, and the features of the chip (the feature
-block is similar to what you will find in a Xen fully virtualized domain
-description).</p>
+it shows the CPU architecture, topology, model name, and additional features
+which are not included in the model but the CPU provides them. Features of the
+chip are shown within the feature block (the block is similar to what you will
+find in a Xen fully virtualized domain description).</p>
<p>The second block (in blue) indicates the paravirtualization support of the
Xen support, you will see the os_type of xen to indicate a paravirtual
kernel, then architecture information and potential features.</p>
diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in
index af31699..5030b6c 100644
--- a/docs/formatdomain.html.in
+++ b/docs/formatdomain.html.in
@@ -201,6 +201,99 @@
CPUs allocated for the guest OS.</dd>
</dl>
+ <h3><a name="elementsCPU">CPU model and topology</a></h3>
+
+ <p>
+ Requirements for CPU model, its features and topology can be specified
+ using the following collection of elements.
+ <snap class="since">Since 0.7.5</span>
+ </p>
+
+ <pre>
+ ...
+ <cpu match='exact'>
+ <model>core2duo</model>
+ <topology sockets='1' cores='2' threads='1'/>
+ <feature policy='disable' name='lahf_lm'/>
+ </cpu>
+ ...</pre>
+
+ <p>
+ In case no restrictions need to be put on CPU model and its features, a
+ simpler <code>cpu</code> element can be used.
+ <span class="since">Since 0.7.6</span>
+ </p>
+
+ <pre>
+ ...
+ <cpu>
+ <topology sockets='1' cores='2' threads='1'/>
+ </cpu>
+ ...</pre>
+
+ <dl>
+ <dt><code>cpu</code><dt>
+ <dd>The <code>cpu</code> element is the main container for describing
+ guest CPU requirements. Its <code>match</code> attribute specified how
+ strictly has the virtual CPU provided to the guest match these
+ requirements. <span class="since">Since 0.7.6</span> the
+ <code>match</code> attribute can be omitted if <code>topology</code>
+ is the only element within <code>cpu</code>. Possible values for the
+ <code>match</code> attribute are:
+
+ <dl>
+ <dt><code>minimum</code></dt>
+ <dd>The specified CPU model and features describes the minimum
+ requested CPU.</dd>
+ <dt><code>exact</code></dt>
+ <dd>The virtual CPU provided to the guest will exactly match the
+ specification</dd>
+ <dt><code>strict</code></dt>
+ <dd>The guest will not be created unless the host CPU does exactly
+ match the specification.</dd>
+ </dl>
+ </dd>
+
+ <dt><code>model</code></dt>
+ <dd>The content of the <code>model</code> element specifies CPU model
+ requested by the guest. The list of available CPU models and their
+ definition can be found in <code>cpu_map.xml</code> file installed
+ in libvirt's data directory.</dd>
+
+ <dt><code>topology</code></dt>
+ <dd>The <code>topology</code> element specifies requested topology of
+ virtual CPU provided to the guest. Three non-zero values have to be
+ given for <code>sockets</code>, <code>cores</code>, and
+ <code>threads</code>: total number of CPU sockets, number of cores per
+ socket, and number of threads per core, respectively.</dd>
+
+ <dt><code>feature</code></dt>
+ <dd>The <code>cpu</code> element can contain zero or more
+ <code>elements</code> used to fine-tune features provided by the
+ selected CPU model. The list of known feature names can be found in
+ the same file as CPU models. The meaning of each <code>feature</code>
+ element depends on its <code>policy</code> attribute, which has to be
+ set to one of the following values:
+
+ <dl>
+ <dt><code>force</code></dt>
+ <dd>The virtual CPU will claim the feature is supported regardless
+ of it being supported by host CPU.</dd>
+ <dt><code>require</code></dt>
+ <dd>Guest creation will fail unless the feature is supported by host
+ CPU.</dd>
+ <dt><code>optional</code></dt>
+ <dd>The feature will be supported by virtual CPU if and only if it
+ is supported by host CPU.</dd>
+ <dt><code>disable</code></dt>
+ <dd>The feature will not be supported by virtual CPU.</dd>
+ <dt><code>forbid</code></dt>
+ <dd>Guest creation will fail if the feature is supported by host
+ CPU.</dd>
+ </dl>
+ </dd>
+ </dl>
+
<h3><a name="elementsLifecycle">Lifecycle control</a></h3>
<p>
--
1.6.6
14 years, 10 months
[libvirt] Website contains outdated information about remote limitations
by Matthias Bolte
http://www.libvirt.org/remote.html#Remote_limitations says:
Limitations
* Remote storage: To be fully useful, particularly for creating
new domains, it should be possible to enumerate and provision storage
on the remote machine. This is currently in the design phase.
* Migration: We expect libvirt will support migration, and
obviously remote support is what makes migration worthwhile. This is
also in the design phase. Issues to discuss include which path the
migration data should follow (eg. client to client direct, or client
to server to client) and security.
IMHO this is outdated information, because libvirt supports both
features now. So both should be removed from the website as they could
misinform newbies.
Matthias
14 years, 10 months
[libvirt] [PATCH 0/4] Update interface xml to match netcf 0.1.5
by Laine Stump
The first two patches make minor additions to the parsing/formatting.
The 3rd is a bit more intrusive, as it switches from using
virInterfaceBareDef for subordinate interfaces to recursively using a
full virInterfaceDef (but with guaranteed closure due to limiting the
type of subordinate interface allowed based on parent interface).
The final patch updates the RNG and test files accordingly.
14 years, 10 months
[libvirt] hvm/x86_64 combination not allowed
by Steve Brown
I have a VM that I am able to run using qemu form a command prompt
with no problems. I want to run it from within libvirt, so I
converted my qemu command to XML using 'virsh domxml-from-native ...'
My problem is that my libvirt does not seem to support the x86_64
architecture, so when I try to launch the VM, the kernel won't built
since it was installed on x86_64. My os container is as follows (as
imported by virsh):
<os>
<type arch='i686' machine='pc-0.11'>hvm</type>
<boot dev='hd'/>
</os>
However, when I try to change it to this:
<os>
<type arch='x86_64'>hvm</type>
<boot dev='hd'/>
</os>
I get the following message:
error: internal error os type 'hvm' & arch 'x86_64' combination is not supported
I've searched for a proper command line switch to build this option
into libvirt, but I have not had any success. So how do I get libvirt
to support the x86_64 arch?
Thanks,
Steve
PS:
$ sudo virsh capabilities
<capabilities>
<host>
<cpu>
<arch>x86_64</arch>
</cpu>
<migration_features>
<live/>
<uri_transports>
<uri_transport>tcp</uri_transport>
</uri_transports>
</migration_features>
</host>
<guest>
<os_type>hvm</os_type>
<arch name='i686'>
<wordsize>32</wordsize>
<emulator>/usr/bin/qemu</emulator>
<machine>pc-0.11</machine>
<machine canonical='pc-0.11'>pc</machine>
<machine>pc-0.10</machine>
<machine>isapc</machine>
<domain type='qemu'>
</domain>
</arch>
<features>
<pae/>
<nonpae/>
<acpi default='on' toggle='yes'/>
<apic default='on' toggle='no'/>
</features>
</guest>
</capabilities>
14 years, 10 months
[libvirt] [PATCH] logging: confirm that we want to ignore a write error
by Jim Meyering
Ignoring a write failure is a big deal, so when you do that deliberately,
it's worth marking in such a way that code analyzers don't report a
false positive. Until a year or so ago, people thought using (void)
would be enough. But newer gcc warns in spite of that (for functions
marked with the warn_unused_result attribute), so now we use the
ignore_value function from gnulib.
A coverity warning prompted the change below, but if we declare
saferead with the warn_unused_result attribute, gcc would, too.
>From 62d2c7f69608407afa9a4bf38f0d29ea3eec88f5 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Mon, 18 Jan 2010 11:51:01 +0100
Subject: [PATCH] logging: confirm that we want to ignore a write error
* src/util/logging.c (virLogMessage): Include "ignore-value.h".
Use it to ignore the return value of safewrite.
Use STDERR_FILENO, rather than "2".
* bootstrap (modules): Add ignore-value.
* gnulib: Update to latest, for ignore-value that is now LGPLv2+.
---
.gnulib | 2 +-
bootstrap | 1 +
src/util/logging.c | 5 +++--
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/.gnulib b/.gnulib
index 4c52807..146d914 160000
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit 4c52807f41f238cf0e352317b2dc54f9ba0f0c4f
+Subproject commit 146d9145073e62a2096a2d6b33f75e93908fedf3
diff --git a/bootstrap b/bootstrap
index c07d851..aec5d05 100755
--- a/bootstrap
+++ b/bootstrap
@@ -76,6 +76,7 @@ getpass
gettext
gitlog-to-changelog
gnumakefile
+ignore-value
inet_pton
ioctl
maintainer-makefile
diff --git a/src/util/logging.c b/src/util/logging.c
index 6bd8469..3b3c309 100644
--- a/src/util/logging.c
+++ b/src/util/logging.c
@@ -1,7 +1,7 @@
/*
* logging.c: internal logging and debugging
*
- * Copyright (C) 2008 Red Hat, Inc.
+ * Copyright (C) 2008, 2010 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -34,6 +34,7 @@
#include <syslog.h>
#endif
+#include "ignore-value.h"
#include "logging.h"
#include "memory.h"
#include "util.h"
@@ -579,7 +580,7 @@ void virLogMessage(const char *category, int priority, const char *funcname,
msg, len, virLogOutputs[i].data);
}
if ((virLogNbOutputs == 0) && (flags != 1))
- safewrite(2, msg, len);
+ ignore_value (safewrite(STDERR_FILENO, msg, len));
virLogUnlock();
VIR_FREE(msg);
--
1.6.6.638.g2bc54
14 years, 10 months
[libvirt] [PATCH v2 0/2] Block assignment of PCI devices below non-ACS capable switch
by Jiri Denemark
This is a patchset for blocking assignment of PCI devices below non-ACS
capable switch. In case user still wants to assign such device even though it
might not be safe, she can specify 'relaxed_acs_check = 1' in qemu.conf
Special thanks to Chris L. who created a standalone program the PCI check.
This code is a port of that check to libvirt.
Changes in version 2:
- permissive attribute for <hostdev> was removed
- new 'relaxed_acs_check' config option in qemu.conf for relaxing the check
Jiri Denemark (2):
Tests for ACS in PCIe switches
Use pciDeviceIsAssignable in qemu driver
src/libvirt_private.syms | 1 +
src/qemu/libvirtd_qemu.aug | 1 +
src/qemu/qemu.conf | 6 ++
src/qemu/qemu_conf.c | 4 +
src/qemu/qemu_conf.h | 2 +
src/qemu/qemu_driver.c | 6 ++-
src/qemu/test_libvirtd_qemu.aug | 6 ++-
src/util/pci.c | 151 +++++++++++++++++++++++++++++++++++++++
src/util/pci.h | 4 +
9 files changed, 179 insertions(+), 2 deletions(-)
14 years, 10 months
[libvirt] [PATCH] Remove superfluous new lines from messages
by Jiri Denemark
I noticed some debug messages are printed with an empty lines after
them. This patch removes these empty lines from all invocations of the
following macros:
VIR_DEBUG
VIR_DEBUG0
VIR_ERROR
VIR_ERROR0
VIR_INFO
VIR_WARN
VIR_WARN0
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
daemon/libvirtd.c | 10 +++---
daemon/remote.c | 8 ++--
src/lxc/lxc_driver.c | 2 +-
src/network/bridge_driver.c | 10 +++---
src/node_device/node_device_hal.c | 16 ++++----
src/node_device/node_device_linux_sysfs.c | 16 ++++----
src/node_device/node_device_udev.c | 54 ++++++++++++++--------------
src/qemu/qemu_driver.c | 36 +++++++++---------
src/qemu/qemu_monitor_text.c | 14 ++++----
src/secret/secret_driver.c | 2 +-
src/util/pci.c | 2 +-
src/xen/proxy_internal.c | 22 ++++++------
tools/console.c | 12 +++---
13 files changed, 102 insertions(+), 102 deletions(-)
diff --git a/daemon/libvirtd.c b/daemon/libvirtd.c
index c53ef0a..551c69c 100644
--- a/daemon/libvirtd.c
+++ b/daemon/libvirtd.c
@@ -600,7 +600,7 @@ remoteMakeSockets (int *fds, int max_fds, int *nfds_r, const char *node, const c
int e = getaddrinfo (node, service, &hints, &ai);
if (e != 0) {
- VIR_ERROR(_("getaddrinfo: %s\n"), gai_strerror (e));
+ VIR_ERROR(_("getaddrinfo: %s"), gai_strerror (e));
return -1;
}
@@ -2511,7 +2511,7 @@ checkType (virConfValuePtr p, const char *filename,
(var_name) = strdup (p->str); \
if ((var_name) == NULL) { \
char ebuf[1024]; \
- VIR_ERROR(_("remoteReadConfigFile: %s\n"), \
+ VIR_ERROR(_("remoteReadConfigFile: %s"), \
virStrerror(errno, ebuf, sizeof ebuf)); \
goto free_and_fail; \
} \
@@ -2554,7 +2554,7 @@ static int remoteConfigGetAuth(virConfPtr conf, const char *key, int *auth, cons
*auth = REMOTE_AUTH_POLKIT;
#endif
} else {
- VIR_ERROR(_("remoteReadConfigFile: %s: %s: unsupported auth %s\n"),
+ VIR_ERROR(_("remoteReadConfigFile: %s: %s: unsupported auth %s"),
filename, key, p->str);
return -1;
}
@@ -2839,13 +2839,13 @@ qemudSetupPrivs (void)
if (__init_daemon_priv (PU_RESETGROUPS | PU_CLEARLIMITSET,
SYSTEM_UID, SYSTEM_UID, PRIV_XVM_CONTROL, NULL)) {
- VIR_ERROR0(_("additional privileges are required\n"));
+ VIR_ERROR0(_("additional privileges are required"));
return -1;
}
if (priv_set (PRIV_OFF, PRIV_ALLSETS, PRIV_FILE_LINK_ANY, PRIV_PROC_INFO,
PRIV_PROC_SESSION, PRIV_PROC_EXEC, PRIV_PROC_FORK, NULL)) {
- VIR_ERROR0(_("failed to set reduced privileges\n"));
+ VIR_ERROR0(_("failed to set reduced privileges"));
return -1;
}
diff --git a/daemon/remote.c b/daemon/remote.c
index 0b30131..8f8adba 100644
--- a/daemon/remote.c
+++ b/daemon/remote.c
@@ -3375,7 +3375,7 @@ remoteDispatchAuthPolkit (struct qemud_server *server,
goto authfail;
}
if (status != 0) {
- VIR_ERROR(_("Policy kit denied action %s from pid %d, uid %d, result: %d\n"),
+ VIR_ERROR(_("Policy kit denied action %s from pid %d, uid %d, result: %d"),
action, callerPid, callerUid, status);
goto authfail;
}
@@ -3442,7 +3442,7 @@ remoteDispatchAuthPolkit (struct qemud_server *server,
if (!(pkaction = polkit_action_new())) {
char ebuf[1024];
- VIR_ERROR(_("Failed to create polkit action %s\n"),
+ VIR_ERROR(_("Failed to create polkit action %s"),
virStrerror(errno, ebuf, sizeof ebuf));
polkit_caller_unref(pkcaller);
goto authfail;
@@ -3452,7 +3452,7 @@ remoteDispatchAuthPolkit (struct qemud_server *server,
if (!(pkcontext = polkit_context_new()) ||
!polkit_context_init(pkcontext, &pkerr)) {
char ebuf[1024];
- VIR_ERROR(_("Failed to create polkit context %s\n"),
+ VIR_ERROR(_("Failed to create polkit context %s"),
(pkerr ? polkit_error_get_error_message(pkerr)
: virStrerror(errno, ebuf, sizeof ebuf)));
if (pkerr)
@@ -3484,7 +3484,7 @@ remoteDispatchAuthPolkit (struct qemud_server *server,
polkit_caller_unref(pkcaller);
polkit_action_unref(pkaction);
if (pkresult != POLKIT_RESULT_YES) {
- VIR_ERROR(_("Policy kit denied action %s from pid %d, uid %d, result: %s\n"),
+ VIR_ERROR(_("Policy kit denied action %s from pid %d, uid %d, result: %s"),
action, callerPid, callerUid,
polkit_result_to_string_representation(pkresult));
goto authfail;
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 86606c7..556359e 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -1603,7 +1603,7 @@ lxcAutostartDomain(void *payload, const char *name ATTRIBUTE_UNUSED, void *opaqu
int ret = lxcVmStart(data->conn, data->driver, vm);
if (ret < 0) {
virErrorPtr err = virGetLastError();
- VIR_ERROR(_("Failed to autostart VM '%s': %s\n"),
+ VIR_ERROR(_("Failed to autostart VM '%s': %s"),
vm->def->name,
err ? err->message : "");
} else {
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 69809b3..4385215 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -977,14 +977,14 @@ static int networkStartNetworkDaemon(virConnectPtr conn,
err_delbr1:
if ((err = brSetInterfaceUp(driver->brctl, network->def->bridge, 0))) {
char ebuf[1024];
- VIR_WARN(_("Failed to bring down bridge '%s' : %s\n"),
+ VIR_WARN(_("Failed to bring down bridge '%s' : %s"),
network->def->bridge, virStrerror(err, ebuf, sizeof ebuf));
}
err_delbr:
if ((err = brDeleteBridge(driver->brctl, network->def->bridge))) {
char ebuf[1024];
- VIR_WARN(_("Failed to delete bridge '%s' : %s\n"),
+ VIR_WARN(_("Failed to delete bridge '%s' : %s"),
network->def->bridge, virStrerror(err, ebuf, sizeof ebuf));
}
@@ -998,7 +998,7 @@ static int networkShutdownNetworkDaemon(virConnectPtr conn,
int err;
char *stateFile;
- VIR_INFO(_("Shutting down network '%s'\n"), network->def->name);
+ VIR_INFO(_("Shutting down network '%s'"), network->def->name);
if (!virNetworkObjIsActive(network))
return 0;
@@ -1017,12 +1017,12 @@ static int networkShutdownNetworkDaemon(virConnectPtr conn,
char ebuf[1024];
if ((err = brSetInterfaceUp(driver->brctl, network->def->bridge, 0))) {
- VIR_WARN(_("Failed to bring down bridge '%s' : %s\n"),
+ VIR_WARN(_("Failed to bring down bridge '%s' : %s"),
network->def->bridge, virStrerror(err, ebuf, sizeof ebuf));
}
if ((err = brDeleteBridge(driver->brctl, network->def->bridge))) {
- VIR_WARN(_("Failed to delete bridge '%s' : %s\n"),
+ VIR_WARN(_("Failed to delete bridge '%s' : %s"),
network->def->bridge, virStrerror(err, ebuf, sizeof ebuf));
}
diff --git a/src/node_device/node_device_hal.c b/src/node_device/node_device_hal.c
index 7cb931e..02fcbf6 100644
--- a/src/node_device/node_device_hal.c
+++ b/src/node_device/node_device_hal.c
@@ -720,22 +720,22 @@ static int halDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED)
dbus_error_init(&err);
hal_ctx = libhal_ctx_new();
if (hal_ctx == NULL) {
- VIR_ERROR0("libhal_ctx_new returned NULL\n");
+ VIR_ERROR0("libhal_ctx_new returned NULL");
goto failure;
}
dbus_conn = dbus_bus_get(DBUS_BUS_SYSTEM, &err);
if (dbus_conn == NULL) {
- VIR_ERROR0("dbus_bus_get failed\n");
+ VIR_ERROR0("dbus_bus_get failed");
goto failure;
}
dbus_connection_set_exit_on_disconnect(dbus_conn, FALSE);
if (!libhal_ctx_set_dbus_connection(hal_ctx, dbus_conn)) {
- VIR_ERROR0("libhal_ctx_set_dbus_connection failed\n");
+ VIR_ERROR0("libhal_ctx_set_dbus_connection failed");
goto failure;
}
if (!libhal_ctx_init(hal_ctx, &err)) {
- VIR_ERROR0("libhal_ctx_init failed, haldaemon is probably not running\n");
+ VIR_ERROR0("libhal_ctx_init failed, haldaemon is probably not running");
/* We don't want to show a fatal error here,
otherwise entire libvirtd shuts down when
hald isn't running */
@@ -749,7 +749,7 @@ static int halDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED)
remove_dbus_watch,
toggle_dbus_watch,
NULL, NULL)) {
- VIR_ERROR0("dbus_connection_set_watch_functions failed\n");
+ VIR_ERROR0("dbus_connection_set_watch_functions failed");
goto failure;
}
@@ -770,13 +770,13 @@ static int halDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED)
!libhal_ctx_set_device_lost_capability(hal_ctx, device_cap_lost) ||
!libhal_ctx_set_device_property_modified(hal_ctx, device_prop_modified) ||
!libhal_device_property_watch_all(hal_ctx, &err)) {
- VIR_ERROR0("setting up HAL callbacks failed\n");
+ VIR_ERROR0("setting up HAL callbacks failed");
goto failure;
}
udi = libhal_get_all_devices(hal_ctx, &num_devs, &err);
if (udi == NULL) {
- VIR_ERROR0("libhal_get_all_devices failed\n");
+ VIR_ERROR0("libhal_get_all_devices failed");
goto failure;
}
for (i = 0; i < num_devs; i++) {
@@ -789,7 +789,7 @@ static int halDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED)
failure:
if (dbus_error_is_set(&err)) {
- VIR_ERROR("%s: %s\n", err.name, err.message);
+ VIR_ERROR("%s: %s", err.name, err.message);
dbus_error_free(&err);
}
virNodeDeviceObjListFree(&driverState->devs);
diff --git a/src/node_device/node_device_linux_sysfs.c b/src/node_device/node_device_linux_sysfs.c
index b1dff10..ff7aaf0 100644
--- a/src/node_device/node_device_linux_sysfs.c
+++ b/src/node_device/node_device_linux_sysfs.c
@@ -245,12 +245,12 @@ static int get_sriov_function(const char *device_link,
char errbuf[64];
int ret = SRIOV_ERROR;
- VIR_DEBUG("Attempting to resolve device path from device link '%s'\n",
+ VIR_DEBUG("Attempting to resolve device path from device link '%s'",
device_link);
if (!virFileExists(device_link)) {
- VIR_DEBUG("SR IOV function link '%s' does not exist\n", device_link);
+ VIR_DEBUG("SR IOV function link '%s' does not exist", device_link);
/* Not an SR IOV device, not an error, either. */
ret = SRIOV_NOT_FOUND;
@@ -261,24 +261,24 @@ static int get_sriov_function(const char *device_link,
device_path = realpath(device_link, device_path);
if (device_path == NULL) {
memset(errbuf, '\0', sizeof(errbuf));
- VIR_ERROR("Failed to resolve device link '%s': '%s'\n", device_link,
+ VIR_ERROR("Failed to resolve device link '%s': '%s'", device_link,
virStrerror(errno, errbuf, sizeof(errbuf)));
goto out;
}
- VIR_DEBUG("SR IOV device path is '%s'\n", device_path);
+ VIR_DEBUG("SR IOV device path is '%s'", device_path);
config_address = basename(device_path);
if (VIR_ALLOC(*bdf) != 0) {
- VIR_ERROR0("Failed to allocate memory for PCI device name\n");
+ VIR_ERROR0("Failed to allocate memory for PCI device name");
goto out;
}
if (parse_pci_config_address(config_address, *bdf) != 0) {
- VIR_ERROR("Failed to parse PCI config address '%s'\n", config_address);
+ VIR_ERROR("Failed to parse PCI config address '%s'", config_address);
goto out;
}
- VIR_DEBUG("SR IOV function %.4x:%.2x:%.2x.%.1x/>\n",
+ VIR_DEBUG("SR IOV function %.4x:%.2x:%.2x.%.1x",
(*bdf)->domain,
(*bdf)->bus,
(*bdf)->slot,
@@ -341,7 +341,7 @@ int get_virtual_functions_linux(const char *sysfs_path,
goto out;
}
- VIR_DEBUG("Number of virtual functions: %d\n", *num_funcs);
+ VIR_DEBUG("Number of virtual functions: %d", *num_funcs);
if (VIR_REALLOC_N(d->pci_dev.virtual_functions,
(*num_funcs) + 1) != 0) {
virReportOOMError(NULL);
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index 7a9c1e5..d0ba88e 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -52,9 +52,9 @@ static int udevStrToLong_ull(char const *s,
ret = virStrToLong_ull(s, end_ptr, base, result);
if (ret != 0) {
- VIR_ERROR("Failed to convert '%s' to unsigned long long\n", s);
+ VIR_ERROR("Failed to convert '%s' to unsigned long long", s);
} else {
- VIR_DEBUG("Converted '%s' to unsigned long %llu\n", s, *result);
+ VIR_DEBUG("Converted '%s' to unsigned long %llu", s, *result);
}
return ret;
@@ -70,9 +70,9 @@ static int udevStrToLong_ui(char const *s,
ret = virStrToLong_ui(s, end_ptr, base, result);
if (ret != 0) {
- VIR_ERROR("Failed to convert '%s' to unsigned int\n", s);
+ VIR_ERROR("Failed to convert '%s' to unsigned int", s);
} else {
- VIR_DEBUG("Converted '%s' to unsigned int %u\n", s, *result);
+ VIR_DEBUG("Converted '%s' to unsigned int %u", s, *result);
}
return ret;
@@ -87,9 +87,9 @@ static int udevStrToLong_i(char const *s,
ret = virStrToLong_i(s, end_ptr, base, result);
if (ret != 0) {
- VIR_ERROR("Failed to convert '%s' to int\n", s);
+ VIR_ERROR("Failed to convert '%s' to int", s);
} else {
- VIR_DEBUG("Converted '%s' to int %u\n", s, *result);
+ VIR_DEBUG("Converted '%s' to int %u", s, *result);
}
return ret;
@@ -363,7 +363,7 @@ static int udevTranslatePCIIds(unsigned int vendor,
const char *vendor_name = NULL, *device_name = NULL;
if (pci_system_init() != 0) {
- VIR_ERROR0("Failed to initialize libpciaccess\n");
+ VIR_ERROR0("Failed to initialize libpciaccess");
goto out;
}
@@ -734,7 +734,7 @@ static int udevGetSCSIType(unsigned int type, char **typestring)
ret = -1;
virReportOOMError(NULL);
} else {
- VIR_ERROR("Failed to find SCSI device type %d\n", type);
+ VIR_ERROR("Failed to find SCSI device type %d", type);
}
}
@@ -799,7 +799,7 @@ static int udevProcessSCSIDevice(struct udev_device *device ATTRIBUTE_UNUSED,
out:
if (ret != 0) {
- VIR_ERROR("Failed to process SCSI device with sysfs path '%s'\n",
+ VIR_ERROR("Failed to process SCSI device with sysfs path '%s'",
def->sysfs_path);
}
return ret;
@@ -957,7 +957,7 @@ static int udevProcessStorage(struct udev_device *device,
devnode = udev_device_get_devnode(device);
if(!devnode) {
- VIR_DEBUG("No devnode for '%s'\n", udev_device_get_devpath(device));
+ VIR_DEBUG("No devnode for '%s'", udev_device_get_devpath(device));
goto out;
}
data->storage.block = strdup(devnode);
@@ -1007,7 +1007,7 @@ static int udevProcessStorage(struct udev_device *device,
} else if (STREQ(def->caps->data.storage.drive_type, "disk")) {
ret = udevProcessDisk(device, def);
} else {
- VIR_INFO("Unsupported storage type '%s'\n",
+ VIR_INFO("Unsupported storage type '%s'",
def->caps->data.storage.drive_type);
goto out;
}
@@ -1121,7 +1121,7 @@ static int udevGetDeviceDetails(struct udev_device *device,
ret = udevProcessStorage(device, def);
break;
default:
- VIR_ERROR("Unknown device type %d\n", def->caps->type);
+ VIR_ERROR("Unknown device type %d", def->caps->type);
ret = -1;
break;
}
@@ -1139,11 +1139,11 @@ static int udevRemoveOneDevice(struct udev_device *device)
name = udev_device_get_syspath(device);
dev = virNodeDeviceFindBySysfsPath(&driverState->devs, name);
if (dev != NULL) {
- VIR_DEBUG("Removing device '%s' with sysfs path '%s'\n",
+ VIR_DEBUG("Removing device '%s' with sysfs path '%s'",
dev->def->name, name);
virNodeDeviceObjRemove(&driverState->devs, dev);
} else {
- VIR_INFO("Failed to find device to remove that has udev name '%s'\n",
+ VIR_INFO("Failed to find device to remove that has udev name '%s'",
name);
ret = -1;
}
@@ -1162,14 +1162,14 @@ static int udevSetParent(struct udev_device *device,
parent_device = udev_device_get_parent(device);
if (parent_device == NULL) {
- VIR_INFO("Could not find udev parent for device with sysfs path '%s'\n",
+ VIR_INFO("Could not find udev parent for device with sysfs path '%s'",
udev_device_get_syspath(device));
goto out;
}
parent_sysfs_path = udev_device_get_syspath(parent_device);
if (parent_sysfs_path == NULL) {
- VIR_INFO("Could not get syspath for parent of '%s'\n",
+ VIR_INFO("Could not get syspath for parent of '%s'",
udev_device_get_syspath(device));
goto out;
}
@@ -1237,7 +1237,7 @@ static int udevAddOneDevice(struct udev_device *device)
dev = virNodeDeviceAssignDef(NULL, &driverState->devs, def);
if (dev == NULL) {
- VIR_ERROR("Failed to create device for '%s'\n", def->name);
+ VIR_ERROR("Failed to create device for '%s'", def->name);
virNodeDeviceDefFree(def);
goto out;
}
@@ -1263,7 +1263,7 @@ static int udevProcessDeviceListEntry(struct udev *udev,
device = udev_device_new_from_syspath(udev, name);
if (device != NULL) {
if (udevAddOneDevice(device) != 0) {
- VIR_INFO("Failed to create node device for udev device '%s'\n",
+ VIR_INFO("Failed to create node device for udev device '%s'",
name);
}
udev_device_unref(device);
@@ -1285,7 +1285,7 @@ static int udevEnumerateDevices(struct udev *udev)
ret = udev_enumerate_scan_devices(udev_enumerate);
if (0 != ret) {
- VIR_ERROR("udev scan devices returned %d\n", ret);
+ VIR_ERROR("udev scan devices returned %d", ret);
goto out;
}
@@ -1355,12 +1355,12 @@ static void udevEventHandleCallback(int watch ATTRIBUTE_UNUSED,
device = udev_monitor_receive_device(udev_monitor);
if (device == NULL) {
- VIR_ERROR0("udev_monitor_receive_device returned NULL\n");
+ VIR_ERROR0("udev_monitor_receive_device returned NULL");
goto out;
}
action = udev_device_get_action(device);
- VIR_DEBUG("udev action: '%s'\n", action);
+ VIR_DEBUG("udev action: '%s'", action);
if (STREQ(action, "add") || STREQ(action, "change")) {
udevAddOneDevice(device);
@@ -1406,11 +1406,11 @@ static int udevSetupSystemDev(void)
udev = udev_monitor_get_udev(DRV_STATE_UDEV_MONITOR(driverState));
device = udev_device_new_from_syspath(udev, DMI_DEVPATH);
if (device == NULL) {
- VIR_ERROR("Failed to get udev device for syspath '%s'\n", DMI_DEVPATH);
+ VIR_ERROR("Failed to get udev device for syspath '%s'", DMI_DEVPATH);
device = udev_device_new_from_syspath(udev, DMI_DEVPATH_FALLBACK);
if (device == NULL) {
- VIR_ERROR("Failed to get udev device for syspath '%s'\n", DMI_DEVPATH_FALLBACK);
+ VIR_ERROR("Failed to get udev device for syspath '%s'", DMI_DEVPATH_FALLBACK);
goto out;
}
}
@@ -1472,7 +1472,7 @@ static int udevSetupSystemDev(void)
dev = virNodeDeviceAssignDef(NULL, &driverState->devs, def);
if (dev == NULL) {
- VIR_ERROR("Failed to create device for '%s'\n", def->name);
+ VIR_ERROR("Failed to create device for '%s'", def->name);
virNodeDeviceDefFree(def);
goto out;
}
@@ -1498,7 +1498,7 @@ static int udevDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED)
}
if (virMutexInit(&driverState->lock) < 0) {
- VIR_ERROR0("Failed to initialize mutex for driverState\n");
+ VIR_ERROR0("Failed to initialize mutex for driverState");
VIR_FREE(driverState);
ret = -1;
goto out;
@@ -1517,7 +1517,7 @@ static int udevDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED)
udev_monitor = udev_monitor_new_from_netlink(udev, "udev");
if (udev_monitor == NULL) {
- VIR_ERROR0("udev_monitor_new_from_netlink returned NULL\n");
+ VIR_ERROR0("udev_monitor_new_from_netlink returned NULL");
ret = -1;
goto out;
}
@@ -1612,7 +1612,7 @@ static virStateDriver udevStateDriver = {
int udevNodeRegister(void)
{
- VIR_DEBUG0("Registering udev node device backend\n");
+ VIR_DEBUG0("Registering udev node device backend");
registerCommonNodeFuncs(&udevDeviceMonitor);
if (virRegisterDeviceMonitor(&udevDeviceMonitor) < 0) {
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 8817565..c7732f7 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -579,7 +579,7 @@ qemuAutostartDomain(void *payload, const char *name ATTRIBUTE_UNUSED, void *opaq
ret = qemudStartVMDaemon(data->conn, data->driver, vm, NULL, -1);
if (ret < 0) {
virErrorPtr err = virGetLastError();
- VIR_ERROR(_("Failed to autostart VM '%s': %s\n"),
+ VIR_ERROR(_("Failed to autostart VM '%s': %s"),
vm->def->name,
err ? err->message : "");
} else {
@@ -819,7 +819,7 @@ qemuConnectMonitor(virDomainObjPtr vm)
priv->monConfig,
priv->monJSON,
&monitorCallbacks)) == NULL) {
- VIR_ERROR(_("Failed to connect monitor for %s\n"), vm->def->name);
+ VIR_ERROR(_("Failed to connect monitor for %s"), vm->def->name);
return -1;
}
@@ -1028,19 +1028,19 @@ qemudStartup(int privileged) {
if (virFileMakePath(qemu_driver->stateDir) < 0) {
char ebuf[1024];
- VIR_ERROR(_("Failed to create state dir '%s': %s\n"),
+ VIR_ERROR(_("Failed to create state dir '%s': %s"),
qemu_driver->stateDir, virStrerror(errno, ebuf, sizeof ebuf));
goto error;
}
if (virFileMakePath(qemu_driver->libDir) < 0) {
char ebuf[1024];
- VIR_ERROR(_("Failed to create lib dir '%s': %s\n"),
+ VIR_ERROR(_("Failed to create lib dir '%s': %s"),
qemu_driver->libDir, virStrerror(errno, ebuf, sizeof ebuf));
goto error;
}
if (virFileMakePath(qemu_driver->cacheDir) < 0) {
char ebuf[1024];
- VIR_ERROR(_("Failed to create cache dir '%s': %s\n"),
+ VIR_ERROR(_("Failed to create cache dir '%s': %s"),
qemu_driver->cacheDir, virStrerror(errno, ebuf, sizeof ebuf));
goto error;
}
@@ -1520,7 +1520,7 @@ qemudWaitForMonitor(virConnectPtr conn,
"console", 3);
if (close(logfd) < 0) {
char ebuf[4096];
- VIR_WARN(_("Unable to close logfile: %s\n"),
+ VIR_WARN(_("Unable to close logfile: %s"),
virStrerror(errno, ebuf, sizeof ebuf));
}
@@ -1865,7 +1865,7 @@ qemuDomainReAttachHostDevices(virConnectPtr conn,
if (!(pcidevs = qemuGetPciHostDeviceList(conn, def))) {
virErrorPtr err = virGetLastError();
- VIR_ERROR(_("Failed to allocate pciDeviceList: %s\n"),
+ VIR_ERROR(_("Failed to allocate pciDeviceList: %s"),
err ? err->message : "");
virResetError(err);
return;
@@ -1884,7 +1884,7 @@ qemuDomainReAttachHostDevices(virConnectPtr conn,
if (pciResetDevice(conn, dev,
driver->activePciHostdevs) < 0) {
virErrorPtr err = virGetLastError();
- VIR_ERROR(_("Failed to reset PCI device: %s\n"),
+ VIR_ERROR(_("Failed to reset PCI device: %s"),
err ? err->message : "");
virResetError(err);
}
@@ -1895,7 +1895,7 @@ qemuDomainReAttachHostDevices(virConnectPtr conn,
if (pciDeviceGetManaged(dev) &&
pciReAttachDevice(NULL, dev) < 0) {
virErrorPtr err = virGetLastError();
- VIR_ERROR(_("Failed to re-attach PCI device: %s\n"),
+ VIR_ERROR(_("Failed to re-attach PCI device: %s"),
err ? err->message : "");
virResetError(err);
}
@@ -2475,29 +2475,29 @@ static int qemudStartVMDaemon(virConnectPtr conn,
tmp = progenv;
while (*tmp) {
if (safewrite(logfile, *tmp, strlen(*tmp)) < 0)
- VIR_WARN(_("Unable to write envv to logfile: %s\n"),
+ VIR_WARN(_("Unable to write envv to logfile: %s"),
virStrerror(errno, ebuf, sizeof ebuf));
if (safewrite(logfile, " ", 1) < 0)
- VIR_WARN(_("Unable to write envv to logfile: %s\n"),
+ VIR_WARN(_("Unable to write envv to logfile: %s"),
virStrerror(errno, ebuf, sizeof ebuf));
tmp++;
}
tmp = argv;
while (*tmp) {
if (safewrite(logfile, *tmp, strlen(*tmp)) < 0)
- VIR_WARN(_("Unable to write argv to logfile: %s\n"),
+ VIR_WARN(_("Unable to write argv to logfile: %s"),
virStrerror(errno, ebuf, sizeof ebuf));
if (safewrite(logfile, " ", 1) < 0)
- VIR_WARN(_("Unable to write argv to logfile: %s\n"),
+ VIR_WARN(_("Unable to write argv to logfile: %s"),
virStrerror(errno, ebuf, sizeof ebuf));
tmp++;
}
if (safewrite(logfile, "\n", 1) < 0)
- VIR_WARN(_("Unable to write argv to logfile: %s\n"),
+ VIR_WARN(_("Unable to write argv to logfile: %s"),
virStrerror(errno, ebuf, sizeof ebuf));
if ((pos = lseek(logfile, 0, SEEK_END)) < 0)
- VIR_WARN(_("Unable to seek to end of logfile: %s\n"),
+ VIR_WARN(_("Unable to seek to end of logfile: %s"),
virStrerror(errno, ebuf, sizeof ebuf));
for (i = 0 ; i < ntapfds ; i++)
@@ -5256,7 +5256,7 @@ cleanup:
try_remove:
if (!net->hostnet_name || net->vlan == 0)
- VIR_WARN0(_("Unable to remove network backend\n"));
+ VIR_WARN0(_("Unable to remove network backend"));
else {
qemuDomainObjEnterMonitorWithDriver(driver, vm);
if (qemuMonitorRemoveHostNetwork(priv->mon, net->vlan, net->hostnet_name) < 0)
@@ -5270,7 +5270,7 @@ try_tapfd_close:
if (tapfd_name) {
qemuDomainObjEnterMonitorWithDriver(driver, vm);
if (qemuMonitorCloseFileHandle(priv->mon, tapfd_name) < 0)
- VIR_WARN(_("Failed to close tapfd with '%s'\n"), tapfd_name);
+ VIR_WARN(_("Failed to close tapfd with '%s'"), tapfd_name);
qemuDomainObjExitMonitorWithDriver(driver, vm);
}
@@ -7639,7 +7639,7 @@ endjob:
* overwrite the previous error, though, so we just throw something
* to the logs and hope for the best
*/
- VIR_ERROR(_("Failed to resume guest %s after failure\n"),
+ VIR_ERROR(_("Failed to resume guest %s after failure"),
vm->def->name);
}
qemuDomainObjExitMonitorWithDriver(driver, vm);
diff --git a/src/qemu/qemu_monitor_text.c b/src/qemu/qemu_monitor_text.c
index 5b9ced2..aae026e 100644
--- a/src/qemu/qemu_monitor_text.c
+++ b/src/qemu/qemu_monitor_text.c
@@ -1301,42 +1301,42 @@ qemuMonitorTextParsePciAddReply(qemuMonitorPtr mon ATTRIBUTE_UNUSED,
s += strlen("domain ");
if (virStrToLong_ui(s, &e, 10, domain) == -1) {
- VIR_WARN(_("Unable to parse domain number '%s'\n"), s);
+ VIR_WARN(_("Unable to parse domain number '%s'"), s);
return -1;
}
if (!STRPREFIX(e, ", ")) {
- VIR_WARN(_("Expected ', ' parsing pci_add reply '%s'\n"), s);
+ VIR_WARN(_("Expected ', ' parsing pci_add reply '%s'"), s);
return -1;
}
s = e + 2;
}
if (!STRPREFIX(s, "bus ")) {
- VIR_WARN(_("Expected 'bus ' parsing pci_add reply '%s'\n"), s);
+ VIR_WARN(_("Expected 'bus ' parsing pci_add reply '%s'"), s);
return -1;
}
s += strlen("bus ");
if (virStrToLong_ui(s, &e, 10, bus) == -1) {
- VIR_WARN(_("Unable to parse bus number '%s'\n"), s);
+ VIR_WARN(_("Unable to parse bus number '%s'"), s);
return -1;
}
if (!STRPREFIX(e, ", ")) {
- VIR_WARN(_("Expected ', ' parsing pci_add reply '%s'\n"), s);
+ VIR_WARN(_("Expected ', ' parsing pci_add reply '%s'"), s);
return -1;
}
s = e + 2;
if (!STRPREFIX(s, "slot ")) {
- VIR_WARN(_("Expected 'slot ' parsing pci_add reply '%s'\n"), s);
+ VIR_WARN(_("Expected 'slot ' parsing pci_add reply '%s'"), s);
return -1;
}
s += strlen("slot ");
if (virStrToLong_ui(s, &e, 10, slot) == -1) {
- VIR_WARN(_("Unable to parse slot number '%s'\n"), s);
+ VIR_WARN(_("Unable to parse slot number '%s'"), s);
return -1;
}
diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c
index 1eef468..4478296 100644
--- a/src/secret/secret_driver.c
+++ b/src/secret/secret_driver.c
@@ -498,7 +498,7 @@ loadSecrets(virConnectPtr conn, virSecretDriverStatePtr driver,
if (secret == NULL) {
virErrorPtr err = virGetLastError();
- VIR_ERROR(_("Error reading secret: %s\n"),
+ VIR_ERROR(_("Error reading secret: %s"),
err != NULL ? err->message: "");
virResetError(err);
continue;
diff --git a/src/util/pci.c b/src/util/pci.c
index 1e003c2..109d435 100644
--- a/src/util/pci.c
+++ b/src/util/pci.c
@@ -440,7 +440,7 @@ pciIsParent(pciDevice *dev, pciDevice *check, void *data ATTRIBUTE_UNUSED)
secondary = pciRead8(check, PCI_SECONDARY_BUS);
subordinate = pciRead8(check, PCI_SUBORDINATE_BUS);
- VIR_DEBUG("%s %s: found parent device %s\n", dev->id, dev->name, check->name);
+ VIR_DEBUG("%s %s: found parent device %s", dev->id, dev->name, check->name);
/* No, it's superman! */
return (dev->bus >= secondary && dev->bus <= subordinate);
diff --git a/src/xen/proxy_internal.c b/src/xen/proxy_internal.c
index 73a0469..bde3eda 100644
--- a/src/xen/proxy_internal.c
+++ b/src/xen/proxy_internal.c
@@ -146,11 +146,11 @@ virProxyForkServer(void)
const char *proxyarg[2];
if (!proxyPath) {
- VIR_WARN0("failed to find libvirt_proxy\n");
+ VIR_WARN0("failed to find libvirt_proxy");
return(-1);
}
- VIR_DEBUG("Asking to launch %s\n", proxyPath);
+ VIR_DEBUG("Asking to launch %s", proxyPath);
proxyarg[0] = proxyPath;
proxyarg[1] = NULL;
@@ -158,7 +158,7 @@ virProxyForkServer(void)
if (virExecDaemonize(NULL, proxyarg, NULL, NULL,
&pid, -1, NULL, NULL, 0,
NULL, NULL, NULL) < 0)
- VIR_ERROR0("Failed to fork libvirt_proxy\n");
+ VIR_ERROR0("Failed to fork libvirt_proxy");
return (0);
}
@@ -239,9 +239,9 @@ virProxyCloseSocket(xenUnifiedPrivatePtr priv) {
ret = close(priv->proxy);
if (ret != 0)
- VIR_WARN(_("Failed to close socket %d\n"), priv->proxy);
+ VIR_WARN(_("Failed to close socket %d"), priv->proxy);
else
- VIR_DEBUG("Closed socket %d\n", priv->proxy);
+ VIR_DEBUG("Closed socket %d", priv->proxy);
priv->proxy = -1;
return(ret);
}
@@ -267,14 +267,14 @@ retry:
ret = read(fd, buffer, len);
if (ret < 0) {
if (errno == EINTR) {
- VIR_DEBUG("read socket %d interrupted\n", fd);
+ VIR_DEBUG("read socket %d interrupted", fd);
goto retry;
}
- VIR_WARN("Failed to read socket %d\n", fd);
+ VIR_WARN("Failed to read socket %d", fd);
return(-1);
}
- VIR_DEBUG("read %d bytes from socket %d\n",
+ VIR_DEBUG("read %d bytes from socket %d",
ret, fd);
return(ret);
}
@@ -296,10 +296,10 @@ virProxyWriteClientSocket(int fd, const char *data, int len) {
ret = safewrite(fd, data, len);
if (ret < 0) {
- VIR_WARN(_("Failed to write to socket %d\n"), fd);
+ VIR_WARN(_("Failed to write to socket %d"), fd);
return(-1);
}
- VIR_DEBUG("wrote %d bytes to socket %d\n",
+ VIR_DEBUG("wrote %d bytes to socket %d",
len, fd);
return(0);
@@ -451,7 +451,7 @@ retry:
goto error;
}
if (res->serial != serial) {
- VIR_WARN(_("got asynchronous packet number %d\n"), res->serial);
+ VIR_WARN(_("got asynchronous packet number %d"), res->serial);
goto retry;
}
diff --git a/tools/console.c b/tools/console.c
index 4a1a80b..3bb97ec 100644
--- a/tools/console.c
+++ b/tools/console.c
@@ -73,7 +73,7 @@ int vshRunConsole(const char *tty) {
/* We do not want this to become the controlling TTY */
if ((ttyfd = open(tty, O_NOCTTY | O_RDWR)) < 0) {
- VIR_ERROR(_("unable to open tty %s: %s\n"),
+ VIR_ERROR(_("unable to open tty %s: %s"),
tty, strerror(errno));
return -1;
}
@@ -84,7 +84,7 @@ int vshRunConsole(const char *tty) {
also ensure Ctrl-C, etc is blocked, and misc
other bits */
if (tcgetattr(STDIN_FILENO, &ttyattr) < 0) {
- VIR_ERROR(_("unable to get tty attributes: %s\n"),
+ VIR_ERROR(_("unable to get tty attributes: %s"),
strerror(errno));
goto closetty;
}
@@ -93,7 +93,7 @@ int vshRunConsole(const char *tty) {
cfmakeraw(&rawattr);
if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &rawattr) < 0) {
- VIR_ERROR(_("unable to set tty attributes: %s\n"),
+ VIR_ERROR(_("unable to set tty attributes: %s"),
strerror(errno));
goto closetty;
}
@@ -128,7 +128,7 @@ int vshRunConsole(const char *tty) {
if (errno == EINTR || errno == EAGAIN)
continue;
- VIR_ERROR(_("failure waiting for I/O: %s\n"), strerror(errno));
+ VIR_ERROR(_("failure waiting for I/O: %s"), strerror(errno));
goto cleanup;
}
@@ -142,7 +142,7 @@ int vshRunConsole(const char *tty) {
int got, sent = 0, destfd;
if ((got = read(fds[i].fd, buf, sizeof(buf))) < 0) {
- VIR_ERROR(_("failure reading input: %s\n"),
+ VIR_ERROR(_("failure reading input: %s"),
strerror(errno));
goto cleanup;
}
@@ -164,7 +164,7 @@ int vshRunConsole(const char *tty) {
int done;
if ((done = safewrite(destfd, buf + sent, got - sent))
<= 0) {
- VIR_ERROR(_("failure writing output: %s\n"),
+ VIR_ERROR(_("failure writing output: %s"),
strerror(errno));
goto cleanup;
}
--
1.6.6
14 years, 10 months
[libvirt] [PATCH] Make all bitfields unsigned ints to avoid unexpected values in casts
by Daniel P. Berrange
The 'int virInterfaceIsActive()' method was directly returning the
value of the 'int active:1' bitfield in virIntefaceDefPtr. A bitfield
with a signed integer, will hold the values 0 and -1, not 0 and +1
as might be expected. This meant that virInterfaceIsActive() was
always returning -1 when the interface was active, not +1 & thus all
callers thought an error had occurred. To protect against this kind
of mistake again, change all bitfields to be unsigned ints
* daemon/libvirtd.h, src/conf/domain_conf.h, src/conf/interface_conf.h,
src/conf/network_conf.h: Change bitfields to unsigned int.
---
daemon/libvirtd.h | 14 +++++++-------
src/conf/domain_conf.h | 14 +++++++-------
src/conf/interface_conf.h | 2 +-
src/conf/network_conf.h | 2 +-
4 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/daemon/libvirtd.h b/daemon/libvirtd.h
index 2f647f3..a7591fc 100644
--- a/daemon/libvirtd.h
+++ b/daemon/libvirtd.h
@@ -175,9 +175,9 @@ struct qemud_client {
int fd;
int watch;
- int readonly:1;
- int closing:1;
- int domain_events_registered:1;
+ unsigned int readonly :1;
+ unsigned int closing :1;
+ unsigned int domain_events_registered :1;
struct sockaddr_storage addr;
socklen_t addrlen;
@@ -185,7 +185,7 @@ struct qemud_client {
int type; /* qemud_sock_type */
gnutls_session_t tlssession;
int auth;
- int handshake : 1; /* If we're in progress for TLS handshake */
+ unsigned int handshake :1; /* If we're in progress for TLS handshake */
#if HAVE_SASL
sasl_conn_t *saslconn;
int saslSSF;
@@ -244,9 +244,9 @@ struct qemud_socket {
struct qemud_worker {
pthread_t thread;
- int hasThread :1;
- int processingCall :1;
- int quitRequest : 1;
+ unsigned int hasThread :1;
+ unsigned int processingCall :1;
+ unsigned int quitRequest :1;
/* back-pointer to our server */
struct qemud_server *server;
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 1413273..7be090d 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -400,8 +400,8 @@ enum virDomainVideoType {
typedef struct _virDomainVideoAccelDef virDomainVideoAccelDef;
typedef virDomainVideoAccelDef *virDomainVideoAccelDefPtr;
struct _virDomainVideoAccelDef {
- int support3d : 1;
- int support2d : 1;
+ unsigned int support3d :1;
+ unsigned int support2d :1;
};
@@ -432,7 +432,7 @@ struct _virDomainGraphicsDef {
union {
struct {
int port;
- int autoport : 1;
+ unsigned int autoport :1;
char *listenAddr;
char *keymap;
char *passwd;
@@ -445,13 +445,13 @@ struct _virDomainGraphicsDef {
struct {
int port;
char *listenAddr;
- int autoport : 1;
- int replaceUser : 1;
- int multiUser : 1;
+ unsigned int autoport :1;
+ unsigned int replaceUser :1;
+ unsigned int multiUser :1;
} rdp;
struct {
char *display;
- int fullscreen : 1;
+ unsigned int fullscreen :1;
} desktop;
} data;
};
diff --git a/src/conf/interface_conf.h b/src/conf/interface_conf.h
index 2683eee..5b201d3 100644
--- a/src/conf/interface_conf.h
+++ b/src/conf/interface_conf.h
@@ -170,7 +170,7 @@ typedef virInterfaceObj *virInterfaceObjPtr;
struct _virInterfaceObj {
virMutex lock;
- int active:1; /* 1 if interface is active (up) */
+ unsigned int active:1; /* 1 if interface is active (up) */
virInterfaceDefPtr def; /* The interface definition */
};
diff --git a/src/conf/network_conf.h b/src/conf/network_conf.h
index 0214d1a..9e50659 100644
--- a/src/conf/network_conf.h
+++ b/src/conf/network_conf.h
@@ -65,7 +65,7 @@ struct _virNetworkDef {
char *bridge; /* Name of bridge device */
char *domain;
unsigned long delay; /* Bridge forward delay (ms) */
- int stp : 1; /* Spanning tree protocol */
+ unsigned int stp :1; /* Spanning tree protocol */
int forwardType; /* One of virNetworkForwardType constants */
char *forwardDev; /* Destination device for forwarding */
--
1.6.5.2
14 years, 10 months
[libvirt] [PATCH] Take disabled/forced CPU features into account
by Jiri Denemark
When comparing x86 CPUs, features with 'disabled' policy were mistakenly
required to be supported by the host CPU.
Likewise, features with 'force' policy which were supported by host CPU
would make CPUs incompatible if 'strict' match was used by guest CPU.
This patch fixes both issues.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/cpu/cpu_x86.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index 50c03ad..298b632 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -782,11 +782,14 @@ x86Compute(virCPUDefPtr host,
if (!(cpu_forbid = x86ModelFromCPU(cpu, map, VIR_CPU_FEATURE_FORBID)))
goto error;
+ x86ModelSubtract(cpu_require, cpu_disable);
+
if ((diff = x86ModelCopy(host_model)) == NULL)
goto no_memory;
x86ModelSubtract(diff, cpu_require);
x86ModelSubtract(diff, cpu_optional);
+ x86ModelSubtract(diff, cpu_force);
for (i = 0; i < cpu_forbid->ncpuid; i++) {
const struct cpuX86cpuid *cpuid1;
--
1.6.6
14 years, 10 months
[libvirt] [PATCH] Add debug messages for CPU incompatibility
by Jiri Denemark
When comparing incompatible CPUs, the reason for this incompatibility is
logged as a debug message.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/cpu/cpu_x86.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/src/cpu/cpu_x86.c b/src/cpu/cpu_x86.c
index 7c50261..50c03ad 100644
--- a/src/cpu/cpu_x86.c
+++ b/src/cpu/cpu_x86.c
@@ -755,8 +755,10 @@ x86Compute(virCPUDefPtr host,
}
}
- if (!found)
+ if (!found) {
+ VIR_DEBUG("CPU arch %s does not match host arch", cpu->arch);
return VIR_CPU_COMPARE_INCOMPATIBLE;
+ }
}
if ((map = x86LoadMap()) == NULL)
@@ -796,6 +798,8 @@ x86Compute(virCPUDefPtr host,
cpuid1->function);
if (cpuid2 != NULL && x86cpuidMatchAny(cpuid2, cpuid1)) {
+ VIR_DEBUG("Host CPU provides forbidden features in CPUID function 0x%x",
+ cpuid1->function);
ret = VIR_CPU_COMPARE_INCOMPATIBLE;
goto out;
}
@@ -803,6 +807,7 @@ x86Compute(virCPUDefPtr host,
result = x86ModelCompare(host_model, cpu_require);
if (result == SUBSET || result == UNRELATED) {
+ VIR_DEBUG0("Host CPU does not provide all required features");
ret = VIR_CPU_COMPARE_INCOMPATIBLE;
goto out;
}
@@ -819,6 +824,7 @@ x86Compute(virCPUDefPtr host,
if (ret == VIR_CPU_COMPARE_SUPERSET
&& cpu->type == VIR_CPU_TYPE_GUEST
&& cpu->match == VIR_CPU_MATCH_STRICT) {
+ VIR_DEBUG0("Host CPU does not strictly match guest CPU");
ret = VIR_CPU_COMPARE_INCOMPATIBLE;
goto out;
}
--
1.6.6
14 years, 10 months