[libvirt] [PATCH] vircommand: fix polling in virCommandProcessIO
by Roman Bogorodskiy
When running on FreeBSD, there's a bug in virCommandProcessIO
polling that is triggered by the commandtest.
A test that triggers EPIPE in commandtest (named "test20") hungs
forever on FreeBSD.
Apparently, this happens because FreeBSD sets POLLHUP flag on revents
when stdin in closed. And as the current implementation only checks for
POLLOUT and POLLERR, it ends up looping forever inside
virCommandProcessIO and not trying to do one more write() that would
trigger EPIPE.
To fix that check for the POLLHUP flag along with POLLOUT and POLLERR.
---
src/util/vircommand.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/vircommand.c b/src/util/vircommand.c
index 648f5ed..f9b3c3f 100644
--- a/src/util/vircommand.c
+++ b/src/util/vircommand.c
@@ -2097,7 +2097,7 @@ virCommandProcessIO(virCommandPtr cmd)
}
}
- if (fds[i].revents & (POLLOUT | POLLERR) &&
+ if (fds[i].revents & (POLLOUT | POLLHUP | POLLERR) &&
fds[i].fd == cmd->inpipe) {
int done;
--
2.3.5
9 years, 7 months
[libvirt] [PATCH] schemas: capability: Add ostype 'aix'
by Cole Robinson
---
docs/schemas/capability.rng | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/schemas/capability.rng b/docs/schemas/capability.rng
index 5f3ec70..3868ee2 100644
--- a/docs/schemas/capability.rng
+++ b/docs/schemas/capability.rng
@@ -266,6 +266,7 @@
<value>hvm</value> <!-- unmodified OS -->
<value>exe</value> <!-- For container based virt -->
<value>uml</value> <!-- user mode linux -->
+ <value>aix</value> <!-- used by phyp driver -->
</choice>
</element>
</define>
--
2.3.5
9 years, 7 months
[libvirt] [PATCH] libvirt-python: add classifiers to setup.py
by Victor Stinner
Add the Python 3 classifier, needed by the caniusepython3 tool to check
if dependencies of a projects are Python 3 compatible:
https://caniusepython3.com/
---
setup.py | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/setup.py b/setup.py
index 79b048f..116b3c0 100755
--- a/setup.py
+++ b/setup.py
@@ -325,4 +325,12 @@ setup(name = 'libvirt-python',
'sdist': my_sdist,
'rpm': my_rpm,
'test': my_test
- })
+ },
+ classifiers = [
+ "Development Status :: 5 - Production/Stable",
+ "Intended Audience :: Developers",
+ "License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)",
+ "Programming Language :: Python",
+ "Programming Language :: Python :: 3",
+ ]
+)
--
2.1.0
9 years, 7 months
[libvirt] [PATCHv2]rework the check for the numa cpus
by Luyao Huang
V1 discussion:
https://www.redhat.com/archives/libvir-list/2015-April/msg00919.html
new for v2:
remove 1/2 because no need introduce a new flag to avoid the broken
introduced by the new check.
We introduce a check for numa cpu total count in 5f7b71,
But seems this check cannot work well. There are some scenarioes:
1. one of cpu id is out of maxvcpus, can set success(cpu count = 5 < 10):
<vcpu placement='static'>10</vcpu>
<cell id='0' cpus='0-3,100' memory='512000' unit='KiB'/>
the cpus '100' exceed maxvcpus, this setting is not valid (although qemu
do not output error).
2. use the same cpu in 2 cell, can set success(cpu count = 8 < 10):
<vcpu placement='static'>10</vcpu>
<cell id='0' cpus='0-3' memory='512000' unit='KiB'/>
<cell id='1' cpus='0-3' memory='512000' unit='KiB'/>
I guess nobody will use this setting if he really want use numa in his
vm. (qemu not output error, but we can find some interesting things in
vm, all cpus have bind in one numa node)
3. use the same cpu in 2 cell, cannot set success(cpu count = 11 > 10):
<vcpu placement='static'>10</vcpu>
<cell id='0' cpus='0-6' memory='512000' unit='KiB'/>
<cell id='1' cpus='0-3' memory='512000' unit='KiB'/>
No need forbid this scenario if scenario 2 is a 'valid' setting.
However add new check during parse xml will make vm has broken settings
disappear after update libvirtd, so possible solutions:
1. add new check when parse xml, i chose this way in this version.
2. add new check when start vm.
I think this is a configuration issue, so no need report it so late.
3. just remove this check and do not add new check... :)
Luyao Huang (1):
conf: rework the cpu check for vm numa settings
src/conf/domain_conf.c | 6 +-----
src/conf/numa_conf.c | 37 ++++++++++++++++++++++++++++++-------
src/conf/numa_conf.h | 2 +-
3 files changed, 32 insertions(+), 13 deletions(-)
--
1.8.3.1
9 years, 7 months
[libvirt] [PATCH 0/3] util: storage: fix indexed access to backing store
by Peter Krempa
Improve error reporting when an index can't be found in the backing chain.
Peter Krempa (3):
util: storage: Fix possible crash when source path is NULL
util: storage: Add hint to error message that indexed access was used
util: storage: Improve error message when requesting image above
'start'
src/util/virstoragefile.c | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
--
2.3.5
9 years, 7 months
[libvirt] [PATCH 0/2] misc cleanups
by Peter Krempa
Peter Krempa (2):
qemu: migration: Refactor hostdev validation in migration check
util: command: Deduplicate code in virCommandNewArgList
src/qemu/qemu_migration.c | 15 ++++-----------
src/util/vircommand.c | 10 +++-------
2 files changed, 7 insertions(+), 18 deletions(-)
--
2.3.5
9 years, 7 months
[libvirt] libvirt-0.10.2-46 compress failed
by 饶俊明
Hello
When compress libvirt-0.10.2-46.el6.src.rpm to support rbd, then failed;
Error log:
cc1: warnings being treated as errors
storage/storage_backend_rbd.c: In function 'virStorageBackendRBDRefreshPool':
storage/storage_backend_rbd.c:284: error: declaration of 'stat' shadows a global declaration [-Wshadow]
/usr/include/sys/stat.h:455: error: shadowed declaration is here [-Wshadow]
At top level:
cc1: error: unrecognized command line option "-Wno-suggest-attribute=const"
cc1: error: unrecognized command line option "-Wno-suggest-attribute=pure"
make[3]: *** [libvirt_driver_storage_impl_la-storage_backend_rbd.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory `/home/ada/rpmbuild/BUILD/libvirt-0.10.2/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/ada/rpmbuild/BUILD/libvirt-0.10.2/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/ada/rpmbuild/BUILD/libvirt-0.10.2'
make: *** [all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.g0IuFq (%build)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.g0IuFq (%build)
Thanks!!!
********************************************************************************************************************************
The information in this email is confidential and may be legally privileged. If you have received this email in error or are not the intended recipient, please immediately notify the sender and delete this message from your computer. Any use, distribution, or copying of this email other than by the intended recipient is strictly prohibited. All messages sent to and from us may be monitored to ensure compliance with internal policies and to protect our business.
Emails are not secure and cannot be guaranteed to be error free as they can be intercepted, amended, lost or destroyed, or contain viruses. Anyone who communicates with us by email is taken to accept these risks.
�跺���欢���娉ㄦ�锛����浠跺�淇��淇℃�锛��璇�����浠讹�璇峰�蹇���ュ���汉骞剁��ュ��伙�涓��浣跨�������澶�����浠躲�
杩����欢����版�������������浠跺��藉����������淇����涪澶便�琚��������璁$��虹�姣��涓���ㄦ��点�
********************************************************************************************************************************
9 years, 7 months
[libvirt] [PATCH] util: fix build on non-Linux
by Roman Bogorodskiy
Build fails on non-Linux systems with this error:
CC util/libvirt_util_la-virnetdev.lo
util/virnetdev.c:364:1: error: unused function 'virNetDevReplaceMacAddress' [-Werror,-Wunused-function]
virNetDevReplaceMacAddress(const char *linkdev,
^
util/virnetdev.c:406:1: error: unused function 'virNetDevRestoreMacAddress' [-Werror,-Wunused-function]
virNetDevRestoreMacAddress(const char *linkdev,
^
2 errors generated.
The virNetDev{Restore,Replace}MacAddress() functions are only used
by VF-related routines that are available on Linux only. So move these
functions under the same #ifdef.
---
src/util/virnetdev.c | 176 ++++++++++++++++++++++++++-------------------------
1 file changed, 89 insertions(+), 87 deletions(-)
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index b7ea524..5069064 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -351,93 +351,6 @@ int virNetDevGetMAC(const char *ifname,
-/**
- * virNetDevReplaceMacAddress:
- * @macaddress: new MAC address for interface
- * @linkdev: name of interface
- * @stateDir: directory to store old MAC address
- *
- * Returns 0 on success, -1 on failure
- *
- */
-static int
-virNetDevReplaceMacAddress(const char *linkdev,
- const virMacAddr *macaddress,
- const char *stateDir)
-{
- virMacAddr oldmac;
- char *path = NULL;
- char macstr[VIR_MAC_STRING_BUFLEN];
- int ret = -1;
-
- if (virNetDevGetMAC(linkdev, &oldmac) < 0)
- return -1;
-
- if (virAsprintf(&path, "%s/%s",
- stateDir,
- linkdev) < 0)
- return -1;
- virMacAddrFormat(&oldmac, macstr);
- if (virFileWriteStr(path, macstr, O_CREAT|O_TRUNC|O_WRONLY) < 0) {
- virReportSystemError(errno, _("Unable to preserve mac for %s"),
- linkdev);
- goto cleanup;
- }
-
- if (virNetDevSetMAC(linkdev, macaddress) < 0)
- goto cleanup;
-
- ret = 0;
-
- cleanup:
- VIR_FREE(path);
- return ret;
-}
-
-/**
- * virNetDevRestoreMacAddress:
- * @linkdev: name of interface
- * @stateDir: directory containing old MAC address
- *
- * Returns 0 on success, -errno on failure.
- *
- */
-static int
-virNetDevRestoreMacAddress(const char *linkdev,
- const char *stateDir)
-{
- int rc = -1;
- char *oldmacname = NULL;
- char *macstr = NULL;
- char *path = NULL;
- virMacAddr oldmac;
-
- if (virAsprintf(&path, "%s/%s",
- stateDir,
- linkdev) < 0)
- return -1;
-
- if (virFileReadAll(path, VIR_MAC_STRING_BUFLEN, &macstr) < 0)
- goto cleanup;
-
- if (virMacAddrParse(macstr, &oldmac) != 0) {
- virReportError(VIR_ERR_INTERNAL_ERROR,
- _("Cannot parse MAC address from '%s'"),
- oldmacname);
- goto cleanup;
- }
-
- /*reset mac and remove file-ignore results*/
- rc = virNetDevSetMAC(linkdev, &oldmac);
- ignore_value(unlink(path));
-
- cleanup:
- VIR_FREE(macstr);
- VIR_FREE(path);
- return rc;
-}
-
-
#if defined(SIOCGIFMTU) && defined(HAVE_STRUCT_IFREQ)
/**
* virNetDevGetMTU:
@@ -1923,6 +1836,95 @@ virNetDevSysfsFile(char **pf_sysfs_device_link ATTRIBUTE_UNUSED,
#endif /* !__linux__ */
#if defined(__linux__) && defined(HAVE_LIBNL) && defined(IFLA_VF_MAX)
+
+/**
+ * virNetDevReplaceMacAddress:
+ * @macaddress: new MAC address for interface
+ * @linkdev: name of interface
+ * @stateDir: directory to store old MAC address
+ *
+ * Returns 0 on success, -1 on failure
+ *
+ */
+static int
+virNetDevReplaceMacAddress(const char *linkdev,
+ const virMacAddr *macaddress,
+ const char *stateDir)
+{
+ virMacAddr oldmac;
+ char *path = NULL;
+ char macstr[VIR_MAC_STRING_BUFLEN];
+ int ret = -1;
+
+ if (virNetDevGetMAC(linkdev, &oldmac) < 0)
+ return -1;
+
+ if (virAsprintf(&path, "%s/%s",
+ stateDir,
+ linkdev) < 0)
+ return -1;
+ virMacAddrFormat(&oldmac, macstr);
+ if (virFileWriteStr(path, macstr, O_CREAT|O_TRUNC|O_WRONLY) < 0) {
+ virReportSystemError(errno, _("Unable to preserve mac for %s"),
+ linkdev);
+ goto cleanup;
+ }
+
+ if (virNetDevSetMAC(linkdev, macaddress) < 0)
+ goto cleanup;
+
+ ret = 0;
+
+ cleanup:
+ VIR_FREE(path);
+ return ret;
+}
+
+/**
+ * virNetDevRestoreMacAddress:
+ * @linkdev: name of interface
+ * @stateDir: directory containing old MAC address
+ *
+ * Returns 0 on success, -errno on failure.
+ *
+ */
+static int
+virNetDevRestoreMacAddress(const char *linkdev,
+ const char *stateDir)
+{
+ int rc = -1;
+ char *oldmacname = NULL;
+ char *macstr = NULL;
+ char *path = NULL;
+ virMacAddr oldmac;
+
+ if (virAsprintf(&path, "%s/%s",
+ stateDir,
+ linkdev) < 0)
+ return -1;
+
+ if (virFileReadAll(path, VIR_MAC_STRING_BUFLEN, &macstr) < 0)
+ goto cleanup;
+
+ if (virMacAddrParse(macstr, &oldmac) != 0) {
+ virReportError(VIR_ERR_INTERNAL_ERROR,
+ _("Cannot parse MAC address from '%s'"),
+ oldmacname);
+ goto cleanup;
+ }
+
+ /*reset mac and remove file-ignore results*/
+ rc = virNetDevSetMAC(linkdev, &oldmac);
+ ignore_value(unlink(path));
+
+ cleanup:
+ VIR_FREE(macstr);
+ VIR_FREE(path);
+ return rc;
+}
+
+
+
static struct nla_policy ifla_vf_policy[IFLA_VF_MAX+1] = {
[IFLA_VF_MAC] = { .type = NLA_UNSPEC,
.maxlen = sizeof(struct ifla_vf_mac) },
--
2.3.5
9 years, 7 months
[libvirt] [PATCHv2] qemu: Fix issues with maxMemory in qemuDomainSetMemoryFlags()
by Peter Krempa
From: Luyao Huang <lhuang(a)redhat.com>
qemuDomainSetMemoryFlags() would allow to set the initial memory greater
than the <maxMemory> field. While the configuration would not work as
memory hotplug requires NUMA to be enabled and the
qemuDomainSetMemoryFlags() API does not work on NUMA guests this just
fixes a corner case.
The fix is still worth though as it allows to induce an invalid
configuration and make the VM vanish on libvirt restart.
Additionally this tweaks error message to be more accurate.
Signed-off-by: Luyao Huang <lhuang(a)redhat.com>
Signed-off-by: Peter Krempa <pkrempa(a)redhat.com>
---
Version 2 tweaks the error messages to be (possibly) more descriptive.
src/qemu/qemu_driver.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 6700fc9..d15931c 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -2319,11 +2319,19 @@ static int qemuDomainSetMemoryFlags(virDomainPtr dom, unsigned long newmem,
* is no way to change the individual node sizes with this API */
if (virDomainNumaGetNodeCount(persistentDef->numa) > 0) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
- _("maximum memory size of a domain with NUMA "
+ _("initial memory size of a domain with NUMA "
"nodes cannot be modified with this API"));
goto endjob;
}
+ if (persistentDef->mem.max_memory &&
+ persistentDef->mem.max_memory < newmem) {
+ virReportError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("cannot set initial memory size biger than "
+ "the maximum memory size"));
+ goto endjob;
+ }
+
virDomainDefSetMemoryInitial(persistentDef, newmem);
if (persistentDef->mem.cur_balloon > newmem)
--
2.2.2
9 years, 7 months
Re: [libvirt] Plan for next release
by Daniel Veillard
So if we want to push the next release for May 1st, it seems we should enter
freeze over the w.e. or early Monday morning. Unless there is disagreement
I plan to proceed that way, hopefully getting next release on time :-)
Daniel
--
Daniel Veillard | Open Source and Standards, Red Hat
veillard(a)redhat.com | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | virtualization library http://libvirt.org/
9 years, 7 months