[libvirt] [PATCH v2 0/4] Don't disable auto_login for iSCSI targets
by John Ferlan
v1: http://www.redhat.com/archives/libvir-list/2016-May/msg01027.html
Changes since v2:
* Patch 2
* Remove the 'str' fetch/free - it was unnecessary
* Initialize and free 'error'
* Did not adjust reported error since with the usage of exitstatus
the call to virCommandRunRegex, that means the virCommandWait code
will return the error rather than reporting it. So the reporting is
left to this code to handle. Kept the same error code (INTERNAL) as
virCommandWait
Patch 3-5
* Remove 3, combine 4 & 5, but remove the setting of the autologin for
libvirt managed targets. This is essentially Fritz's initial patch:
http://www.redhat.com/archives/libvir-list/2016-May/msg00002.html
but with the adjustment to add the "ATTRIBUTE_UNUSED" for the
initiatoriqn parameter (it'll be removed in the next patch as
it is a bit more invasive).
Fritz Elfert (1):
util: Remove disabling of autologin for iscsi-targets
John Ferlan (3):
util: Add exitstatus parameter to virCommandRunRegex
iscsi: Add exit status checking for virISCSIGetSession
iscsi: Remove initiatoriqn from virISCSIScanTargets
src/storage/storage_backend_fs.c | 2 +-
src/storage/storage_backend_iscsi.c | 8 ++---
src/storage/storage_backend_logical.c | 10 +++---
src/util/vircommand.c | 9 ++++--
src/util/vircommand.h | 3 +-
src/util/viriscsi.c | 60 +++++++++++++++--------------------
src/util/viriscsi.h | 1 -
tests/viriscsitest.c | 7 ++--
8 files changed, 46 insertions(+), 54 deletions(-)
--
2.5.5
8 years, 11 months
[libvirt] [PATCH v2 0/5] Automatically choose usable GIC version
by Andrea Bolognani
Changes from [v1]:
* Factor away some of the logic to
virQEMUCapsSupportsGICVersion(), as suggested by,
and based on a first implementation by, Cole
* Factor away the common test suite bits to
testutilsqemu.{h,c} to avoid code duplication
[v1] https://www.redhat.com/archives/libvir-list/2016-May/msg00637.html
Andrea Bolognani (5):
qemu: Add virQEMUCapsSupportsGICVersion()
qemu: Automatically choose usable GIC version
qemu: Add virQEMUCapsSetGICCapabilities()
tests: Prepare to have different usable GIC versions
tests: Try different usable GIC versions
src/qemu/qemu_capabilities.c | 91 ++++++++++--
src/qemu/qemu_capabilities.h | 9 ++
src/qemu/qemu_domain.c | 49 +++++--
.../qemuxml2argv-aarch64-gic-none-both.args | 1 +
.../qemuxml2argv-aarch64-gic-none-both.xml | 1 +
.../qemuxml2argv-aarch64-gic-none-v2.args | 1 +
.../qemuxml2argv-aarch64-gic-none-v2.xml | 1 +
.../qemuxml2argv-aarch64-gic-none-v3.args | 1 +
.../qemuxml2argv-aarch64-gic-none-v3.xml | 1 +
tests/qemuxml2argvtest.c | 125 +++++++++++++----
.../qemuxml2xmlout-aarch64-gic-none-both.xml | 1 +
.../qemuxml2xmlout-aarch64-gic-none-v2.xml | 1 +
.../qemuxml2xmlout-aarch64-gic-none-v3.xml | 1 +
tests/qemuxml2xmltest.c | 155 ++++++++++++---------
tests/testutilsqemu.c | 36 +++++
tests/testutilsqemu.h | 10 ++
16 files changed, 361 insertions(+), 123 deletions(-)
create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-both.args
create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-both.xml
create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-v2.args
create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-v2.xml
create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-v3.args
create mode 120000 tests/qemuxml2argvdata/qemuxml2argv-aarch64-gic-none-v3.xml
create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-none-both.xml
create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-none-v2.xml
create mode 120000 tests/qemuxml2xmloutdata/qemuxml2xmlout-aarch64-gic-none-v3.xml
--
2.5.5
8 years, 11 months
[libvirt] [PATCH v6 REBASE 0/5] vz: add migration support
by Nikolay Shirokovskiy
Difference from v5
==================
1. managed case is implemented
2. p2p follows managed migration flow now
3. 'vz: fix const correctness case' is needed to implement managed case.
4. misc options that are always on for vz (--live, --compressed) are
not required to be set explicitly.
5. --offline is not supported anymore but migration of inactive
domains is possible without this option set.
Nikolay Shirokovskiy (5):
vz: save session uuid on login
vz: fix const correctness case
vz: implement managed migration
vz: implement p2p migration
vz: cleanup: define vz format of uuids
src/vz/vz_driver.c | 557 +++++++++++++++++++++++++++++++++++++++++++++++++++++
src/vz/vz_sdk.c | 90 +++++++--
src/vz/vz_sdk.h | 6 +
src/vz/vz_utils.c | 2 +-
src/vz/vz_utils.h | 6 +-
5 files changed, 645 insertions(+), 16 deletions(-)
--
1.8.3.1
8 years, 11 months
[libvirt] [PATCH V2 0/3] correct libxl config file convert
by Chunyan Liu
Correct libxl config file type=vif handling.
---
Changes in v2:
* update xen{Parse,Format}ConfigCommon parameter vif_typename to
nativeFomat. To reuse XEN_CONFIG_FORMAT_{XM,XL}, first extract
XEN_CONFIG_FORMAT_{XM,XL} to xen_common.h
Chunyan Liu (3):
extract XEN_CONFIG_FORMAT_XM/XL to xen_common.h
xenFormatNet: correct `type=netfront' to 'type=vif' to match libxl
xlconfigtest: add test case for type=vif in xl format
src/libxl/libxl_driver.c | 14 ++++------
src/xen/xen_driver.h | 3 ---
src/xenconfig/xen_common.c | 43 ++++++++++++++++++++++--------
src/xenconfig/xen_common.h | 10 +++++--
src/xenconfig/xen_xl.c | 4 +--
src/xenconfig/xen_xm.c | 4 +--
tests/xlconfigdata/test-vif-typename.cfg | 25 ++++++++++++++++++
tests/xlconfigdata/test-vif-typename.xml | 45 ++++++++++++++++++++++++++++++++
tests/xlconfigtest.c | 1 +
9 files changed, 120 insertions(+), 29 deletions(-)
create mode 100644 tests/xlconfigdata/test-vif-typename.cfg
create mode 100644 tests/xlconfigdata/test-vif-typename.xml
--
2.1.4
8 years, 11 months
[libvirt] [PATCH 0/2] bhyve: implement virConnectIsEncrypted and virConnectIsSecure
by Fabian Freyer
These patches implement some rather trivial missing calls in the bhyve driver.
Since the bhyve connection (Interaction through /dev/vmm as well as the bhyveload, bhyvectl user-space tools) is local, encryption is not applicable, but the connection is seen as not prone to eavesdropping.
Fabian Freyer (2):
bhyve: Implement virConnectIsEncrypted
bhyve: implement virConnectIsSecure
src/bhyve/bhyve_driver.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
--
2.7.2
8 years, 11 months
[libvirt] [PATCH] spec: Remove %defattr usage
by Cole Robinson
It was only needed for rpm versions that are much older than our
minimally supported distro
Some more details here: https://fedorahosted.org/fpc/ticket/77
---
libvirt.spec.in | 27 ---------------------------
1 file changed, 27 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index d96917b..c7fcf85 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1514,10 +1514,8 @@ exit 0
%endif
%files
-%defattr(-, root, root)
%files docs
-%defattr(-, root, root)
%doc AUTHORS ChangeLog.gz NEWS README TODO
%doc libvirt-docs/*
@@ -1539,7 +1537,6 @@ exit 0
%files daemon
-%defattr(-, root, root)
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/
@@ -1607,20 +1604,16 @@ exit 0
%doc examples/polkit/*.rules
%files daemon-config-network
-%defattr(-, root, root)
%dir %{_datadir}/libvirt/networks/
%{_datadir}/libvirt/networks/default.xml
%files daemon-config-nwfilter
-%defattr(-, root, root)
%{_sysconfdir}/libvirt/nwfilter/*.xml
%files daemon-driver-interface
-%defattr(-, root, root)
%{_libdir}/%{name}/connection-driver/libvirt_driver_interface.so
%files daemon-driver-network
-%defattr(-, root, root)
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/networks/autostart
@@ -1631,27 +1624,22 @@ exit 0
%{_libdir}/%{name}/connection-driver/libvirt_driver_network.so
%files daemon-driver-nodedev
-%defattr(-, root, root)
%{_libdir}/%{name}/connection-driver/libvirt_driver_nodedev.so
%files daemon-driver-nwfilter
-%defattr(-, root, root)
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/nwfilter/
%ghost %dir %{_localstatedir}/run/libvirt/network/
%{_libdir}/%{name}/connection-driver/libvirt_driver_nwfilter.so
%files daemon-driver-secret
-%defattr(-, root, root)
%{_libdir}/%{name}/connection-driver/libvirt_driver_secret.so
%files daemon-driver-storage
-%defattr(-, root, root)
%attr(0755, root, root) %{_libexecdir}/libvirt_parthelper
%{_libdir}/%{name}/connection-driver/libvirt_driver_storage.so
%if %{with_qemu}
%files daemon-driver-qemu
-%defattr(-, root, root)
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/qemu/
%config(noreplace) %{_sysconfdir}/libvirt/qemu.conf
@@ -1667,7 +1655,6 @@ exit 0
%if %{with_lxc}
%files daemon-driver-lxc
-%defattr(-, root, root)
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/lxc/
%config(noreplace) %{_sysconfdir}/libvirt/lxc.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.lxc
@@ -1681,7 +1668,6 @@ exit 0
%if %{with_uml}
%files daemon-driver-uml
-%defattr(-, root, root)
%dir %attr(0700, root, root) %{_localstatedir}/log/libvirt/uml/
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.uml
%ghost %dir %{_localstatedir}/run/libvirt/uml/
@@ -1691,14 +1677,12 @@ exit 0
%if %{with_xen}
%files daemon-driver-xen
-%defattr(-, root, root)
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/xen/
%{_libdir}/%{name}/connection-driver/libvirt_driver_xen.so
%endif
%if %{with_libxl}
%files daemon-driver-libxl
-%defattr(-, root, root)
%config(noreplace) %{_sysconfdir}/libvirt/libxl.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/libvirtd.libxl
%config(noreplace) %{_sysconfdir}/libvirt/libxl-lockd.conf
@@ -1712,43 +1696,35 @@ exit 0
%if %{with_vbox}
%files daemon-driver-vbox
-%defattr(-, root, root)
%{_libdir}/%{name}/connection-driver/libvirt_driver_vbox.so
%endif
%if %{with_qemu_tcg}
%files daemon-qemu
-%defattr(-, root, root)
%endif
%if %{with_qemu_kvm}
%files daemon-kvm
-%defattr(-, root, root)
%endif
%if %{with_lxc}
%files daemon-lxc
-%defattr(-, root, root)
%endif
%if %{with_uml}
%files daemon-uml
-%defattr(-, root, root)
%endif
%if %{with_xen} || %{with_libxl}
%files daemon-xen
-%defattr(-, root, root)
%endif
%if %{with_vbox}
%files daemon-vbox
-%defattr(-, root, root)
%endif
%if %{with_sanlock}
%files lock-sanlock
-%defattr(-, root, root)
%if %{with_qemu}
%config(noreplace) %{_sysconfdir}/libvirt/qemu-sanlock.conf
%endif
@@ -1765,7 +1741,6 @@ exit 0
%endif
%files client -f %{name}.lang
-%defattr(-, root, root)
%doc COPYING COPYING.LESSER
%config(noreplace) %{_sysconfdir}/libvirt/libvirt.conf
@@ -1835,8 +1810,6 @@ exit 0
%endif
%files devel
-%defattr(-, root, root)
-
%{_libdir}/libvirt.so
%{_libdir}/libvirt-qemu.so
%{_libdir}/libvirt-lxc.so
--
2.7.4
8 years, 11 months
[libvirt] [PATCH] fix build with gcc 4.8.5-4 and -Werror=inline option
by Maxim Nestratov
fix numerous inlining errors like:
In file included from vircgroupmock.c:24:0:
In function 'stat':
virmock.h:259:1: error: inlining failed in call to 'callStat.part.1':
call is unlikely and code size would grow [-Werror=inline]
callStat(int (*realStat)(const char *, struct stat *),
---
tests/Makefile.am | 8 +++++---
tests/virmock.c | 43 +++++++++++++++++++++++++++++++++++++++++++
tests/virmock.h | 16 ++--------------
3 files changed, 50 insertions(+), 17 deletions(-)
create mode 100644 tests/virmock.c
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 238f6da..1f73958 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1071,7 +1071,8 @@ vircgrouptest_SOURCES = \
vircgrouptest_LDADD = $(LDADDS)
vircgroupmock_la_SOURCES = \
- vircgroupmock.c
+ vircgroupmock.c \
+ virmock.c
vircgroupmock_la_CFLAGS = $(AM_CFLAGS)
vircgroupmock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
vircgroupmock_la_LIBADD = $(MOCKLIBS_LIBS)
@@ -1081,7 +1082,7 @@ vircryptotest_SOURCES = \
vircryptotest_LDADD = $(LDADDS)
virhostdevtest_SOURCES = \
- virhostdevtest.c testutils.h testutils.c
+ virhostdevtest.c testutils.h testutils.c virmock.c
virhostdevtest_LDADD = $(LDADDS)
virpcitest_SOURCES = \
@@ -1089,7 +1090,8 @@ virpcitest_SOURCES = \
virpcitest_LDADD = $(LDADDS)
virpcimock_la_SOURCES = \
- virpcimock.c
+ virpcimock.c \
+ virmock.c
virpcimock_la_CFLAGS = $(AM_CFLAGS)
virpcimock_la_LDFLAGS = $(MOCKLIBS_LDFLAGS)
virpcimock_la_LIBADD = $(MOCKLIBS_LIBS)
diff --git a/tests/virmock.c b/tests/virmock.c
new file mode 100644
index 0000000..98dd872
--- /dev/null
+++ b/tests/virmock.c
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2013 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
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <config.h>
+
+#ifdef __linux__
+# include "virmock.h"
+
+int callStat(int (*realStat)(const char *, struct stat *),
+ int (*realXstat)(int, const char *, struct stat *),
+ int __ver, const char *__filename, struct stat *__stat_buf)
+{
+ if (!realXstat) {
+ if (__ver == _STAT_VER) {
+ return realStat(__filename, __stat_buf);
+ } else {
+ fprintf(stderr, "Not handled __xstat(ver=%d)", __ver);
+ abort();
+ }
+ }
+
+ return realXstat(__ver, __filename, __stat_buf);
+}
+
+#else
+/* Nothing to override on non-__linux__ platforms */
+#endif
diff --git a/tests/virmock.h b/tests/virmock.h
index 27c03ba..4b50976 100644
--- a/tests/virmock.h
+++ b/tests/virmock.h
@@ -255,22 +255,10 @@
static void (*real_##name)(void); \
void name(void)
-static inline int
+int
callStat(int (*realStat)(const char *, struct stat *),
int (*realXstat)(int, const char *, struct stat *),
- int __ver, const char *__filename, struct stat *__stat_buf)
-{
- if (!realXstat) {
- if (__ver == _STAT_VER) {
- return realStat(__filename, __stat_buf);
- } else {
- fprintf(stderr, "Not handled __xstat(ver=%d)", __ver);
- abort();
- }
- }
-
- return realXstat(__ver, __filename, __stat_buf);
-}
+ int __ver, const char *__filename, struct stat *__stat_buf);
# define VIR_MOCK_CALL_STAT(__ver, __filename, __stat_buf) \
callStat(real_stat, real___xstat, __ver, __filename, __stat_buf)
--
1.8.3.1
8 years, 11 months
[libvirt] [PATCH] Change return value of VIR_APPEND*INPLACE* to void
by Jiri Denemark
The INPLACE variants of the VIR_APPEND macros cannot fail and they are
inherently quiet.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/conf/domain_conf.c | 2 +-
src/qemu/qemu_hotplug.c | 2 +-
src/util/viralloc.h | 25 +++++++++++--------------
3 files changed, 13 insertions(+), 16 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 04f1381..3b69771 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -13997,7 +13997,7 @@ virDomainChrInsertPreAlloced(virDomainDefPtr vmdef,
virDomainChrGetDomainPtrsInternal(vmdef, chr->deviceType, &arrPtr, &cntPtr);
- ignore_value(VIR_APPEND_ELEMENT_INPLACE(*arrPtr, *cntPtr, chr));
+ VIR_APPEND_ELEMENT_INPLACE(*arrPtr, *cntPtr, chr);
}
virDomainChrDefPtr
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 85c5e0c..2b2e91c 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1660,7 +1660,7 @@ qemuDomainAttachRNGDevice(virQEMUDriverPtr driver,
goto cleanup;
}
- ignore_value(VIR_APPEND_ELEMENT_INPLACE(vm->def->rngs, vm->def->nrngs, rng));
+ VIR_APPEND_ELEMENT_INPLACE(vm->def->rngs, vm->def->nrngs, rng);
ret = 0;
diff --git a/src/util/viralloc.h b/src/util/viralloc.h
index 5f4e27b..d790b3d 100644
--- a/src/util/viralloc.h
+++ b/src/util/viralloc.h
@@ -436,13 +436,17 @@ void virDispose(void *ptrptr, size_t count, size_t element_size, size_t *countpt
VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), false, false, \
true, VIR_FROM_THIS, __FILE__, __FUNCTION__, __LINE__)
# define VIR_APPEND_ELEMENT_INPLACE(ptr, count, newelem) \
- virInsertElementsN(&(ptr), sizeof(*(ptr)), -1, &(count), \
- VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), true, true, \
- true, VIR_FROM_THIS, __FILE__, __FUNCTION__, __LINE__)
+ ignore_value(virInsertElementsN(&(ptr), sizeof(*(ptr)), -1, &(count), \
+ VIR_TYPEMATCH(ptr, &(newelem)), \
+ &(newelem), true, true, false, \
+ VIR_FROM_THIS, __FILE__, \
+ __FUNCTION__, __LINE__))
# define VIR_APPEND_ELEMENT_COPY_INPLACE(ptr, count, newelem) \
- virInsertElementsN(&(ptr), sizeof(*(ptr)), -1, &(count), \
- VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), false, true, \
- true, VIR_FROM_THIS, __FILE__, __FUNCTION__, __LINE__)
+ ignore_value(virInsertElementsN(&(ptr), sizeof(*(ptr)), -1, &(count), \
+ VIR_TYPEMATCH(ptr, &(newelem)), \
+ &(newelem), false, true, false, \
+ VIR_FROM_THIS, __FILE__, \
+ __FUNCTION__, __LINE__))
/* Quiet version of macros above */
# define VIR_APPEND_ELEMENT_QUIET(ptr, count, newelem) \
@@ -453,14 +457,7 @@ void virDispose(void *ptrptr, size_t count, size_t element_size, size_t *countpt
virInsertElementsN(&(ptr), sizeof(*(ptr)), -1, &(count), \
VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), false, false, \
false, 0, NULL, NULL, 0)
-# define VIR_APPEND_ELEMENT_INPLACE_QUIET(ptr, count, newelem) \
- virInsertElementsN(&(ptr), sizeof(*(ptr)), -1, &(count), \
- VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), true, true, \
- false. 0, NULL, NULL, 0)
-# define VIR_APPEND_ELEMENT_COPY_INPLACE_QUIET(ptr, count, newelem) \
- virInsertElementsN(&(ptr), sizeof(*(ptr)), -1, &(count), \
- VIR_TYPEMATCH(ptr, &(newelem)), &(newelem), false, true, \
- false, 0, NULL, NULL, 0)
+
/**
* VIR_DELETE_ELEMENT:
* @ptr: pointer to array of objects (*not* ptr to ptr)
--
2.8.2
8 years, 11 months
[libvirt] [PATCH] Remove virDomainRNGInsert
by Jiri Denemark
It was just a useless wrapper around VIR_APPEND_ELEMENT*.
Signed-off-by: Jiri Denemark <jdenemar(a)redhat.com>
---
src/conf/domain_conf.c | 12 ------------
src/conf/domain_conf.h | 3 ---
src/libvirt_private.syms | 1 -
src/qemu/qemu_driver.c | 2 +-
src/qemu/qemu_hotplug.c | 3 +--
5 files changed, 2 insertions(+), 19 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index ed0c471..04f1381 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -14024,18 +14024,6 @@ virDomainChrRemove(virDomainDefPtr vmdef,
}
-int
-virDomainRNGInsert(virDomainDefPtr def,
- virDomainRNGDefPtr rng,
- bool inplace)
-{
- if (inplace)
- return VIR_APPEND_ELEMENT_INPLACE(def->rngs, def->nrngs, rng);
- else
- return VIR_APPEND_ELEMENT(def->rngs, def->nrngs, rng);
-}
-
-
ssize_t
virDomainRNGFind(virDomainDefPtr def,
virDomainRNGDefPtr rng)
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index b9e696d..3ad3604 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -2909,9 +2909,6 @@ virDomainChrDefPtr
virDomainChrRemove(virDomainDefPtr vmdef,
virDomainChrDefPtr chr);
-int virDomainRNGInsert(virDomainDefPtr def,
- virDomainRNGDefPtr rng,
- bool inplace);
ssize_t virDomainRNGFind(virDomainDefPtr def, virDomainRNGDefPtr rng);
virDomainRNGDefPtr virDomainRNGRemove(virDomainDefPtr def, size_t idx);
diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index 8408081..9514201 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -424,7 +424,6 @@ virDomainRedirdevBusTypeToString;
virDomainRNGBackendTypeToString;
virDomainRNGDefFree;
virDomainRNGFind;
-virDomainRNGInsert;
virDomainRNGModelTypeToString;
virDomainRNGRemove;
virDomainRunningReasonTypeFromString;
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 37d970e..00daf72 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -7914,7 +7914,7 @@ qemuDomainAttachDeviceConfig(virQEMUCapsPtr qemuCaps,
return -1;
}
- if (virDomainRNGInsert(vmdef, dev->data.rng, false) < 0)
+ if (VIR_APPEND_ELEMENT(vmdef->rngs, vmdef->nrngs, dev->data.rng) < 0)
return -1;
dev->data.rng = NULL;
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index f8ab095..85c5e0c 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1660,8 +1660,7 @@ qemuDomainAttachRNGDevice(virQEMUDriverPtr driver,
goto cleanup;
}
- if (virDomainRNGInsert(vm->def, rng, true) < 0)
- goto audit;
+ ignore_value(VIR_APPEND_ELEMENT_INPLACE(vm->def->rngs, vm->def->nrngs, rng));
ret = 0;
--
2.8.2
8 years, 11 months
[libvirt] [PATCH] qemu: hotplug: Report error if we hit tray status timeout
by Cole Robinson
If we exceed the timeout waiting for the tray status to change,
we don't report an error. Fix it
---
I hit this trying to eject floppy media for a win10 VM with F24
qemu, but I didn't dig deeper to figure out _why_ it's timing out...
src/qemu/qemu_hotplug.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 03e5309..e5f8a38 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -224,7 +224,13 @@ qemuDomainChangeEjectableMedia(virQEMUDriverPtr driver,
goto error;
while (disk->tray_status != VIR_DOMAIN_DISK_TRAY_OPEN) {
- if (virDomainObjWaitUntil(vm, now + CHANGE_MEDIA_TIMEOUT) != 0)
+ int rc2 = virDomainObjWaitUntil(vm, now + CHANGE_MEDIA_TIMEOUT);
+ if (rc2 == 1) {
+ virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("timed out waiting for "
+ "disk tray status update"));
+ }
+ if (rc2 != 0)
goto error;
}
} while (rc < 0);
--
2.7.4
8 years, 11 months