[libvirt] [PATCH 0/6] Almost finish extermination of virDomainLiveConfigHelperMethod
by Peter Krempa
Few patches are not ideal, so ideas are welcome.
Peter Krempa (6):
qemu: driver: Make name of QEMU_SET_MEM_PARAMETER more universal
lxc: Synchronize implementation of qemuDomainSetMemoryParameters
openvz: Remove use of virDomainLiveConfigHelperMethod
conf: Don't use virDomainLiveConfigHelperMethod in
virDomainObjSetMetadata
conf: Don't use virDomainLiveConfigHelperMethod in
virDomainObjGetMetadata
conf: Isolate virDomainLiveConfigHelperMethod to libxl only
src/bhyve/bhyve_driver.c | 9 +------
src/conf/domain_conf.c | 49 ++++++-------------------------------
src/conf/domain_conf.h | 9 -------
src/libvirt_private.syms | 1 -
src/libxl/libxl_driver.c | 30 +++++++++++++++++++++++
src/lxc/lxc_driver.c | 60 ++++++++++++++++++++--------------------------
src/openvz/openvz_driver.c | 15 ++++--------
src/qemu/qemu_driver.c | 22 +++++++----------
src/test/test_driver.c | 4 +---
9 files changed, 79 insertions(+), 120 deletions(-)
--
2.9.0
8 years, 4 months
[libvirt] Designing NVDIMM & memory-backend-file
by Michal Privoznik
Dear list,
I'd like to fix the following bug [1]. Long story short, the only way
how to have a domain use memory-backend-file object is to configure
hugepages. Either for whole domain under <memoryBacking/> element, or in
<memory/> device:
<memoryBacking>
<hugepages>
<page size='2048' unit='KiB' nodeset='1'/>
</hugepages>
</memoryBacking>
-object memory-backend-file,id=ram-node1,prealloc=yes,\
mem-path=/dev/hugepages2M/libvirt/qemu,size=1073741824,host-nodes=0-3,\
policy=bind \
-numa node,nodeid=1,cpus=1,memdev=ram-node1 \
<memory model='dimm'>
<source>
<nodemask>1-3</nodemask>
<pagesize unit='KiB'>2048</pagesize>
</source>
<target>
<size unit='KiB'>524287</size>
<node>0</node>
</target>
</memory>
-object memory-backend-file,id=memdimm1,prealloc=yes,\
mem-path=/dev/hugepages2M/libvirt/qemu,size=536870912,host-nodes=1-3,policy=bind
\
-device pc-dimm,node=0,memdev=memdimm1,id=dimm1 \
Now, there's a request in the BZ to allow applications to use the
memory-backend-file but let them use different backend, well different
path for backing the memory, e.g. shm which is usually mounted at
/dev/shm. And I'd like to consult my idea before I dig deep in the patches.
My idea is to extend <memory/> device we have, more precisely <source/>
element to allow something like this:
<memory model='dimm'>
<source>
<path>/dev/shm</path>
</source>
<target/>
</memory>
This way we can allow users to pass an arbitrary path to the
memory-backend-file. Also the amount of code needing change would be
fairly small O:-)
And while I'll be working on this, I want to take a look at NVDIMM
feature that qemu introduced recently [2]. The way I understand it, it
is very similar to my problem from above. The only difference (for the
consistence) would be that the memory model would be something else than
'dimm' ('nvdimm' perhaps?)
<memory model='nvdimm'>
<source>
<path>/tmp/nvdimm1</path>
</source>
<target>
<size unit='GiB'>10</size>
</target>
</memory>
-machine pc,nvdimm -m 8G,maxmem=100G,slots=100 \
-object memory-backend-file,id=mem1,share,mem-path=/tmp/nvdimm1,size=10G \
-device nvdimm,memdev=mem1,id=nv1
Please, let me know what do you think of this. Thank you for saving me
from doing couple of useless iterations of patches getting the design
right :-)
Michal
1: https://bugzilla.redhat.com/show_bug.cgi?id=1214369
2: http://lists.nongnu.org/archive/html/qemu-devel/2016-06/msg07068.html
8 years, 4 months
[libvirt] [PATCH] virtlogd: increase max file size to 2 MB
by Daniel P. Berrange
People debugging guest OS boot processes and reported that
the default 128 KB size is too small to capture an entire
boot up sequence. Increase the default size to 2 MB which
should allow capturing a full boot up even with verbose
debugging.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/logging/log_daemon_config.c | 2 +-
src/logging/virtlogd.conf | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/logging/log_daemon_config.c b/src/logging/log_daemon_config.c
index b584970..7bf10c6 100644
--- a/src/logging/log_daemon_config.c
+++ b/src/logging/log_daemon_config.c
@@ -128,7 +128,7 @@ virLogDaemonConfigNew(bool privileged ATTRIBUTE_UNUSED)
return NULL;
data->max_clients = 1024;
- data->max_size = 128 * 1024;
+ data->max_size = 1024 * 1024 * 2;
data->max_backups = 3;
return data;
diff --git a/src/logging/virtlogd.conf b/src/logging/virtlogd.conf
index fbd92ff..7ef1ac3 100644
--- a/src/logging/virtlogd.conf
+++ b/src/logging/virtlogd.conf
@@ -59,8 +59,8 @@
#max_clients = 1024
-# Maximum file size before rolling over. Defaults to 128 KB
-#max_size = 131072
+# Maximum file size before rolling over. Defaults to 2 MB
+#max_size = 2097152
# Maximum number of backup files to keep. Defaults to 3,
# not including the primary active file
--
2.7.4
8 years, 4 months
[libvirt] [PATCH] virtlogd: make max file size & number of backups configurable
by Daniel P. Berrange
Currently virtlogd has a hardcoded max file size of 128kb
and max of 3 backups. This adds two new config parameters
to /etc/libvirt/virtlogd.conf to let these be customized.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/logging/log_daemon.c | 17 +++++++++++++----
src/logging/log_daemon_config.c | 5 +++++
src/logging/log_daemon_config.h | 3 +++
src/logging/log_handler.c | 27 ++++++++++++++++++---------
src/logging/log_handler.h | 4 ++++
src/logging/test_virtlogd.aug.in | 4 ++++
src/logging/virtlogd.aug | 2 ++
src/logging/virtlogd.conf | 8 ++++++++
8 files changed, 57 insertions(+), 13 deletions(-)
diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c
index 9f71ca9..80e75bf 100644
--- a/src/logging/log_daemon.c
+++ b/src/logging/log_daemon.c
@@ -165,6 +165,8 @@ virLogDaemonNew(virLogDaemonConfigPtr config, bool privileged)
goto error;
if (!(logd->handler = virLogHandlerNew(privileged,
+ config->max_size,
+ config->max_backups,
virLogDaemonInhibitor,
logd)))
goto error;
@@ -185,7 +187,8 @@ virLogDaemonGetHandler(virLogDaemonPtr dmn)
static virLogDaemonPtr
-virLogDaemonNewPostExecRestart(virJSONValuePtr object, bool privileged)
+virLogDaemonNewPostExecRestart(virJSONValuePtr object, bool privileged,
+ virLogDaemonConfigPtr config)
{
virLogDaemonPtr logd;
virJSONValuePtr child;
@@ -226,6 +229,8 @@ virLogDaemonNewPostExecRestart(virJSONValuePtr object, bool privileged)
if (!(logd->handler = virLogHandlerNewPostExecRestart(child,
privileged,
+ config->max_size,
+ config->max_backups,
virLogDaemonInhibitor,
logd)))
goto error;
@@ -717,7 +722,8 @@ static int
virLogDaemonPostExecRestart(const char *state_file,
const char *pid_file,
int *pid_file_fd,
- bool privileged)
+ bool privileged,
+ virLogDaemonConfigPtr config)
{
const char *gotmagic;
char *wantmagic = NULL;
@@ -766,7 +772,9 @@ virLogDaemonPostExecRestart(const char *state_file,
(*pid_file_fd = virPidFileAcquirePath(pid_file, false, getpid())) < 0)
goto cleanup;
- if (!(logDaemon = virLogDaemonNewPostExecRestart(object, privileged)))
+ if (!(logDaemon = virLogDaemonNewPostExecRestart(object,
+ privileged,
+ config)))
goto cleanup;
ret = 1;
@@ -1086,7 +1094,8 @@ int main(int argc, char **argv) {
if ((rv = virLogDaemonPostExecRestart(state_file,
pid_file,
&pid_file_fd,
- privileged)) < 0) {
+ privileged,
+ config)) < 0) {
ret = VIR_LOG_DAEMON_ERR_INIT;
goto cleanup;
}
diff --git a/src/logging/log_daemon_config.c b/src/logging/log_daemon_config.c
index 9e729fa..b584970 100644
--- a/src/logging/log_daemon_config.c
+++ b/src/logging/log_daemon_config.c
@@ -128,6 +128,8 @@ virLogDaemonConfigNew(bool privileged ATTRIBUTE_UNUSED)
return NULL;
data->max_clients = 1024;
+ data->max_size = 128 * 1024;
+ data->max_backups = 3;
return data;
}
@@ -154,6 +156,9 @@ virLogDaemonConfigLoadOptions(virLogDaemonConfigPtr data,
GET_CONF_STR(conf, filename, log_outputs);
GET_CONF_UINT(conf, filename, max_clients);
+ GET_CONF_UINT(conf, filename, max_size);
+ GET_CONF_UINT(conf, filename, max_backups);
+
return 0;
error:
diff --git a/src/logging/log_daemon_config.h b/src/logging/log_daemon_config.h
index 24cc631..0da7b0b 100644
--- a/src/logging/log_daemon_config.h
+++ b/src/logging/log_daemon_config.h
@@ -34,6 +34,9 @@ struct _virLogDaemonConfig {
char *log_filters;
char *log_outputs;
int max_clients;
+
+ size_t max_backups;
+ size_t max_size;
};
diff --git a/src/logging/log_handler.c b/src/logging/log_handler.c
index a8cb6cf..cd0ba6e 100644
--- a/src/logging/log_handler.c
+++ b/src/logging/log_handler.c
@@ -41,8 +41,6 @@ VIR_LOG_INIT("logging.log_handler");
#define VIR_FROM_THIS VIR_FROM_LOGGING
-#define DEFAULT_FILE_SIZE (128 * 1024)
-#define DEFAULT_MAX_BACKUP 3
#define DEFAULT_MODE 0600
typedef struct _virLogHandlerLogFile virLogHandlerLogFile;
@@ -62,6 +60,9 @@ struct _virLogHandler {
virObjectLockable parent;
bool privileged;
+ size_t max_size;
+ size_t max_backups;
+
virLogHandlerLogFilePtr *files;
size_t nfiles;
@@ -184,6 +185,8 @@ virLogHandlerDomainLogFileEvent(int watch,
virLogHandlerPtr
virLogHandlerNew(bool privileged,
+ size_t max_size,
+ size_t max_backups,
virLogHandlerShutdownInhibitor inhibitor,
void *opaque)
{
@@ -196,6 +199,8 @@ virLogHandlerNew(bool privileged,
goto error;
handler->privileged = privileged;
+ handler->max_size = max_size;
+ handler->max_backups = max_backups;
handler->inhibitor = inhibitor;
handler->opaque = opaque;
@@ -254,8 +259,8 @@ virLogHandlerLogFilePostExecRestart(virLogHandlerPtr handler,
}
if ((file->file = virRotatingFileWriterNew(path,
- DEFAULT_FILE_SIZE,
- DEFAULT_MAX_BACKUP,
+ handler->max_size,
+ handler->max_backups,
false,
DEFAULT_MODE)) == NULL)
goto error;
@@ -283,6 +288,8 @@ virLogHandlerLogFilePostExecRestart(virLogHandlerPtr handler,
virLogHandlerPtr
virLogHandlerNewPostExecRestart(virJSONValuePtr object,
bool privileged,
+ size_t max_size,
+ size_t max_backups,
virLogHandlerShutdownInhibitor inhibitor,
void *opaque)
{
@@ -292,6 +299,8 @@ virLogHandlerNewPostExecRestart(virJSONValuePtr object,
size_t i;
if (!(handler = virLogHandlerNew(privileged,
+ max_size,
+ max_backups,
inhibitor,
opaque)))
return NULL;
@@ -396,8 +405,8 @@ virLogHandlerDomainOpenLogFile(virLogHandlerPtr handler,
goto error;
if ((file->file = virRotatingFileWriterNew(path,
- DEFAULT_FILE_SIZE,
- DEFAULT_MAX_BACKUP,
+ handler->max_size,
+ handler->max_backups,
trunc,
DEFAULT_MODE)) == NULL)
goto error;
@@ -487,7 +496,7 @@ virLogHandlerDomainReadLogFile(virLogHandlerPtr handler,
virObjectLock(handler);
- if (!(file = virRotatingFileReaderNew(path, DEFAULT_MAX_BACKUP)))
+ if (!(file = virRotatingFileReaderNew(path, handler->max_backups)))
goto error;
if (virRotatingFileReaderSeek(file, inode, offset) < 0)
@@ -542,8 +551,8 @@ virLogHandlerDomainAppendLogFile(virLogHandlerPtr handler,
if (!writer) {
if (!(newwriter = virRotatingFileWriterNew(path,
- DEFAULT_FILE_SIZE,
- DEFAULT_MAX_BACKUP,
+ handler->max_size,
+ handler->max_backups,
false,
DEFAULT_MODE)))
goto cleanup;
diff --git a/src/logging/log_handler.h b/src/logging/log_handler.h
index 4607e45..70be567 100644
--- a/src/logging/log_handler.h
+++ b/src/logging/log_handler.h
@@ -34,10 +34,14 @@ typedef void (*virLogHandlerShutdownInhibitor)(bool inhibit,
void *opaque);
virLogHandlerPtr virLogHandlerNew(bool privileged,
+ size_t max_size,
+ size_t max_backups,
virLogHandlerShutdownInhibitor inhibitor,
void *opaque);
virLogHandlerPtr virLogHandlerNewPostExecRestart(virJSONValuePtr child,
bool privileged,
+ size_t max_size,
+ size_t max_backups,
virLogHandlerShutdownInhibitor inhibitor,
void *opaque);
diff --git a/src/logging/test_virtlogd.aug.in b/src/logging/test_virtlogd.aug.in
index b12f676..792a5b8 100644
--- a/src/logging/test_virtlogd.aug.in
+++ b/src/logging/test_virtlogd.aug.in
@@ -2,9 +2,13 @@ module Test_virtlogd =
let conf = "log_level = 3
log_filters=\"3:remote 4:event\"
log_outputs=\"3:syslog:virtlogd\"
+max_size = 131072
+max_backups = 3
"
test Virtlogd.lns get conf =
{ "log_level" = "3" }
{ "log_filters" = "3:remote 4:event" }
{ "log_outputs" = "3:syslog:virtlogd" }
+ { "max_size" = "131072" }
+ { "max_backups" = "3" }
diff --git a/src/logging/virtlogd.aug b/src/logging/virtlogd.aug
index eefba5b..da480fd 100644
--- a/src/logging/virtlogd.aug
+++ b/src/logging/virtlogd.aug
@@ -29,6 +29,8 @@ module Virtlogd =
| str_entry "log_outputs"
| int_entry "log_buffer_size"
| int_entry "max_clients"
+ | int_entry "max_size"
+ | int_entry "max_backups"
(* Each enty in the config is one of the following three ... *)
let entry = logging_entry
diff --git a/src/logging/virtlogd.conf b/src/logging/virtlogd.conf
index abb3633..fbd92ff 100644
--- a/src/logging/virtlogd.conf
+++ b/src/logging/virtlogd.conf
@@ -57,3 +57,11 @@
# The maximum number of concurrent client connections to allow
# over all sockets combined.
#max_clients = 1024
+
+
+# Maximum file size before rolling over. Defaults to 128 KB
+#max_size = 131072
+
+# Maximum number of backup files to keep. Defaults to 3,
+# not including the primary active file
+#max_backups = 3
--
2.7.4
8 years, 4 months
[libvirt] [PATCH] maint: update to latest gnulib
by Martin Kletzander
Fix mingw build regarding rpl_{printf,scanf} symbols.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
Pushed under gnulib maintenance (just guessing what that means) and
build-breaker rules.
.gnulib | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.gnulib b/.gnulib
index 246b3b28808e..68b6adebef05 160000
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit 246b3b28808ee5f4664be674dce573af9497fc7a
+Subproject commit 68b6adebef05670a312fb92b05e7bd089d2ed43a
--
2.9.0
8 years, 4 months
[libvirt] [PATCH 0/6] Revert: 'IP peer address and host-side address config support'
by Ján Tomko
This series was accidentally pushed in the feature freeze.
Revert the last six commits adding the new functionality.
The rest are either bugfixes or preparation for the bugfixes.
Ján Tomko (6):
Revert "qemu: support setting host-side IP addresses/routes"
Revert "lxc: support setting host-side IP addresses/routes"
Revert "util: support setting peer for virNetDevIPInfo addresses"
Revert "conf: support host-side IP/route information in <interface>"
Revert "conf: allow setting peer address in <ip> element of
<interface>"
Revert "util: new function virNetDevIPInfoAddToDev"
docs/formatdomain.html.in | 60 +++--------
docs/schemas/domaincommon.rng | 8 +-
src/conf/domain_conf.c | 117 ++++-----------------
src/conf/domain_conf.h | 3 +-
src/libvirt_private.syms | 1 -
src/lxc/lxc_container.c | 47 +++++++--
src/lxc/lxc_process.c | 8 --
src/qemu/qemu_interface.c | 6 +-
src/util/virnetdevip.c | 60 -----------
src/util/virnetdevip.h | 7 +-
tests/lxcxml2xmldata/lxc-ethernet-hostip.xml | 44 --------
tests/lxcxml2xmltest.c | 1 -
.../qemuxml2argv-net-eth-hostip.args | 23 ----
.../qemuxml2argv-net-eth-hostip.xml | 39 -------
tests/qemuxml2argvtest.c | 1 -
.../qemuxml2xmlout-net-eth-hostip.xml | 44 --------
tests/qemuxml2xmltest.c | 1 -
17 files changed, 75 insertions(+), 395 deletions(-)
delete mode 100644 tests/lxcxml2xmldata/lxc-ethernet-hostip.xml
delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-eth-hostip.args
delete mode 100644 tests/qemuxml2argvdata/qemuxml2argv-net-eth-hostip.xml
delete mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-net-eth-hostip.xml
--
2.7.3
8 years, 4 months
[libvirt] CPU topology and ordering in ACPI MADT
by Eduardo Habkost
I got a bug report yesterday that seems to be related to how CPUs
are ordered 'lscpu' and /proc/cpuinfo:
https://bugzilla.redhat.com/show_bug.cgi?id=1351160
It's not an actual bug, but it's not the first time I see people
confused by CPU numbers not following socket/core/thread IDs in
lscpu and /proc/cpuinfo in the host (making CPU numbers seen in
the guest not matching CPU numbers in the host).
The ordering in /proc/cpuinfo and lscpu seems to come from the
MADT ACPI table, and on some hosts it looks completely
arbitrary[1].
Now that we will allow the APIC ID (or socket/core/thread IDs) to
be explicitly set in each VCPU, we could let management make CPU
ordering match the host exactly, for people that really want to
reproduce the host topology and get easily confused by CPU
numbers that don't match the host.
But this is lot of data to be provided to QEMU, so I don't see it
as an useful feature unless it can be represented in the libvirt
XML configuration in a more compact way, or generated
automatically based on the host. I'm CCing libvir-list to see if
they have any ideas.
...or we could just tell users that sometimes it will be
impossible to make the CPU numbers in the guest match the ones in
the host. To be honest, I am more inclined towards this option,
but I would like to hear your opinions.
[1] Example of lscpu output from a host that doesn't follow
socket/core/thread ID on the MADT table:
# lscpu -e
CPU NODE SOCKET CORE L1d:L1i:L2:L3 ONLINE
0 1 0 0 0:0:0:0 yes
1 0 1 1 1:1:1:1 yes
2 1 0 2 2:2:2:0 yes
3 0 1 3 3:3:3:1 yes
4 1 0 4 4:4:4:0 yes
5 0 1 5 5:5:5:1 yes
6 1 0 6 6:6:6:0 yes
7 0 1 7 7:7:7:1 yes
8 1 0 8 8:8:8:0 yes
9 0 1 9 9:9:9:1 yes
10 1 0 10 10:10:10:0 yes
11 0 1 11 11:11:11:1 yes
12 1 0 0 0:0:0:0 yes
13 0 1 1 1:1:1:1 yes
14 1 0 2 2:2:2:0 yes
15 0 1 3 3:3:3:1 yes
16 1 0 4 4:4:4:0 yes
17 0 1 5 5:5:5:1 yes
18 1 0 6 6:6:6:0 yes
19 0 1 7 7:7:7:1 yes
20 1 0 8 8:8:8:0 yes
21 0 1 9 9:9:9:1 yes
22 1 0 10 10:10:10:0 yes
23 0 1 11 11:11:11:1 yes
# lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 24
On-line CPU(s) list: 0-23
Thread(s) per core: 2
Core(s) per socket: 6
Socket(s): 2
NUMA node(s): 2
Vendor ID: GenuineIntel
CPU family: 6
Model: 44
Model name: Intel(R) Xeon(R) CPU L5640 @ 2.27GHz
Stepping: 2
CPU MHz: 2266.000
BogoMIPS: 4533.26
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 12288K
NUMA node0 CPU(s): 1,3,5,7,9,11,13,15,17,19,21,23
NUMA node1 CPU(s): 0,2,4,6,8,10,12,14,16,18,20,22
#
--
Eduardo
8 years, 4 months
[libvirt] [PATCH 0/5] Some USB hotplug and alias cleanups
by John Ferlan
A post 2.0.0 type adjustment...
While answering a question for bz 1289391 regarding the USB path - I figured
that making the code be more the virtio and scsi code paths would at least
have a better look'n'feel. Then I tripped in to the alias morass and cleaned
that up a bit too.
John Ferlan (5):
qemu: Reorder qemuDomainAttachUSBMassStorageDevice failure path
qemu: Move drive alias processing to qemu_alias
qemu: Use qemuAssignDeviceDiskDriveAlias
qemu: Make QEMU_DRIVE_HOST_PREFIX more private
qemu: Add attempt to call qemuMonitorDriveDel for USB failure path
src/qemu/qemu_alias.c | 34 +++++++++++++++++++++++++
src/qemu/qemu_alias.h | 4 +++
src/qemu/qemu_command.c | 23 ++++++++---------
src/qemu/qemu_command.h | 1 -
src/qemu/qemu_domain.c | 3 +--
src/qemu/qemu_driver.c | 3 +--
src/qemu/qemu_hotplug.c | 59 ++++++++++++++++++++++++++++----------------
src/qemu/qemu_migration.c | 11 +++------
src/qemu/qemu_monitor_json.c | 10 +++-----
src/qemu/qemu_monitor_text.c | 18 ++++++++------
src/qemu/qemu_process.c | 3 +--
11 files changed, 107 insertions(+), 62 deletions(-)
--
2.5.5
8 years, 4 months