[libvirt] [PATCH 0/6] vz: add disk and controller check in domainPostParse phase
by Mikhail Feoktistov
Mikhail Feoktistov (6):
vz: save vz version in connection structure
vz: add vzCapabilities to connection structure
vz: check supported disk format and bus
vz: report correct disk format in domainGetXMLDesc
vz: check supported controllers
vz: set default SCSI model
src/vz/vz_driver.c | 61 +++++------------
src/vz/vz_sdk.c | 80 +++++++++++-----------
src/vz/vz_sdk.h | 2 +-
src/vz/vz_utils.c | 191 +++++++++++++++++++++++++++++++++++++++++++++++++++++
src/vz/vz_utils.h | 24 +++++++
5 files changed, 274 insertions(+), 84 deletions(-)
--
1.8.3.1
8 years, 9 months
[libvirt] [Issue]: Regarding client socket getting closed from the server once the lxc container is started
by Rammohan Gowrimoole (rgowrimo)
Hi Folks,
Using libvirt python bindings we are creating an lxc container.Here is the problem that we see sometimes (say 20 % of the time) when we create a new container.
1.container gets created, and also starts.However the we are not able to enter the namepace of the container.It throws an error initPid not available.We see that the using netstat command , socket connection is closed.
2.To get around this problem we have to stop and start the container again.We see that socket under (/var/run/libvirt/*) connection is established and we are able to enter the namespace.
Enabled the libvirtd debug logs to debug this issue.
For success case we see that for new client connection gets created and is able to handle async incoming events,
2016-03-12 08:18:55.748+0000: 1247: info : virObjectNew:202 : OBJECT_NEW: obj=0x7fed54005460 classname=virLXCMonitor
2016-03-12 08:18:55.748+0000: 1247: debug : virNetSocketNew:159 : localAddr=0x7fed7cd1d170 remoteAddr=0x7fed7cd1d200 fd=28 errfd=-1 pid=0
2016-03-12 08:18:55.749+0000: 1247: info : virObjectNew:202 : OBJECT_NEW: obj=0x7fed54009040 classname=virNetSocket
2016-03-12 08:18:55.749+0000: 1247: info : virNetSocketNew:209 : RPC_SOCKET_NEW: sock=0x7fed54009040 fd=28 errfd=-1 pid=0 localAddr=127.0.0.1;0, remoteAddr=127.0.0.1;0
2016-03-12 08:18:55.749+0000: 1247: info : virObjectNew:202 : OBJECT_NEW: obj=0x7fed54009d10 classname=virNetClient
2016-03-12 08:18:55.749+0000: 1247: info : virNetClientNew:327 : RPC_CLIENT_NEW: client=0x7fed54009d10 sock=0x7fed54009040
2016-03-12 08:18:55.749+0000: 1247: info : virObjectRef:296 : OBJECT_REF: obj=0x7fed54009d10
2016-03-12 08:18:55.749+0000: 1247: info : virObjectRef:296 : OBJECT_REF: obj=0x7fed54009040
2016-03-12 08:18:55.750+0000: 1247: info : virObjectNew:202 : OBJECT_NEW: obj=0x7fed540009a0 classname=virNetClientProgram
2016-03-12 08:18:55.750+0000: 1247: info : virObjectRef:296 : OBJECT_REF: obj=0x7fed540009a0
2016-03-12 08:18:55.750+0000: 1247: info : virObjectRef:296 : OBJECT_REF: obj=0x7fed54005460
2016-03-12 08:18:55.750+0000: 1247: info : virObjectUnref:259 : OBJECT_UNREF: obj=0x7fed5c168eb0
2016-03-12 08:18:55.750+0000: 1247: debug : virLXCProcessCleanInterfaces:475 : Cleared net names: eth0
2016-03-12 08:18:55.750+0000: 1247: info : virObjectUnref:259 : OBJECT_UNREF: obj=0x7fed5c168eb0
2016-03-12 08:18:55.750+0000: 1247: info : virObjectUnref:259 : OBJECT_UNREF: obj=0x7fed5c169600
2016-03-12 08:18:55.755+0000: 1244: debug : virNetClientIncomingEvent:1808 : client=0x7fed54009d10 wantclose=0
2016-03-12 08:18:55.755+0000: 1244: debug : virNetClientIncomingEvent:1816 : Event fired 0x7fed54009040 1
2016-03-12 08:18:55.755+0000: 1244: debug : virNetMessageDecodeLength:151 : Got length, now need 36 total (32 more)
2016-03-12 08:18:55.756+0000: 1244: info : virNetClientCallDispatch:1116 : RPC_CLIENT_MSG_RX: client=0x7fed54009d10 len=36 prog=305402420 vers=1 proc=2 type=2 status=0 serial=1
2016-03-12 08:18:55.756+0000: 1244: debug : virKeepAliveCheckMessage:377 : ka=(nil), client=0x7fed81fc5ed4, msg=0x7fed54009d78
2016-03-12 08:18:55.756+0000: 1244: debug : virNetClientProgramDispatch:220 : prog=305402420 ver=1 type=2 status=0 serial=1 proc=2
2016-03-12 08:18:55.756+0000: 1244: debug : virLXCMonitorHandleEventInit:109 : Event init 1420
For failure case ,we see that the client socket connection is initiated and gets closed immediately after receiving an incoming event.In this case, I don’t see an object for virNetClientProgram being created.
Incoming event comes in and since the its unable to find client->prog it bails out and closes the connection.
Snaphost of the code,
static int virNetClientCallDispatchMessage(virNetClientPtr client)
{
size_t i;
virNetClientProgramPtr prog = NULL;
for (i = 0; i < client->nprograms; i++) {
if (virNetClientProgramMatches(client->programs[i],
&client->msg)) {
prog = client->programs[i];
break;
}
}
if (!prog) {
VIR_DEBUG("No program found for event with prog=%d vers=%d",
client->msg.header.prog, client->msg.header.vers);
return -1;
}
2016-03-12 08:19:15.935+0000: 1246: info : virObjectRef:296 : OBJECT_REF: obj=0x7fed5c168eb0
2016-03-12 08:19:15.935+0000: 1246: info : virObjectRef:296 : OBJECT_REF: obj=0x7fed82bd7bc0
2016-03-12 08:19:15.935+0000: 1246: info : virObjectNew:202 : OBJECT_NEW: obj=0x7fed82bd8120 classname=virLXCMonitor
2016-03-12 08:19:15.935+0000: 1246: debug : virNetSocketNew:159 : localAddr=0x7fed7d51e170 remoteAddr=0x7fed7d51e200 fd=31 errfd=-1 pid=0
2016-03-12 08:19:15.936+0000: 1246: info : virObjectNew:202 : OBJECT_NEW: obj=0x7fed82bd8660 classname=virNetSocket
2016-03-12 08:19:15.936+0000: 1246: info : virNetSocketNew:209 : RPC_SOCKET_NEW: sock=0x7fed82bd8660 fd=31 errfd=-1 pid=0 localAddr=127.0.0.1;0, remoteAddr=127.0.0.1;0
2016-03-12 08:19:15.936+0000: 1246: info : virObjectNew:202 : OBJECT_NEW: obj=0x7fed82bd8ca0 classname=virNetClient
2016-03-12 08:19:15.936+0000: 1246: info : virNetClientNew:327 : RPC_CLIENT_NEW: client=0x7fed82bd8ca0 sock=0x7fed82bd8660
2016-03-12 08:19:15.936+0000: 1246: info : virObjectRef:296 : OBJECT_REF: obj=0x7fed82bd8ca0
2016-03-12 08:19:15.936+0000: 1246: info : virObjectRef:296 : OBJECT_REF: obj=0x7fed82bd8660
2016-03-12 08:19:15.942+0000: 1244: debug : virNetClientIncomingEvent:1808 : client=0x7fed82bd8ca0 wantclose=0
2016-03-12 08:19:15.942+0000: 1244: debug : virNetClientIncomingEvent:1816 : Event fired 0x7fed82bd8660 1
2016-03-12 08:19:15.942+0000: 1244: debug : virNetMessageDecodeLength:151 : Got length, now need 36 total (32 more)
2016-03-12 08:19:15.942+0000: 1244: info : virNetClientCallDispatch:1116 : RPC_CLIENT_MSG_RX: client=0x7fed82bd8ca0 len=36 prog=305402420 vers=1 proc=2 type=2 status=0 serial=1
2016-03-12 08:19:15.942+0000: 1244: debug : virKeepAliveCheckMessage:377 : ka=(nil), client=0x7fed81fc5ed4, msg=0x7fed82bd8d08
2016-03-12 08:19:15.942+0000: 1244: debug : virNetClientCallDispatchMessage:1008 : No program found for event with prog=305402420 vers=1
2016-03-12 08:19:15.942+0000: 1244: debug : virNetMessageClear:57 : msg=0x7fed82bd8d08 nfds=0
2016-03-12 08:19:15.942+0000: 1244: debug : virNetClientMarkClose:632 : client=0x7fed82bd8ca0, reason=0
2016-03-12 08:19:15.942+0000: 1244: debug : virNetClientCloseLocked:648 : client=0x7fed82bd8ca0, sock=0x7fed82bd8660, reason=0
Here is the snapshot of code ,
virLXCMonitorPtr virLXCMonitorNew(virDomainObjPtr vm,
const char *socketdir,
virLXCMonitorCallbacksPtr cb)
{
virLXCMonitorPtr mon;
char *sockpath = NULL;
if (virLXCMonitorInitialize() < 0)
return NULL;
if (!(mon = virObjectLockableNew(virLXCMonitorClass)))
return NULL;
if (virAsprintf(&sockpath, "%s/%s.sock",
socketdir, vm->def->name) < 0)
goto error;
if (!(mon->client = virNetClientNewUNIX(sockpath, false, NULL)))
goto error;
if (virNetClientRegisterAsyncIO(mon->client) < 0)
goto error;
if (!(mon->program = virNetClientProgramNew(VIR_LXC_MONITOR_PROGRAM,
VIR_LXC_MONITOR_PROGRAM_VERSION,
virLXCMonitorEvents,
ARRAY_CARDINALITY(virLXCMonitorEvents),
mon)))
goto error;
if (virNetClientAddProgram(mon->client,
mon->program) < 0)
goto error;
mon->vm = vm;
memcpy(&mon->cb, cb, sizeof(mon->cb));
virObjectRef(mon);
virNetClientSetCloseCallback(mon->client, virLXCMonitorEOFNotify, mon,
virLXCMonitorCloseFreeCallback);
Is the problem occurring due to invocation of “virNetClientRegisterAsyncIO" api before the virNetClientAddProgram.Probably once we register for aysnc IO , immediately an event comes in and that thread takes priority and bails out since it does not find the client->prog?Also the client is not retrying to establish a new connection.
Please let me any thoughts/comments.Is there any patch already available which has fixed this issue?
-Thanks,
Rammohan
8 years, 9 months
[libvirt] [PATCH 00/21] Various (tiny) clean-ups and changes for daemon/admin
by Martin Kletzander
I wanted to make virAdmConnectListAllServers()'s dispatch function
generated by our mighty gendispatch script. And when doing that I
stumbled upon various other things, changed what seemed better and at
the end I ended up with one huge commit. Because lot of those changes
should not be done together in one commit, I split each tiny part so
it's nicer to review. However, some might point out that some commits
do not belong together. To that I say it was a pain splitting the
commit, don't make me split the series as well, please =)
This "conflicts" with Erik's series that deals with worker threads
tuning. We about know that and we will merge those together, or
rather rebase on top of each other based on which version of
virAdmConnectLookupServer{,ByName}() you and we like better.
Martin Kletzander (21):
admin: Make virAdmServerFree() handle NULL gracefully
admin: Check for flags properly
server: Store server name in server object
daemon: Get server name from the server itself
virerror: Introduce new error type NO_SERVER
daemon: Set error for unknown server name
daemon: Properly check for clients
Expose virNetServerGetName
admin: Do not work with virAdm on the server side
Change virNetDaemonGetServerNames to virNetDaemonGetServers
admin: Don't use priority for admin APIs
virt-admin: Don't leak uri all over the place
admin: Be consistent when resetting errors
gendispatch: Cluster, don't capture if not needed
gendispatch: Be able to generate multi-return values
admin: Generate ConnectListServers dispatch helpers
gendispatch: Accept server as an argument
admin: Add virAdmConnectLookupServer
gendispatch: Remember the name of snapshot variable name
gendispatch: Support modern listing of more types
remote: Generate what's possible
daemon/admin.c | 49 +--
daemon/admin_server.c | 36 +--
daemon/admin_server.h | 12 +-
daemon/libvirtd.c | 10 +-
daemon/remote.c | 599 ------------------------------------
include/libvirt/libvirt-admin.h | 4 +
include/libvirt/virterror.h | 1 +
po/POTFILES.in | 1 -
src/admin/admin_protocol.x | 21 +-
src/admin/admin_remote.c | 63 ----
src/admin_protocol-structs | 8 +
src/libvirt-admin.c | 48 ++-
src/libvirt_admin_private.syms | 2 +
src/libvirt_admin_public.syms | 1 +
src/libvirt_remote.syms | 2 +
src/locking/lock_daemon.c | 5 +-
src/logging/log_daemon.c | 5 +-
src/lxc/lxc_controller.c | 5 +-
src/remote/remote_driver.c | 654 ----------------------------------------
src/remote/remote_protocol.x | 40 +--
src/rpc/gendispatch.pl | 374 +++++++++++++++++------
src/rpc/virnetdaemon.c | 65 ++--
src/rpc/virnetdaemon.h | 3 +-
src/rpc/virnetserver.c | 20 +-
src/rpc/virnetserver.h | 6 +-
src/util/virerror.c | 6 +
tests/virnetdaemontest.c | 10 +-
tools/virt-admin.c | 8 +-
28 files changed, 509 insertions(+), 1549 deletions(-)
--
2.7.2
8 years, 9 months
[libvirt] [PATCH] conf: nodedev: Remove inverted match logic
by Andrea Bolognani
Commit c1276177f832 simplified the match logic; this commit
gets rid of the inverted logic to make the code even more
straightforward.
---
src/conf/node_device_conf.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
index 0c9c348..b9b9dfa 100644
--- a/src/conf/node_device_conf.c
+++ b/src/conf/node_device_conf.c
@@ -1806,22 +1806,22 @@ virNodeDeviceMatch(virNodeDeviceObjPtr devobj,
{
/* filter by cap type */
if (flags & VIR_CONNECT_LIST_NODE_DEVICES_FILTERS_CAP) {
- if (!(MATCH(SYSTEM) ||
- MATCH(PCI_DEV) ||
- MATCH(USB_DEV) ||
- MATCH(USB_INTERFACE) ||
- MATCH(NET) ||
- MATCH(SCSI_HOST) ||
- MATCH(SCSI_TARGET) ||
- MATCH(SCSI) ||
- MATCH(STORAGE) ||
- MATCH(FC_HOST) ||
- MATCH(VPORTS) ||
- MATCH(SCSI_GENERIC)))
- return false;
+ if (MATCH(SYSTEM) ||
+ MATCH(PCI_DEV) ||
+ MATCH(USB_DEV) ||
+ MATCH(USB_INTERFACE) ||
+ MATCH(NET) ||
+ MATCH(SCSI_HOST) ||
+ MATCH(SCSI_TARGET) ||
+ MATCH(SCSI) ||
+ MATCH(STORAGE) ||
+ MATCH(FC_HOST) ||
+ MATCH(VPORTS) ||
+ MATCH(SCSI_GENERIC))
+ return true;
}
- return true;
+ return false;
}
#undef MATCH
--
2.5.0
8 years, 9 months
[libvirt] [PATCH] qemu migration: assign addresses in xml passed as parameter
by Nikolay Shirokovskiy
Usecase:
1. define domain with xml A where addresses are not set
2. migrate with '--xml A'
You get ABI incompatibility because we comprare xmls with addresses
set and not. This patch assign addresses in parameter xml so
the comprasion is fair.
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy(a)virtuozzo.com>
---
src/qemu/qemu_migration.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c
index 1443d96..7cceaa1 100644
--- a/src/qemu/qemu_migration.c
+++ b/src/qemu/qemu_migration.c
@@ -2992,6 +2992,7 @@ qemuMigrationBeginPhase(virQEMUDriverPtr driver,
virDomainDefPtr def = NULL;
qemuDomainObjPrivatePtr priv = vm->privateData;
virCapsPtr caps = NULL;
+ virQEMUCapsPtr qemuCaps = NULL;
unsigned int cookieFlags = QEMU_MIGRATION_COOKIE_LOCKSTATE;
VIR_DEBUG("driver=%p, vm=%p, xmlin=%s, dname=%s,"
@@ -3105,6 +3106,13 @@ qemuMigrationBeginPhase(virQEMUDriverPtr driver,
VIR_DOMAIN_DEF_PARSE_INACTIVE)))
goto cleanup;
+ if (!(qemuCaps = virQEMUCapsCacheLookup(driver->qemuCapsCache,
+ def->emulator)))
+ goto cleanup;
+
+ if (qemuDomainAssignAddresses(def, qemuCaps, NULL) < 0)
+ goto cleanup;
+
if (!qemuDomainDefCheckABIStability(driver, vm->def, def))
goto cleanup;
@@ -3117,6 +3125,7 @@ qemuMigrationBeginPhase(virQEMUDriverPtr driver,
qemuMigrationCookieFree(mig);
virObjectUnref(caps);
virDomainDefFree(def);
+ virObjectUnref(qemuCaps);
return rv;
}
--
1.8.3.1
8 years, 9 months
[libvirt] [PATCH] qemu: Don't access uninitialized memory
by Martin Kletzander
In qemuConnectDomainXMLToNative() we set up the monitor, but we never
memset() it to zeros. Thanks to the introduction of the logfile
parameter of chardevs (and the logfile member of the struct), we started
checking whether that's non-NULL and that exposed this old error.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/qemu/qemu_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index a0d6596aef7b..e868b9f899e7 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -6950,7 +6950,7 @@ static char *qemuConnectDomainXMLToNative(virConnectPtr conn,
{
virQEMUDriverPtr driver = conn->privateData;
virDomainDefPtr def = NULL;
- virDomainChrSourceDef monConfig;
+ virDomainChrSourceDef monConfig = {0};
virQEMUCapsPtr qemuCaps = NULL;
bool monitor_json = false;
virCommandPtr cmd = NULL;
--
2.7.3
8 years, 9 months
[libvirt] [PATCH 0/3] Cosmetic changes to SPICE QEMU commandline
by Christophe Fergeau
Hey,
I've been trying out the recently adding virgl support, which does
not need any TCP port/address to be set (it's directly opening a local unix
fd).
While looking at QEMU command line in configs such as
<graphics type="spice" autoport="no"/>, I've noticed that the QEMU command line
gets some 'useless' arguments such as
-spice port=0
or
-spice addr=127.0.0.1
(without a port defined).
This series changes the spice command line generation so that we don't add these arguments
when not needed.
Christophe
8 years, 9 months
[libvirt] [PATCH v5 0/2] notify about reverting to a snapshot
by Dmitry Andreev
The original idea of this patch-set was to notify API clients
about changes in domain configuration on revert to a snapshot.
But in the last review Cole noticed that updated configuration
doesn't saved to a file and libvirtd reboot drops changes.
So in the patch-set v5 configuration is saved and event is emitted
for all cases when persistent domain configuration was updated
from a snapshot.
Dmitry Andreev (2):
Introduce new VIR_DOMAIN_EVENT_DEFINED_FROM_SNAPSHOT sub-event
qemuDomainRevertToSnapshot: save domain configuration
examples/object-events/event-test.c | 2 ++
include/libvirt/libvirt-domain.h | 1 +
src/qemu/qemu_driver.c | 9 +++++++++
tools/virsh-domain.c | 3 ++-
4 files changed, 14 insertions(+), 1 deletion(-)
--
1.8.3.1
8 years, 9 months
[libvirt] [PATCH] qemu: Don't overwrite DomainSave errors
by Cole Robinson
These functions already report fine grained errors, there's no
benefit to overwriting the error here.
---
src/qemu/qemu_driver.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index edf39d9..36c8fb5 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -17632,8 +17632,6 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
ret = virDomainSaveStatus(driver->xmlopt, cfg->stateDir, vm, driver->caps);
if (ret < 0) {
- virReportError(VIR_ERR_OPERATION_FAILED, "%s",
- _("Saving live XML config failed"));
goto endjob;
}
@@ -17659,8 +17657,6 @@ qemuDomainSetBlockIoTune(virDomainPtr dom,
conf_disk->blkdeviotune = info;
ret = virDomainSaveConfig(cfg->configDir, driver->caps, persistentDef);
if (ret < 0) {
- virReportError(VIR_ERR_OPERATION_INVALID, "%s",
- _("Write to config file failed"));
goto endjob;
}
}
--
2.5.0
8 years, 9 months
[libvirt] [PATCH] nodedev: Shorten match condition
by Martin Kletzander
Just a cleanup I stumbled upon in one of my older branches I did when
browsing through some code and forgot to send it.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
src/conf/node_device_conf.c | 41 +++++++++++++++--------------------------
1 file changed, 15 insertions(+), 26 deletions(-)
diff --git a/src/conf/node_device_conf.c b/src/conf/node_device_conf.c
index c04739f90121..0c9c348e3793 100644
--- a/src/conf/node_device_conf.c
+++ b/src/conf/node_device_conf.c
@@ -1798,37 +1798,26 @@ virNodeDeviceCapMatch(virNodeDeviceObjPtr devobj,
return false;
}
-#define MATCH(FLAG) (flags & (FLAG))
+#define MATCH(FLAG) ((flags & (VIR_CONNECT_LIST_NODE_DEVICES_CAP_ ## FLAG)) && \
+ virNodeDeviceCapMatch(devobj, VIR_NODE_DEV_CAP_ ## FLAG))
static bool
virNodeDeviceMatch(virNodeDeviceObjPtr devobj,
unsigned int flags)
{
/* filter by cap type */
- if (MATCH(VIR_CONNECT_LIST_NODE_DEVICES_FILTERS_CAP)) {
- if (!((MATCH(VIR_CONNECT_LIST_NODE_DEVICES_CAP_SYSTEM) &&
- virNodeDeviceCapMatch(devobj, VIR_NODE_DEV_CAP_SYSTEM)) ||
- (MATCH(VIR_CONNECT_LIST_NODE_DEVICES_CAP_PCI_DEV) &&
- virNodeDeviceCapMatch(devobj, VIR_NODE_DEV_CAP_PCI_DEV)) ||
- (MATCH(VIR_CONNECT_LIST_NODE_DEVICES_CAP_USB_DEV) &&
- virNodeDeviceCapMatch(devobj, VIR_NODE_DEV_CAP_USB_DEV)) ||
- (MATCH(VIR_CONNECT_LIST_NODE_DEVICES_CAP_USB_INTERFACE) &&
- virNodeDeviceCapMatch(devobj, VIR_NODE_DEV_CAP_USB_INTERFACE)) ||
- (MATCH(VIR_CONNECT_LIST_NODE_DEVICES_CAP_NET) &&
- virNodeDeviceCapMatch(devobj, VIR_NODE_DEV_CAP_NET)) ||
- (MATCH(VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_HOST) &&
- virNodeDeviceCapMatch(devobj, VIR_NODE_DEV_CAP_SCSI_HOST)) ||
- (MATCH(VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_TARGET) &&
- virNodeDeviceCapMatch(devobj, VIR_NODE_DEV_CAP_SCSI_TARGET)) ||
- (MATCH(VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI) &&
- virNodeDeviceCapMatch(devobj, VIR_NODE_DEV_CAP_SCSI)) ||
- (MATCH(VIR_CONNECT_LIST_NODE_DEVICES_CAP_STORAGE) &&
- virNodeDeviceCapMatch(devobj, VIR_NODE_DEV_CAP_STORAGE)) ||
- (MATCH(VIR_CONNECT_LIST_NODE_DEVICES_CAP_FC_HOST) &&
- virNodeDeviceCapMatch(devobj, VIR_NODE_DEV_CAP_FC_HOST)) ||
- (MATCH(VIR_CONNECT_LIST_NODE_DEVICES_CAP_VPORTS) &&
- virNodeDeviceCapMatch(devobj, VIR_NODE_DEV_CAP_VPORTS)) ||
- (MATCH(VIR_CONNECT_LIST_NODE_DEVICES_CAP_SCSI_GENERIC) &&
- virNodeDeviceCapMatch(devobj, VIR_NODE_DEV_CAP_SCSI_GENERIC))))
+ if (flags & VIR_CONNECT_LIST_NODE_DEVICES_FILTERS_CAP) {
+ if (!(MATCH(SYSTEM) ||
+ MATCH(PCI_DEV) ||
+ MATCH(USB_DEV) ||
+ MATCH(USB_INTERFACE) ||
+ MATCH(NET) ||
+ MATCH(SCSI_HOST) ||
+ MATCH(SCSI_TARGET) ||
+ MATCH(SCSI) ||
+ MATCH(STORAGE) ||
+ MATCH(FC_HOST) ||
+ MATCH(VPORTS) ||
+ MATCH(SCSI_GENERIC)))
return false;
}
--
2.7.3
8 years, 9 months