[libvirt] [RFC PATCH 00/10] introduce push backups
by Nikolay Shirokovskiy
Push backup is a backup when hypervisor itself copy backup
data to destination in contrast to pull backup when hypervisor
exports backup data thru some interface and mgmt itself make
a copy.
This patch series basically adds API and remote/qemu implementation
of backup creation and correspondent backup xml description definition.
Just like other blockjobs backup creation is asynchronous. That
is creation is merely a backup start and client should track
backup error/completion thru blockjob events. Another option
is to make backup synchronus operation. AFAIU on this way we
have to make backup asynchronus job and thus make all modifying
commands unavailable during backup. This makes backup rather
obtrusive operation which is not convinient.
Backup xml desription follows closely snapshot one and
is described in more details in definition patch [1].
Nikolay Shirokovskiy (10):
api: add API to create backup
add driver based implementation of backup API
remote: add backup API
qemu: monitor: add backup command
misc: add backup block job type
conf: add backup definition [1]
qemu: add qemuDomainBackupCreateXML implementation
qemu: check backup destination before start
qemu: prepare backup destination
virsh: add create backup command
daemon/remote.c | 8 +
examples/object-events/event-test.c | 3 +
include/libvirt/libvirt-domain-backup.h | 59 +++++++
include/libvirt/libvirt-domain.h | 3 +
include/libvirt/libvirt.h | 1 +
include/libvirt/virterror.h | 2 +
po/POTFILES.in | 2 +
src/Makefile.am | 3 +
src/access/viraccessperm.c | 3 +-
src/access/viraccessperm.h | 6 +
src/conf/backup_conf.c | 294 ++++++++++++++++++++++++++++++++
src/conf/backup_conf.h | 69 ++++++++
src/conf/domain_conf.c | 2 +-
src/datatypes.c | 60 +++++++
src/datatypes.h | 29 ++++
src/driver-hypervisor.h | 6 +
src/libvirt-domain-backup.c | 203 ++++++++++++++++++++++
src/libvirt_private.syms | 9 +
src/libvirt_public.syms | 10 ++
src/qemu/qemu_conf.h | 1 +
src/qemu/qemu_domain.c | 14 ++
src/qemu/qemu_domain.h | 2 +
src/qemu/qemu_driver.c | 249 +++++++++++++++++++++++++++
src/qemu/qemu_monitor.c | 13 ++
src/qemu/qemu_monitor.h | 5 +
src/qemu/qemu_monitor_json.c | 36 ++++
src/qemu/qemu_monitor_json.h | 6 +
src/remote/remote_driver.c | 7 +
src/remote/remote_protocol.x | 24 ++-
src/rpc/gendispatch.pl | 29 +++-
src/util/virerror.c | 6 +
tools/Makefile.am | 1 +
tools/virsh-backup.c | 101 +++++++++++
tools/virsh-backup.h | 29 ++++
tools/virsh-domain.c | 3 +-
tools/virsh.c | 2 +
tools/virsh.h | 1 +
37 files changed, 1290 insertions(+), 11 deletions(-)
create mode 100644 include/libvirt/libvirt-domain-backup.h
create mode 100644 src/conf/backup_conf.c
create mode 100644 src/conf/backup_conf.h
create mode 100644 src/libvirt-domain-backup.c
create mode 100644 tools/virsh-backup.c
create mode 100644 tools/virsh-backup.h
--
1.8.3.1
7 years, 10 months
[libvirt] [PATCH] cputest: Fix name of the file removed by cpu-parse.sh
by Jiri Denemark
We want to remove the file created by
json <<<"$data" >$fname.json
in case it was empty.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
tests/cputestdata/cpu-parse.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/cputestdata/cpu-parse.sh b/tests/cputestdata/cpu-parse.sh
index 1b5ab4a5a..c3b5ef106 100755
--- a/tests/cputestdata/cpu-parse.sh
+++ b/tests/cputestdata/cpu-parse.sh
@@ -53,5 +53,5 @@ json <<<"$data" >$fname.json
if [[ -s $fname.json ]]; then
echo $fname.json
else
- rm $fname.new.json
+ rm $fname.json
fi
--
2.11.1
7 years, 10 months
[libvirt] [RFC PATCH v2 00/18] Introduce vGPU mdev framework to libvirt
by Erik Skultety
since v1:
- new <hostdev> attribute model introduced which tells libvirt which device API
should be considered when auto-assigning guest address
- device_api is properly checked, thus taking the 'model' attribute only as a
hint to assign "some" address
- new address type 'mdev' is introduced rather than using plain <uuid> element,
since the address element is more conveniently extendable.
- the emulated mtty driver now works as well out of the box, so no HW needed to
review this series --> let's try it :)
- fixed all the nits from v1
Erik Skultety (18):
util: Introduce new module virmdev
conf: Introduce new hostdev device type mdev
conf: Introduce new address type mdev
conf: Update XML parser, formatter, and RNG schema to support mdev
conf: Introduce virDomainHostdevDefPostParse
conf: Add post parse code for mdevs to virDomainHostdevDefPostParse
security: dac: Enable labeling of vfio mediated devices
security: selinux: Enable labeling of vfio mediated devices
conf: Enable cold-plug of a mediated device
qemu: Assign PCI addresses for mediated devices as well
hostdev: Maintain a driver list of active mediated devices
hostdev: Introduce a reattach method for mediated devices
qemu: cgroup: Adjust cgroups' logic to allow mediated devices
qemu: namespace: Hook up the discovery of mdevs into the namespace
code
qemu: Format mdevs on the qemu command line
test: Add some test cases for our test suite regarding the mdevs
docs: Document the new hostdev and address type 'mdev'
news: Update the NEWS.xml about the new mdev feature
docs/formatdomain.html.in | 48 ++-
docs/news.xml | 11 +
docs/schemas/domaincommon.rng | 26 ++
po/POTFILES.in | 1 +
src/Makefile.am | 1 +
src/conf/device_conf.h | 1 +
src/conf/domain_conf.c | 203 ++++++++++--
src/conf/domain_conf.h | 9 +
src/libvirt_private.syms | 20 ++
src/qemu/qemu_cgroup.c | 34 ++
src/qemu/qemu_command.c | 49 +++
src/qemu/qemu_command.h | 5 +
src/qemu/qemu_domain.c | 12 +
src/qemu/qemu_domain.h | 1 +
src/qemu/qemu_domain_address.c | 16 +-
src/qemu/qemu_hostdev.c | 37 +++
src/qemu/qemu_hostdev.h | 8 +
src/qemu/qemu_hotplug.c | 2 +
src/security/security_apparmor.c | 3 +
src/security/security_dac.c | 55 ++++
src/security/security_selinux.c | 54 ++++
src/util/virhostdev.c | 229 ++++++++++++-
src/util/virhostdev.h | 16 +
src/util/virmdev.c | 358 +++++++++++++++++++++
src/util/virmdev.h | 93 ++++++
tests/domaincapsschemadata/full.xml | 1 +
.../qemuxml2argv-hostdev-mdev-unmanaged.args | 25 ++
.../qemuxml2argv-hostdev-mdev-unmanaged.xml | 37 +++
tests/qemuxml2argvtest.c | 6 +
.../qemuxml2xmlout-hostdev-mdev-unmanaged.xml | 40 +++
tests/qemuxml2xmltest.c | 1 +
31 files changed, 1362 insertions(+), 40 deletions(-)
create mode 100644 src/util/virmdev.c
create mode 100644 src/util/virmdev.h
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-mdev-unmanaged.args
create mode 100644 tests/qemuxml2argvdata/qemuxml2argv-hostdev-mdev-unmanaged.xml
create mode 100644 tests/qemuxml2xmloutdata/qemuxml2xmlout-hostdev-mdev-unmanaged.xml
--
2.10.2
7 years, 10 months
[libvirt] [PATCH] libxl: fix coverity issues introduced by 6a95edf
by Joao Martins
As discussed here [0][1] Coverity reported two issues:
- On libxlDomainMigrationPrepareTunnel3 @@mig will be leaked on failures
after sucessfull call libxlDomainMigrationPrepareAny hence we free it.
Setting mig = NULL after @mig is assigned plus adding libxlMigrationCookieFree
on error paths addresses the issue. In case virThreadCreate fails,
unref of args frees the cookie on dispose function (libxlMigrationDstArgsDispose)
- On libxlMigrationStartTunnel @tc would be leaked.
Fixed by correctly saving the newly allocated @tc onto @tnl such that
libxlMigrationStopTunnel would free it up.
[0] https://www.redhat.com/archives/libvir-list/2017-February/msg00791.html
[1] https://www.redhat.com/archives/libvir-list/2017-February/msg00833.html
Signed-off-by: Joao Martins <joao.m.martins(a)oracle.com>
---
Cc: John Ferlan <jferlan(a)redhat.com>
Cc: Jim Fehlig <jfehlig(a)suse.com>
---
src/libxl/libxl_migration.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/libxl/libxl_migration.c b/src/libxl/libxl_migration.c
index ba1ca5c..fb833d1 100644
--- a/src/libxl/libxl_migration.c
+++ b/src/libxl/libxl_migration.c
@@ -617,6 +617,8 @@ libxlDomainMigrationPrepareTunnel3(virConnectPtr dconn,
/* Receive from pipeOut */
args->recvfd = dataFD[0];
args->nsocks = 0;
+ mig = NULL;
+
if (virThreadCreate(&thread, false, libxlDoMigrateReceive, args) < 0) {
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("Failed to create thread for receiving migration data"));
@@ -627,6 +629,7 @@ libxlDomainMigrationPrepareTunnel3(virConnectPtr dconn,
goto done;
error:
+ libxlMigrationCookieFree(mig);
VIR_FORCE_CLOSE(dataFD[1]);
VIR_FORCE_CLOSE(dataFD[0]);
virObjectUnref(args);
@@ -907,13 +910,15 @@ libxlMigrationStartTunnel(libxlDriverPrivatePtr driver,
virDomainObjPtr vm,
unsigned long flags,
virStreamPtr st,
- struct libxlTunnelControl *tc)
+ struct libxlTunnelControl **tnl)
{
+ struct libxlTunnelControl *tc = NULL;
libxlTunnelMigrationThread *arg = NULL;
int ret = -1;
if (VIR_ALLOC(tc) < 0)
goto out;
+ *tnl = tc;
tc->dataFD[0] = -1;
tc->dataFD[1] = -1;
@@ -1045,7 +1050,7 @@ libxlDoMigrateP2P(libxlDriverPrivatePtr driver,
VIR_DEBUG("Perform3 uri=%s", NULLSTR(uri_out));
if (flags & VIR_MIGRATE_TUNNELLED)
- ret = libxlMigrationStartTunnel(driver, vm, flags, st, tc);
+ ret = libxlMigrationStartTunnel(driver, vm, flags, st, &tc);
else
ret = libxlDomainMigrationPerform(driver, vm, NULL, NULL,
uri_out, NULL, flags);
--
2.1.4
7 years, 10 months
[libvirt] [PATCH] nodedev: Return the parent for a virNodeDevicePtr struct
by John Ferlan
When the 'parent' was added to the virNodeDevicePtr structure
by commit id 'e8a4ea75a' the 'parent' field was not properly filled
in when a virGetNodeDevice call was made within driver/config code.
Only the device name was ever filled in. Fetching the parent required
a second trip via virNodeDeviceGetParent into the node device lookup
code was required in order to retrieve the specific parent field (and
still the parent field was never filled in although it was free'd).
Since we have the data when we initially call virGetNodeDevice from
within driver/node_config code - let's just fill in the parent field
as well for anyone that wants it without requiring another trip into
the node_device lookup just to get the parent.
This will allow API's such as virConnectListAllNodeDevices,
virNodeDeviceLookupByName, and virNodeDeviceLookupSCSIHostByWWN
to retrieve both name and parent in the returned virNodeDevicePtr.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
Found this while working on some vHBA in the domain code when I was
thinking about using a virConnectListAllNodeDevices... The returned
structures didn't have the ->parent filled in...
src/conf/node_device_conf.c | 4 ++--
src/node_device/node_device_driver.c | 10 ++++++++--
src/test/test_driver.c | 6 +++++-
3 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
index 4d3268f..f6d7692 100644
--- a/src/conf/node_device_conf.c
+++ b/src/conf/node_device_conf.c
@@ -2158,8 +2158,8 @@ virNodeDeviceObjListExport(virConnectPtr conn,
if ((!filter || filter(conn, devobj->def)) &&
virNodeDeviceMatch(devobj, flags)) {
if (devices) {
- if (!(device = virGetNodeDevice(conn,
- devobj->def->name))) {
+ if (!(device = virGetNodeDevice(conn, devobj->def->name)) ||
+ VIR_STRDUP(device->parent, devobj->def->parent) < 0) {
virNodeDeviceObjUnlock(devobj);
goto cleanup;
}
diff --git a/src/node_device/node_device_driver.c b/src/node_device/node_device_driver.c
index 5238e23..4900e32 100644
--- a/src/node_device/node_device_driver.c
+++ b/src/node_device/node_device_driver.c
@@ -261,7 +261,10 @@ nodeDeviceLookupByName(virConnectPtr conn, const char *name)
if (virNodeDeviceLookupByNameEnsureACL(conn, obj->def) < 0)
goto cleanup;
- ret = virGetNodeDevice(conn, name);
+ if ((ret = virGetNodeDevice(conn, name))) {
+ if (VIR_STRDUP(ret->parent, obj->def->parent) < 0)
+ virObjectUnref(ret);
+ }
cleanup:
if (obj)
@@ -302,7 +305,10 @@ nodeDeviceLookupSCSIHostByWWN(virConnectPtr conn,
if (virNodeDeviceLookupSCSIHostByWWNEnsureACL(conn, obj->def) < 0)
goto out;
- dev = virGetNodeDevice(conn, obj->def->name);
+ if ((dev = virGetNodeDevice(conn, obj->def->name))) {
+ if (VIR_STRDUP(dev->parent, obj->def->parent) < 0)
+ virObjectUnref(dev);
+ }
virNodeDeviceObjUnlock(obj);
goto out;
}
diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 6820298..8dd738b 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -5450,7 +5450,10 @@ testNodeDeviceLookupByName(virConnectPtr conn, const char *name)
goto cleanup;
}
- ret = virGetNodeDevice(conn, name);
+ if ((ret = virGetNodeDevice(conn, name))) {
+ if (VIR_STRDUP(ret->parent, obj->def->parent) < 0)
+ virObjectUnref(ret);
+ }
cleanup:
if (obj)
@@ -5648,6 +5651,7 @@ testNodeDeviceCreateXML(virConnectPtr conn,
0);
dev = virGetNodeDevice(conn, def->name);
+ ignore_value(VIR_STRDUP(def->parent, def->parent));
def = NULL;
cleanup:
testDriverUnlock(driver);
--
2.7.4
7 years, 10 months
[libvirt] [PATCH v3 0/2] libxl: tunnelled migration support
by Joao Martins
Hey!
Presented herewith is take 4 from tunnelled migration addressing all previous
comments. No functional changes from v2, only revert to v1 on the top level
migration functions and removing unnecessary usage of virReportError.
Thanks,
Joao
Bob Liu (1):
libxl: add tunnelled migration support
Joao Martins (1):
libxl: refactor libxlDomainMigrationPrepare
src/libxl/libxl_driver.c | 58 ++++++-
src/libxl/libxl_migration.c | 367 +++++++++++++++++++++++++++++++++++++-------
src/libxl/libxl_migration.h | 9 ++
3 files changed, 381 insertions(+), 53 deletions(-)
--
2.1.4
7 years, 10 months
[libvirt] [PATCH] Revert "news: fix spelling of tunneled"
by Jim Fehlig
Use of 'tunnelled' is over 100x that of 'tunneled' throughout the
code. Also, the commit providing this news item used 'tunnelled'.
This reverts commit b5ac475f506cd13adab773cebd125a45d3f2ba8d.
Signed-off-by: Jim Fehlig <jfehlig(a)suse.com>
---
Heh, so much for the trivial rule. I'll wait for an ACK on this one.
Sorry for the chatter...
docs/news.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/news.xml b/docs/news.xml
index 5bca75ea1..b0629b523 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -55,10 +55,10 @@
</change>
<change>
<summary>
- libxl: add tunneled migration support
+ libxl: add tunnelled migration support
</summary>
<description>
- Add tunneled migration to libxl driver, which is always capable of
+ Add tunnelled migration to libxl driver, which is always capable of
strong encryption and doesn't require any extra network connection
other than what's required for remote access of libvirtd.
</description>
--
2.11.0
7 years, 10 months
[libvirt] [PATCH] libvirt-override: fix flags mutually exclusize
by Jie Wang
Because of virDomainGetBlkioParameters is called in libvirt_virDomainSetBlkioParameters,
it will result in the two flags 'VIR_DOMAIN_AFFECT_LIVE' and 'VIR_DOMAIN_AFFECT_CONFIG'
are mutually exclusive in libvirt_virDomainSetBlkioParameters, it's unreasonable,
So ues this patch to fix it.
Signed-off-by: Jie Wang <wangjie88(a)huawei.com>
---
libvirt-override.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libvirt-override.c b/libvirt-override.c
index 9e40f00..7bdc09c 100644
--- a/libvirt-override.c
+++ b/libvirt-override.c
@@ -727,7 +727,7 @@ libvirt_virDomainSetBlkioParameters(PyObject *self ATTRIBUTE_UNUSED,
}
LIBVIRT_BEGIN_ALLOW_THREADS;
- i_retval = virDomainGetBlkioParameters(domain, NULL, &nparams, flags);
+ i_retval = virDomainGetBlkioParameters(domain, NULL, &nparams, 0);
LIBVIRT_END_ALLOW_THREADS;
if (i_retval < 0)
@@ -743,7 +743,7 @@ libvirt_virDomainSetBlkioParameters(PyObject *self ATTRIBUTE_UNUSED,
return PyErr_NoMemory();
LIBVIRT_BEGIN_ALLOW_THREADS;
- i_retval = virDomainGetBlkioParameters(domain, params, &nparams, flags);
+ i_retval = virDomainGetBlkioParameters(domain, params, &nparams, 0);
LIBVIRT_END_ALLOW_THREADS;
if (i_retval < 0) {
--
1.9.5.msysgit.1
7 years, 10 months
[libvirt] [PATCH] news: document libxl tunnelled migration support
by Joao Martins
Signed-off-by: Joao Martins <joao.m.martins(a)oracle.com>
---
docs/news.xml | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/docs/news.xml b/docs/news.xml
index b756a97..b0629b5 100644
--- a/docs/news.xml
+++ b/docs/news.xml
@@ -53,6 +53,16 @@
was <code>virtio-net</code>.
</description>
</change>
+ <change>
+ <summary>
+ libxl: add tunnelled migration support
+ </summary>
+ <description>
+ Add tunnelled migration to libxl driver, which is always capable of
+ strong encryption and doesn't require any extra network connection
+ other than what's required for remote access of libvirtd.
+ </description>
+ </change>
</section>
<section title="Improvements">
<change>
--
2.1.4
7 years, 10 months
[libvirt] [PATCH 0/9] perf: Add software perf events
by Nitesh Konkar
This patch series adds software perf events.
Nitesh Konkar (9):
perf: add cpu_clock software perf event support
perf: add task_clock software perf event support
perf: add page_faults software perf event support
perf: add context_switches software perf event support
perf: add cpu_migrations software perf event support
perf: add page_faults_min software perf event support
perf: add page_faults_maj software perf event support
perf: add alignment_faults software perf event support
perf: add emulation_faults software perf event support
docs/formatdomain.html.in | 58 +++++++++++++++++++
docs/news.xml | 7 ++-
docs/schemas/domaincommon.rng | 9 +++
include/libvirt/libvirt-domain.h | 90 +++++++++++++++++++++++++++++
src/libvirt-domain.c | 24 ++++++++
src/qemu/qemu_driver.c | 9 +++
src/util/virperf.c | 33 ++++++++++-
src/util/virperf.h | 9 +++
tests/genericxml2xmlindata/generic-perf.xml | 9 +++
tools/virsh.pod | 35 +++++++++++
10 files changed, 280 insertions(+), 3 deletions(-)
--
1.9.3
7 years, 10 months