[libvirt] [PATCH] PHYP: Adding reboot domain function
by Eduardo Otubo
Adding reboot <domain> function for pHyp driver.
---
src/phyp/phyp_driver.c | 35 ++++++++++++++++++++++++++++++++++-
1 files changed, 34 insertions(+), 1 deletions(-)
diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
index bb0e0ac..228751d 100644
--- a/src/phyp/phyp_driver.c
+++ b/src/phyp/phyp_driver.c
@@ -3384,6 +3384,39 @@ cleanup:
}
static int
+phypDomainReboot(virDomainPtr dom)
+{
+ int result = -1;
+ ConnectionData *connection_data = dom->conn->networkPrivateData;
+ virConnectPtr conn = dom->conn;
+ LIBSSH2_SESSION *session = connection_data->session;
+ phyp_driverPtr phyp_driver = conn->privateData;
+ int system_type = phyp_driver->system_type;
+ char *managed_system = phyp_driver->managed_system;
+ int exit_status = 0;
+ char *ret = NULL;
+ virBuffer buf = VIR_BUFFER_INITIALIZER;
+
+ virBufferAddLit(&buf, "chsysstate");
+ if (system_type == HMC)
+ virBufferVSprintf(&buf, " -m %s", managed_system);
+ virBufferVSprintf(&buf,
+ " -r lpar -o shutdown --id %d --immed --restart",
+ dom->id);
+ ret = phypExecBuffer(session, &buf, &exit_status, dom->conn, false);
+
+ if (exit_status < 0)
+ goto cleanup;
+
+ result = 0;
+
+ cleanup:
+ VIR_FREE(ret);
+
+ return result;
+}
+
+static int
phypDomainShutdown(virDomainPtr dom)
{
int result = -1;
@@ -3707,7 +3740,7 @@ static virDriver phypDriver = {
NULL, /* domainSuspend */
phypDomainResume, /* domainResume */
phypDomainShutdown, /* domainShutdown */
- NULL, /* domainReboot */
+ phypDomainReboot, /* domainReboot */
phypDomainDestroy, /* domainDestroy */
NULL, /* domainGetOSType */
NULL, /* domainGetMaxMemory */
--
1.7.1
13 years, 7 months
[libvirt] [PATCH] esx: Add a wrapper for shared CURL handles
by Matthias Bolte
To be used to share a CURL handle between multiple threads in the
upcoming domain event support.
---
src/esx/esx_vi.c | 176 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
src/esx/esx_vi.h | 19 ++++++
2 files changed, 195 insertions(+), 0 deletions(-)
diff --git a/src/esx/esx_vi.c b/src/esx/esx_vi.c
index 2fd09cd..84ff2e2 100644
--- a/src/esx/esx_vi.c
+++ b/src/esx/esx_vi.c
@@ -85,6 +85,16 @@ ESX_VI__TEMPLATE__ALLOC(CURL)
/* esxVI_CURL_Free */
ESX_VI__TEMPLATE__FREE(CURL,
{
+ esxVI_SharedCURL *shared = item->shared;
+
+ if (shared != NULL) {
+ esxVI_SharedCURL_Remove(shared, item);
+
+ if (shared->count == 0) {
+ esxVI_SharedCURL_Free(&shared);
+ }
+ }
+
if (item->handle != NULL) {
curl_easy_cleanup(item->handle);
}
@@ -418,6 +428,172 @@ esxVI_CURL_Upload(esxVI_CURL *curl, const char *url, const char *content)
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * SharedCURL
+ */
+
+static void
+esxVI_SharedCURL_Lock(CURL *handle ATTRIBUTE_UNUSED, curl_lock_data data,
+ curl_lock_access access_ ATTRIBUTE_UNUSED, void *userptr)
+{
+ int i;
+ esxVI_SharedCURL *shared = userptr;
+
+ switch (data) {
+ case CURL_LOCK_DATA_SHARE:
+ i = 0;
+ break;
+
+ case CURL_LOCK_DATA_COOKIE:
+ i = 1;
+ break;
+
+ case CURL_LOCK_DATA_DNS:
+ i = 2;
+ break;
+
+ default:
+ VIR_ERROR(_("Trying to lock unknown SharedCURL lock %d"), (int)data);
+ return;
+ }
+
+ virMutexLock(&shared->locks[i]);
+}
+
+static void
+esxVI_SharedCURL_Unlock(CURL *handle ATTRIBUTE_UNUSED, curl_lock_data data,
+ void *userptr)
+{
+ int i;
+ esxVI_SharedCURL *shared = userptr;
+
+ switch (data) {
+ case CURL_LOCK_DATA_SHARE:
+ i = 0;
+ break;
+
+ case CURL_LOCK_DATA_COOKIE:
+ i = 1;
+ break;
+
+ case CURL_LOCK_DATA_DNS:
+ i = 2;
+ break;
+
+ default:
+ VIR_ERROR(_("Trying to unlock unknown SharedCURL lock %d"), (int)data);
+ return;
+ }
+
+ virMutexUnlock(&shared->locks[i]);
+}
+
+/* esxVI_SharedCURL_Alloc */
+ESX_VI__TEMPLATE__ALLOC(SharedCURL)
+
+/* esxVI_SharedCURL_Free */
+ESX_VI__TEMPLATE__FREE(SharedCURL,
+{
+ int i;
+
+ if (item->count > 0) {
+ /* Better leak than crash */
+ VIR_ERROR0(_("Trying to free SharedCURL object that is still in use"));
+ return;
+ }
+
+ if (item->handle != NULL) {
+ curl_share_cleanup(item->handle);
+ }
+
+ for (i = 0; i < ARRAY_CARDINALITY(item->locks); ++i) {
+ virMutexDestroy(&item->locks[i]);
+ }
+})
+
+int
+esxVI_SharedCURL_Add(esxVI_SharedCURL *shared, esxVI_CURL *curl)
+{
+ int i;
+
+ if (curl->handle == NULL) {
+ ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot share uninitialized CURL handle"));
+ return -1;
+ }
+
+ if (curl->shared != NULL) {
+ ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot share CURL handle that is already shared"));
+ return -1;
+ }
+
+ if (shared->handle == NULL) {
+ shared->handle = curl_share_init();
+
+ if (shared->handle == NULL) {
+ ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Could not initialize CURL (share)"));
+ return -1;
+ }
+
+ curl_share_setopt(shared->handle, CURLSHOPT_LOCKFUNC,
+ esxVI_SharedCURL_Lock);
+ curl_share_setopt(shared->handle, CURLSHOPT_UNLOCKFUNC,
+ esxVI_SharedCURL_Unlock);
+ curl_share_setopt(shared->handle, CURLSHOPT_USERDATA, shared);
+ curl_share_setopt(shared->handle, CURLSHOPT_SHARE,
+ CURL_LOCK_DATA_COOKIE);
+ curl_share_setopt(shared->handle, CURLSHOPT_SHARE,
+ CURL_LOCK_DATA_DNS);
+
+ for (i = 0; i < ARRAY_CARDINALITY(shared->locks); ++i) {
+ if (virMutexInit(&shared->locks[i]) < 0) {
+ ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Could not initialize a CURL (share) mutex"));
+ return -1;
+ }
+ }
+ }
+
+ curl_easy_setopt(curl->handle, CURLOPT_SHARE, shared->handle);
+
+ curl->shared = shared;
+ ++shared->count;
+
+ return 0;
+}
+
+int
+esxVI_SharedCURL_Remove(esxVI_SharedCURL *shared, esxVI_CURL *curl)
+{
+ if (curl->handle == NULL) {
+ ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot unshare uninitialized CURL handle"));
+ return -1;
+ }
+
+ if (curl->shared == NULL) {
+ ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s",
+ _("Cannot unshare CURL handle that is not shared"));
+ return -1;
+ }
+
+ if (curl->shared != shared) {
+ ESX_VI_ERROR(VIR_ERR_INTERNAL_ERROR, "%s", _("CURL (share) mismatch"));
+ return -1;
+ }
+
+ curl_easy_setopt(curl->handle, CURLOPT_SHARE, NULL);
+
+ curl->shared = NULL;
+ --shared->count;
+
+ return 0;
+}
+
+
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Context
*/
diff --git a/src/esx/esx_vi.h b/src/esx/esx_vi.h
index 57788ac..560b2a6 100644
--- a/src/esx/esx_vi.h
+++ b/src/esx/esx_vi.h
@@ -83,6 +83,7 @@ typedef enum _esxVI_ProductVersion esxVI_ProductVersion;
typedef enum _esxVI_Occurrence esxVI_Occurrence;
typedef struct _esxVI_ParsedHostCpuIdInfo esxVI_ParsedHostCpuIdInfo;
typedef struct _esxVI_CURL esxVI_CURL;
+typedef struct _esxVI_SharedCURL esxVI_SharedCURL;
typedef struct _esxVI_Context esxVI_Context;
typedef struct _esxVI_Response esxVI_Response;
typedef struct _esxVI_Enumeration esxVI_Enumeration;
@@ -151,6 +152,7 @@ struct _esxVI_CURL {
virMutex lock;
struct curl_slist *headers;
char error[CURL_ERROR_SIZE];
+ esxVI_SharedCURL *shared;
};
int esxVI_CURL_Alloc(esxVI_CURL **curl);
@@ -162,6 +164,23 @@ int esxVI_CURL_Upload(esxVI_CURL *curl, const char *url, const char *content);
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * SharedCURL
+ */
+
+struct _esxVI_SharedCURL {
+ CURLSH *handle;
+ virMutex locks[3]; /* share, cookie, dns */
+ size_t count;
+};
+
+int esxVI_SharedCURL_Alloc(esxVI_SharedCURL **shared);
+void esxVI_SharedCURL_Free(esxVI_SharedCURL **shared);
+int esxVI_SharedCURL_Add(esxVI_SharedCURL *shared, esxVI_CURL *curl);
+int esxVI_SharedCURL_Remove(esxVI_SharedCURL *shared, esxVI_CURL *curl);
+
+
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Context
*/
--
1.7.0.4
13 years, 7 months
[libvirt] [PATCH 0/6] virObject for reference-counting
by Hu Tao
This series adds a virObject structure that manages reference-counting.
Some notes about referece-counting introduced by this series:
A thread owns a virObject by incrementing its reference-count by 1.
If a thread owns a virObject, the virObject is guarenteed not be
freed until the thread releases ownership by decrementing its
reference-count by 1. A thread can't access a virObject after it
releases the ownership of virObject because it can be freed at
anytime.
A thread can own a virObject legally in these ways:
- a thread owns a virObject that it creates.
- a thread owns a virObject if another thread passes the ownership
to it. Example: qemuMonitorOpen
- a thread gets a virObject from a container.
Example: virDomainFindByUUID
- a container owns a virObject by incrementing its reference-count
by 1 before adding it to the container
- if a virObject is removed from a container its reference-count
must be decremented by 1
By following these rules, there is no need to protect operations on
an object's reference-count by an external lock. (like in old ways
virDomainObj lock protects qemu monitor's ref-count.)
This series is a draft and posted for early review. Any comments are
welcome.
Hu Tao (6):
Add virObject and virAtomic.
use virObject to manage reference-count of qemud_client
use virObject to manage reference-count of virDomainObj
qemu: use virObject to manages reference-counting for qemu monitor
remove qemuDomainObjEnterMonitorWithDriver and
qemuDomainObjExitMonitorWithDriver
remove qemuDomainObjBeginJobWithDriver
daemon/dispatch.c | 2 -
daemon/libvirtd.c | 62 ++++++--
daemon/libvirtd.h | 5 +-
src/Makefile.am | 2 +
src/conf/domain_conf.c | 56 ++++----
src/conf/domain_conf.h | 6 +-
src/libvirt_private.syms | 5 +
src/openvz/openvz_conf.c | 8 +-
src/qemu/qemu_domain.c | 121 +--------------
src/qemu/qemu_domain.h | 8 +-
src/qemu/qemu_driver.c | 358 ++++++++++++++++++++-------------------------
src/qemu/qemu_hotplug.c | 90 ++++++------
src/qemu/qemu_migration.c | 101 ++++++-------
src/qemu/qemu_monitor.c | 109 ++++++++-------
src/qemu/qemu_monitor.h | 4 +-
src/qemu/qemu_process.c | 99 ++++++-------
src/util/viratomic.c | 46 ++++++
src/util/viratomic.h | 30 ++++
src/util/virobject.c | 52 +++++++
src/util/virobject.h | 39 +++++
src/vmware/vmware_conf.c | 2 +-
21 files changed, 628 insertions(+), 577 deletions(-)
create mode 100644 src/util/viratomic.c
create mode 100644 src/util/viratomic.h
create mode 100644 src/util/virobject.c
create mode 100644 src/util/virobject.h
--
1.7.3.1
13 years, 7 months
[libvirt] libvirt and virsh logging
by Supriya Kannery
I am trying to get virsh commands with timestamp logged into a file
along with logs collected from libvirt. Finding that virsh and libvirt
logs into separate log files. Please suggest on what could be a right
approach to get both virsh and libvirt logs into a single file.
Thanks,
Supriya
13 years, 7 months
[libvirt] Application Development Guide
by Guilherme Santos
Good morning!
I am one of the developers of OurGrid (http://www.ourgrid.org), a middleware
that enables the creation of peer-to-peer computational grids, and we are
studying your Libvirt API in order to see if it satisfies our middleware's
demands.
So we found out your Application Development Guide, and it is being quite
useful. I just found small mistakes in the code examples. Even though don't
know if this is the appropriate place to notify you guys, here you are:
At section 3.9, in the main function, the if block above:
if (conn4 == NULL) {
fprintf(stderr, "Failed to open connection to
qemu:///system\n");
virConnectClose(conn3);
virConnectClose(conn2);
virConnectClose(conn1);
return 3;
}
The 'return 3' was meant to be 'return 4', right?
And I guess that the final If block at section 4.3 is just missing a return
statement too.
With that being said, I want to take this opportunity to say that
documentation of section 9.3 (Java bindings) would be of great help to us,
since we are developing everything using Java.
Cheers and congratulations for this great job you guys are doing.
Moreover, sorry for my poor english.
Guilherme Santos
--
Guilherme Santos G. Baptista
Graduando em Ciência da Computação pela UFCG
LSD - Laboratório de Sistemas Distribuídos
13 years, 7 months
[libvirt] [libvirt-snmp][PATCH v5 0/4] Add SNMP trap/notification support
by Michal Privoznik
The fifth version.
In case we build against libvirt older than 0.9.0 (which have old event API),
we need to include some sources from libvirt git. So we are able to run even
on older RHELs, like 5.6. Those files were copied to our git and modified
very slighty.
Finally, we have a proof-of-concept implementation of SNMP trap.
Two new files were first generated using mib2c then edited, so be
careful when re-generating them.
Destination of traps is defined in snmpd.conf (trap2sink), and to
receive them snmptrapd must be configured and up.
The idea behind is - create a thread in which we poll for domain
events. Once we receive event notification, we just fire up
trap sending.
Michal Privoznik (4):
Add notification-type object to libvirt MIB
Add libvirt error handling function
Create functions to fill in and send notification packets.
Add SNMP trap/notification support.
INSTALL.1st | 9 +-
configure.ac | 17 +-
libvirt-snmp.spec.in | 7 +-
src/LIBVIRT-MIB.txt | 9 +
src/Makefile.am | 25 ++-
src/README.txt | 9 +-
src/event_poll.c | 724 ++++++++++++++++++++++++++++++++++++++++++++
src/event_poll.h | 132 ++++++++
src/ignore-value.h | 64 ++++
src/internal.h | 267 ++++++++++++++++
src/libvirtNotifications.c | 122 ++++++++
src/libvirtNotifications.h | 33 ++
src/libvirtSnmp.c | 154 +++++++++-
src/libvirtSnmpError.c | 34 ++
src/libvirtSnmpError.h | 31 ++
src/memory.c | 313 +++++++++++++++++++
src/memory.h | 212 +++++++++++++
src/threads.c | 251 +++++++++++++++
src/threads.h | 101 ++++++
src/util.c | 105 +++++++
src/util.h | 38 +++
21 files changed, 2643 insertions(+), 14 deletions(-)
create mode 100644 src/event_poll.c
create mode 100644 src/event_poll.h
create mode 100644 src/ignore-value.h
create mode 100644 src/internal.h
create mode 100644 src/libvirtNotifications.c
create mode 100644 src/libvirtNotifications.h
create mode 100644 src/libvirtSnmpError.c
create mode 100644 src/libvirtSnmpError.h
create mode 100644 src/memory.c
create mode 100644 src/memory.h
create mode 100644 src/threads.c
create mode 100644 src/threads.h
create mode 100644 src/util.c
create mode 100644 src/util.h
--
1.7.4.2
13 years, 7 months
[libvirt] [libvirt-php] Add libvirt_storagepool_build() function
by Lyre
also add flags for this function, currently not used.
---
src/libvirt-php.c | 31 +++++++++++++++++++++++++++++++
src/libvirt-php.h | 1 +
2 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/src/libvirt-php.c b/src/libvirt-php.c
index d436e1c..54331bb 100644
--- a/src/libvirt-php.c
+++ b/src/libvirt-php.c
@@ -129,6 +129,7 @@ static function_entry libvirt_functions[] = {
PHP_FE(libvirt_storagepool_refresh, NULL)
PHP_FE(libvirt_storagepool_set_autostart, NULL)
PHP_FE(libvirt_storagepool_get_autostart, NULL)
+ PHP_FE(libvirt_storagepool_build, NULL)
/* Network functions */
PHP_FE(libvirt_network_define_xml, NULL)
PHP_FE(libvirt_network_undefine, NULL)
@@ -542,6 +543,13 @@ PHP_MINIT_FUNCTION(libvirt)
/* Forcibly modify device (ex. force eject a cdrom) */
REGISTER_LONG_CONSTANT("VIR_DOMAIN_DEVICE_MODIFY_FORCE", 4, CONST_CS | CONST_PERSISTENT);
+ /* REGISTER_LONG_CONSTANT */
+ REGISTER_LONG_CONSTANT("VIR_STORAGE_POOL_BUILD_NEW", 0, CONST_CS | CONST_PERSISTENT);
+ /* Repair / reinitialize */
+ REGISTER_LONG_CONSTANT("VIR_STORAGE_POOL_BUILD_REPAIR", 1, CONST_CS | CONST_PERSISTENT);
+ /* Extend existing pool */
+ REGISTER_LONG_CONSTANT("VIR_STORAGE_POOL_BUILD_RESIZE", 2, CONST_CS | CONST_PERSISTENT);
+
REGISTER_INI_ENTRIES();
/* Initialize libvirt and set up error callback */
@@ -3582,6 +3590,29 @@ PHP_FUNCTION(libvirt_storagepool_get_autostart)
}
}
+/*
+ Function name: libvirt_storagepool_build
+ Since version: 0.4.2
+ Description: Function is used to Build the underlying storage pool, e.g. create the destination directory for NFS
+ Arguments: @res [resource]: libvirt storagepool resource
+ Returns: TRUE if success, FALSE on error
+*/
+PHP_FUNCTION(libvirt_storagepool_build)
+{
+ php_libvirt_storagepool *pool = NULL;
+ zval *zpool;
+ int flags = 0;
+
+ GET_STORAGEPOOL_FROM_ARGS ("r", &zpool);
+
+ if (virStoragePoolBuild (pool->pool, flags) == 0)
+ {
+ RETURN_TRUE;
+ }
+
+ RETURN_FALSE;
+}
+
/* Listing functions */
/*
Function name: libvirt_list_storagepools
diff --git a/src/libvirt-php.h b/src/libvirt-php.h
index 4e8dec6..2d79f60 100644
--- a/src/libvirt-php.h
+++ b/src/libvirt-php.h
@@ -193,6 +193,7 @@ PHP_FUNCTION(libvirt_storagepool_get_volume_count);
PHP_FUNCTION(libvirt_storagepool_refresh);
PHP_FUNCTION(libvirt_storagepool_set_autostart);
PHP_FUNCTION(libvirt_storagepool_get_autostart);
+PHP_FUNCTION(libvirt_storagepool_build);
/* Network functions */
PHP_FUNCTION(libvirt_network_define_xml);
PHP_FUNCTION(libvirt_network_undefine);
--
1.7.3.4
13 years, 7 months
[libvirt] [RFC][PATCHv1 0/5] libvirt - show per cpu accounting information
by KAMEZAWA Hiroyuki
When running 'virt-top -1' , "show percpu statistics mode",
virt-top shows a fake value.
When running 'while true; do echo hello;done' on a 4vcpu guest,
==
0 0.0
1 0.0
2 0.0
3 0.0
4 25.0 25.0=
5 25.0 25.0=#
6 25.0 25.0=
7 25.0 25.0=
==
All cpus just used equally ;)
This is because there is no interface to get per-cpu usage of domain.
This patch adds an interface virDomainPcpuStats() to get per-cpu
statistics, cpuTime in nanoseconds.
Here is a test result with a python script using new interface.
==
[root@bluextal python]# ./virt-cpuacct.py
({'cpuTime': 0L}, {'cpuTime': 0L}, {'cpuTime': 0L}, {'cpuTime': 0L}, {'cpuTime': 4679204346L}, {'cpuTime': 2103820380L}, {'cpuTime': 8904513019L}, {'cpuTime': 7424701195L})
[root@bluextal python]# ./virt-cpuacct.py
({'cpuTime': 0L}, {'cpuTime': 0L}, {'cpuTime': 0L}, {'cpuTime': 0L}, {'cpuTime': 57010689139L}, {'cpuTime': 26152907202L}, {'cpuTime': 53759693931L}, {'cpuTime': 43074348218L})
==
Although I added a new interface, I still wonder what interface is better...
any comments are welcome.
Thanks,
-Kame
13 years, 7 months
[libvirt] [PATCHv10 0/6] libvirt - support persistent device modification
by KAMEZAWA Hiroyuki
Hi, this is v10, totally refleshed. Thank you for advices.
This version includes Eric's cleanup and Hu's Update device works.
(And droppped some sanity check patches.)
Because of many changes from v9, it may be better to write [RFC] in subject ;)
This patch series does
consolidate Attach/Detach/Update device's codes as..
==
shared code (prepare lock, get objects etc..)
switch(action) {
case ATTACH
case DETACH
case UPDATE
}
shared code.
==
After that, adding persistent modification support as
==
shared code (prepare lock, get objects etc...)
if (MODIFY_CONFIG) {
switch (action) {
case ATTACH:
case DETACH:
case UPDATE:
}
}
if (MODIFY_LIVE) {
switch (action) {
case ATTACH:
case DETACH:
case UPDATE:
}
}
shared code. (save config etc.)
==
Thanks,
-Kame
13 years, 7 months
[libvirt] [PATCH] nwfilter: no support for direct type of interface
by Stefan Berger
Ebtables filtering doesn't work on macvtap device. Remove support for
direct type of interface.
Signed-off-by: Stefan Berger <stefanb(a)linux.vnet.ibm.com>
---
docs/formatnwfilter.html.in | 2 --
src/conf/domain_conf.c | 1 -
src/nwfilter/nwfilter_ebiptables_driver.c | 16 +---------------
3 files changed, 1 insertion(+), 18 deletions(-)
Index: libvirt-acl/src/conf/domain_conf.c
===================================================================
--- libvirt-acl.orig/src/conf/domain_conf.c
+++ libvirt-acl/src/conf/domain_conf.c
@@ -2862,7 +2862,6 @@ virDomainNetDefParseXML(virCapsPtr caps,
case VIR_DOMAIN_NET_TYPE_ETHERNET:
case VIR_DOMAIN_NET_TYPE_NETWORK:
case VIR_DOMAIN_NET_TYPE_BRIDGE:
- case VIR_DOMAIN_NET_TYPE_DIRECT:
def->filter = filter;
filter = NULL;
def->filterparams = filterparams;
Index: libvirt-acl/docs/formatnwfilter.html.in
===================================================================
--- libvirt-acl.orig/docs/formatnwfilter.html.in
+++ libvirt-acl/docs/formatnwfilter.html.in
@@ -52,8 +52,6 @@
<li><code>network</code></li>
<li><code>ethernet</code> -- must be used in bridging mode</li>
<li><code>bridge</code></li>
- <li><code>direct</code> -- only protocols mac, arp, ip and ipv6
- can be filtered</li>
</ul>
<p>
The interface XML is used to reference a top-level filter. In the
Index: libvirt-acl/src/nwfilter/nwfilter_ebiptables_driver.c
===================================================================
--- libvirt-acl.orig/src/nwfilter/nwfilter_ebiptables_driver.c
+++ libvirt-acl/src/nwfilter/nwfilter_ebiptables_driver.c
@@ -2357,7 +2357,7 @@ err_exit:
*/
static int
ebiptablesCreateRuleInstance(virConnectPtr conn ATTRIBUTE_UNUSED,
- enum virDomainNetType nettype,
+ enum virDomainNetType nettype
ATTRIBUTE_UNUSED,
virNWFilterDefPtr nwfilter,
virNWFilterRuleDefPtr rule,
const char *ifname,
@@ -2409,13 +2409,6 @@ ebiptablesCreateRuleInstance(virConnectP
case VIR_NWFILTER_RULE_PROTOCOL_ICMP:
case VIR_NWFILTER_RULE_PROTOCOL_IGMP:
case VIR_NWFILTER_RULE_PROTOCOL_ALL:
- if (nettype == VIR_DOMAIN_NET_TYPE_DIRECT) {
- virNWFilterReportError(VIR_ERR_INTERNAL_ERROR,
- _("'%s' protocol not support for net type '%s'"),
-
virNWFilterRuleProtocolTypeToString(rule->prtclType),
- virDomainNetTypeToString(nettype));
- return 1;
- }
isIPv6 = 0;
rc = iptablesCreateRuleInstance(nwfilter,
rule,
@@ -2433,13 +2426,6 @@ ebiptablesCreateRuleInstance(virConnectP
case VIR_NWFILTER_RULE_PROTOCOL_SCTPoIPV6:
case VIR_NWFILTER_RULE_PROTOCOL_ICMPV6:
case VIR_NWFILTER_RULE_PROTOCOL_ALLoIPV6:
- if (nettype == VIR_DOMAIN_NET_TYPE_DIRECT) {
- virNWFilterReportError(VIR_ERR_OPERATION_FAILED,
- _("'%s' protocol not support for net type '%s'"),
-
virNWFilterRuleProtocolTypeToString(rule->prtclType),
- virDomainNetTypeToString(nettype));
- return 1;
- }
isIPv6 = 1;
rc = iptablesCreateRuleInstance(nwfilter,
rule,
13 years, 7 months