[libvirt] [PATCH] storage: prefer using newDef to save configfile
by Shichangkuo
When re-defining an active storage pool, the configfile has not changed. This issue was introduced by bfcd8fc9,
storage: Use virStoragePoolObjGetDef accessor for driver. So we prefer using newDef to save configfile.
Signed-off-by: Changkuo Shi <shi.changkuo(a)h3c.com>
---
src/storage/storage_driver.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index b0de96d..fab3c5b 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -844,13 +844,14 @@ storagePoolDefineXML(virConnectPtr conn,
if (!(obj = virStoragePoolObjAssignDef(driver->pools, newDef)))
goto cleanup;
- newDef = NULL;
+ newDef = virStoragePoolObjGetNewDef(obj);
def = virStoragePoolObjGetDef(obj);
- if (virStoragePoolObjSaveDef(driver, obj, def) < 0) {
+ if (virStoragePoolObjSaveDef(driver, obj, newDef ? newDef : def) < 0) {
virStoragePoolObjRemove(driver->pools, obj);
virObjectUnref(obj);
obj = NULL;
+ newDef = NULL;
goto cleanup;
}
@@ -860,6 +861,7 @@ storagePoolDefineXML(virConnectPtr conn,
VIR_INFO("Defining storage pool '%s'", def->name);
pool = virGetStoragePool(conn, def->name, def->uuid, NULL, NULL);
+ newDef = NULL;
cleanup:
if (event)
--
1.7.9.5
-------------------------------------------------------------------------------------------------------------------------------------
本邮件及其附件含有新华三集团的保密信息,仅限于发送给上面地址中列出
的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制、
或散发)本邮件中的信息。如果您错收了本邮件,请您立即电话或邮件通知发件人并删除本
邮件!
This e-mail and its attachments contain confidential information from New H3C, which is
intended only for the person or entity whose address is listed above. Any use of the
information contained herein in any way (including, but not limited to, total or partial
disclosure, reproduction, or dissemination) by persons other than the intended
recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender
by phone or email immediately and delete it!
6 years, 11 months
[libvirt] [PATCH 0/2] qemu: Support vhost-vsock-ccw
by Boris Fiuczynski
Support the vhost-vsock-ccw device on S390.
Boris Fiuczynski (2):
qemu: Add ccw support for vhost-vsock
news: Update for vhost-vsock-ccw support
docs/news.xml | 8 +++++
src/qemu/qemu_command.c | 15 +++++++--
src/qemu/qemu_domain_address.c | 7 +++-
.../vhost-vsock-ccw-auto.args | 27 ++++++++++++++++
.../qemuxml2argvdata/vhost-vsock-ccw-auto.xml | 25 +++++++++++++++
tests/qemuxml2argvdata/vhost-vsock-ccw.args | 27 ++++++++++++++++
tests/qemuxml2argvdata/vhost-vsock-ccw.xml | 32 +++++++++++++++++++
tests/qemuxml2argvtest.c | 4 +++
.../vhost-vsock-ccw-auto.xml | 32 +++++++++++++++++++
tests/qemuxml2xmloutdata/vhost-vsock-ccw.xml | 1 +
tests/qemuxml2xmltest.c | 5 +++
11 files changed, 180 insertions(+), 3 deletions(-)
create mode 100644 tests/qemuxml2argvdata/vhost-vsock-ccw-auto.args
create mode 100644 tests/qemuxml2argvdata/vhost-vsock-ccw-auto.xml
create mode 100644 tests/qemuxml2argvdata/vhost-vsock-ccw.args
create mode 100644 tests/qemuxml2argvdata/vhost-vsock-ccw.xml
create mode 100644 tests/qemuxml2xmloutdata/vhost-vsock-ccw-auto.xml
create mode 120000 tests/qemuxml2xmloutdata/vhost-vsock-ccw.xml
--
2.17.0
6 years, 11 months
[libvirt] [PATCH v2 0/2] Change virFileIsCDROM to check cdrom status
by Han Han
v1 link: https://www.redhat.com/archives/libvir-list/2018-July/msg00103.html
Refactor virFileIsCDROM to virFileCheckCDROM and now it could be used to
store cdrom status.
In libvirt, it gives general Input/Output error when reading a not ready
cdrom backend vol. This error should be replaced with warning just like the
warning of lacking backing file.
Han Han (2):
util: Refactor virFileIsCDROM to virFileCheckCDROM
storage: Improve error handling on cdrom backend
src/libvirt_private.syms | 2 +-
src/qemu/qemu_domain.c | 4 ++--
src/storage/storage_util.c | 15 ++++++++++++-
src/util/virfile.c | 44 ++++++++++++++++++++++++++++++++------
src/util/virfile.h | 11 +++++++++-
5 files changed, 65 insertions(+), 11 deletions(-)
--
2.17.1
6 years, 11 months
[libvirt] [PATCH 0/2] Change virFileIsCDROM to check cdrom status
by Han Han
Refactor virFileIsCDROM to virFileCheckCDROM and now it could be used to
store cdrom status.
In libvirt, it gives general Input/Output error when reading a not ready
cdrom backend vol. This error should be replaced with warning just like the
warning of lacking backing file.
Han Han (2):
util: Refactor virFileIsCDROM to virFileCheckCDROM
storage: Improve error handling on cdrom backend
src/libvirt_private.syms | 2 +-
src/qemu/qemu_domain.c | 4 ++--
src/storage/storage_util.c | 15 ++++++++++++-
src/util/virfile.c | 44 ++++++++++++++++++++++++++++++++------
src/util/virfile.h | 11 +++++++++-
5 files changed, 65 insertions(+), 11 deletions(-)
--
2.17.1
6 years, 11 months
[libvirt] [dbus PATCH v2] gitignore: add tests/.pytest_cache
by Anya Harter
Signed-off-by: Anya Harter <aharter(a)redhat.com>
---
.gitignore | 1 +
1 file changed, 1 insertion(+)
diff --git a/.gitignore b/.gitignore
index ca9e4e1..b2021d4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -44,3 +44,4 @@ vgcore.*
/src/org.libvirt.service
/tests/test_util
+**/.pytest_cache
--
2.17.1
6 years, 11 months
[libvirt] [PATCH 0/2] Add function to check cdrom status
by Han Han
In libvirt, it gives general Input/Output error when reading a not ready
cdrom. This error could be more detailed on cdrom, such as drive not
ready, no disc, trey open, no information.
These patches provide private API virFileCdromStatus to check cdrom storage backend
status and improve error handling of virStorageBackendVolOpen on cdrom.
Han Han (2):
util: Introduce virFileCdromStatus
storage: Improve error handling on cdrom backend
src/libvirt_private.syms | 1 +
src/storage/storage_util.c | 38 ++++++++++++++++++++++++++++
src/util/virfile.c | 52 ++++++++++++++++++++++++++++++++++++++
src/util/virfile.h | 10 ++++++++
4 files changed, 101 insertions(+)
--
2.17.1
6 years, 11 months
[libvirt] [PATCH 0/2] qemu: migration: Fix crash when adding TLS objects
by Peter Krempa
Thankfully no other caller of qemuMonitorAddObject uses double pointers
so the checks are correct.
Peter Krempa (2):
qemu: hotplug: Do not try to add secret object for TLS if it does not
exist
qemu: monitor: Make qemuMonitorAddObject more robust against
programming errors
src/qemu/qemu_hotplug.c | 2 +-
src/qemu/qemu_monitor.c | 22 ++++++++++++++++------
src/qemu/qemu_monitor.h | 3 ++-
3 files changed, 19 insertions(+), 8 deletions(-)
--
2.16.2
6 years, 11 months
[libvirt] [PATCH python] spec: Remove Group: and %defattr
by Cole Robinson
These are only needed for RHEL5 builds, which are no longer supported
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.o...
https://fedoraproject.org/wiki/RPMGroups
Signed-off-by: Cole Robinson <crobinso(a)redhat.com>
---
libvirt-python.spec.in | 5 -----
1 file changed, 5 deletions(-)
diff --git a/libvirt-python.spec.in b/libvirt-python.spec.in
index 9697ea8..f3940cc 100644
--- a/libvirt-python.spec.in
+++ b/libvirt-python.spec.in
@@ -38,7 +38,6 @@ Release: 1%{?dist}%{?extra_release}
Source0: http://libvirt.org/sources/python/%{name}-%{version}.tar.gz
Url: http://libvirt.org
License: LGPLv2+
-Group: Development/Libraries
BuildRequires: libvirt-devel == %{version}
%if %{with_python2}
%if %{py2_versioned_deps}
@@ -77,7 +76,6 @@ of recent versions of Linux (and other OSes).
Summary: The libvirt virtualization API python2 binding
Url: http://libvirt.org
License: LGPLv2+
-Group: Development/Libraries
%{?python_provide:%python_provide python2-libvirt}
Provides: libvirt-python = %{version}-%{release}
Obsoletes: libvirt-python <= 3.6.0-1%{?dist}
@@ -94,7 +92,6 @@ of recent versions of Linux (and other OSes).
Summary: The libvirt virtualization API python3 binding
Url: http://libvirt.org
License: LGPLv2+
-Group: Development/Libraries
%{?python_provide:%python_provide python3-libvirt}
Provides: libvirt-python3 = %{version}-%{release}
Obsoletes: libvirt-python3 <= 3.6.0-1%{?dist}
@@ -145,7 +142,6 @@ CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
%if %{with_python2}
%files -n python2-libvirt
-%defattr(-,root,root)
%doc ChangeLog AUTHORS NEWS README COPYING COPYING.LESSER examples/
%{python_sitearch}/libvirt.py*
%{python_sitearch}/libvirt_qemu.py*
@@ -156,7 +152,6 @@ CFLAGS="$RPM_OPT_FLAGS" %{__python3} setup.py build
%if %{with_python3}
%files -n python3-libvirt
-%defattr(-,root,root)
%doc ChangeLog AUTHORS NEWS README COPYING COPYING.LESSER examples/
%{python3_sitearch}/libvirt.py*
%{python3_sitearch}/libvirtaio.py*
--
2.17.1
6 years, 11 months
[libvirt] [PATCH] conf: virDomainDefValidateInternal prohibit some characters in shmem name
by Simon Kobyda
XML shmem name will not include characters '/', '.' or '..', as shmem name
is used in a path
https://bugzilla.redhat.com/show_bug.cgi?id=1192400
---
src/conf/domain_conf.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 7ab2953d83..3f580525bb 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -6107,6 +6107,8 @@ virDomainDefLifecycleActionValidate(const virDomainDef *def)
static int
virDomainDefValidateInternal(const virDomainDef *def)
{
+ size_t i;
+
if (virDomainDefCheckDuplicateDiskInfo(def) < 0)
return -1;
@@ -6136,6 +6138,17 @@ virDomainDefValidateInternal(const virDomainDef *def)
return -1;
}
+ for (i = 0; i < def->nshmems; i++) {
+ if (strchr(def->shmems[i]->name, '/'))
+ return -1;
+
+ if (strchr(def->shmems[i]->name, '.'))
+ return -1;
+
+ if (strstr(def->shmems[i]->name, ".."))
+ return -1;
+ }
+
if (virDomainDefLifecycleActionValidate(def) < 0)
return -1;
--
2.17.1
6 years, 11 months