diff options
author | Peter Schiffer <pschiffe@redhat.com> | 2014-03-31 08:29:25 +0200 |
---|---|---|
committer | Peter Schiffer <pschiffe@redhat.com> | 2014-03-31 08:29:25 +0200 |
commit | bda49e2a348266e81320a32590899c363b06d2f4 (patch) | |
tree | ba00766a8fa89e4ae03d41f413ffb3734484bcdd | |
parent | da58e745fbecc9cd34270bae9d5f034ec5d9b4e6 (diff) | |
download | openlmi-providers-bda49e2a348266e81320a32590899c363b06d2f4.tar.gz openlmi-providers-bda49e2a348266e81320a32590899c363b06d2f4.tar.xz openlmi-providers-bda49e2a348266e81320a32590899c363b06d2f4.zip |
Software-dbus: implemented HostedSoftwareCollectionProvider
-rw-r--r-- | src/software-dbus/LMI_HostedSoftwareCollectionProvider.c | 44 |
1 files changed, 41 insertions, 3 deletions
diff --git a/src/software-dbus/LMI_HostedSoftwareCollectionProvider.c b/src/software-dbus/LMI_HostedSoftwareCollectionProvider.c index d07b752..1284eee 100644 --- a/src/software-dbus/LMI_HostedSoftwareCollectionProvider.c +++ b/src/software-dbus/LMI_HostedSoftwareCollectionProvider.c @@ -1,10 +1,32 @@ +/* + * Copyright (C) 2013-2014 Red Hat, Inc. All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Authors: Peter Schiffer <pschiffe@redhat.com> + */ + #include <konkret/konkret.h> #include "LMI_HostedSoftwareCollection.h" +#include "LMI_Software.h" static const CMPIBroker* _cb; -static void LMI_HostedSoftwareCollectionInitialize() +static void LMI_HostedSoftwareCollectionInitialize(const CMPIContext *ctx) { + lmi_init(provider_name, _cb, ctx, provider_config_defaults); } static CMPIStatus LMI_HostedSoftwareCollectionCleanup( @@ -32,6 +54,22 @@ static CMPIStatus LMI_HostedSoftwareCollectionEnumInstances( const CMPIObjectPath* cop, const char** properties) { + char instance_id[INSTANCE_ID_LEN] = ""; + + create_instance_id(SYSTEM_SW_COLLECTION_CLASS_NAME, NULL, instance_id, + INSTANCE_ID_LEN); + + LMI_SystemSoftwareCollectionRef ssc; + LMI_SystemSoftwareCollectionRef_Init(&ssc, _cb, KNameSpace(cop)); + LMI_SystemSoftwareCollectionRef_Set_InstanceID(&ssc, instance_id); + + LMI_HostedSoftwareCollection w; + LMI_HostedSoftwareCollection_Init(&w, _cb, KNameSpace(cop)); + LMI_HostedSoftwareCollection_SetObjectPath_Antecedent(&w, + lmi_get_computer_system()); + LMI_HostedSoftwareCollection_Set_Dependent(&w, &ssc); + KReturnInstance(cr, w); + CMReturn(CMPI_RC_OK); } @@ -187,13 +225,13 @@ CMInstanceMIStub( LMI_HostedSoftwareCollection, LMI_HostedSoftwareCollection, _cb, - LMI_HostedSoftwareCollectionInitialize()) + LMI_HostedSoftwareCollectionInitialize(ctx)) CMAssociationMIStub( LMI_HostedSoftwareCollection, LMI_HostedSoftwareCollection, _cb, - LMI_HostedSoftwareCollectionInitialize()) + LMI_HostedSoftwareCollectionInitialize(ctx)) KONKRET_REGISTRATION( "root/cimv2", |