[libvirt] [PATCH]docs: fix typos in formatnwfilter
by Chen Hanxiao
From: Chen Hanxiao <chenhanxiao(a)cn.fujitsu.com>
s/initated/initiated
Signed-off-by: Chen Hanxiao <chenhanxiao(a)cn.fujitsu.com>
---
docs/formatnwfilter.html.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/formatnwfilter.html.in b/docs/formatnwfilter.html.in
index 5e1c6bb..ec20300 100644
--- a/docs/formatnwfilter.html.in
+++ b/docs/formatnwfilter.html.in
@@ -2079,9 +2079,9 @@
To enable traffic for TCP ports 22 and 80 we will add 2 rules to
enable this type of traffic. To allow the VM to send ping traffic
we will add a rule for ICMP traffic. For simplicity reasons
- we allow general ICMP traffic to be initated from the VM, not
+ we allow general ICMP traffic to be initiated from the VM, not
just ICMP echo request and response messages. To then
- disallow all other traffic to reach or be initated by the
+ disallow all other traffic to reach or be initiated by the
VM we will then need to add a rule that drops all other traffic.
Assuming our VM is called <i>test</i> and
the interface we want to associate our filter with is called <i>eth0</i>,
--
1.8.2.1
11 years, 1 month
[libvirt] [PATCH]lxc: improve readability of lxcContainer[Send|Waitfor]Continue
by Chen Hanxiao
From: Chen Hanxiao <chenhanxiao(a)cn.fujitsu.com>
Currently, lxcContainer[Send|Waitfor]Continue only tell
us 'fd', but we had to deal with the interaction between
lxc_[container|controller|process].
This patch adds parameters to identify the caller.
Signed-off-by: Chen Hanxiao <chenhanxiao(a)cn.fujitsu.com>
---
src/lxc/lxc_container.c | 16 +++++++++-------
src/lxc/lxc_container.h | 4 ++--
src/lxc/lxc_controller.c | 6 +++---
src/lxc/lxc_process.c | 2 +-
4 files changed, 15 insertions(+), 13 deletions(-)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index ed1fe29..c7371ca 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -351,19 +351,20 @@ cleanup:
/**
* lxcContainerSendContinue:
* @control: control FD to child
+ * @caller: function invoker
*
* Sends the continue message via the socket pair stored in the vm
* structure.
*
* Returns 0 on success or -1 in case of error
*/
-int lxcContainerSendContinue(int control)
+int lxcContainerSendContinue(int control, const char *caller)
{
int rc = -1;
lxc_message_t msg = LXC_CONTINUE_MSG;
int writeCount = 0;
- VIR_DEBUG("Send continue on fd %d", control);
+ VIR_DEBUG("Send continue on fd %d by %s", control, caller);
writeCount = safewrite(control, &msg, sizeof(msg));
if (writeCount != sizeof(msg)) {
goto error_out;
@@ -377,6 +378,7 @@ error_out:
/**
* lxcContainerWaitForContinue:
* @control: Control FD from parent
+ * @caller: function invoker
*
* This function will wait for the container continue message from the
* parent process. It will send this message on the socket pair stored in
@@ -384,14 +386,14 @@ error_out:
*
* Returns 0 on success or -1 in case of error
*/
-int lxcContainerWaitForContinue(int control)
+int lxcContainerWaitForContinue(int control, const char *caller)
{
lxc_message_t msg;
int readLen;
- VIR_DEBUG("Wait continue on fd %d", control);
+ VIR_DEBUG("%s wait continue on fd %d", caller, control);
readLen = saferead(control, &msg, sizeof(msg));
- VIR_DEBUG("Got continue on fd %d %d", control, readLen);
+ VIR_DEBUG("%s got continue on fd %d %d", caller, control, readLen);
if (readLen != sizeof(msg)) {
if (readLen >= 0)
errno = EIO;
@@ -1813,7 +1815,7 @@ static int lxcContainerChild(void *data)
/* Wait for controller to finish setup tasks, including
* things like move of network interfaces, uid/gid mapping
*/
- if (lxcContainerWaitForContinue(argv->monitor) < 0) {
+ if (lxcContainerWaitForContinue(argv->monitor, __func__) < 0) {
virReportSystemError(errno, "%s",
_("Failed to read the container continue message"));
goto cleanup;
@@ -1880,7 +1882,7 @@ static int lxcContainerChild(void *data)
if (lxcContainerDropCapabilities(!!hasReboot) < 0)
goto cleanup;
- if (lxcContainerSendContinue(argv->handshakefd) < 0) {
+ if (lxcContainerSendContinue(argv->handshakefd, __func__) < 0) {
virReportSystemError(errno, "%s",
_("Failed to send continue signal to controller"));
goto cleanup;
diff --git a/src/lxc/lxc_container.h b/src/lxc/lxc_container.h
index e74a7d7..77fb2a0 100644
--- a/src/lxc/lxc_container.h
+++ b/src/lxc/lxc_container.h
@@ -49,8 +49,8 @@ enum {
# define LXC_DEV_MAJ_FUSE 10
# define LXC_DEV_MIN_FUSE 229
-int lxcContainerSendContinue(int control);
-int lxcContainerWaitForContinue(int control);
+int lxcContainerSendContinue(int control, const char *caller);
+int lxcContainerWaitForContinue(int control, const char *caller);
int lxcContainerStart(virDomainDefPtr def,
virSecurityManagerPtr securityDriver,
diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
index 851a773..25dbbec 100644
--- a/src/lxc/lxc_controller.c
+++ b/src/lxc/lxc_controller.c
@@ -319,7 +319,7 @@ static int virLXCControllerConsoleSetNonblocking(virLXCControllerConsolePtr cons
static int virLXCControllerDaemonHandshake(virLXCControllerPtr ctrl)
{
- if (lxcContainerSendContinue(ctrl->handshakeFd) < 0) {
+ if (lxcContainerSendContinue(ctrl->handshakeFd, __func__) < 0) {
virReportSystemError(errno, "%s",
_("error sending continue signal to daemon"));
return -1;
@@ -2176,13 +2176,13 @@ virLXCControllerRun(virLXCControllerPtr ctrl)
if (virLXCControllerMoveInterfaces(ctrl) < 0)
goto cleanup;
- if (lxcContainerSendContinue(control[0]) < 0) {
+ if (lxcContainerSendContinue(control[0], __func__) < 0) {
virReportSystemError(errno, "%s",
_("Unable to send container continue message"));
goto cleanup;
}
- if (lxcContainerWaitForContinue(containerhandshake[0]) < 0) {
+ if (lxcContainerWaitForContinue(containerhandshake[0], __func__) < 0) {
virReportSystemError(errno, "%s",
_("error receiving signal from container"));
goto cleanup;
diff --git a/src/lxc/lxc_process.c b/src/lxc/lxc_process.c
index f088e8e..de20dd0 100644
--- a/src/lxc/lxc_process.c
+++ b/src/lxc/lxc_process.c
@@ -1264,7 +1264,7 @@ int virLXCProcessStart(virConnectPtr conn,
if (virAtomicIntInc(&driver->nactive) == 1 && driver->inhibitCallback)
driver->inhibitCallback(true, driver->inhibitOpaque);
- if (lxcContainerWaitForContinue(handshakefds[0]) < 0) {
+ if (lxcContainerWaitForContinue(handshakefds[0], __func__) < 0) {
char out[1024];
if (!(virLXCProcessReadLogOutput(vm, logfile, pos, out, 1024) < 0)) {
--
1.8.2.1
11 years, 1 month
[libvirt] [PATCH] MacOS: Re-add support for QEMU backend
by Doug Goldstein
The QEMU backend was disabled on Mac OS X without a reason in the code
and due to refactors its difficult to understand when/why it was
disabled. With QEMU being supported on Mac OS X there is no reason to
disable QEMU on this platform.
---
configure.ac | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/configure.ac b/configure.ac
index 1c5b168..f519cbe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -191,10 +191,6 @@ if test $with_freebsd = yes; then
with_firewalld=no
fi
-if test $with_osx = yes; then
- with_qemu=no
-fi
-
AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"])
AM_CONDITIONAL([WITH_FREEBSD], [test "$with_freebsd" = "yes"])
@@ -2393,7 +2389,7 @@ fi
AM_CONDITIONAL([WITH_INTERFACE], [test "$with_interface" = "yes"])
-if test $with_freebsd = yes; then
+if test $with_freebsd = yes || test $with_osx = yes; then
default_qemu_user=root
default_qemu_group=wheel
else
--
1.8.1.5
11 years, 1 month
[libvirt] [PATCH] Add '+' to uid/gid printing for label processing
by John Ferlan
To ensure proper processing by virGetUserID() and virGetGroupID()
of a uid/gid add a "+" prior to the uid/gid to denote it's really
a uid/gid for the label.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
src/security/security_dac.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/security/security_dac.c b/src/security/security_dac.c
index 019c789..cb7d322 100644
--- a/src/security/security_dac.c
+++ b/src/security/security_dac.c
@@ -60,7 +60,7 @@ virSecurityDACSetUserAndGroup(virSecurityManagerPtr mgr,
priv->user = user;
priv->group = group;
- if (virAsprintf(&priv->baselabel, "%u:%u",
+ if (virAsprintf(&priv->baselabel, "+%u:+%u",
(unsigned int) user,
(unsigned int) group) < 0)
return -1;
@@ -1064,7 +1064,7 @@ virSecurityDACGenLabel(virSecurityManagerPtr mgr,
}
break;
case VIR_DOMAIN_SECLABEL_DYNAMIC:
- if (virAsprintf(&seclabel->label, "%u:%u",
+ if (virAsprintf(&seclabel->label, "+%u:+%u",
(unsigned int) priv->user,
(unsigned int) priv->group) < 0)
return rc;
--
1.8.3.1
11 years, 1 month
[libvirt] [PATCH] storage: fix incorrect typedef
by Eric Blake
The rbd code had a confusing typedef ending in Ptr that was not
actually a pointer, which made the rest of the code harder to
read. This fixes things to actually pass by pointer rather than
by copy.
* src/storage/storage_backend_rbd.c (virStorageBackendStatePtr):
Fix typedef.
(virStorageBackendRBDOpenRADOSConn)
(virStorageBackendRBDCloseRADOSConn)
(volStorageBackendRBDRefreshVolInfo)
(virStorageBackendRBDRefreshPool, virStorageBackendRBDDeleteVol)
(virStorageBackendRBDCreateVol, virStorageBackendRBDRefreshVol)
(virStorageBackendRBDResizeVol): Fix fallout.
Signed-off-by: Eric Blake <eblake(a)redhat.com>
---
A quick git grep found no other instances of a '...Ptr' typedef
that wasn't actually a pointer; but I can also add a syntax check
to prevent that mistake if desired.
src/storage/storage_backend_rbd.c | 46 +++++++++++++++++++--------------------
1 file changed, 23 insertions(+), 23 deletions(-)
diff --git a/src/storage/storage_backend_rbd.c b/src/storage/storage_backend_rbd.c
index 60b48c2..4e18bf9 100644
--- a/src/storage/storage_backend_rbd.c
+++ b/src/storage/storage_backend_rbd.c
@@ -44,9 +44,9 @@ struct _virStorageBackendRBDState {
};
typedef struct _virStorageBackendRBDState virStorageBackendRBDState;
-typedef virStorageBackendRBDState virStorageBackendRBDStatePtr;
+typedef virStorageBackendRBDState *virStorageBackendRBDStatePtr;
-static int virStorageBackendRBDOpenRADOSConn(virStorageBackendRBDStatePtr *ptr,
+static int virStorageBackendRBDOpenRADOSConn(virStorageBackendRBDStatePtr ptr,
virConnectPtr conn,
virStoragePoolObjPtr pool)
{
@@ -223,21 +223,21 @@ static int virStorageBackendRBDCloseRADOSConn(virStorageBackendRBDStatePtr ptr)
{
int ret = 0;
- if (ptr.ioctx != NULL) {
+ if (ptr->ioctx != NULL) {
VIR_DEBUG("Closing RADOS IoCTX");
- rados_ioctx_destroy(ptr.ioctx);
+ rados_ioctx_destroy(ptr->ioctx);
ret = -1;
}
- ptr.ioctx = NULL;
+ ptr->ioctx = NULL;
- if (ptr.cluster != NULL) {
+ if (ptr->cluster != NULL) {
VIR_DEBUG("Closing RADOS connection");
- rados_shutdown(ptr.cluster);
+ rados_shutdown(ptr->cluster);
ret = -2;
}
- ptr.cluster = NULL;
+ ptr->cluster = NULL;
- time_t runtime = time(0) - ptr.starttime;
+ time_t runtime = time(0) - ptr->starttime;
VIR_DEBUG("RADOS connection existed for %ld seconds", runtime);
return ret;
@@ -249,7 +249,7 @@ static int volStorageBackendRBDRefreshVolInfo(virStorageVolDefPtr vol,
{
int ret = -1;
rbd_image_t image;
- if (rbd_open(ptr.ioctx, vol->name, &image, NULL) < 0) {
+ if (rbd_open(ptr->ioctx, vol->name, &image, NULL) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to open the RBD image '%s'"),
vol->name);
@@ -298,7 +298,7 @@ static int virStorageBackendRBDRefreshPool(virConnectPtr conn,
int ret = -1;
int len = -1;
char *name, *names = NULL;
- virStorageBackendRBDStatePtr ptr;
+ virStorageBackendRBDState ptr;
ptr.cluster = NULL;
ptr.ioctx = NULL;
@@ -373,7 +373,7 @@ static int virStorageBackendRBDRefreshPool(virConnectPtr conn,
name += strlen(name) + 1;
- if (volStorageBackendRBDRefreshVolInfo(vol, pool, ptr) < 0) {
+ if (volStorageBackendRBDRefreshVolInfo(vol, pool, &ptr) < 0) {
virStorageVolDefFree(vol);
goto cleanup;
}
@@ -388,7 +388,7 @@ static int virStorageBackendRBDRefreshPool(virConnectPtr conn,
cleanup:
VIR_FREE(names);
- virStorageBackendRBDCloseRADOSConn(ptr);
+ virStorageBackendRBDCloseRADOSConn(&ptr);
return ret;
}
@@ -398,7 +398,7 @@ static int virStorageBackendRBDDeleteVol(virConnectPtr conn,
unsigned int flags)
{
int ret = -1;
- virStorageBackendRBDStatePtr ptr;
+ virStorageBackendRBDState ptr;
ptr.cluster = NULL;
ptr.ioctx = NULL;
@@ -431,7 +431,7 @@ static int virStorageBackendRBDDeleteVol(virConnectPtr conn,
ret = 0;
cleanup:
- virStorageBackendRBDCloseRADOSConn(ptr);
+ virStorageBackendRBDCloseRADOSConn(&ptr);
return ret;
}
@@ -439,7 +439,7 @@ static int virStorageBackendRBDCreateVol(virConnectPtr conn,
virStoragePoolObjPtr pool,
virStorageVolDefPtr vol)
{
- virStorageBackendRBDStatePtr ptr;
+ virStorageBackendRBDState ptr;
ptr.cluster = NULL;
ptr.ioctx = NULL;
int order = 0;
@@ -475,14 +475,14 @@ static int virStorageBackendRBDCreateVol(virConnectPtr conn,
goto cleanup;
}
- if (volStorageBackendRBDRefreshVolInfo(vol, pool, ptr) < 0) {
+ if (volStorageBackendRBDRefreshVolInfo(vol, pool, &ptr) < 0) {
goto cleanup;
}
ret = 0;
cleanup:
- virStorageBackendRBDCloseRADOSConn(ptr);
+ virStorageBackendRBDCloseRADOSConn(&ptr);
return ret;
}
@@ -490,7 +490,7 @@ static int virStorageBackendRBDRefreshVol(virConnectPtr conn,
virStoragePoolObjPtr pool ATTRIBUTE_UNUSED,
virStorageVolDefPtr vol)
{
- virStorageBackendRBDStatePtr ptr;
+ virStorageBackendRBDState ptr;
ptr.cluster = NULL;
ptr.ioctx = NULL;
int ret = -1;
@@ -507,14 +507,14 @@ static int virStorageBackendRBDRefreshVol(virConnectPtr conn,
goto cleanup;
}
- if (volStorageBackendRBDRefreshVolInfo(vol, pool, ptr) < 0) {
+ if (volStorageBackendRBDRefreshVolInfo(vol, pool, &ptr) < 0) {
goto cleanup;
}
ret = 0;
cleanup:
- virStorageBackendRBDCloseRADOSConn(ptr);
+ virStorageBackendRBDCloseRADOSConn(&ptr);
return ret;
}
@@ -524,7 +524,7 @@ static int virStorageBackendRBDResizeVol(virConnectPtr conn ATTRIBUTE_UNUSED,
unsigned long long capacity,
unsigned int flags)
{
- virStorageBackendRBDStatePtr ptr;
+ virStorageBackendRBDState ptr;
ptr.cluster = NULL;
ptr.ioctx = NULL;
rbd_image_t image = NULL;
@@ -563,7 +563,7 @@ static int virStorageBackendRBDResizeVol(virConnectPtr conn ATTRIBUTE_UNUSED,
cleanup:
if (image != NULL)
rbd_close(image);
- virStorageBackendRBDCloseRADOSConn(ptr);
+ virStorageBackendRBDCloseRADOSConn(&ptr);
return ret;
}
--
1.8.3.1
11 years, 1 month
[libvirt] [PATCH] apparmor: Fix typo in function name in driver struct initialization
by Peter Krempa
Commit 64a68a4a introduced a typo in the initialization of the apparmor
driver structure breaking the build with apparmor enabled.
---
src/security/security_apparmor.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/security/security_apparmor.c b/src/security/security_apparmor.c
index 776a470..a9f04d2 100644
--- a/src/security/security_apparmor.c
+++ b/src/security/security_apparmor.c
@@ -979,5 +979,5 @@ virSecurityDriver virAppArmorSecurityDriver = {
.domainGetSecurityMountOptions = AppArmorGetMountOptions,
- .getBaseLabel = AppArmoryGetBaseLabel,
+ .getBaseLabel = AppArmorGetBaseLabel,
};
--
1.8.3.2
11 years, 1 month
[libvirt] [PATCH] LXC: don't free tty before using it in lxcContainerSetupDevices
by Gao feng
Signed-off-by: Gao feng <gaofeng(a)cn.fujitsu.com>
---
.gnulib | 2 +-
src/lxc/lxc_container.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/.gnulib b/.gnulib
index 8f74258..4a5ee89 160000
--- a/.gnulib
+++ b/.gnulib
@@ -1 +1 @@
-Subproject commit 8f7425866463f994538584d1dd7211603b8b0550
+Subproject commit 4a5ee89c8a8be7350a8fd8ca1bacb196a190e492
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index 1ec59d5..255c711 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -1042,10 +1042,10 @@ static int lxcContainerSetupDevices(char **ttyPaths, size_t nttyPaths)
if (virAsprintf(&tty, "/dev/tty%zu", i+1) < 0)
return -1;
if (symlink(ttyPaths[i], tty) < 0) {
- VIR_FREE(tty);
virReportSystemError(errno,
_("Failed to symlink %s to %s"),
ttyPaths[i], tty);
+ VIR_FREE(tty);
return -1;
}
VIR_FREE(tty);
--
1.8.3.1
11 years, 1 month
[libvirt] [PATCH v2] Fix race condition reconnecting to vms & loading configs
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
The following sequence
1. Define a persistent QMEU guest
2. Start the QEMU guest
3. Stop libvirtd
4. Kill the QEMU process
5. Start libvirtd
6. List persistent guets
At the last step, the previously running persistent guest
will be missing. This is because of a race condition in the
QEMU driver startup code. It does
1. Load all VM state files
2. Spawn thread to reconnect to each VM
3. Load all VM config files
Only at the end of step 3, does the 'virDomainObjPtr' get
marked as "persistent". There is therefore a window where
the thread reconnecting to the VM will remove the persistent
VM from the list.
The easy fix is to simply switch the order of steps 2 & 3.
In addition to this though, we must only attempt to reconnect
to a VM which had a non-zero PID loaded from its state file.
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/qemu/qemu_driver.c | 3 +--
src/qemu/qemu_process.c | 3 +++
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index c613967..9c3daad 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -816,8 +816,6 @@ qemuStateInitialize(bool privileged,
conn = virConnectOpen(cfg->uri);
- qemuProcessReconnectAll(conn, qemu_driver);
-
/* Then inactive persistent configs */
if (virDomainObjListLoadAllConfigs(qemu_driver->domains,
cfg->configDir,
@@ -828,6 +826,7 @@ qemuStateInitialize(bool privileged,
NULL, NULL) < 0)
goto error;
+ qemuProcessReconnectAll(conn, qemu_driver);
virDomainObjListForEach(qemu_driver->domains,
qemuDomainSnapshotLoad,
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index b278742..bdffdf8 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3253,6 +3253,9 @@ qemuProcessReconnectHelper(virDomainObjPtr obj,
struct qemuProcessReconnectData *src = opaque;
struct qemuProcessReconnectData *data;
+ if (!obj->pid)
+ return 0;
+
if (VIR_ALLOC(data) < 0)
return -1;
--
1.8.3.1
11 years, 1 month
[libvirt] [PATCH] Fix leak of objects when reconnecting to QEMU instances
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
The 'error' cleanup block in qemuProcessReconnect() had a
'return' statement in the middle of it. This caused a leak
of virConnectPtr & virQEMUDriverConfigPtr instances. This
was identified because netcf recently started checking its
refcount in libvirtd shutdown:
netcfStateCleanup:109 : internal error: Attempt to close netcf state driver with open connections
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
src/qemu/qemu_process.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index 354e079..b278742 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3219,10 +3219,7 @@ error:
if (!virDomainObjIsActive(obj)) {
if (virObjectUnref(obj))
virObjectUnlock(obj);
- return;
- }
-
- if (virObjectUnref(obj)) {
+ } else if (virObjectUnref(obj)) {
/* We can't get the monitor back, so must kill the VM
* to remove danger of it ending up running twice if
* user tries to start it again later
--
1.8.3.1
11 years, 1 month
[libvirt] [PATCH] Push RPM deps down into libvirt-daemon-driver-XXXX sub-RPMs
by Daniel P. Berrange
From: "Daniel P. Berrange" <berrange(a)redhat.com>
For inexplicable reasons, many of the 3rd party package deps
were left against the 'libvirt-daemon' RPM when the drivers
were split out. This makes a minimal install heavier that
it should be. Push them all down into libvirt-daemon-driver-XXX
so they're only pulled in when truely needed
With this change applied, a minimal install of just the
libvirt-daemon-driver-lxc RPM is reduced by 41 MB on a
Fedora 19 host.
Fedora cloud team has requested that we cut down minimal
libvirt install size as much as is possible. Fixing these
deps is the biggest win without coding work, per:
https://bugzilla.redhat.com/show_bug.cgi?id=1012198
Signed-off-by: Daniel P. Berrange <berrange(a)redhat.com>
---
libvirt.spec.in | 135 +++++++++++++++++++++++++++-----------------------------
1 file changed, 66 insertions(+), 69 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index fb4d46f..48feea5 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -657,31 +657,6 @@ Requires: avahi
Requires: avahi-libs
%endif
%endif
- %if %{with_network}
-Requires: dnsmasq >= 2.41
-Requires: radvd
- %endif
- %if %{with_network} || %{with_nwfilter}
-Requires: iptables
-Requires: iptables-ipv6
- %endif
- %if %{with_nwfilter}
-Requires: ebtables
- %endif
- %if %{with_netcf} && (0%{?fedora} >= 18 || 0%{?rhel} >= 7)
-Requires: netcf-libs >= 0.2.2
- %endif
-# needed for device enumeration
- %if %{with_hal}
-Requires: hal
- %endif
- %if %{with_udev}
- %if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
-Requires: systemd >= 185
- %else
-Requires: udev >= 145
- %endif
- %endif
%if %{with_polkit}
%if 0%{?fedora} >= 12 || 0%{?rhel} >=6
Requires: polkit >= 0.93
@@ -689,50 +664,6 @@ Requires: polkit >= 0.93
Requires: PolicyKit >= 0.6
%endif
%endif
- %if %{with_storage_fs}
-Requires: nfs-utils
-# For mkfs
-Requires: util-linux
-# For glusterfs
- %if 0%{?fedora} >= 11
-Requires: glusterfs-client >= 2.0.1
- %endif
- %endif
- %if %{with_qemu}
-# From QEMU RPMs
-Requires: /usr/bin/qemu-img
-# For image compression
-Requires: gzip
-Requires: bzip2
-Requires: lzop
-Requires: xz
- %else
- %if %{with_xen}
-# From Xen RPMs
-Requires: /usr/sbin/qcow-create
- %endif
- %endif
- %if %{with_storage_lvm}
-# For LVM drivers
-Requires: lvm2
- %endif
- %if %{with_storage_iscsi}
-# For ISCSI driver
-Requires: iscsi-initiator-utils
- %endif
- %if %{with_storage_disk}
-# For disk driver
-Requires: parted
-Requires: device-mapper
- %endif
- %if %{with_storage_mpath}
-# For multipath support
-Requires: device-mapper
- %endif
- %if %{with_storage_sheepdog}
-# For Sheepdog support
-Requires: sheepdog
- %endif
%if %{with_cgconfig}
Requires: libcgroup
%endif
@@ -788,6 +719,10 @@ Network filter configuration files for cleaning guest traffic
Summary: Network driver plugin for the libvirtd daemon
Group: Development/Libraries
Requires: libvirt-daemon = %{version}-%{release}
+Requires: dnsmasq >= 2.41
+Requires: radvd
+Requires: iptables
+Requires: iptables-ipv6
%description daemon-driver-network
The network driver plugin for the libvirtd daemon, providing
@@ -801,6 +736,9 @@ bridge capabilities.
Summary: Nwfilter driver plugin for the libvirtd daemon
Group: Development/Libraries
Requires: libvirt-daemon = %{version}-%{release}
+Requires: iptables
+Requires: iptables-ipv6
+Requires: ebtables
%description daemon-driver-nwfilter
The nwfilter driver plugin for the libvirtd daemon, providing
@@ -814,6 +752,17 @@ iptables and ip6tables capabilities
Summary: Nodedev driver plugin for the libvirtd daemon
Group: Development/Libraries
Requires: libvirt-daemon = %{version}-%{release}
+# needed for device enumeration
+ %if %{with_hal}
+Requires: hal
+ %endif
+ %if %{with_udev}
+ %if 0%{?fedora} >= 18 || 0%{?rhel} >= 7
+Requires: systemd >= 185
+ %else
+Requires: udev >= 145
+ %endif
+ %endif
%description daemon-driver-nodedev
The nodedev driver plugin for the libvirtd daemon, providing
@@ -827,6 +776,9 @@ capabilities.
Summary: Interface driver plugin for the libvirtd daemon
Group: Development/Libraries
Requires: libvirt-daemon = %{version}-%{release}
+ %if %{with_netcf} && (0%{?fedora} >= 18 || 0%{?rhel} >= 7)
+Requires: netcf-libs >= 0.2.2
+ %endif
%description daemon-driver-interface
The interface driver plugin for the libvirtd daemon, providing
@@ -850,6 +802,45 @@ an implementation of the secret key APIs.
Summary: Storage driver plugin for the libvirtd daemon
Group: Development/Libraries
Requires: libvirt-daemon = %{version}-%{release}
+ %if %{with_storage_fs}
+Requires: nfs-utils
+# For mkfs
+Requires: util-linux
+# For glusterfs
+ %if 0%{?fedora} >= 11
+Requires: glusterfs-client >= 2.0.1
+ %endif
+ %endif
+ %if %{with_storage_lvm}
+# For LVM drivers
+Requires: lvm2
+ %endif
+ %if %{with_storage_iscsi}
+# For ISCSI driver
+Requires: iscsi-initiator-utils
+ %endif
+ %if %{with_storage_disk}
+# For disk driver
+Requires: parted
+Requires: device-mapper
+ %endif
+ %if %{with_storage_mpath}
+# For multipath support
+Requires: device-mapper
+ %endif
+ %if %{with_storage_sheepdog}
+# For Sheepdog support
+Requires: sheepdog
+ %endif
+ %if %{with_qemu}
+# From QEMU RPMs
+Requires: /usr/bin/qemu-img
+ %else
+ %if %{with_xen}
+# From Xen RPMs
+Requires: /usr/sbin/qcow-create
+ %endif
+ %endif
%description daemon-driver-storage
The storage driver plugin for the libvirtd daemon, providing
@@ -865,6 +856,12 @@ Group: Development/Libraries
Requires: libvirt-daemon = %{version}-%{release}
# There really is a hard cross-driver dependency here
Requires: libvirt-daemon-driver-network = %{version}-%{release}
+Requires: /usr/bin/qemu-img
+# For image compression
+Requires: gzip
+Requires: bzip2
+Requires: lzop
+Requires: xz
%description daemon-driver-qemu
The qemu driver plugin for the libvirtd daemon, providing
--
1.8.3.1
11 years, 1 month