[libvirt] [PATCH] libxl_domain: Use g_autoptr for libxlDriverConfig
by Michal Privoznik
This simplifies some functions, but mostly
libxlDomainManagedSavePath() which is going to be modified in
future commits.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/libxl/libxl_domain.c | 34 ++++++++++------------------------
1 file changed, 10 insertions(+), 24 deletions(-)
diff --git a/src/libxl/libxl_domain.c b/src/libxl/libxl_domain.c
index 25228af7a6..d79c3c1ed7 100644
--- a/src/libxl/libxl_domain.c
+++ b/src/libxl/libxl_domain.c
@@ -475,10 +475,9 @@ libxlDomainShutdownThread(void *opaque)
libxlDriverPrivatePtr driver = shutdown_info->driver;
virObjectEventPtr dom_event = NULL;
libxl_shutdown_reason xl_reason = ev->u.domain_shutdown.shutdown_reason;
- libxlDriverConfigPtr cfg;
+ g_autoptr(libxlDriverConfig) cfg = libxlDriverConfigGet(driver);
libxl_domain_config d_config;
- cfg = libxlDriverConfigGet(driver);
libxl_domain_config_init(&d_config);
vm = virDomainObjListFindByID(driver->domains, ev->domid);
@@ -600,7 +599,6 @@ libxlDomainShutdownThread(void *opaque)
libxl_event_free(cfg->ctx, ev);
VIR_FREE(shutdown_info);
libxl_domain_config_dispose(&d_config);
- virObjectUnref(cfg);
}
static void
@@ -611,11 +609,9 @@ libxlDomainDeathThread(void *opaque)
libxl_event *ev = shutdown_info->event;
libxlDriverPrivatePtr driver = shutdown_info->driver;
virObjectEventPtr dom_event = NULL;
- libxlDriverConfigPtr cfg;
+ g_autoptr(libxlDriverConfig) cfg = libxlDriverConfigGet(driver);
libxlDomainObjPrivatePtr priv;
- cfg = libxlDriverConfigGet(driver);
-
vm = virDomainObjListFindByID(driver->domains, ev->domid);
if (!vm) {
/* vm->def->id already cleared, means the death was handled by the
@@ -647,7 +643,6 @@ libxlDomainDeathThread(void *opaque)
virObjectEventStateQueue(driver->domainEventState, dom_event);
libxl_event_free(cfg->ctx, ev);
VIR_FREE(shutdown_info);
- virObjectUnref(cfg);
}
@@ -661,7 +656,7 @@ libxlDomainEventHandler(void *data, VIR_LIBXL_EVENT_CONST libxl_event *event)
libxl_shutdown_reason xl_reason = event->u.domain_shutdown.shutdown_reason;
struct libxlShutdownThreadInfo *shutdown_info = NULL;
virThread thread;
- libxlDriverConfigPtr cfg;
+ g_autoptr(libxlDriverConfig) cfg = NULL;
int ret = -1;
if (event->type != LIBXL_EVENT_TYPE_DOMAIN_SHUTDOWN &&
@@ -710,7 +705,6 @@ libxlDomainEventHandler(void *data, VIR_LIBXL_EVENT_CONST libxl_event *event)
cfg = libxlDriverConfigGet(driver);
/* Cast away any const */
libxl_event_free(cfg->ctx, (libxl_event *)event);
- virObjectUnref(cfg);
VIR_FREE(shutdown_info);
}
@@ -718,10 +712,9 @@ char *
libxlDomainManagedSavePath(libxlDriverPrivatePtr driver, virDomainObjPtr vm)
{
char *ret;
- libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver);
+ g_autoptr(libxlDriverConfig) cfg = libxlDriverConfigGet(driver);
ignore_value(virAsprintf(&ret, "%s/%s.save", cfg->saveDir, vm->def->name));
- virObjectUnref(cfg);
return ret;
}
@@ -808,7 +801,7 @@ int
libxlDomainDestroyInternal(libxlDriverPrivatePtr driver,
virDomainObjPtr vm)
{
- libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver);
+ g_autoptr(libxlDriverConfig) cfg = libxlDriverConfigGet(driver);
libxlDomainObjPrivatePtr priv = vm->privateData;
int ret = -1;
@@ -825,7 +818,6 @@ libxlDomainDestroyInternal(libxlDriverPrivatePtr driver,
if (ret)
priv->ignoreDeathEvent = false;
- virObjectUnref(cfg);
return ret;
}
@@ -839,7 +831,7 @@ libxlDomainCleanup(libxlDriverPrivatePtr driver,
virDomainObjPtr vm)
{
libxlDomainObjPrivatePtr priv = vm->privateData;
- libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver);
+ g_autoptr(libxlDriverConfig) cfg = libxlDriverConfigGet(driver);
int vnc_port;
char *file;
virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr;
@@ -931,7 +923,6 @@ libxlDomainCleanup(libxlDriverPrivatePtr driver,
}
virDomainObjRemoveTransientDef(vm);
- virObjectUnref(cfg);
virObjectUnref(conn);
}
@@ -944,7 +935,7 @@ int
libxlDomainAutoCoreDump(libxlDriverPrivatePtr driver,
virDomainObjPtr vm)
{
- libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver);
+ g_autoptr(libxlDriverConfig) cfg = libxlDriverConfigGet(driver);
time_t curtime = time(NULL);
char timestr[100];
struct tm time_info;
@@ -969,7 +960,6 @@ libxlDomainAutoCoreDump(libxlDriverPrivatePtr driver,
cleanup:
VIR_FREE(dumpfile);
- virObjectUnref(cfg);
return ret;
}
@@ -977,7 +967,7 @@ libxlDomainAutoCoreDump(libxlDriverPrivatePtr driver,
int
libxlDomainSetVcpuAffinities(libxlDriverPrivatePtr driver, virDomainObjPtr vm)
{
- libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver);
+ g_autoptr(libxlDriverConfig) cfg = libxlDriverConfigGet(driver);
virDomainVcpuDefPtr vcpu;
libxl_bitmap map;
virBitmapPtr cpumask = NULL;
@@ -1014,7 +1004,6 @@ libxlDomainSetVcpuAffinities(libxlDriverPrivatePtr driver, virDomainObjPtr vm)
cleanup:
libxl_bitmap_dispose(&map);
- virObjectUnref(cfg);
return ret;
}
@@ -1275,7 +1264,7 @@ libxlDomainStart(libxlDriverPrivatePtr driver,
char *managed_save_path = NULL;
int managed_save_fd = -1;
libxlDomainObjPrivatePtr priv = vm->privateData;
- libxlDriverConfigPtr cfg;
+ g_autoptr(libxlDriverConfig) cfg = libxlDriverConfigGet(driver);
virHostdevManagerPtr hostdev_mgr = driver->hostdevMgr;
libxl_asyncprogress_how aop_console_how;
libxl_domain_restore_params params;
@@ -1288,7 +1277,6 @@ libxlDomainStart(libxlDriverPrivatePtr driver,
libxl_domain_config_init(&d_config);
- cfg = libxlDriverConfigGet(driver);
/* If there is a managed saved state restore it instead of starting
* from scratch. The old state is removed once the restoring succeeded. */
if (restore_fd < 0) {
@@ -1528,7 +1516,6 @@ libxlDomainStart(libxlDriverPrivatePtr driver,
VIR_FREE(managed_save_path);
virDomainDefFree(def);
VIR_FORCE_CLOSE(managed_save_fd);
- virObjectUnref(cfg);
return ret;
}
@@ -1558,7 +1545,7 @@ libxlDomainDefCheckABIStability(libxlDriverPrivatePtr driver,
{
virDomainDefPtr migratableDefSrc = NULL;
virDomainDefPtr migratableDefDst = NULL;
- libxlDriverConfigPtr cfg = libxlDriverConfigGet(driver);
+ g_autoptr(libxlDriverConfig) cfg = libxlDriverConfigGet(driver);
bool ret = false;
if (!(migratableDefSrc = virDomainDefCopy(src, cfg->caps, driver->xmlopt, NULL, true)) ||
@@ -1572,6 +1559,5 @@ libxlDomainDefCheckABIStability(libxlDriverPrivatePtr driver,
cleanup:
virDomainDefFree(migratableDefSrc);
virDomainDefFree(migratableDefDst);
- virObjectUnref(cfg);
return ret;
}
--
2.21.0
5 years, 1 month
[libvirt] [PATCH] bhyve_conf: Drop unused 'error' label in virBhyveDriverConfigNew()
by Michal Privoznik
There's unused 'error' label left after transition from
VIR_STRDUP() to g_strdup (v5.8.0-255-g652cdbe364).
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
Pushed under trivial & build breaker rules.
src/bhyve/bhyve_conf.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/src/bhyve/bhyve_conf.c b/src/bhyve/bhyve_conf.c
index ab5d7f467b..f3e2ebf7c7 100644
--- a/src/bhyve/bhyve_conf.c
+++ b/src/bhyve/bhyve_conf.c
@@ -59,10 +59,6 @@ virBhyveDriverConfigNew(void)
cfg->firmwareDir = g_strdup(DATADIR "/uefi-firmware");
return cfg;
-
- error:
- virObjectUnref(cfg);
- return NULL;
}
int
--
2.21.0
5 years, 1 month
[libvirt] [PATCH 00/25] cleanup current build system
by Pavel Hrdina
As preparation to switch to Meson there are some things that needs be
cleaned up to make the conversion easier.
The important thing in Meson is that there is a strict separation
between source and build directory and the distributed tarball by
default contains only files tracked by git with a possibility to
write a script which would add some other sources into the tarball.
Regardless of the adoption of Meson these patches improve our current
build system to fully support VPATH builds.
Pavel Hrdina (25):
4: virt-driver-libxl: remove Fedora 28 check
m4: virt-libnl: drop libnl-1.0 support
m4: virt-netcf: bump minimal version to 0.1.8
m4: virt-selinux: remove obsolete checks
locking: separate lock driver code into libvirt_driver_lock.la
logging: separate log driver code into libvirt_driver_log.la
remote: unify rpc server dispatch generated files
build: move admin code into admin directory
src: move nodist_libvirt_driver_remote_la_SOURCES into remote Makefile
docs: apibuild: remove old code paths
docs: generate files into build dir and stop distributing them
po: generate files into build dir
po: rewrite the way how we generate files
src: generate source files into build directory
src: access: generate source files into build directory
src: admin: generate source files into build directory
src: esx: generate source files into build directory
src: hyperv: generate source files into build directory
src: locking: generate source files into build directory
src: logging: generate source files into build directory
src: lxc: generate source files into build directory
src: remote: generate source files into build directory
include: stop distributing generated source files
src: stop distributing generated source files
tools: stop distributing generated source files
build-aux/syntax-check.mk | 6 +-
docs/Makefile.am | 115 ++++----
docs/apibuild.py | 19 +-
docs/hvsupport.pl | 37 +--
include/libvirt/Makefile.am | 2 +-
m4/virt-driver-libxl.m4 | 17 --
m4/virt-libnl.m4 | 56 +---
m4/virt-netcf.m4 | 18 +-
m4/virt-selinux.m4 | 20 +-
m4/virt-win-symbols.m4 | 4 +-
po/Makefile.am | 47 +--
po/POTFILES | 320 ---------------------
po/POTFILES.in | 320 +++++++++++++++++++++
src/Makefile.am | 94 +-----
src/access/Makefile.inc.am | 17 +-
src/admin/Makefile.inc.am | 109 ++++++-
src/{ => admin}/libvirt-admin.c | 0
src/{ => admin}/libvirt-admin.conf | 0
src/{ => admin}/libvirt_admin_private.syms | 0
src/{ => admin}/libvirt_admin_public.syms | 0
src/bhyve/Makefile.inc.am | 1 +
src/esx/Makefile.inc.am | 9 +-
src/esx/esx_vi_generator.py | 11 +-
src/hyperv/Makefile.inc.am | 9 +-
src/hyperv/hyperv_wmi_generator.py | 11 +-
src/interface/Makefile.inc.am | 2 +
src/interface/interface_backend_netcf.c | 4 -
src/libxl/Makefile.inc.am | 2 +
src/locking/Makefile.inc.am | 30 +-
src/logging/Makefile.inc.am | 30 +-
src/lxc/Makefile.inc.am | 36 ++-
src/network/Makefile.inc.am | 2 +
src/node_device/Makefile.inc.am | 2 +
src/nwfilter/Makefile.inc.am | 2 +
src/qemu/Makefile.inc.am | 2 +
src/qemu/qemu_domain.c | 4 +-
src/remote/Makefile.inc.am | 47 +--
src/remote/remote_daemon_dispatch.c | 4 +-
src/rpc/Makefile.inc.am | 8 +-
src/secret/Makefile.inc.am | 2 +
src/security/security_selinux.c | 22 +-
src/storage/Makefile.inc.am | 2 +
src/util/Makefile.inc.am | 6 +-
src/util/virnetlink.c | 13 +-
src/util/virnetlink.h | 8 -
src/vbox/Makefile.inc.am | 1 +
src/vz/Makefile.inc.am | 1 +
tests/Makefile.am | 4 +
tests/securityselinuxhelper.c | 19 +-
tools/Makefile.am | 1 -
50 files changed, 735 insertions(+), 761 deletions(-)
delete mode 100644 po/POTFILES
create mode 100644 po/POTFILES.in
rename src/{ => admin}/libvirt-admin.c (100%)
rename src/{ => admin}/libvirt-admin.conf (100%)
rename src/{ => admin}/libvirt_admin_private.syms (100%)
rename src/{ => admin}/libvirt_admin_public.syms (100%)
--
2.21.0
5 years, 1 month
[libvirt] [RFC PATCH v1 0/4] NUMA Host or Node Partitioning
by Wim Ten Have
From: Wim ten Have <wim.ten.have(a)oracle.com>
This patch extends guest domain administration by adding a feature that
creates a guest with a NUMA layout, also referred to as vNUMA (Virtual
NUMA).
NUMA (Non-Uniform Memory Access) is a method of configuring a cluster of
nodes within a single multiprocessing system such that each node shares
its processor local memory with other nodes, improving performance and
the ability of the system to be expanded.
The illustration below shows a typical 4-node NUMA system. Within this
system, each socket is equipped with its own distinct memory and some
also with I/O. Access to memory or I/O on remote nodes is only possible
communicating through the "Interconnect."
+-------------+-------+ +-------+-------------+
|NODE0| | | | | |NODE3|
| | CPU00 | CPU03 | | CPU12 | CPU15 | |
| | | | | | | |
| Mem +--- Socket0 ---<-------->--- Socket3 ---+ Mem |
| | | | | | | |
+-----+ CPU01 | CPU02 | | CPU13 | CPU14 | |
| I/O | | | | | | |
+-----+-------^-------+ +-------^-------+-----+
| |
| Interconnect |
| |
+-------------v-------+ +-------v-------------+
|NODE1| | | | | |NODE2|
| | CPU04 | CPU07 | | CPU08 | CPU11 | |
| | | | | | | |
| Mem +--- Socket1 ---<-------->--- Socket2 ---+ Mem |
| | | | | | | |
+-----+ CPU05 | CPU06 | | CPU09 | CPU10 | |
| I/O | | | | | | |
+-----+-------+-------+ +-------+-------+-----+
Unfortunately, NUMA architectures have some drawbacks. For example,
when data is stored in memory associated with Socket2 but is accessed
by a CPU in Socket0, that CPU uses the interconnect to access the
memory associated with Socket2. These interconnect hops add data access
delays. Some high performance software takes NUMA architecture into
account by carefully placing data in memory and pinning the processes
most likely to access that data to CPUs with the shortest access times.
Similarly, such software can pin its I/O processes to CPUs with the
shortest access times to I/O devices. When such software is run within
a guest VM, constructing the VM such that its virtual NUMA topology
mirrors the physical NUMA topology preserves the application software's
performance.
The changes brought by this patch series add a new libvirt domain element
named <vnuma> that allows for dynamic 'host' or 'node' partitioning of
a guest where libvirt inspects the host capabilities and renders a best
guest XML design holding a host matching vNUMA topology.
<domain>
..
<vnuma mode='host|node'
distribution='contiguous|siblings|round-robin|interleave'>
<memory unit='KiB'>524288</memory>
<partition nodeset="1-4,^3" cells="8"/>
</vnuma>
..
</domain>
The content of this <vnuma> element causes libvirt to dynamically
partition the guest domain XML into a 'host' or 'node' numa model.
Under <vnuma mode='host' ... > the guest domain is automatically
partitioned according to the "host" capabilities.
Under <vnuma mode='node' ... > the guest domain is partitioned according
to the nodeset and cells under the vnuma partition subelement.
The optional <vnuma> attribute distribution='type' is to indicate the
guest numa cell cpus distribution. This distribution='type' can have
the following values:
- 'contiguous' delivery, under which the cpus enumerate sequentially
over the numa defined cells.
- 'siblings' cpus are distributed over the numa cells matching the host
CPU SMT model.
- 'round-robin' cpus are distributed over the numa cells matching the
host CPU topology.
- 'interleave' cpus are interleaved one at a time over the numa cells.
The optional subelement <memory> specifies the memory size reserved
for the guest to dimension its <numa> <cell id> size. If no memory is
specified, the <vnuma> <memory> setting is acquired from the guest's
total memory, <domain> <memory> setting.
The optional attribute <partition> is only active when <vnuma mode='node'>
is in effect and allows for defining the active "nodeset" and "cells" to
target for under the "guest" domain. For example, the specified attribute
"nodeset" can limit the assigned host NUMA nodes in effect under the guest
with help of NUMA node tuning (<numatune>.) Alternatively, the provided
"cells" attribute can define the guest number of vNUMA cells to render.
We're planning a 'virsh vnuma' command to convert existing guest domains
to one of these vNUMA models.
Wim ten Have (4):
XML definitions for guest vNUMA and parsing routines
qemu: driver changes adding vNUMA vCPU hotplug support
qemu: driver changes adding vNUMA memory hotplug support
tests: add various tests to exercise vNUMA host partitioning
docs/formatdomain.html.in | 94 ++++
docs/schemas/domaincommon.rng | 65 +++
src/conf/domain_conf.c | 482 +++++++++++++++++-
src/conf/domain_conf.h | 2 +
src/conf/numa_conf.c | 241 ++++++++-
src/conf/numa_conf.h | 58 ++-
src/libvirt_private.syms | 8 +
src/qemu/qemu_driver.c | 65 ++-
src/qemu/qemu_hotplug.c | 95 +++-
.../cpu-host-passthrough-nonuma.args | 29 ++
.../cpu-host-passthrough-nonuma.xml | 19 +
.../cpu-host-passthrough-numa-contiguous.args | 37 ++
.../cpu-host-passthrough-numa-contiguous.xml | 20 +
.../cpu-host-passthrough-numa-interleave.args | 41 ++
.../cpu-host-passthrough-numa-interleave.xml | 19 +
...host-passthrough-numa-node-contiguous.args | 53 ++
...-host-passthrough-numa-node-contiguous.xml | 21 +
...host-passthrough-numa-node-interleave.args | 41 ++
...-host-passthrough-numa-node-interleave.xml | 22 +
...ost-passthrough-numa-node-round-robin.args | 125 +++++
...host-passthrough-numa-node-round-robin.xml | 21 +
...u-host-passthrough-numa-node-siblings.args | 32 ++
...pu-host-passthrough-numa-node-siblings.xml | 23 +
...cpu-host-passthrough-numa-round-robin.args | 37 ++
.../cpu-host-passthrough-numa-round-robin.xml | 22 +
.../cpu-host-passthrough-numa-siblings.args | 37 ++
.../cpu-host-passthrough-numa-siblings.xml | 20 +
.../cpu-host-passthrough-numa.args | 37 ++
.../cpu-host-passthrough-numa.xml | 20 +
tests/qemuxml2argvtest.c | 10 +
30 files changed, 1765 insertions(+), 31 deletions(-)
create mode 100644 tests/qemuxml2argvdata/cpu-host-passthrough-nonuma.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-passthrough-nonuma.xml
create mode 100644 tests/qemuxml2argvdata/cpu-host-passthrough-numa-contiguous.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-passthrough-numa-contiguous.xml
create mode 100644 tests/qemuxml2argvdata/cpu-host-passthrough-numa-interleave.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-passthrough-numa-interleave.xml
create mode 100644 tests/qemuxml2argvdata/cpu-host-passthrough-numa-node-contiguous.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-passthrough-numa-node-contiguous.xml
create mode 100644 tests/qemuxml2argvdata/cpu-host-passthrough-numa-node-interleave.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-passthrough-numa-node-interleave.xml
create mode 100644 tests/qemuxml2argvdata/cpu-host-passthrough-numa-node-round-robin.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-passthrough-numa-node-round-robin.xml
create mode 100644 tests/qemuxml2argvdata/cpu-host-passthrough-numa-node-siblings.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-passthrough-numa-node-siblings.xml
create mode 100644 tests/qemuxml2argvdata/cpu-host-passthrough-numa-round-robin.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-passthrough-numa-round-robin.xml
create mode 100644 tests/qemuxml2argvdata/cpu-host-passthrough-numa-siblings.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-passthrough-numa-siblings.xml
create mode 100644 tests/qemuxml2argvdata/cpu-host-passthrough-numa.args
create mode 100644 tests/qemuxml2argvdata/cpu-host-passthrough-numa.xml
--
2.21.0
5 years, 1 month
[libvirt] [PATCH] m4: Improve portability for non-bash shells
by Maya Rashish
= and == are both operators to test for string equality in bash,
but only = is required by POSIX.
Signed-off-by: Maya Rashish <coypu(a)sdf.org>
---
m4/virt-nls.m4 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/m4/virt-nls.m4 b/m4/virt-nls.m4
index be3c53fe4d..fd8707033a 100644
--- a/m4/virt-nls.m4
+++ b/m4/virt-nls.m4
@@ -26,7 +26,7 @@ AC_DEFUN([LIBVIRT_CHECK_NLS],[
then
AC_CHECK_FUNC([gettext], [], [
AC_CHECK_LIB([intl], [gettext], [], [
- if test "x$enable_nls" == "xcheck"
+ if test "x$enable_nls" = "xcheck"
then
enable_nls=no
else
@@ -39,7 +39,7 @@ AC_DEFUN([LIBVIRT_CHECK_NLS],[
if test "x$enable_nls" != "xno"
then
AC_CHECK_HEADERS([libintl.h], [enable_nls=yes],[
- if test "x$enable_nls" == "xcheck"
+ if test "x$enable_nls" = "xcheck"
then
enable_nls=no
else
--
2.23.0
5 years, 1 month
[libvirt] [PATCH] bhyve: Ignore test_libvirtd_bhyve.aug
by Michal Privoznik
The file is generated during build, but not ignored.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
Pushed under trivial rule.
.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitignore b/.gitignore
index 85ead5c907..acd88b0340 100644
--- a/.gitignore
+++ b/.gitignore
@@ -120,6 +120,7 @@
/src/admin/admin_client.h
/src/admin/admin_protocol.[ch]
/src/admin/admin_server_dispatch_stubs.h
+/src/bhyve/test_libvirtd_bhyve.aug
/src/bhyve/test_virtbhyved.aug
/src/bhyve/virtbhyved.aug
/src/bhyve/virtbhyved.conf
--
2.21.0
5 years, 1 month
[libvirt] [PATCHv2 0/1] Add --force flag to virsh blockresize
by martinsson.patrik@gmail.com
From: Patrik Martinsson <martinsson.patrik(a)gmail.com>
This patch changes the behaviour when shrinking a block device. It only
changes the behaviour in the 'virsh layer', not in the API.
Basically this is a remake of a patch I posted a few weeks ago, but implemented
according to the feedback that was given (hopefully).
Previous discussion can be found at
https://www.redhat.com/archives/libvir-list/2019-October/msg00258.html
Patrik Martinsson (1):
Add --force flag to virsh blockresize
docs/news.xml | 13 +++++++++++++
tools/virsh-domain.c | 34 +++++++++++++++++++++++++++++++---
tools/virsh.pod | 6 +++++-
3 files changed, 49 insertions(+), 4 deletions(-)
--
2.23.0
5 years, 1 month
[libvirt] [libvirt-dbus] [PATCH 0/2] Implement snapshots
by Simon Kobyda
Implement snapshot interface and its APIs.
Simon Kobyda (2):
Introduce Domain Snapshot Interface
Implement snapshots APIs
data/org.libvirt.Domain.xml | 26 +++
data/org.libvirt.DomainSnapshot.xml | 41 ++++
src/connect.c | 6 +
src/connect.h | 1 +
src/domain.c | 158 ++++++++++++++++
src/domainsnapshot.c | 282 ++++++++++++++++++++++++++++
src/domainsnapshot.h | 9 +
src/meson.build | 1 +
src/util.c | 49 +++++
src/util.h | 16 ++
tests/libvirttest.py | 14 ++
tests/meson.build | 1 +
tests/test_domain.py | 8 +
tests/test_snapshot.py | 43 +++++
tests/xmldata.py | 6 +
15 files changed, 661 insertions(+)
create mode 100644 data/org.libvirt.DomainSnapshot.xml
create mode 100644 src/domainsnapshot.c
create mode 100644 src/domainsnapshot.h
create mode 100755 tests/test_snapshot.py
--
2.21.0
5 years, 1 month
[libvirt] [PATCH] conf: Do not validate resolution XML if 'x' or/and 'y' are 0.
by jcfaracco@gmail.com
From: Julio Faracco <jcfaracco(a)gmail.com>
There is an issue with <resolution/> when of 'x' or 'y' settings are 0.
Function virDomainVideoResolutionDefParseXML() will validate this XML,
but both 'x' and 'y' will be removed. One example, if someone defines
this settings:
<model ...>
<resolution x='1024' y='0'/>
<model/>
After applying this settings, funcion libvirt will remove both
resolutions because virDomainVideoResolutionDefFormat() requires 'x' and
'y' higher than 0. So, the example above will become:
<model ...>
<resolution/>
<model/>
Now, libvirt only adds <resolution/> with 'x' and 'y' if boths strings
are not NULL AND they are higher than 0.
Signed-off-by: Julio Faracco <jcfaracco(a)gmail.com>
---
src/conf/domain_conf.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 88e93f6fb8..d89d8059ce 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -15375,7 +15375,7 @@ virDomainVideoResolutionDefParseXML(xmlNodePtr node)
if (virStrToLong_uip(x, NULL, 10, &def->x) < 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("cannot parse video x-resolution '%s'"), x);
- goto cleanup;
+ goto error;
}
}
@@ -15383,12 +15383,21 @@ virDomainVideoResolutionDefParseXML(xmlNodePtr node)
if (virStrToLong_uip(y, NULL, 10, &def->y) < 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("cannot parse video y-resolution '%s'"), y);
- goto cleanup;
+ goto error;
}
}
+ /* QEMU ignores 'xres' or/and 'yres' with value 0. */
+ if (!def->x || !def->y)
+ goto error;
+
cleanup:
return def;
+
+ error:
+ VIR_FREE(def);
+ def = NULL;
+ goto cleanup;
}
static virDomainVideoDriverDefPtr
--
2.20.1
5 years, 1 month
[libvirt] [PATCH] vsh: mark ctl as unused in vshReadline
by Ján Tomko
My commit removed the last use in the version for platforms
without readline.
Fixes: c937c1d23db00cf0f33091f9d30f7ac33d9d6aa4
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
Fixed as a push builder break.
tools/vsh.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/vsh.c b/tools/vsh.c
index a10a9625e4..07eea4adf9 100644
--- a/tools/vsh.c
+++ b/tools/vsh.c
@@ -3028,7 +3028,8 @@ vshReadlineDeinit(vshControl *ctl G_GNUC_UNUSED)
}
char *
-vshReadline(vshControl *ctl, const char *prompt)
+vshReadline(vshControl *ctl G_GNUC_UNUSED,
+ const char *prompt)
{
char line[1024];
char *r;
--
2.21.0
5 years, 1 month