[libvirt] [PATCH 00/10 v4] Unprivileged SG_IO support
by Osier Yang
Hi,
As a result of RFC [1], this implements the unprivleged SG_IO
support. Testing is not that enough, but I'd like see the
reviewing earlier, and meanwhile I'm not going to give up
the further testing.
v2 - v3:
* Change the XML tag name to "cdbfilter"
* Maintain an internal list of shared disks for QEMU driver.
v3 - v4:
* Rebase on the top
* More testing
Patches 1/10 ~ 4/10 are to introduce the internal list for shared
disks.
Osier Yang (10):
qemu: Introduce a list to maintain the shared disks between domains
qemu: Init/Free the list with the driver's lifecyle
qemu: Add/remove the shared disk entry during domain's lifecyle
qemu: Add/Remove the entry of sharedDisks when live
attaching/detaching
docs: Add docs and rng schema for new XML cdbfilter
conf: Parse and format the new XML tag cdbfilter
util: Prepare helpers for unpriv_sgio setting
qemu: Manage disk's cdbfilter in domain's lifecycle
qemu: Do not restore the sysfs unpriv_sgio if the disk is being
shared
qemu: Error out when domain starting if the cdbfilter setting
conflicts
Regards,
Osier
12 years
[libvirt] [PATCH V2] implement managedsave in libvirt xen legacy driver
by Bamvor Jian Zhang
Implement the domainManagedSave, domainHasManagedSaveImage, and
domainManagedSaveRemove functions in the libvirt legacy xen driver.
domainHasManagedSaveImage check the managedsave image from filesystem
everytime. This is different from qemu and libxl driver. In qemu or
libxl driver, there is a hasManagesSave flags in virDomainObjPtr which
is not used in xen legacy driver. This flag could not add into xen
driver ptr either, because the driver ptr will be release at the end of
every libvirt api calls. Meanwhile, AFAIK, xen store all the flags in
xen not in libvirt xen driver. There is no need to add this flags in xen.
Signed-off-by: Bamvor Jian Zhang <bjzhang(a)suse.com>
---
Changes since v1:
(1), add save dir in libvirt.spec.in and src/Makefile.am
(2), misc changes for return value and memory leak.
i have test the following case for this patch:
1), "virsh managedsave" save domain to /var/lib/xen/save/domain_name.save.
call xenUnifiedDomainManagedSave.
2), "virsh start": if managedsave image is exist, it should be boot from
managed save image.
call xenUnifiedDomainHasManagedSaveImage.
3), "virsh start --force-boot": fresh boot, delete the managed save image
if exists.
call xenUnifiedDomainHasManagedSaveImage,
xenUnifiedDomainManagedSaveRemove.
4), "virsh managedsave-remove": remove managed save image.
call xenUnifiedDomainManagedSaveRemove
5), "virsh undefine": undefine the domain, it will fail if mananed save
image exist.
call xenUnifiedDomainHasManagedSaveImage.
6), "virsh undefine --managed-save": undefine the domain, and remove
mananed save image.
call xenUnifiedDomainHasManagedSaveImage and
xenUnifiedDomainManagedSaveRemove.
7), "virsh list --all --with-managed-save". list domain if managed save
image exist. got nothing if non-exists.
call xenUnifiedDomainHasManagedSaveImage.
8), "virsh list --all --without-managed-save". do not list the domain if
managed save image exist.
call xenUnifiedDomainHasManagedSaveImage.
libvirt.spec.in | 3 ++
src/Makefile.am | 6 +++
src/xen/xen_driver.c | 108 ++++++++++++++++++++++++++++++++++++++++++++++++++-
src/xen/xen_driver.h | 2 +
4 files changed, 118 insertions(+), 1 deletion(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index 47cb087..ae18adb 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1719,6 +1719,9 @@ rm -f $RPM_BUILD_ROOT%{_sysconfdir}/sysctl.d/libvirtd
%ghost %dir %{_localstatedir}/run/libvirt/libxl/
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/libxl/
%endif
+%if %{with_xen}
+%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/xen/
+%endif
%if %{with_network}
%ghost %dir %{_localstatedir}/run/libvirt/network/
%dir %attr(0700, root, root) %{_localstatedir}/lib/libvirt/network/
diff --git a/src/Makefile.am b/src/Makefile.am
index 01cb995..fc0d78a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1769,6 +1769,9 @@ if WITH_UML
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/uml"
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/run/libvirt/uml"
endif
+if WITH_XEN
+ $(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/xen"
+endif
if WITH_NETWORK
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/network"
$(MKDIR_P) "$(DESTDIR)$(localstatedir)/lib/libvirt/dnsmasq"
@@ -1815,6 +1818,9 @@ if WITH_UML
rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/uml" ||:
rmdir "$(DESTDIR)$(localstatedir)/run/libvirt/uml" ||:
endif
+if WITH_XEN
+ rmdir "$(DESTDIR)$(localstatedir)/lib/libvirt/xen" ||:
+endif
if WITH_NETWORK
rm -f $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/autostart/default.xml
rm -f $(DESTDIR)$(sysconfdir)/libvirt/qemu/networks/default.xml
diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c
index 5a40757..71ff5bd 100644
--- a/src/xen/xen_driver.c
+++ b/src/xen/xen_driver.c
@@ -65,8 +65,10 @@
#include "command.h"
#include "virnodesuspend.h"
#include "nodeinfo.h"
+#include "configmake.h"
#define VIR_FROM_THIS VIR_FROM_XEN
+#define XEN_SAVE_DIR LOCALSTATEDIR "/lib/libvirt/xen/save"
static int
xenUnifiedNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info);
@@ -267,6 +269,7 @@ xenUnifiedOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int flags)
{
int i, ret = VIR_DRV_OPEN_DECLINED;
xenUnifiedPrivatePtr priv;
+ char ebuf[1024];
#ifdef __sun
/*
@@ -406,6 +409,17 @@ xenUnifiedOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int flags)
}
#endif
+ if (virAsprintf(&priv->saveDir, "%s", XEN_SAVE_DIR) == -1) {
+ virReportOOMError();
+ goto fail;
+ }
+
+ if (virFileMakePath(priv->saveDir) < 0) {
+ VIR_ERROR(_("Failed to create save dir '%s': %s"), priv->saveDir,
+ virStrerror(errno, ebuf, sizeof(ebuf)));
+ goto fail;
+ }
+
return VIR_DRV_OPEN_SUCCESS;
fail:
@@ -437,6 +451,7 @@ xenUnifiedClose(virConnectPtr conn)
if (priv->opened[i])
drivers[i]->xenClose(conn);
+ VIR_FREE(priv->saveDir);
virMutexDestroy(&priv->lock);
VIR_FREE(conn->privateData);
@@ -1080,6 +1095,77 @@ xenUnifiedDomainSave(virDomainPtr dom, const char *to)
return xenUnifiedDomainSaveFlags(dom, to, NULL, 0);
}
+static char *
+xenUnifiedDomainManagedSavePath(xenUnifiedPrivatePtr priv, virDomainPtr dom)
+{
+ char *ret;
+
+ if (virAsprintf(&ret, "%s/%s.save", priv->saveDir, dom->name) < 0) {
+ virReportOOMError();
+ return NULL;
+ }
+
+ VIR_DEBUG("managed save image: %s", ret);
+ return ret;
+}
+
+static int
+xenUnifiedDomainManagedSave(virDomainPtr dom, unsigned int flags)
+{
+ GET_PRIVATE(dom->conn);
+ char *name;
+ int ret = -1;
+
+ virCheckFlags(0, -1);
+
+ name = xenUnifiedDomainManagedSavePath(priv, dom);
+ if (!name)
+ goto cleanup;
+
+ if (priv->opened[XEN_UNIFIED_XEND_OFFSET])
+ ret = xenDaemonDomainSave(dom, name);
+
+cleanup:
+ VIR_FREE(name);
+ return ret;
+}
+
+static int
+xenUnifiedDomainHasManagedSaveImage(virDomainPtr dom, unsigned int flags)
+{
+ GET_PRIVATE(dom->conn);
+ char *name;
+ int ret = -1;
+
+ virCheckFlags(0, -1);
+
+ name = xenUnifiedDomainManagedSavePath(priv, dom);
+ if (!name)
+ return ret;
+
+ ret = virFileExists(name);
+ VIR_FREE(name);
+ return ret;
+}
+
+static int
+xenUnifiedDomainManagedSaveRemove(virDomainPtr dom, unsigned int flags)
+{
+ GET_PRIVATE(dom->conn);
+ char *name;
+ int ret = -1;
+
+ virCheckFlags(0, -1);
+
+ name = xenUnifiedDomainManagedSavePath(priv, dom);
+ if (!name)
+ return ret;
+
+ ret = unlink(name);
+ VIR_FREE(name);
+ return ret;
+}
+
static int
xenUnifiedDomainRestoreFlags(virConnectPtr conn, const char *from,
const char *dxml, unsigned int flags)
@@ -1505,15 +1591,32 @@ xenUnifiedDomainCreateWithFlags(virDomainPtr dom, unsigned int flags)
{
GET_PRIVATE(dom->conn);
int i;
+ int ret = -1;
+ char *name = NULL;
virCheckFlags(0, -1);
+ name = xenUnifiedDomainManagedSavePath(priv, dom);
+ if (!name)
+ goto cleanup;
+
+ if (virFileExists(name)) {
+ if (priv->opened[XEN_UNIFIED_XEND_OFFSET]) {
+ ret = xenDaemonDomainRestore(dom->conn, name);
+ if (ret == 0)
+ unlink(name);
+ }
+ goto cleanup;
+ }
+
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
if (priv->opened[i] && drivers[i]->xenDomainCreate &&
drivers[i]->xenDomainCreate(dom) == 0)
return 0;
- return -1;
+cleanup:
+ VIR_FREE(name);
+ return ret;
}
static int
@@ -2218,6 +2321,9 @@ static virDriver xenUnifiedDriver = {
.domainGetState = xenUnifiedDomainGetState, /* 0.9.2 */
.domainSave = xenUnifiedDomainSave, /* 0.0.3 */
.domainSaveFlags = xenUnifiedDomainSaveFlags, /* 0.9.4 */
+ .domainManagedSave = xenUnifiedDomainManagedSave, /* 1.0.1 */
+ .domainHasManagedSaveImage = xenUnifiedDomainHasManagedSaveImage, /* 1.0.1 */
+ .domainManagedSaveRemove = xenUnifiedDomainManagedSaveRemove, /* 1.0.1 */
.domainRestore = xenUnifiedDomainRestore, /* 0.0.3 */
.domainRestoreFlags = xenUnifiedDomainRestoreFlags, /* 0.9.4 */
.domainCoreDump = xenUnifiedDomainCoreDump, /* 0.1.9 */
diff --git a/src/xen/xen_driver.h b/src/xen/xen_driver.h
index b3fbcff..078980e 100644
--- a/src/xen/xen_driver.h
+++ b/src/xen/xen_driver.h
@@ -200,6 +200,8 @@ struct _xenUnifiedPrivate {
/* Location of config files, either /etc
* or /var/lib/xen */
const char *configDir;
+ /* Location of managed save dir, default /var/lib/libvirt/xen/save */
+ char *saveDir;
# if WITH_XEN_INOTIFY
/* The inotify fd */
--
1.7.12
12 years
[libvirt] [PATCH] Fix the indention
by Osier Yang
Introduced by commit 1465876a, pushed under build-breaker &&
trivial rule.
---
python/libvirt-override.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/python/libvirt-override.c b/python/libvirt-override.c
index 573c032..eda8a11 100644
--- a/python/libvirt-override.c
+++ b/python/libvirt-override.c
@@ -6029,7 +6029,7 @@ libvirt_virConnectCloseCallbackDispatch(virConnectPtr conn ATTRIBUTE_UNUSED,
Py_DECREF(pyobj_cbData);
- if(!pyobj_ret) {
+ if (!pyobj_ret) {
DEBUG("%s - ret:%p\n", __FUNCTION__, pyobj_ret);
PyErr_Print();
} else {
--
1.7.7.6
12 years
[libvirt] [PATCH] Do not export symbol virStateActive anymore
by Osier Yang
Commit 79b8a56995 removes virStateActive, however it forgot to
remove the symbol together. Pushed under build-breaker rule.
---
src/libvirt_daemon.syms | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/src/libvirt_daemon.syms b/src/libvirt_daemon.syms
index dde77a6..e184ded 100644
--- a/src/libvirt_daemon.syms
+++ b/src/libvirt_daemon.syms
@@ -4,7 +4,6 @@
# libvirt_internal.h
virRegisterStateDriver;
-virStateActive;
virStateCleanup;
virStateInitialize;
virStateReload;
--
1.7.7.6
12 years
[libvirt] [PATCH] Fix memory leak in QEMU QMP capabilities initialization
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
The qemuCapsInitQMP method never frees the QEMU 'package'
version string.
---
src/qemu/qemu_capabilities.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 6e34cdf..a0ed4f1 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -2299,7 +2299,7 @@ qemuCapsInitQMP(qemuCapsPtr caps,
virCommandPtr cmd = NULL;
qemuMonitorPtr mon = NULL;
int major, minor, micro;
- char *package;
+ char *package = NULL;
int status = 0;
virDomainChrSourceDef config;
char *monarg = NULL;
@@ -2443,6 +2443,7 @@ cleanup:
virCommandFree(cmd);
VIR_FREE(monarg);
VIR_FREE(monpath);
+ VIR_FREE(package);
if (pidfile) {
char ebuf[1024];
--
1.7.11.7
12 years
[libvirt] fail to patch rpmbuild -bb libvirt.spec
by Frost Rains
Hi Mr/Mrs,
At my install I fail in:
make[3]: *** [libvirt_driver_libxl_la-libxl_conf.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory `/root/rpmbuild/BUILD/libvirt-0.9.10/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/root/rpmbuild/BUILD/libvirt-0.9.10/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/rpmbuild/BUILD/libvirt-0.9.10'
make: *** [all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.ezXtRF (%build)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.ezXtRF (%build)
Please help me fix these problem,
Waiting for your answers,
Best Regard,
12 years
[libvirt] [PATCH] implement managedsave in libvirt xen legacy driver
by Bamvor Jian Zhang
Implement the domainManagedSave, domainHasManagedSaveImage, and
domainManagedSaveRemove functions in the libvirt legacy xen driver.
domainHasManagedSaveImage check the managedsave image from filesystem
everytime. This is different from qemu and libxl driver. In qemu or
libxl driver, there is a hasManagesSave flags in virDomainObjPtr which
is not used in xen legacy driver. This flag could not add into xen
driver ptr either, because the driver ptr will be release at the end of
every libvirt api calls. Meanwhile, AFAIK, xen store all the flags in
xen not in libvirt xen driver. There is no need to add this flags in xen.
---
i have test the following case for this patch:
1), "virsh managedsave" save domain to /var/lib/xen/save/domain_name.save.
call xenUnifiedDomainManagedSave.
2), "virsh start": if managedsave image is exist, it should be boot from
managed save image.
call xenUnifiedDomainHasManagedSaveImage.
3), "virsh start --force-boot": fresh boot, delete the managed save image
if exists.
call xenUnifiedDomainHasManagedSaveImage,
xenUnifiedDomainManagedSaveRemove.
4), "virsh managedsave-remove": remove managed save image.
call xenUnifiedDomainManagedSaveRemove
5), "virsh undefine": undefine the domain, it will fail if mananed save
image exist.
call xenUnifiedDomainHasManagedSaveImage.
6), "virsh undefine --managed-save": undefine the domain, and remove
mananed save image.
call xenUnifiedDomainHasManagedSaveImage and
xenUnifiedDomainManagedSaveRemove.
7), "virsh list --all --with-managed-save". list domain if managed save
image exist. got nothing if non-exists.
call xenUnifiedDomainHasManagedSaveImage.
8), "virsh list --all --without-managed-save". do not list the domain if
managed save image exist.
call xenUnifiedDomainHasManagedSaveImage.
src/xen/xen_driver.c | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++-
src/xen/xen_driver.h | 2 +
2 files changed, 110 insertions(+), 1 deletion(-)
diff --git a/src/xen/xen_driver.c b/src/xen/xen_driver.c
index 5a40757..0b2418d 100644
--- a/src/xen/xen_driver.c
+++ b/src/xen/xen_driver.c
@@ -67,6 +67,7 @@
#include "nodeinfo.h"
#define VIR_FROM_THIS VIR_FROM_XEN
+#define XEN_SAVE_DIR LOCALSTATEDIR "/lib/libvirt/xen/save"
static int
xenUnifiedNodeGetInfo(virConnectPtr conn, virNodeInfoPtr info);
@@ -267,6 +268,7 @@ xenUnifiedOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int flags)
{
int i, ret = VIR_DRV_OPEN_DECLINED;
xenUnifiedPrivatePtr priv;
+ char ebuf[1024];
#ifdef __sun
/*
@@ -406,6 +408,17 @@ xenUnifiedOpen(virConnectPtr conn, virConnectAuthPtr auth, unsigned int flags)
}
#endif
+ if (virAsprintf(&priv->saveDir, "%s", XEN_SAVE_DIR) == -1) {
+ virReportOOMError();
+ goto fail;
+ }
+
+ if (virFileMakePath(priv->saveDir) < 0) {
+ VIR_ERROR(_("Failed to create save dir '%s': %s"), priv->saveDir,
+ virStrerror(errno, ebuf, sizeof(ebuf)));
+ goto fail;
+ }
+
return VIR_DRV_OPEN_SUCCESS;
fail:
@@ -437,6 +450,7 @@ xenUnifiedClose(virConnectPtr conn)
if (priv->opened[i])
drivers[i]->xenClose(conn);
+ VIR_FREE(priv->saveDir);
virMutexDestroy(&priv->lock);
VIR_FREE(conn->privateData);
@@ -1080,6 +1094,79 @@ xenUnifiedDomainSave(virDomainPtr dom, const char *to)
return xenUnifiedDomainSaveFlags(dom, to, NULL, 0);
}
+static char *
+xenUnifiedDomainManagedSavePath(xenUnifiedPrivatePtr priv, virDomainPtr dom)
+{
+ char *ret;
+
+ if (virAsprintf(&ret, "%s/%s.save", priv->saveDir, dom->name) < 0) {
+ virReportOOMError();
+ return NULL;
+ }
+
+ VIR_DEBUG("managed save image: %s", ret);
+ return ret;
+}
+
+static int
+xenUnifiedDomainManagedSave(virDomainPtr dom, unsigned int flags)
+{
+ GET_PRIVATE(dom->conn);
+ char *name;
+ int ret = -1;
+
+ virCheckFlags(0, -1);
+
+ name = xenUnifiedDomainManagedSavePath(priv, dom);
+ if (!name)
+ goto cleanup;
+
+ if (priv->opened[XEN_UNIFIED_XEND_OFFSET])
+ ret = xenDaemonDomainSave(dom, name);
+
+cleanup:
+ VIR_FREE(name);
+ return ret;
+}
+
+static int
+xenUnifiedDomainHasManagedSaveImage(virDomainPtr dom, unsigned int flags)
+{
+ GET_PRIVATE(dom->conn);
+ char *name;
+ int ret = -1;
+
+ virCheckFlags(0, -1);
+
+ name = xenUnifiedDomainManagedSavePath(priv, dom);
+ if (!name)
+ return ret;
+
+ ret = virFileExists(name);
+ VIR_FREE(name);
+ return ret;
+}
+
+static int
+xenUnifiedDomainManagedSaveRemove(virDomainPtr dom, unsigned int flags)
+{
+ GET_PRIVATE(dom->conn);
+ char *name;
+ int ret = -1;
+
+ virCheckFlags(0, -1);
+
+ name = xenUnifiedDomainManagedSavePath(priv, dom);
+ if (!name)
+ goto cleanup;
+
+ ret = unlink(name);
+ VIR_FREE(name);
+
+cleanup:
+ return ret;
+}
+
static int
xenUnifiedDomainRestoreFlags(virConnectPtr conn, const char *from,
const char *dxml, unsigned int flags)
@@ -1504,16 +1591,33 @@ static int
xenUnifiedDomainCreateWithFlags(virDomainPtr dom, unsigned int flags)
{
GET_PRIVATE(dom->conn);
+ char *name;
int i;
+ int ret = -1;
virCheckFlags(0, -1);
+ name = xenUnifiedDomainManagedSavePath(priv, dom);
+ if (!name)
+ goto cleanup;
+
+ if (virFileExists(name)) {
+ if (priv->opened[XEN_UNIFIED_XEND_OFFSET]) {
+ ret = xenDaemonDomainRestore(dom->conn, name);
+ if (ret == 0)
+ unlink(name);
+ }
+ VIR_FREE(name);
+ goto cleanup;
+ }
+
for (i = 0; i < XEN_UNIFIED_NR_DRIVERS; ++i)
if (priv->opened[i] && drivers[i]->xenDomainCreate &&
drivers[i]->xenDomainCreate(dom) == 0)
return 0;
- return -1;
+cleanup:
+ return ret;
}
static int
@@ -2218,6 +2322,9 @@ static virDriver xenUnifiedDriver = {
.domainGetState = xenUnifiedDomainGetState, /* 0.9.2 */
.domainSave = xenUnifiedDomainSave, /* 0.0.3 */
.domainSaveFlags = xenUnifiedDomainSaveFlags, /* 0.9.4 */
+ .domainManagedSave = xenUnifiedDomainManagedSave, /* 1.0.1 */
+ .domainHasManagedSaveImage = xenUnifiedDomainHasManagedSaveImage, /* 1.0.1 */
+ .domainManagedSaveRemove = xenUnifiedDomainManagedSaveRemove, /* 1.0.1 */
.domainRestore = xenUnifiedDomainRestore, /* 0.0.3 */
.domainRestoreFlags = xenUnifiedDomainRestoreFlags, /* 0.9.4 */
.domainCoreDump = xenUnifiedDomainCoreDump, /* 0.1.9 */
diff --git a/src/xen/xen_driver.h b/src/xen/xen_driver.h
index b3fbcff..078980e 100644
--- a/src/xen/xen_driver.h
+++ b/src/xen/xen_driver.h
@@ -200,6 +200,8 @@ struct _xenUnifiedPrivate {
/* Location of config files, either /etc
* or /var/lib/xen */
const char *configDir;
+ /* Location of managed save dir, default /var/lib/libvirt/xen/save */
+ char *saveDir;
# if WITH_XEN_INOTIFY
/* The inotify fd */
--
1.7.12
12 years
[libvirt] [PATCH] build: fix incremental autogen.sh when no AUTHORS is present
by Eric Blake
Commit 71d1256 tried to fix a problem where rebasing an old
branch on top of newer libvirt.git resulted in automake failing
because of a missing AUTHORS file. However, while the fix
worked for an incremental 'make', it did not work for someone
that directly reran './autogen.sh'. Reported by Laine Stump.
* autogen.sh (autoreconf): Check for same conditions as cfg.mk.
* cfg.mk (_update_required): Add comments.
---
autogen.sh | 3 ++-
cfg.mk | 2 ++
2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/autogen.sh b/autogen.sh
index 126b272..d4957f1 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -69,14 +69,15 @@ if test -d .git; then
*:set) ;;
*-dirty*)
echo "error: gnulib submodule is dirty, please investigate" 2>&1
echo "set env-var CLEAN_SUBMODULE to discard gnulib changes" 2>&1
exit 1 ;;
esac
+ # Keep this test in sync with cfg.mk:_update_required
if test "$t" = "$(cat $curr_status 2>/dev/null)" \
- && test -f "po/Makevars"; then
+ && test -f "po/Makevars" && test -f AUTHORS; then
# good, it's up to date, all we need is autoreconf
autoreconf -if
else
if test ${CLEAN_SUBMODULE+set}; then
echo cleaning up submodules...
git submodule foreach 'git clean -dfqx && git reset --hard'
diff --git a/cfg.mk b/cfg.mk
index ec4ab1c..c4ae195 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -688,12 +688,14 @@ ifeq (0,$(MAKELEVEL))
# in column 1 and does not print a "git describe"-style string after the
# submodule name. Contrast these:
# -b653eda3ac4864de205419d9f41eec267cb89eeb .gnulib
# b653eda3ac4864de205419d9f41eec267cb89eeb .gnulib (v0.0-2286-gb653eda)
# $ cat .git-module-status
# b653eda3ac4864de205419d9f41eec267cb89eeb
+ #
+ # Keep this logic in sync with autogen.sh.
_submodule_hash = sed 's/^[ +-]//;s/ .*//'
_update_required := $(shell \
cd '$(srcdir)'; \
test -d .git || { echo 0; exit; }; \
test -f po/Makevars || { echo 1; exit; }; \
test -f AUTHORS || { echo 1; exit; }; \
--
1.7.1
12 years
[libvirt] [PATCH v1 00/11] Allow minimal bandwidth guarantee
by Michal Privoznik
This is a rework of my one year old patchset [1].
If you are brave enough and start reviewing it, you may want to read
the last patch first. The whole magic hidden behind the scene is
documented there. For now, the only supported combination where this
works is virtual interface connected to virtual network. This network
MUST have an inbound average set, at least. This tells how much
bandwidth do we have, and how much can we guarantee. If we would miss
this info, then we cannot guarantee anything. On the other hand, this
is just a very small part of whole problem. Users MUST configure all
other devices on traffic path to follow up their setting in libvirt.
But that's out of our scope.
1: http://www.redhat.com/archives/libvir-list/2011-December/msg00486.html
Michal Privoznik (11):
bandwidth: add new 'floor' attribute
bandwidth: Create hierarchical shaping classes
bandwidth: Create (un)plug functions
bandwidth: Create rate update function
bandwidth: Create network (un)plug functions
network: Create real network status files
domain: Keep assigned class_id in domstatus XML
network: Update status file on (un)plug
network: Allow class ID to be reused
bandwidth: Attach sfq to leaf node
bandwidth: Add documentation
docs/formatdomain.html.in | 20 ++-
docs/schemas/networkcommon.rng | 5 +
po/POTFILES.in | 1 +
src/Makefile.am | 7 +-
src/conf/domain_conf.c | 10 +-
src/conf/domain_conf.h | 1 +
src/conf/netdev_bandwidth_conf.c | 54 ++++++-
src/conf/netdev_bandwidth_conf.h | 3 +-
src/conf/network_conf.c | 230 ++++++++++++++++++++++-----
src/conf/network_conf.h | 6 +
src/libvirt_network.syms | 8 +
src/libvirt_private.syms | 1 +
src/lxc/lxc_process.c | 3 +-
src/network/bridge_driver.c | 224 +++++++++++++++++++++++++-
src/network/bridge_driver.h | 10 +-
src/qemu/qemu_command.c | 35 +++--
src/qemu/qemu_domain.c | 66 +++++++-
src/qemu/qemu_driver.c | 2 +-
src/qemu/qemu_process.c | 12 ++
src/util/virnetdevbandwidth.c | 326 +++++++++++++++++++++++++++++++++++++-
src/util/virnetdevbandwidth.h | 25 +++-
src/util/virnetdevmacvlan.c | 2 +-
22 files changed, 956 insertions(+), 95 deletions(-)
create mode 100644 src/libvirt_network.syms
--
1.7.8.6
12 years