From 5cef563131a13424c6530ef0c89a485e48c1673b Mon Sep 17 00:00:00 2001 From: CentOS Buildsys Date: Mar 03 2014 10:17:54 +0000 Subject: import libvirt-cim-0.6.3-6.el7.src.rpm --- diff --git a/SOURCES/libvirt-cim-0.6.3-0a742856.patch b/SOURCES/libvirt-cim-0.6.3-0a742856.patch new file mode 100644 index 0000000..1232a3e --- /dev/null +++ b/SOURCES/libvirt-cim-0.6.3-0a742856.patch @@ -0,0 +1,142 @@ +From 0a742856490bfdcb02c2af48a2a849593cccf1c7 Mon Sep 17 00:00:00 2001 +From: Viktor Mihajlovski +Date: Thu, 29 Aug 2013 17:18:49 +0200 +Subject: [PATCH 08/48] libxkutil: Improve domain.os_info cleanup + +The union fields in os_info were set by means of XML parsing which +doesn't take into account that certain fields are depending on the +virtualization type. +This could lead both to memory overwrites and memory leaks. +Fixed by using temporary variables and type-based setting of fields + +Signed-off-by: Viktor Mihajlovski +Signed-off-by: John Ferlan +--- + libxkutil/device_parsing.c | 73 +++++++++++++++++++++++++++++++++------------- + 1 file changed, 52 insertions(+), 21 deletions(-) + +diff --git a/libxkutil/device_parsing.c b/libxkutil/device_parsing.c +index 542e4e9..ad0f19c 100644 +--- a/libxkutil/device_parsing.c ++++ b/libxkutil/device_parsing.c +@@ -1103,23 +1103,37 @@ int parse_fq_devid(const char *devid, char **host, char **device) + return 1; + } + ++static void cleanup_bootlist(char **blist, unsigned blist_ct) ++{ ++ while (blist_ct > 0) { ++ free(blist[--blist_ct]); ++ } ++ free(blist); ++} ++ + static int parse_os(struct domain *dominfo, xmlNode *os) + { + xmlNode *child; + char **blist = NULL; + unsigned bl_size = 0; ++ char *kernel = NULL; ++ char *initrd = NULL; ++ char *cmdline = NULL; ++ char *loader = NULL; ++ char *boot = NULL; ++ char *init = NULL; + + for (child = os->children; child != NULL; child = child->next) { +- if (XSTREQ(child->name, "type")) ++ if (XSTREQ(child->name, "type")) { + STRPROP(dominfo, os_info.pv.type, child); +- else if (XSTREQ(child->name, "kernel")) +- STRPROP(dominfo, os_info.pv.kernel, child); ++ } else if (XSTREQ(child->name, "kernel")) ++ kernel = get_node_content(child); + else if (XSTREQ(child->name, "initrd")) +- STRPROP(dominfo, os_info.pv.initrd, child); ++ initrd = get_node_content(child); + else if (XSTREQ(child->name, "cmdline")) +- STRPROP(dominfo, os_info.pv.cmdline, child); ++ cmdline = get_node_content(child); + else if (XSTREQ(child->name, "loader")) +- STRPROP(dominfo, os_info.fv.loader, child); ++ loader = get_node_content(child); + else if (XSTREQ(child->name, "boot")) { + char **tmp_list = NULL; + +@@ -1137,7 +1151,7 @@ static int parse_os(struct domain *dominfo, xmlNode *os) + blist[bl_size] = get_attr_value(child, "dev"); + bl_size++; + } else if (XSTREQ(child->name, "init")) +- STRPROP(dominfo, os_info.lxc.init, child); ++ init = get_node_content(child); + } + + if ((STREQC(dominfo->os_info.fv.type, "hvm")) && +@@ -1154,17 +1168,39 @@ static int parse_os(struct domain *dominfo, xmlNode *os) + else + dominfo->type = -1; + +- if (STREQC(dominfo->os_info.fv.type, "hvm")) { ++ switch (dominfo->type) { ++ case DOMAIN_XENFV: ++ case DOMAIN_KVM: ++ case DOMAIN_QEMU: ++ dominfo->os_info.fv.loader = loader; + dominfo->os_info.fv.bootlist_ct = bl_size; + dominfo->os_info.fv.bootlist = blist; +- } else { +- int i; +- +- for (i = 0; i < bl_size; i++) +- free(blist[i]); +- free(blist); ++ loader = NULL; ++ blist = NULL; ++ bl_size = 0; ++ break; ++ case DOMAIN_XENPV: ++ dominfo->os_info.pv.kernel = kernel; ++ dominfo->os_info.pv.initrd = initrd; ++ dominfo->os_info.pv.cmdline = cmdline; ++ kernel = NULL; ++ initrd = NULL; ++ cmdline = NULL; ++ break; ++ case DOMAIN_LXC: ++ dominfo->os_info.lxc.init = init; ++ init = NULL; ++ break; ++ default: ++ break; + } + ++ free(kernel); ++ free(initrd); ++ free(cmdline); ++ free(boot); ++ free(init); ++ cleanup_bootlist(blist, bl_size); + return 1; + } + +@@ -1360,15 +1396,10 @@ void cleanup_dominfo(struct domain **dominfo) + free(dom->os_info.pv.cmdline); + } else if ((dom->type == DOMAIN_XENFV) || + (dom->type == DOMAIN_KVM) || (dom->type == DOMAIN_QEMU)) { +- int i; +- + free(dom->os_info.fv.type); + free(dom->os_info.fv.loader); +- +- for (i = 0; i < dom->os_info.fv.bootlist_ct; i++) { +- free(dom->os_info.fv.bootlist[i]); +- } +- free(dom->os_info.fv.bootlist); ++ cleanup_bootlist(dom->os_info.fv.bootlist, ++ dom->os_info.fv.bootlist_ct); + } else if (dom->type == DOMAIN_LXC) { + free(dom->os_info.lxc.type); + free(dom->os_info.lxc.init); +-- +1.8.5.3 + diff --git a/SOURCES/libvirt-cim-0.6.3-19ffef8e.patch b/SOURCES/libvirt-cim-0.6.3-19ffef8e.patch new file mode 100644 index 0000000..30ab027 --- /dev/null +++ b/SOURCES/libvirt-cim-0.6.3-19ffef8e.patch @@ -0,0 +1,44 @@ +From 19ffef8e60a3cb90b41043ebda3063355896b6a7 Mon Sep 17 00:00:00 2001 +From: Michal Privoznik +Date: Thu, 8 Aug 2013 11:49:25 +0200 +Subject: [PATCH 03/48] libvirt-cim.spec.in: Don't install open-pegasus' + specific providers + +https://bugzilla.redhat.com/show_bug.cgi?id=859122 + +libvirt-cim installs open-pegasus' specific providers in sblim-sfcb +repository staging directory and causing problem when creating sfcb +repository. + +Signed-off-by: John Ferlan +--- + libvirt-cim.spec.in | 6 ------ + 1 file changed, 6 deletions(-) + +diff --git a/libvirt-cim.spec.in b/libvirt-cim.spec.in +index 7b6221e..a027246 100644 +--- a/libvirt-cim.spec.in ++++ b/libvirt-cim.spec.in +@@ -133,9 +133,6 @@ then + -n root/interop \ + -r %{INTEROP_REG} -m %{INTEROP_MOF} -v >/dev/null 2>&1 || true + %{_datadir}/%{name}/provider-register.sh -t sfcb \ +- -n root/PG_InterOp \ +- -r %{PGINTEROP_REG} -m %{PGINTEROP_MOF} -v >/dev/null 2>&1 || true +-%{_datadir}/%{name}/provider-register.sh -t sfcb \ + -n root/cimv2\ + -r %{CIMV2_REG} -m %{CIMV2_MOF} -v >/dev/null 2>&1 || true + fi +@@ -165,9 +162,6 @@ then + -n root/interop \ + -r %{INTEROP_REG} -m %{INTEROP_MOF} >/dev/null 2>&1 || true + %{_datadir}/%{name}/provider-register.sh -d -t sfcb \ +- -n root/PG_InterOp \ +- -r %{PGINTEROP_REG} -m %{PGINTEROP_MOF} >/dev/null 2>&1 || true +-%{_datadir}/%{name}/provider-register.sh -d -t sfcb \ + -n root/cimv2 \ + -r %{CIMV2_REG} -m %{CIMV2_MOF} >/dev/null 2>&1 || true + fi +-- +1.8.5.3 + diff --git a/SOURCES/libvirt-cim-0.6.3-1c7dfda2.patch b/SOURCES/libvirt-cim-0.6.3-1c7dfda2.patch new file mode 100644 index 0000000..b2cf002 --- /dev/null +++ b/SOURCES/libvirt-cim-0.6.3-1c7dfda2.patch @@ -0,0 +1,211 @@ +From 1c7dfda2b543da27ea092a7cb9deab8b2917acba Mon Sep 17 00:00:00 2001 +From: Viktor Mihajlovski +Date: Tue, 5 Nov 2013 10:03:31 +0100 +Subject: [PATCH 32/48] build: Fix incorrect provider registration in upgrade + path + +The scriplet logic was incorrectly assuming that the superseded package's +%postun script would be called before the superceding packages %pre/%post. +This effectively broke upgrades of libvirt-cim because all the providers +were deregistered. +We are now checking whether we are in an upgrade situation and if so +will not deregister the providers in postun. +Another enhancement is that we do a full deregistration in the %post +section for tog-pegasus now. This should make installs and upgrades more +robust against potentially damaged repositories (e.g., on development +systems). + +As a reminder here's a short description of RPM's scriptlet processing. + +action: install upgrade uninstall + %pre 1 >1 - + %post 1 >1 - + %preun - 1 0 + %postun - 1 0 + +Scriptlet invocation order on upgrade +1. %pre(new_package) +2. %post(new_package) +3. %preun(old_package) +4. %postun(old_package) + +Signed-off-by: Viktor Mihajlovski +Signed-off-by: John Ferlan +--- + libvirt-cim.spec.in | 115 +++++++++++++++++++++++++++++++--------------------- + 1 file changed, 68 insertions(+), 47 deletions(-) + +diff --git a/libvirt-cim.spec.in b/libvirt-cim.spec.in +index 459650c..b50cbd1 100644 +--- a/libvirt-cim.spec.in ++++ b/libvirt-cim.spec.in +@@ -64,7 +64,6 @@ mkdir -p $RPM_BUILD_ROOT@INFO_STORE@ + %clean + rm -fr $RPM_BUILD_ROOT + +-%pre + %define REGISTRATION %{_datadir}/%{name}/*.registration + %define SCHEMA %{_datadir}/%{name}/*.mof + +@@ -77,24 +76,46 @@ rm -fr $RPM_BUILD_ROOT + %define CIMV2_REG %{_datadir}/%{name}/{HostedResourcePool,ElementCapabilities,HostedService,HostedDependency,ElementConformsToProfile,HostedAccessPoint}.registration + %define CIMV2_MOF %{_datadir}/%{name}/{HostedResourcePool,ElementCapabilities,HostedService,HostedDependency,RegisteredProfile,ComputerSystem,ElementConformsToProfile,HostedAccessPoint}.mof + ++%pre + # _If_ there is already a version of this installed, we must deregister + # the classes we plan to install in post, otherwise we may corrupt + # the pegasus repository. This is convention in other provider packages +-%{_datadir}/%{name}/provider-register.sh -d -t pegasus \ +- -n @CIM_VIRT_NS@ \ +- -r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true ++if [ $1 -gt 1 ] ++then ++ if [ -x /usr/sbin/cimserver ] ++ then ++ %{_datadir}/%{name}/provider-register.sh -d -t pegasus \ ++ -n @CIM_VIRT_NS@ \ ++ -r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true ++ %{_datadir}/%{name}/provider-register.sh -d -t pegasus \ ++ -n root/interop \ ++ -r %{INTEROP_REG} -m %{INTEROP_MOF} -v >/dev/null 2>&1 || true ++ %{_datadir}/%{name}/provider-register.sh -d -t pegasus \ ++ -n root/PG_InterOp \ ++ -r %{PGINTEROP_REG} -m %{PGINTEROP_MOF} -v >/dev/null 2>&1 || true ++ %{_datadir}/%{name}/provider-register.sh -d -t pegasus \ ++ -n root/cimv2\ ++ -r %{CIMV2_REG} -m %{CIMV2_MOF} -v >/dev/null 2>&1 || true ++ fi + + # Remove open-pegasus-specific providers installed in sfcb repository + # by older libvirt-cim packages +-%{_datadir}/%{name}/provider-register.sh -d -t sfcb \ +- -n root/PG_InterOp \ +- -r %{PGINTEROP_REG} -m %{PGINTEROP_MOF} >/dev/null 2>&1 || true +- ++ if [ -x /usr/sbin/sfcbd ] ++ then ++ %{_datadir}/%{name}/provider-register.sh -d -t sfcb \ ++ -n root/PG_InterOp \ ++ -r %{PGINTEROP_REG} -m %{PGINTEROP_MOF} >/dev/null 2>&1 || true ++ fi ++fi + + %post + /sbin/ldconfig + +-%{_datadir}/%{name}/install_base_schema.sh %{_datadir}/%{name} ++if [ $1 -eq 1 ] ++then ++# Install the CIM base schema if this is the initial install ++ %{_datadir}/%{name}/install_base_schema.sh %{_datadir}/%{name} ++fi + + %if 0%{?fedora} >= 17 || 0%{?rhel} >= 7 + if [ "`systemctl is-active tog-pegasus.service`" = "active" ] +@@ -112,65 +133,65 @@ rm -fr $RPM_BUILD_ROOT + + if [ -x /usr/sbin/cimserver ] + then +-%{_datadir}/%{name}/provider-register.sh -t pegasus \ ++ %{_datadir}/%{name}/provider-register.sh -t pegasus \ + -n @CIM_VIRT_NS@ \ + -r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true +-%{_datadir}/%{name}/provider-register.sh -t pegasus \ +- -n @CIM_VIRT_NS@ \ +- -r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true +-%{_datadir}/%{name}/provider-register.sh -t pegasus \ ++ %{_datadir}/%{name}/provider-register.sh -t pegasus \ + -n root/interop \ + -r %{INTEROP_REG} -m %{INTEROP_MOF} -v >/dev/null 2>&1 || true +-%{_datadir}/%{name}/provider-register.sh -t pegasus \ ++ %{_datadir}/%{name}/provider-register.sh -t pegasus \ + -n root/PG_InterOp \ + -r %{PGINTEROP_REG} -m %{PGINTEROP_MOF} -v >/dev/null 2>&1 || true +-%{_datadir}/%{name}/provider-register.sh -t pegasus \ ++ %{_datadir}/%{name}/provider-register.sh -t pegasus \ + -n root/cimv2\ + -r %{CIMV2_REG} -m %{CIMV2_MOF} -v >/dev/null 2>&1 || true + fi + if [ -x /usr/sbin/sfcbd ] + then +-%{_datadir}/%{name}/provider-register.sh -t sfcb \ +- -n root/virt \ +- -r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true +-%{_datadir}/%{name}/provider-register.sh -t sfcb \ ++ %{_datadir}/%{name}/provider-register.sh -t sfcb \ + -n root/virt \ + -r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true +-%{_datadir}/%{name}/provider-register.sh -t sfcb \ ++ %{_datadir}/%{name}/provider-register.sh -t sfcb \ + -n root/interop \ + -r %{INTEROP_REG} -m %{INTEROP_MOF} -v >/dev/null 2>&1 || true +-%{_datadir}/%{name}/provider-register.sh -t sfcb \ ++ %{_datadir}/%{name}/provider-register.sh -t sfcb \ + -n root/cimv2\ + -r %{CIMV2_REG} -m %{CIMV2_MOF} -v >/dev/null 2>&1 || true + fi + + %preun +-if [ -x /usr/sbin/cimserver ] ++# The uninstall scriptlets are called after the install scriptlets ++# in the upgrade case. Therefore we must only deregister the providers ++# when $1 == 0 (final remove). ++if [ $1 -eq 0 ] + then +-%{_datadir}/%{name}/provider-register.sh -d -t pegasus \ +- -n root/virt \ +- -r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true +-%{_datadir}/%{name}/provider-register.sh -d -t pegasus \ +- -n root/interop \ +- -r %{INTEROP_REG} -m %{INTEROP_MOF} >/dev/null 2>&1 || true +-%{_datadir}/%{name}/provider-register.sh -d -t pegasus \ +- -n root/PG_InterOp \ +- -r %{PGINTEROP_REG} -m %{PGINTEROP_MOF} >/dev/null 2>&1 || true +-%{_datadir}/%{name}/provider-register.sh -d -t pegasus \ +- -n root/cimv2 \ +- -r %{CIMV2_REG} -m %{CIMV2_MOF} >/dev/null 2>&1 || true +-fi +-if [ -x /usr/sbin/sfcbd ] +-then +-%{_datadir}/%{name}/provider-register.sh -d -t sfcb \ +- -n root/virt \ +- -r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true +-%{_datadir}/%{name}/provider-register.sh -d -t sfcb \ +- -n root/interop \ +- -r %{INTEROP_REG} -m %{INTEROP_MOF} >/dev/null 2>&1 || true +-%{_datadir}/%{name}/provider-register.sh -d -t sfcb \ +- -n root/cimv2 \ +- -r %{CIMV2_REG} -m %{CIMV2_MOF} >/dev/null 2>&1 || true ++ if [ -x /usr/sbin/cimserver ] ++ then ++ %{_datadir}/%{name}/provider-register.sh -d -t pegasus \ ++ -n root/virt \ ++ -r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true ++ %{_datadir}/%{name}/provider-register.sh -d -t pegasus \ ++ -n root/interop \ ++ -r %{INTEROP_REG} -m %{INTEROP_MOF} >/dev/null 2>&1 || true ++ %{_datadir}/%{name}/provider-register.sh -d -t pegasus \ ++ -n root/PG_InterOp \ ++ -r %{PGINTEROP_REG} -m %{PGINTEROP_MOF} >/dev/null 2>&1 || true ++ %{_datadir}/%{name}/provider-register.sh -d -t pegasus \ ++ -n root/cimv2 \ ++ -r %{CIMV2_REG} -m %{CIMV2_MOF} >/dev/null 2>&1 || true ++ fi ++ if [ -x /usr/sbin/sfcbd ] ++ then ++ %{_datadir}/%{name}/provider-register.sh -d -t sfcb \ ++ -n root/virt \ ++ -r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true ++ %{_datadir}/%{name}/provider-register.sh -d -t sfcb \ ++ -n root/interop \ ++ -r %{INTEROP_REG} -m %{INTEROP_MOF} >/dev/null 2>&1 || true ++ %{_datadir}/%{name}/provider-register.sh -d -t sfcb \ ++ -n root/cimv2 \ ++ -r %{CIMV2_REG} -m %{CIMV2_MOF} >/dev/null 2>&1 || true ++ fi + fi + + %postun -p /sbin/ldconfig +-- +1.8.5.3 + diff --git a/SOURCES/libvirt-cim-0.6.3-3c3a541d.patch b/SOURCES/libvirt-cim-0.6.3-3c3a541d.patch new file mode 100644 index 0000000..97ae1bc --- /dev/null +++ b/SOURCES/libvirt-cim-0.6.3-3c3a541d.patch @@ -0,0 +1,29 @@ +From 3c3a541db6824849d330930efb7c30f89cf826fa Mon Sep 17 00:00:00 2001 +From: John Ferlan +Date: Thu, 8 Aug 2013 15:46:48 -0400 +Subject: [PATCH 06/48] spec: Replace the path to the tar.gz file + +Commit '07adabc2' seems to have inadvertently removed the path +to the source ftp file added by commit '5412bf11'. + +Signed-off-by: John Ferlan +--- + libvirt-cim.spec.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libvirt-cim.spec.in b/libvirt-cim.spec.in +index cd399b1..98f2a75 100644 +--- a/libvirt-cim.spec.in ++++ b/libvirt-cim.spec.in +@@ -6,7 +6,7 @@ Version: @PACKAGE_VERSION@ + Release: 1%{?dist}%{?extra_release} + License: LGPLv2+ + Group: Development/Libraries +-Source: libvirt-cim-%{version}.tar.gz ++Source: ftp://libvirt.org/libvirt-cim/libvirt-cim-%{version}.tar.gz + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root + URL: http://libvirt.org/CIM/ + Requires: libxml2 >= 2.6.0 +-- +1.8.5.3 + diff --git a/SOURCES/libvirt-cim-0.6.3-54778c78.patch b/SOURCES/libvirt-cim-0.6.3-54778c78.patch new file mode 100644 index 0000000..e676c3f --- /dev/null +++ b/SOURCES/libvirt-cim-0.6.3-54778c78.patch @@ -0,0 +1,64 @@ +From 54778c7811594a731254e086a46dcc5f25ad2ee7 Mon Sep 17 00:00:00 2001 +From: John Ferlan +Date: Tue, 21 Jan 2014 16:23:16 -0500 +Subject: [PATCH 40/48] spec: Fix docs/*.html packaging issue + +Using a more recent rpmbuild on f20, I found that the 'make rpm' was failing: + + Installed (but unpackaged) file(s) found: + /usr/share/doc/libvirt-cim-0.6.3/html/architecture.html + /usr/share/doc/libvirt-cim-0.6.3/html/downloads.html + /usr/share/doc/libvirt-cim-0.6.3/html/index.html + /usr/share/doc/libvirt-cim-0.6.3/html/intro.html + /usr/share/doc/libvirt-cim-0.6.3/html/libvirt-cim.html + /usr/share/doc/libvirt-cim-0.6.3/html/news.html + /usr/share/doc/libvirt-cim-0.6.3/html/patches.html + /usr/share/doc/libvirt-cim-0.6.3/html/platforms.html + /usr/share/doc/libvirt-cim-0.6.3/html/schema.html + make: *** [rpm] Error 1 + +After a bit of research - I found the following page that describes a +workaround to add "%define _unpackaged_files_terminate_build 0" to the +spec file: + +http://www.oldrpm.org/hintskinks/unpackaged/ + +However, figuring that wasn't a great solution - I found a libvirt change +that provided a way to work around what was being seen, see: + +http://www.redhat.com/archives/libvir-list/2013-November/msg00441.html + +It seems as though having that %doc doc/*.html is not proper any more. +With this change I can once again build RPM packages + +Signed-off-by: John Ferlan +--- + libvirt-cim.spec.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libvirt-cim.spec.in b/libvirt-cim.spec.in +index c96451b..24ef280 100644 +--- a/libvirt-cim.spec.in ++++ b/libvirt-cim.spec.in +@@ -60,6 +60,7 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/libxkutil.so + mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d + echo %{_libdir}/cmpi > $RPM_BUILD_ROOT/etc/ld.so.conf.d/libvirt-cim.%{_arch}.conf + mkdir -p $RPM_BUILD_ROOT@INFO_STORE@ ++mv $RPM_BUILD_ROOT%{_datadir}/doc/libvirt-cim-%{version} libvirt-cim-docs + + %clean + rm -fr $RPM_BUILD_ROOT +@@ -347,9 +348,8 @@ fi + %defattr(-, root, root) + %{_sysconfdir}/libvirt/cim + +-%doc README COPYING doc/CodingStyle doc/SubmittingPatches ++%doc README COPYING doc/CodingStyle doc/SubmittingPatches libvirt-cim-docs/* + %doc base_schema/README.DMTF +-%doc doc/*.html + %{_libdir}/lib*.so* + %{_libdir}/cmpi/lib*.so* + %{_datadir}/libvirt-cim +-- +1.8.5.3 + diff --git a/SOURCES/libvirt-cim-0.6.3-5d2626f6.patch b/SOURCES/libvirt-cim-0.6.3-5d2626f6.patch new file mode 100644 index 0000000..4882450 --- /dev/null +++ b/SOURCES/libvirt-cim-0.6.3-5d2626f6.patch @@ -0,0 +1,39 @@ +From 5d2626f6e743e76b18272ec5e6bf4ee7e46cfee4 Mon Sep 17 00:00:00 2001 +From: John Ferlan +Date: Thu, 8 Aug 2013 15:50:29 -0400 +Subject: [PATCH 07/48] spec: Fix capitalization for version check + +Following seen on rpm -ivh install: + +Preparing... ################################# [100%] +Updating / installing... + 1:libvirt-cim-0.6.3-1.fc19 ################################# [100%] + /var/tmp/rpm-tmp.uY5oGu: line 5: /etc/init.d/tog-pegasus: No such file or directory + +Turns out commit id '8480cc79' inadvertently capitalized Fedora when replacing +a check that got removed by commit id '07adabc2'. + +"Fedora" shouldn't have been capitalized in the check to use +systemctl instead of /etc/init.d/tog-pegasus + +Signed-off-by: John Ferlan +--- + libvirt-cim.spec.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libvirt-cim.spec.in b/libvirt-cim.spec.in +index 98f2a75..459650c 100644 +--- a/libvirt-cim.spec.in ++++ b/libvirt-cim.spec.in +@@ -96,7 +96,7 @@ rm -fr $RPM_BUILD_ROOT + + %{_datadir}/%{name}/install_base_schema.sh %{_datadir}/%{name} + +-%if 0%{?Fedora} >= 17 || 0%{?rhel} >= 7 ++%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7 + if [ "`systemctl is-active tog-pegasus.service`" = "active" ] + then + systemctl restart tog-pegasus.service +-- +1.8.5.3 + diff --git a/SOURCES/libvirt-cim-0.6.3-6024403e.patch b/SOURCES/libvirt-cim-0.6.3-6024403e.patch new file mode 100644 index 0000000..156384d --- /dev/null +++ b/SOURCES/libvirt-cim-0.6.3-6024403e.patch @@ -0,0 +1,170 @@ +From 6024403e02643db81555e3333463b2f0e1b206b5 Mon Sep 17 00:00:00 2001 +From: Viktor Mihajlovski +Date: Thu, 29 Aug 2013 17:18:50 +0200 +Subject: [PATCH 09/48] VSSD: Add properties for arch and machine + +For architectures like s390 the machine type is relevant for +the proper guest construction. We add the necessary properties +to the schema and the C structures and the necessary code +for CIM-to-libvirt mapping. + +Signed-off-by: Viktor Mihajlovski +Signed-off-by: John Ferlan +--- + libxkutil/device_parsing.c | 12 ++++++++++++ + libxkutil/device_parsing.h | 2 ++ + libxkutil/xmlgen.c | 6 ++++++ + schema/VSSD.mof | 6 ++++++ + src/Virt_VSSD.c | 9 +++++++++ + src/Virt_VirtualSystemManagementService.c | 14 ++++++++++++++ + 6 files changed, 49 insertions(+) + +diff --git a/libxkutil/device_parsing.c b/libxkutil/device_parsing.c +index ad0f19c..7af3953 100644 +--- a/libxkutil/device_parsing.c ++++ b/libxkutil/device_parsing.c +@@ -1116,6 +1116,8 @@ static int parse_os(struct domain *dominfo, xmlNode *os) + xmlNode *child; + char **blist = NULL; + unsigned bl_size = 0; ++ char *arch = NULL; ++ char *machine = NULL; + char *kernel = NULL; + char *initrd = NULL; + char *cmdline = NULL; +@@ -1126,6 +1128,8 @@ static int parse_os(struct domain *dominfo, xmlNode *os) + for (child = os->children; child != NULL; child = child->next) { + if (XSTREQ(child->name, "type")) { + STRPROP(dominfo, os_info.pv.type, child); ++ arch = get_attr_value(child, "arch"); ++ machine = get_attr_value(child, "machine"); + } else if (XSTREQ(child->name, "kernel")) + kernel = get_node_content(child); + else if (XSTREQ(child->name, "initrd")) +@@ -1173,9 +1177,13 @@ static int parse_os(struct domain *dominfo, xmlNode *os) + case DOMAIN_KVM: + case DOMAIN_QEMU: + dominfo->os_info.fv.loader = loader; ++ dominfo->os_info.fv.arch = arch; ++ dominfo->os_info.fv.machine = machine; + dominfo->os_info.fv.bootlist_ct = bl_size; + dominfo->os_info.fv.bootlist = blist; + loader = NULL; ++ arch = NULL; ++ machine = NULL; + blist = NULL; + bl_size = 0; + break; +@@ -1195,6 +1203,8 @@ static int parse_os(struct domain *dominfo, xmlNode *os) + break; + } + ++ free(arch); ++ free(machine); + free(kernel); + free(initrd); + free(cmdline); +@@ -1398,6 +1408,8 @@ void cleanup_dominfo(struct domain **dominfo) + (dom->type == DOMAIN_KVM) || (dom->type == DOMAIN_QEMU)) { + free(dom->os_info.fv.type); + free(dom->os_info.fv.loader); ++ free(dom->os_info.fv.arch); ++ free(dom->os_info.fv.machine); + cleanup_bootlist(dom->os_info.fv.bootlist, + dom->os_info.fv.bootlist_ct); + } else if (dom->type == DOMAIN_LXC) { +diff --git a/libxkutil/device_parsing.h b/libxkutil/device_parsing.h +index 979b792..df5080c 100644 +--- a/libxkutil/device_parsing.h ++++ b/libxkutil/device_parsing.h +@@ -139,6 +139,8 @@ struct pv_os_info { + + struct fv_os_info { + char *type; /* Should always be 'hvm' */ ++ char *arch; ++ char *machine; + char *loader; + unsigned bootlist_ct; + char **bootlist; +diff --git a/libxkutil/xmlgen.c b/libxkutil/xmlgen.c +index 30e9a5e..2ca2341 100644 +--- a/libxkutil/xmlgen.c ++++ b/libxkutil/xmlgen.c +@@ -811,6 +811,12 @@ static char *_kvm_os_xml(xmlNodePtr root, struct domain *domain) + if (tmp == NULL) + return XML_ERROR; + ++ if (os->arch) ++ xmlNewProp(tmp, BAD_CAST "arch", BAD_CAST os->arch); ++ ++ if (os->machine) ++ xmlNewProp(tmp, BAD_CAST "machine", BAD_CAST os->machine); ++ + ret = _fv_bootlist_xml(root, os); + if (ret == 0) + return XML_ERROR; +diff --git a/schema/VSSD.mof b/schema/VSSD.mof +index 0359d67..2734d8e 100644 +--- a/schema/VSSD.mof ++++ b/schema/VSSD.mof +@@ -48,6 +48,12 @@ class KVM_VirtualSystemSettingData : Virt_VirtualSystemSettingData + [Description ("The emulator the guest should use during runtime.")] + string Emulator; + ++ [Description ("The guest's architecture.")] ++ string Arch; ++ ++ [Description ("The guest's machine type")] ++ string Machine; ++ + }; + + [Description ( +diff --git a/src/Virt_VSSD.c b/src/Virt_VSSD.c +index 3363b38..67e56aa 100644 +--- a/src/Virt_VSSD.c ++++ b/src/Virt_VSSD.c +@@ -121,6 +121,15 @@ static CMPIStatus _set_fv_prop(const CMPIBroker *broker, + goto out; + } + ++ if (dominfo->os_info.fv.arch != NULL) ++ CMSetProperty(inst, "Arch", ++ (CMPIValue *)dominfo->os_info.fv.arch, ++ CMPI_chars); ++ ++ if (dominfo->os_info.fv.machine != NULL) ++ CMSetProperty(inst, "Machine", ++ (CMPIValue *)dominfo->os_info.fv.machine, ++ CMPI_chars); + out: + return s; + } +diff --git a/src/Virt_VirtualSystemManagementService.c b/src/Virt_VirtualSystemManagementService.c +index 8ced2d6..3df878f 100644 +--- a/src/Virt_VirtualSystemManagementService.c ++++ b/src/Virt_VirtualSystemManagementService.c +@@ -543,6 +543,20 @@ static int fv_vssd_to_domain(CMPIInstance *inst, + if (!fv_set_emulator(domain, val)) + return 0; + ++ free(domain->os_info.fv.arch); ++ ret = cu_get_str_prop(inst, "Arch", &val); ++ if (ret == CMPI_RC_OK) ++ domain->os_info.fv.arch = strdup(val); ++ else ++ domain->os_info.fv.arch = NULL; ++ ++ free(domain->os_info.fv.machine); ++ ret = cu_get_str_prop(inst, "Machine", &val); ++ if (ret == CMPI_RC_OK) ++ domain->os_info.fv.machine = strdup(val); ++ else ++ domain->os_info.fv.machine = NULL; ++ + return 1; + } + +-- +1.8.5.3 + diff --git a/SOURCES/libvirt-cim-0.6.3-7e164fbd.patch b/SOURCES/libvirt-cim-0.6.3-7e164fbd.patch new file mode 100644 index 0000000..c34fe51 --- /dev/null +++ b/SOURCES/libvirt-cim-0.6.3-7e164fbd.patch @@ -0,0 +1,72 @@ +From 7e164fbdac05e955fe21c5bacc4aeee171821fd5 Mon Sep 17 00:00:00 2001 +From: Michal Privoznik +Date: Tue, 6 Aug 2013 14:41:33 +0200 +Subject: [PATCH 02/48] get_dominfo: Use VIR_DOMAIN_XML_SECURE more wisely + +Currently, even if we are connected RO to the libvirtd, we try to dump +domain XML with secure information (VIR_DOMAIN_XML_SECURE flag). This +is, however, forbidden in libvirt. With RO connection, we should not use +the SECURE flag at all. + +Signed-off-by: John Ferlan +--- + libxkutil/device_parsing.c | 9 +++++++-- + libxkutil/misc_util.c | 2 +- + libxkutil/misc_util.h | 1 + + 3 files changed, 9 insertions(+), 3 deletions(-) + +diff --git a/libxkutil/device_parsing.c b/libxkutil/device_parsing.c +index 7900e06..ffdf682 100644 +--- a/libxkutil/device_parsing.c ++++ b/libxkutil/device_parsing.c +@@ -31,6 +31,7 @@ + #include + + #include "device_parsing.h" ++#include "misc_util.h" + #include "xmlgen.h" + #include "../src/svpc_types.h" + +@@ -1283,8 +1284,12 @@ int get_dominfo(virDomainPtr dom, struct domain **dominfo) + char *xml; + int ret = 0; + int start; +- xml = virDomainGetXMLDesc(dom, +- VIR_DOMAIN_XML_INACTIVE | VIR_DOMAIN_XML_SECURE); ++ int flags = VIR_DOMAIN_XML_INACTIVE; ++ ++ if (!is_read_only()) ++ flags |= VIR_DOMAIN_XML_SECURE; ++ ++ xml = virDomainGetXMLDesc(dom, flags); + + if (xml == NULL) { + CU_DEBUG("Failed to get dom xml with libvirt API."); +diff --git a/libxkutil/misc_util.c b/libxkutil/misc_util.c +index 9e7e0d5..2164dd0 100644 +--- a/libxkutil/misc_util.c ++++ b/libxkutil/misc_util.c +@@ -219,7 +219,7 @@ static int libvirt_cim_config_get(LibvirtcimConfigProperty *prop) + } + #endif + +-static int is_read_only(void) ++int is_read_only(void) + { + static LibvirtcimConfigProperty prop = { + "readonly", CONFIG_BOOL, {0}, 0}; +diff --git a/libxkutil/misc_util.h b/libxkutil/misc_util.h +index fd4f191..056c327 100644 +--- a/libxkutil/misc_util.h ++++ b/libxkutil/misc_util.h +@@ -153,6 +153,7 @@ int virt_set_status(const CMPIBroker *broker, + #define REF2STR(r) CMGetCharPtr(CMObjectPathToString(r, NULL)) + + /* get libvirt-cim config */ ++int is_read_only(void); + const char *get_mig_ssh_tmp_key(void); + bool get_disable_kvm(void); + const char *get_lldptool_query_options(void); +-- +1.8.5.3 + diff --git a/SOURCES/libvirt-cim-0.6.3-95f0d418.patch b/SOURCES/libvirt-cim-0.6.3-95f0d418.patch new file mode 100644 index 0000000..b844e9d --- /dev/null +++ b/SOURCES/libvirt-cim-0.6.3-95f0d418.patch @@ -0,0 +1,43 @@ +From 95f0d418fe4240a0ea2706cc400828ec90984844 Mon Sep 17 00:00:00 2001 +From: Viktor Mihajlovski +Date: Tue, 5 Nov 2013 10:03:33 +0100 +Subject: [PATCH 34/48] schema: Fix class removal with Pegasus + +In provider de-registration step, the provider-register.sh +script is attempting to delete all libvirt-cim classes from +the Pegasus repository. Pegasus refuses to delete classes +if it still has child classes in the repository. +While the MOF files are processed in reverse order, the classes +were still deleted in their original order, which can fail due +to inter-class dependencies. +Changed to reverse the class deletion order on a per MOF +file base. + +Signed-off-by: Viktor Mihajlovski +Signed-off-by: John Ferlan +--- + provider-register.sh | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/provider-register.sh b/provider-register.sh +index b730ef3..abe8e95 100755 +--- a/provider-register.sh ++++ b/provider-register.sh +@@ -332,8 +332,12 @@ pegasus_uninstall() + echo "Error: wbemexec not found" >&2 + return 1 + fi +- CLASSES=`cat $mymofs 2> /dev/null | grep '^class'| cut -d ' ' -f 2 | uniq` +- ++ for mof in $mymofs ++ do ++ # We must delete the classes in reverse order per MOF file ++ MOFCLASSES=`cat $mof 2> /dev/null | grep '^[[:space:]]*class' | sed 's/ \+/ /g' | tac | cut -d ' ' -f 2` ++ CLASSES="$CLASSES $MOFCLASSES" ++ done + for _TEMPDIR in /var/tmp /tmp + do + if test -w $_TEMPDIR +-- +1.8.5.3 + diff --git a/SOURCES/libvirt-cim-0.6.3-9c1d321b.patch b/SOURCES/libvirt-cim-0.6.3-9c1d321b.patch new file mode 100644 index 0000000..a0d0145 --- /dev/null +++ b/SOURCES/libvirt-cim-0.6.3-9c1d321b.patch @@ -0,0 +1,218 @@ +From 9c1d321b14334b390ab84a2ff708566037b19130 Mon Sep 17 00:00:00 2001 +From: Viktor Mihajlovski +Date: Tue, 5 Nov 2013 10:03:32 +0100 +Subject: [PATCH 33/48] build: Fix provider registration issues + +This commit addresses an issue with provider registration during +RPM install or update. +The schema registration by wildcard doesn't take into consideration +that there are dependencies between the MOF files leading to +a partially populated repository and a not working libvirt-cim +provider. +Fixed by explicitly stating the mof and registration files in the +necessary order. + +Further a minor false error message coming from the systemd service +detection was bound to cause irritation. This is suppressed now. + +Signed-off-by: Viktor Mihajlovski +Signed-off-by: John Ferlan +--- + libvirt-cim.spec.in | 167 ++++++++++++++++++++++++++++++++++++++++++++++++---- + 1 file changed, 157 insertions(+), 10 deletions(-) + +diff --git a/libvirt-cim.spec.in b/libvirt-cim.spec.in +index b50cbd1..c96451b 100644 +--- a/libvirt-cim.spec.in ++++ b/libvirt-cim.spec.in +@@ -64,17 +64,164 @@ mkdir -p $RPM_BUILD_ROOT@INFO_STORE@ + %clean + rm -fr $RPM_BUILD_ROOT + +-%define REGISTRATION %{_datadir}/%{name}/*.registration +-%define SCHEMA %{_datadir}/%{name}/*.mof ++%define REGISTRATION %{_datadir}/%{name}/ComputerSystem.registration \\\ ++ %{_datadir}/%{name}/LogicalDisk.registration \\\ ++ %{_datadir}/%{name}/NetworkPort.registration \\\ ++ %{_datadir}/%{name}/Memory.registration \\\ ++ %{_datadir}/%{name}/Processor.registration \\\ ++ %{_datadir}/%{name}/SystemDevice.registration \\\ ++ %{_datadir}/%{name}/VSSD.registration \\\ ++ %{_datadir}/%{name}/HostSystem.registration \\\ ++ %{_datadir}/%{name}/HostedDependency.registration \\\ ++ %{_datadir}/%{name}/VirtualSystemManagementService.registration \\\ ++ %{_datadir}/%{name}/VirtualSystemManagementCapabilities.registration \\\ ++ %{_datadir}/%{name}/EnabledLogicalElementCapabilities.registration \\\ ++ %{_datadir}/%{name}/AllocationCapabilities.registration \\\ ++ %{_datadir}/%{name}/SettingsDefineCapabilities.registration \\\ ++ %{_datadir}/%{name}/MemoryPool.registration \\\ ++ %{_datadir}/%{name}/ElementCapabilities.registration \\\ ++ %{_datadir}/%{name}/ProcessorPool.registration \\\ ++ %{_datadir}/%{name}/DiskPool.registration \\\ ++ %{_datadir}/%{name}/HostedResourcePool.registration \\\ ++ %{_datadir}/%{name}/ComputerSystemIndication.registration \\\ ++ %{_datadir}/%{name}/ResourceAllocationSettingDataIndication.registration \\\ ++ %{_datadir}/%{name}/SwitchService.registration \\\ ++ %{_datadir}/%{name}/ComputerSystemMigrationIndication.registration \\\ ++ %{_datadir}/%{name}/ResourceAllocationSettingData.registration \\\ ++ %{_datadir}/%{name}/ResourcePoolConfigurationService.registration \\\ ++ %{_datadir}/%{name}/ResourcePoolConfigurationCapabilities.registration \\\ ++ %{_datadir}/%{name}/VSSDComponent.registration \\\ ++ %{_datadir}/%{name}/SettingsDefineState.registration \\\ ++ %{_datadir}/%{name}/NetPool.registration \\\ ++ %{_datadir}/%{name}/ResourceAllocationFromPool.registration \\\ ++ %{_datadir}/%{name}/ElementAllocatedFromPool.registration \\\ ++ %{_datadir}/%{name}/HostedService.registration \\\ ++ %{_datadir}/%{name}/ElementSettingData.registration \\\ ++ %{_datadir}/%{name}/VSMigrationCapabilities.registration \\\ ++ %{_datadir}/%{name}/VSMigrationService.registration \\\ ++ %{_datadir}/%{name}/ElementConformsToProfile.registration \\\ ++ %{_datadir}/%{name}/VSMigrationSettingData.registration \\\ ++ %{_datadir}/%{name}/VirtualSystemSnapshotService.registration \\\ ++ %{_datadir}/%{name}/VirtualSystemSnapshotServiceCapabilities.registration \\\ ++ %{_datadir}/%{name}/ConcreteComponent.registration \\\ ++ %{_datadir}/%{name}/ConsoleRedirectionService.registration \\\ ++ %{_datadir}/%{name}/ConsoleRedirectionServiceCapabilities.registration \\\ ++ %{_datadir}/%{name}/ServiceAffectsElement.registration \\\ ++ %{_datadir}/%{name}/KVMRedirectionSAP.registration \\\ ++ %{_datadir}/%{name}/DisplayController.registration \\\ ++ %{_datadir}/%{name}/PointingDevice.registration \\\ ++ %{_datadir}/%{name}/GraphicsPool.registration \\\ ++ %{_datadir}/%{name}/InputPool.registration \\\ ++ %{_datadir}/%{name}/HostedAccessPoint.registration \\\ ++ %{_datadir}/%{name}/ServiceAccessBySAP.registration \\\ ++ %{_datadir}/%{name}/SAPAvailableForElement.registration \\\ ++ %{_datadir}/%{name}/FilterEntry.registration \\\ ++ %{_datadir}/%{name}/FilterList.registration \\\ ++ %{_datadir}/%{name}/EntriesInFilterList.registration \\\ ++ %{_datadir}/%{name}/NestedFilterList.registration \\\ ++ %{_datadir}/%{name}/AppliedFilterList.registration \\\ ++ %{_datadir}/%{name}/HostedFilterList.registration + +-%define INTEROP_REG %{_datadir}/%{name}/{RegisteredProfile,ElementConformsToProfile,ReferencedProfile}.registration +-%define INTEROP_MOF %{_datadir}/%{name}/{ComputerSystem,HostSystem,RegisteredProfile,DiskPool,MemoryPool,NetPool,ProcessorPool,VSMigrationService,ElementConformsToProfile,ReferencedProfile,AllocationCapabilities}.mof ++%define SCHEMA %{_datadir}/%{name}/ComputerSystem.mof \\\ ++ %{_datadir}/%{name}/LogicalDisk.mof \\\ ++ %{_datadir}/%{name}/NetworkPort.mof \\\ ++ %{_datadir}/%{name}/Memory.mof \\\ ++ %{_datadir}/%{name}/Processor.mof \\\ ++ %{_datadir}/%{name}/SystemDevice.mof \\\ ++ %{_datadir}/%{name}/Virt_VSSD.mof \\\ ++ %{_datadir}/%{name}/VSSD.mof \\\ ++ %{_datadir}/%{name}/HostSystem.mof \\\ ++ %{_datadir}/%{name}/HostedDependency.mof \\\ ++ %{_datadir}/%{name}/VirtualSystemManagementService.mof \\\ ++ %{_datadir}/%{name}/VirtualSystemManagementCapabilities.mof \\\ ++ %{_datadir}/%{name}/EnabledLogicalElementCapabilities.mof \\\ ++ %{_datadir}/%{name}/AllocationCapabilities.mof \\\ ++ %{_datadir}/%{name}/SettingsDefineCapabilities.mof \\\ ++ %{_datadir}/%{name}/MemoryPool.mof \\\ ++ %{_datadir}/%{name}/ElementCapabilities.mof \\\ ++ %{_datadir}/%{name}/ProcessorPool.mof \\\ ++ %{_datadir}/%{name}/DiskPool.mof \\\ ++ %{_datadir}/%{name}/HostedResourcePool.mof \\\ ++ %{_datadir}/%{name}/RegisteredProfile.mof \\\ ++ %{_datadir}/%{name}/ElementConformsToProfile.mof \\\ ++ %{_datadir}/%{name}/ComputerSystemIndication.mof \\\ ++ %{_datadir}/%{name}/ResourceAllocationSettingDataIndication.mof \\\ ++ %{_datadir}/%{name}/SwitchService.mof \\\ ++ %{_datadir}/%{name}/ComputerSystemMigrationIndication.mof \\\ ++ %{_datadir}/%{name}/Virt_ResourceAllocationSettingData.mof \\\ ++ %{_datadir}/%{name}/ResourceAllocationSettingData.mof \\\ ++ %{_datadir}/%{name}/ResourcePoolConfigurationService.mof \\\ ++ %{_datadir}/%{name}/ResourcePoolConfigurationCapabilities.mof \\\ ++ %{_datadir}/%{name}/VSSDComponent.mof \\\ ++ %{_datadir}/%{name}/SettingsDefineState.mof \\\ ++ %{_datadir}/%{name}/NetPool.mof \\\ ++ %{_datadir}/%{name}/ResourceAllocationFromPool.mof \\\ ++ %{_datadir}/%{name}/ElementAllocatedFromPool.mof \\\ ++ %{_datadir}/%{name}/HostedService.mof \\\ ++ %{_datadir}/%{name}/ElementSettingData.mof \\\ ++ %{_datadir}/%{name}/VSMigrationCapabilities.mof \\\ ++ %{_datadir}/%{name}/VSMigrationService.mof \\\ ++ %{_datadir}/%{name}/VSMigrationSettingData.mof \\\ ++ %{_datadir}/%{name}/VirtualSystemSnapshotService.mof \\\ ++ %{_datadir}/%{name}/VirtualSystemSnapshotServiceCapabilities.mof \\\ ++ %{_datadir}/%{name}/ConcreteComponent.mof \\\ ++ %{_datadir}/%{name}/ConsoleRedirectionService.mof \\\ ++ %{_datadir}/%{name}/ConsoleRedirectionServiceCapabilities.mof \\\ ++ %{_datadir}/%{name}/ServiceAffectsElement.mof \\\ ++ %{_datadir}/%{name}/KVMRedirectionSAP.mof \\\ ++ %{_datadir}/%{name}/DisplayController.mof \\\ ++ %{_datadir}/%{name}/PointingDevice.mof \\\ ++ %{_datadir}/%{name}/GraphicsPool.mof \\\ ++ %{_datadir}/%{name}/InputPool.mof \\\ ++ %{_datadir}/%{name}/HostedAccessPoint.mof \\\ ++ %{_datadir}/%{name}/ServiceAccessBySAP.mof \\\ ++ %{_datadir}/%{name}/SAPAvailableForElement.mof \\\ ++ %{_datadir}/%{name}/FilterEntry.mof \\\ ++ %{_datadir}/%{name}/FilterList.mof \\\ ++ %{_datadir}/%{name}/EntriesInFilterList.mof \\\ ++ %{_datadir}/%{name}/NestedFilterList.mof \\\ ++ %{_datadir}/%{name}/AppliedFilterList.mof \\\ ++ %{_datadir}/%{name}/HostedFilterList.mof + +-%define PGINTEROP_REG %{_datadir}/%{name}/{RegisteredProfile,ElementConformsToProfile,ReferencedProfile}.registration +-%define PGINTEROP_MOF %{_datadir}/%{name}/{RegisteredProfile,ElementConformsToProfile,ReferencedProfile}.mof ++%define INTEROP_REG %{_datadir}/%{name}/RegisteredProfile.registration \\\ ++ %{_datadir}/%{name}/ElementConformsToProfile.registration \\\ ++ %{_datadir}/%{name}/ReferencedProfile.registration + +-%define CIMV2_REG %{_datadir}/%{name}/{HostedResourcePool,ElementCapabilities,HostedService,HostedDependency,ElementConformsToProfile,HostedAccessPoint}.registration +-%define CIMV2_MOF %{_datadir}/%{name}/{HostedResourcePool,ElementCapabilities,HostedService,HostedDependency,RegisteredProfile,ComputerSystem,ElementConformsToProfile,HostedAccessPoint}.mof ++%define INTEROP_MOF %{_datadir}/%{name}/ComputerSystem.mof \\\ ++ %{_datadir}/%{name}/HostSystem.mof \\\ ++ %{_datadir}/%{name}/RegisteredProfile.mof \\\ ++ %{_datadir}/%{name}/DiskPool.mof \\\ ++ %{_datadir}/%{name}/MemoryPool.mof \\\ ++ %{_datadir}/%{name}/NetPool.mof \\\ ++ %{_datadir}/%{name}/ProcessorPool.mof \\\ ++ %{_datadir}/%{name}/VSMigrationService.mof \\\ ++ %{_datadir}/%{name}/ElementConformsToProfile.mof \\\ ++ %{_datadir}/%{name}/ReferencedProfile.mof \\\ ++ %{_datadir}/%{name}/AllocationCapabilities.mof ++ ++%define PGINTEROP_REG %{_datadir}/%{name}/RegisteredProfile.registration \\\ ++ %{_datadir}/%{name}/ElementConformsToProfile.registration \\\ ++ %{_datadir}/%{name}/ReferencedProfile.registration ++ ++%define PGINTEROP_MOF %{_datadir}/%{name}/RegisteredProfile.mof \\\ ++ %{_datadir}/%{name}/ElementConformsToProfile.mof \\\ ++ %{_datadir}/%{name}/ReferencedProfile.mof ++ ++%define CIMV2_REG %{_datadir}/%{name}/HostedResourcePool.registration \\\ ++ %{_datadir}/%{name}/ElementCapabilities.registration \\\ ++ %{_datadir}/%{name}/HostedService.registration \\\ ++ %{_datadir}/%{name}/HostedDependency.registration \\\ ++ %{_datadir}/%{name}/ElementConformsToProfile.registration \\\ ++ %{_datadir}/%{name}/HostedAccessPoint.registration ++ ++%define CIMV2_MOF %{_datadir}/%{name}/HostedResourcePool.mof \\\ ++ %{_datadir}/%{name}/ElementCapabilities.mof \\\ ++ %{_datadir}/%{name}/HostedService.mof \\\ ++ %{_datadir}/%{name}/HostedDependency.mof \\\ ++ %{_datadir}/%{name}/RegisteredProfile.mof \\\ ++ %{_datadir}/%{name}/ComputerSystem.mof \\\ ++ %{_datadir}/%{name}/ElementConformsToProfile.mof \\\ ++ %{_datadir}/%{name}/HostedAccessPoint.mof + + %pre + # _If_ there is already a version of this installed, we must deregister +@@ -118,12 +265,12 @@ then + fi + + %if 0%{?fedora} >= 17 || 0%{?rhel} >= 7 +- if [ "`systemctl is-active tog-pegasus.service`" = "active" ] ++ if [ "`systemctl is-active tog-pegasus.service 2> /dev/null`" = "active" ] + then + systemctl restart tog-pegasus.service + fi + +- if [ "`systemctl is-active sblim-sfcb.service`" = "active" ] ++ if [ "`systemctl is-active sblim-sfcb.service 2> /dev/null`" = "active" ] + then + systemctl restart sblim-sfcb.service + fi +-- +1.8.5.3 + diff --git a/SOURCES/libvirt-cim-0.6.3-a8cfd7dc.patch b/SOURCES/libvirt-cim-0.6.3-a8cfd7dc.patch new file mode 100644 index 0000000..b734708 --- /dev/null +++ b/SOURCES/libvirt-cim-0.6.3-a8cfd7dc.patch @@ -0,0 +1,198 @@ +From a8cfd7dc6a4f173c764f02688ff0c8aec00ecec2 Mon Sep 17 00:00:00 2001 +From: John Ferlan +Date: Mon, 13 Jan 2014 14:11:21 -0500 +Subject: [PATCH 48/48] Use of root/interop instead of root/PG_InterOp + +As of tog-pegasus 2.12.1-5 we can no longer use "root/PG_InterOp" namespace +for the CIM provider instead the use of "root/interop" is the preferred +mechanism. + +This patch will adjust where libvirt-cim installs its classes to use the +"root/interop" namespace. + +For more context, see: + + http://www.redhat.com/archives/libvirt-cim/2013-November/msg00083.html + +and + + http://www.redhat.com/archives/libvirt-cim/2013-November/msg00008.html + +This patch does not include the schema changes to FilterList although I +have a suspicion that a bug fix between 2.12.1-8 and 2.12.1-11 has resolved +the issue seen. Cannot find a reference though. + +Signed-off-by: John Ferlan +--- + Makefile.am | 29 ++++++++++++++++++++++++----- + libvirt-cim.spec.in | 27 ++++++++++++++++++++++----- + provider-register.sh | 18 +++++++++++++++++- + 3 files changed, 63 insertions(+), 11 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 9e8e96b..69b65cf 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -78,6 +78,9 @@ INTEROP_MOFS = \ + $(top_srcdir)/schema/ReferencedProfile.mof \ + $(top_srcdir)/schema/AllocationCapabilities.mof + ++# The PGINTEROP_MOFS are used by tog-pegasus up through version 2.12.1 ++# If support for versions prior to 2.12.1 is removed, then these defs ++# can go away + PGINTEROP_MOFS = \ + $(top_srcdir)/schema/RegisteredProfile.mof \ + $(top_srcdir)/schema/ElementConformsToProfile.mof \ +@@ -157,6 +160,9 @@ INTEROP_REGS = \ + $(top_srcdir)/schema/ElementConformsToProfile.registration \ + $(top_srcdir)/schema/ReferencedProfile.registration + ++# The PGINTEROP_REGS are used by tog-pegasus up through version 2.12.1 ++# If support for versions prior to 2.12.1 is removed, then these defs ++# can go away + PGINTEROP_REGS = \ + $(top_srcdir)/schema/RegisteredProfile.registration \ + $(top_srcdir)/schema/ElementConformsToProfile.registration \ +@@ -181,7 +187,8 @@ EXTRA_DIST = schema $(MOFS) $(REGS) $(INTEROP_MOFS) $(INTEROP_REGS) \ + .changeset .revision \ + examples/diskpool.conf + +-# If Pegasus isn't the CIMOM target, then remove the PG_InterOp namespace from the appropriate files ++# If Pegasus isn't the CIMOM target, then remove the PG_InterOp namespace ++# from the appropriate files + install-data-local: + $(mkinstalldirs) "$(DESTDIR)$(pkgdatadir)" + $(install_sh_DATA) -t "$(DESTDIR)$(pkgdatadir)" $(MOFS) +@@ -189,11 +196,12 @@ install-data-local: + $(install_sh_DATA) -t "$(DESTDIR)$(pkgdatadir)" $(INTEROP_MOFS) + $(install_sh_DATA) -t "$(DESTDIR)$(pkgdatadir)" $(INTEROP_REGS) + if [[ @CIMSERVER@ != pegasus ]]; then \ +- sed -i '/^# --/,/^# --!/d' $(subst $(top_srcdir)/schema,$(DESTDIR)$(pkgdatadir), $(PGINTEROP_REGS)); \ ++ sed -i '/^# --/,/^# --!/d' $(subst $(top_srcdir)/schema,$(DESTDIR)$(pkgdatadir), $(PGINTEROP_REGS)); \ ++ sed -i '/^# --/,/^# --!/d' $(subst $(top_srcdir)/schema,$(DESTDIR)$(pkgdatadir), $(PGINTEROP_MOFS)); \ + fi + + uninstall-local: +- @list='$(MOFS) $(REGS) $(INTEROP_MOFS) $(INTEROP_REGS)'; \ ++ @list='$(MOFS) $(REGS) $(INTEROP_MOFS) $(INTEROP_REGS) $(PGINTEROP_REGS) $(PGINTEROP_MOFS)'; \ + for p in $$list; do \ + f=`echo "$$p" | sed 's|^.*/||;'`; \ + echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \ +@@ -209,8 +217,19 @@ postinstall: + $(SHELL) provider-register.sh -v -t @CIMSERVER@ -n @CIM_VIRT_NS@ -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(MOFS)) + $(SHELL) provider-register.sh -v -t @CIMSERVER@ -n root/interop -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(INTEROP_REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(INTEROP_MOFS)) + $(SHELL) provider-register.sh -v -t @CIMSERVER@ -n root/cimv2 -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(CIMV2_REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(CIMV2_MOFS)) ++ # ++ # We need to check the version - if we're not yet at 2.12.1, then ++ # we'll register at root/PG_InterOp; otherwise, using just the above ++ # registration should be sufficient. The actual cutoff root/PG_InterOp ++ # not being valid was 2.12.1-5; however, --version doesn't give us that ++ # level of detail. The Pegasus docs imply that usage of root/interop was ++ # valid as of 2.12.0. ++ # + if [[ @CIMSERVER@ = pegasus ]]; then \ +- $(SHELL) provider-register.sh -v -t @CIMSERVER@ -n root/PG_InterOp -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(PGINTEROP_REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(PGINTEROP_MOFS)); \ ++ CIMVER=`@CIMSERVER@ --version | awk -F. '{printf("%02d%02d%02d\n", $1,$2,$3); }'` \ ++ if [[ $CIMVER -lt 021201 ]]; then \ ++ $(SHELL) provider-register.sh -v -t @CIMSERVER@ -n root/PG_InterOp -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(PGINTEROP_REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(PGINTEROP_MOFS)); \ ++ fi \ + fi + virsh -v | grep -q '^0.3' && cp examples/diskpool.conf $(DISK_POOL_CONFIG) || true + mkdir -p $(INFO_STORE) +@@ -220,7 +239,7 @@ preuninstall: + $(SHELL) provider-register.sh -v -d -t @CIMSERVER@ -n root/interop -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(INTEROP_REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(INTEROP_MOFS)) + $(SHELL) provider-register.sh -v -d -t @CIMSERVER@ -n root/cimv2 -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(CIMV2_REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(CIMV2_MOFS)) + if [[ @CIMSERVER@ = pegasus ]]; then \ +- $(SHELL) provider-register.sh -v -d -t @CIMSERVER@ -n root/PG_InterOp -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(PGINTEROP_REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(PGINTEROP_MOFS)); \ ++ $(SHELL) provider-register.sh -v -d -t @CIMSERVER@ -n root/PG_InterOp -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(PGINTEROP_REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(PGINTEROP_MOFS)); \ + fi + + rpm: clean +diff --git a/libvirt-cim.spec.in b/libvirt-cim.spec.in +index 24ef280..01ee329 100644 +--- a/libvirt-cim.spec.in ++++ b/libvirt-cim.spec.in +@@ -200,6 +200,10 @@ rm -fr $RPM_BUILD_ROOT + %{_datadir}/%{name}/ReferencedProfile.mof \\\ + %{_datadir}/%{name}/AllocationCapabilities.mof + ++# NOTE: As of Pegasus 2.12.1-5, using root/PG_InterOp will no longer be ++# valid. All mofs can just compile into root/interop. However, we ++# need to keep these here for 'historical purposes'. ++# + %define PGINTEROP_REG %{_datadir}/%{name}/RegisteredProfile.registration \\\ + %{_datadir}/%{name}/ElementConformsToProfile.registration \\\ + %{_datadir}/%{name}/ReferencedProfile.registration +@@ -268,12 +272,12 @@ fi + %if 0%{?fedora} >= 17 || 0%{?rhel} >= 7 + if [ "`systemctl is-active tog-pegasus.service 2> /dev/null`" = "active" ] + then +- systemctl restart tog-pegasus.service ++ systemctl restart tog-pegasus.service > /dev/null 2>&1 + fi + + if [ "`systemctl is-active sblim-sfcb.service 2> /dev/null`" = "active" ] + then +- systemctl restart sblim-sfcb.service ++ systemctl restart sblim-sfcb.service > /dev/null 2>&1 + fi + %else + /etc/init.d/tog-pegasus condrestart +@@ -287,9 +291,22 @@ then + %{_datadir}/%{name}/provider-register.sh -t pegasus \ + -n root/interop \ + -r %{INTEROP_REG} -m %{INTEROP_MOF} -v >/dev/null 2>&1 || true +- %{_datadir}/%{name}/provider-register.sh -t pegasus \ +- -n root/PG_InterOp \ +- -r %{PGINTEROP_REG} -m %{PGINTEROP_MOF} -v >/dev/null 2>&1 || true ++ # ++ # We need to check the version - if we're not yet at 2.12.1, then ++ # we'll register at root/PG_InterOp; otherwise, using just the above ++ # registration should be sufficient. The actual cutoff root/PG_InterOp ++ # not being valid was 2.12.1-5; however, --version doesn't give us that ++ # level of detail. The Pegasus docs imply that usage of root/interop was ++ # valid as of 2.12.0. ++ # ++ CIMVER=`/usr/sbin/cimserver --version | \ ++ awk -F. '{printf("%02d%02d%02d\n", $1,$2,$3); }'` ++ if [ $CIMVER -lt 021201 ] ++ then ++ %{_datadir}/%{name}/provider-register.sh -t pegasus \ ++ -n root/PG_InterOp \ ++ -r %{PGINTEROP_REG} -m %{PGINTEROP_MOF} -v >/dev/null 2>&1 || true ++ fi + %{_datadir}/%{name}/provider-register.sh -t pegasus \ + -n root/cimv2\ + -r %{CIMV2_REG} -m %{CIMV2_MOF} -v >/dev/null 2>&1 || true +diff --git a/provider-register.sh b/provider-register.sh +index abe8e95..f66fe54 100755 +--- a/provider-register.sh ++++ b/provider-register.sh +@@ -274,7 +274,23 @@ pegasus_install() + chatter Registering providers with $state cimserver '('$version')' + chatter Installing mofs into namespace $namespace from path $mofpath + $CIMMOF -uc -I $mofpath -n $namespace $mymofs && +- $CIMMOF -uc -n root/PG_Interop $_REGFILENAME ++ # ++ # If compare_version returns false here (e.g. $version is less than ++ # "2.12.1", then we will compile into root/PG_InterOp; otherwise, ++ # compile into root/interop. As of 2.12.1-5 using the PG_InterOp ++ # will fail. Since we cannot get that level of detail out of the ++ # --version output, "assume" that 2.12.1 -> 2.12.1-4 will be able ++ # to use the new namespace. The Pegasus docs imply as of 2.12.0 using ++ # root/interop was preferred. ++ # ++ if compare_version "$version" "2.12.1" ++ then ++ chatter Installing $_REGFILENAME into root/PG_InterOp ++ $CIMMOF -uc -n root/PG_Interop $_REGFILENAME ++ else ++ chatter Installing $_REGFILENAME into root/interop ++ $CIMMOF -uc -n root/interop $_REGFILENAME ++ fi + else + echo "Failed to build pegasus registration MOF." >&2 + return 1 +-- +1.8.5.3 + diff --git a/SOURCES/libvirt-cim-0.6.3-de03c66f.patch b/SOURCES/libvirt-cim-0.6.3-de03c66f.patch new file mode 100644 index 0000000..c5a0c37 --- /dev/null +++ b/SOURCES/libvirt-cim-0.6.3-de03c66f.patch @@ -0,0 +1,112 @@ +From de03c66f06549081fef4d5600eb9a2136664a0fa Mon Sep 17 00:00:00 2001 +From: Xu Wang +Date: Mon, 19 Aug 2013 17:11:10 +0800 +Subject: [PATCH 05/48] Add dumpCore tag support to memory + +dumpCore tag in the is not supported by libvirt-cim and +it will be dropped during updating any element in the xml definition +of a domain. This patch keep the tag all the time. + +Signed-off-by: Xu Wang +Signed-off-by: John Ferlan +--- + libxkutil/device_parsing.c | 28 +++++++++++++++++++++++++++- + libxkutil/device_parsing.h | 3 +++ + libxkutil/xmlgen.c | 9 +++++++++ + 3 files changed, 39 insertions(+), 1 deletion(-) + +diff --git a/libxkutil/device_parsing.c b/libxkutil/device_parsing.c +index ffdf682..542e4e9 100644 +--- a/libxkutil/device_parsing.c ++++ b/libxkutil/device_parsing.c +@@ -606,8 +606,17 @@ static int parse_mem_device(xmlNode *node, struct virt_device **vdevs) + + if (XSTREQ(node->name, "currentMemory")) + sscanf(content, "%" PRIu64, &mdev->size); +- else if (XSTREQ(node->name, "memory")) ++ else if (XSTREQ(node->name, "memory")) { + sscanf(content, "%" PRIu64, &mdev->maxsize); ++ content = get_attr_value(node, "dumpCore"); ++ if (content && XSTREQ(content, "on")) { ++ mdev->dumpCore = MEM_DUMP_CORE_ON; ++ } else if (content && XSTREQ(content, "off")) { ++ mdev->dumpCore = MEM_DUMP_CORE_OFF; ++ } else { ++ mdev->dumpCore = MEM_DUMP_CORE_NOT_SET; ++ } ++ } + + free(content); + +@@ -969,6 +978,7 @@ static int _get_mem_device(const char *xml, struct virt_device **list) + struct virt_device *mdevs = NULL; + struct virt_device *mdev = NULL; + int ret; ++ bool mem_dump_core_set = false; + + ret = parse_devices(xml, &mdevs, CIM_RES_TYPE_MEM); + if (ret <= 0) +@@ -988,10 +998,26 @@ static int _get_mem_device(const char *xml, struct virt_device **list) + mdevs[1].dev.mem.size); + mdev->dev.mem.maxsize = MAX(mdevs[0].dev.mem.maxsize, + mdevs[1].dev.mem.maxsize); ++ /* libvirt dumpCore tag always belong to memory xml node, but ++ * here we may have two mdev for memory node and currentMemory ++ * node. So pick up one value. ++ */ ++ if (mdevs[0].dev.mem.dumpCore != MEM_DUMP_CORE_NOT_SET) { ++ mdev->dev.mem.dumpCore = mdevs[0].dev.mem.dumpCore; ++ mem_dump_core_set = true; ++ } else if (mdevs[1].dev.mem.dumpCore != ++ MEM_DUMP_CORE_NOT_SET) { ++ if (mem_dump_core_set) { ++ CU_DEBUG("WARN: libvirt set memory core dump in" ++ "two nodes!"); ++ } ++ mdev->dev.mem.dumpCore = mdevs[1].dev.mem.dumpCore; ++ } + } else { + mdev->dev.mem.size = MAX(mdevs[0].dev.mem.size, + mdevs[0].dev.mem.maxsize); + mdev->dev.mem.maxsize = mdev->dev.mem.size; ++ mdev->dev.mem.dumpCore = mdevs[0].dev.mem.dumpCore; + } + + mdev->type = CIM_RES_TYPE_MEM; +diff --git a/libxkutil/device_parsing.h b/libxkutil/device_parsing.h +index 2b6d3d1..979b792 100644 +--- a/libxkutil/device_parsing.h ++++ b/libxkutil/device_parsing.h +@@ -75,6 +75,9 @@ struct net_device { + struct mem_device { + uint64_t size; + uint64_t maxsize; ++ enum { MEM_DUMP_CORE_NOT_SET, ++ MEM_DUMP_CORE_ON, ++ MEM_DUMP_CORE_OFF } dumpCore; + }; + + struct vcpu_device { +diff --git a/libxkutil/xmlgen.c b/libxkutil/xmlgen.c +index 4287d42..30e9a5e 100644 +--- a/libxkutil/xmlgen.c ++++ b/libxkutil/xmlgen.c +@@ -498,6 +498,15 @@ static const char *mem_xml(xmlNodePtr root, struct domain *dominfo) + BAD_CAST string); + + free(string); ++ ++ if (tmp == NULL) ++ return XML_ERROR; ++ if (mem->dumpCore == MEM_DUMP_CORE_ON) { ++ xmlNewProp(tmp, BAD_CAST "dumpCore", BAD_CAST "on"); ++ } else if (mem->dumpCore == MEM_DUMP_CORE_OFF) { ++ xmlNewProp(tmp, BAD_CAST "dumpCore", BAD_CAST "off"); ++ } ++ + out: + if (tmp == NULL) + return XML_ERROR; +-- +1.8.5.3 + diff --git a/SOURCES/libvirt-cim-0.6.3-ee74ebc1.patch b/SOURCES/libvirt-cim-0.6.3-ee74ebc1.patch new file mode 100644 index 0000000..c9743da --- /dev/null +++ b/SOURCES/libvirt-cim-0.6.3-ee74ebc1.patch @@ -0,0 +1,39 @@ +From ee74ebc122c60e86dd02442589b880c367a4eb9a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?J=C3=A1n=20Tomko?= +Date: Wed, 21 Aug 2013 15:35:28 +0200 +Subject: [PATCH 04/48] libvirt-cim.spec.in: Uninstall open-pegasus-specific + providers from sfcb +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Older libvirt-cim might've installed these in the sblim-sfcb +repository, causing errors when calling sfcbrepos on libvirt-cim update. + +Signed-off-by: Ján Tomko +Signed-off-by: John Ferlan +--- + libvirt-cim.spec.in | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/libvirt-cim.spec.in b/libvirt-cim.spec.in +index a027246..cd399b1 100644 +--- a/libvirt-cim.spec.in ++++ b/libvirt-cim.spec.in +@@ -84,6 +84,13 @@ rm -fr $RPM_BUILD_ROOT + -n @CIM_VIRT_NS@ \ + -r %{REGISTRATION} -m %{SCHEMA} >/dev/null 2>&1 || true + ++# Remove open-pegasus-specific providers installed in sfcb repository ++# by older libvirt-cim packages ++%{_datadir}/%{name}/provider-register.sh -d -t sfcb \ ++ -n root/PG_InterOp \ ++ -r %{PGINTEROP_REG} -m %{PGINTEROP_MOF} >/dev/null 2>&1 || true ++ ++ + %post + /sbin/ldconfig + +-- +1.8.5.3 + diff --git a/SOURCES/libvirt-cim-0.6.3-f18ba715.patch b/SOURCES/libvirt-cim-0.6.3-f18ba715.patch new file mode 100644 index 0000000..e957eaa --- /dev/null +++ b/SOURCES/libvirt-cim-0.6.3-f18ba715.patch @@ -0,0 +1,72 @@ +From f18ba71595815c820742e2f12cc30481fc510642 Mon Sep 17 00:00:00 2001 +From: Viktor Mihajlovski +Date: Fri, 30 Aug 2013 14:12:20 +0200 +Subject: [PATCH 13/48] build: Don't use /bin/sh unconditionally + +provider-register.sh implicitly assumes that the shell has bash-like +capabilities. On systems like Ubuntu this is not the case leading +to a make postinstall failure when used with Pegasus. +Changing the script shebang to /bin/bash to make this explicit. +Further replace occurrences of sh to $(SHELL) in the Makefile +invocations of provider-register.sh. + +Signed-off-by: Viktor Mihajlovski +Signed-off-by: John Ferlan +--- + Makefile.am | 18 +++++++++--------- + provider-register.sh | 2 +- + 2 files changed, 10 insertions(+), 10 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 63ed3c7..9e8e96b 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -201,26 +201,26 @@ uninstall-local: + done + + preinstall: +- sh -x base_schema/install_base_schema.sh `pwd`/base_schema ++ $(SHELL) -x base_schema/install_base_schema.sh `pwd`/base_schema + + # Un/Register the providers and class definitions from/to the current CIMOM. + # @CIMSERVER@ is set by the configure script + postinstall: +- sh provider-register.sh -v -t @CIMSERVER@ -n @CIM_VIRT_NS@ -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(MOFS)) +- sh provider-register.sh -v -t @CIMSERVER@ -n root/interop -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(INTEROP_REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(INTEROP_MOFS)) +- sh provider-register.sh -v -t @CIMSERVER@ -n root/cimv2 -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(CIMV2_REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(CIMV2_MOFS)) ++ $(SHELL) provider-register.sh -v -t @CIMSERVER@ -n @CIM_VIRT_NS@ -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(MOFS)) ++ $(SHELL) provider-register.sh -v -t @CIMSERVER@ -n root/interop -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(INTEROP_REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(INTEROP_MOFS)) ++ $(SHELL) provider-register.sh -v -t @CIMSERVER@ -n root/cimv2 -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(CIMV2_REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(CIMV2_MOFS)) + if [[ @CIMSERVER@ = pegasus ]]; then \ +- sh provider-register.sh -v -t @CIMSERVER@ -n root/PG_InterOp -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(PGINTEROP_REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(PGINTEROP_MOFS)); \ ++ $(SHELL) provider-register.sh -v -t @CIMSERVER@ -n root/PG_InterOp -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(PGINTEROP_REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(PGINTEROP_MOFS)); \ + fi + virsh -v | grep -q '^0.3' && cp examples/diskpool.conf $(DISK_POOL_CONFIG) || true + mkdir -p $(INFO_STORE) + + preuninstall: +- sh provider-register.sh -v -d -t @CIMSERVER@ -n @CIM_VIRT_NS@ -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(MOFS)) +- sh provider-register.sh -v -d -t @CIMSERVER@ -n root/interop -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(INTEROP_REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(INTEROP_MOFS)) +- sh provider-register.sh -v -d -t @CIMSERVER@ -n root/cimv2 -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(CIMV2_REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(CIMV2_MOFS)) ++ $(SHELL) provider-register.sh -v -d -t @CIMSERVER@ -n @CIM_VIRT_NS@ -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(MOFS)) ++ $(SHELL) provider-register.sh -v -d -t @CIMSERVER@ -n root/interop -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(INTEROP_REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(INTEROP_MOFS)) ++ $(SHELL) provider-register.sh -v -d -t @CIMSERVER@ -n root/cimv2 -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(CIMV2_REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(CIMV2_MOFS)) + if [[ @CIMSERVER@ = pegasus ]]; then \ +- sh provider-register.sh -v -d -t @CIMSERVER@ -n root/PG_InterOp -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(PGINTEROP_REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(PGINTEROP_MOFS)); \ ++ $(SHELL) provider-register.sh -v -d -t @CIMSERVER@ -n root/PG_InterOp -r $(subst $(top_srcdir)/schema,$(pkgdatadir), $(PGINTEROP_REGS)) -m $(subst $(top_srcdir)/schema,$(pkgdatadir), $(PGINTEROP_MOFS)); \ + fi + + rpm: clean +diff --git a/provider-register.sh b/provider-register.sh +index b907df1..b730ef3 100755 +--- a/provider-register.sh ++++ b/provider-register.sh +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + # $Id$ + # ================================================================== + # Copyright IBM Corp. 2005 +-- +1.8.5.3 + diff --git a/SPECS/libvirt-cim.spec b/SPECS/libvirt-cim.spec index 103e07c..fe8fd72 100644 --- a/SPECS/libvirt-cim.spec +++ b/SPECS/libvirt-cim.spec @@ -3,13 +3,91 @@ Summary: A CIM provider for libvirt Name: libvirt-cim Version: 0.6.3 -Release: 2%{?dist}%{?extra_release} +Release: 6%{?dist}%{?extra_release} License: LGPLv2+ Group: Development/Libraries Source: ftp://libvirt.org/libvirt-cim/libvirt-cim-%{version}.tar.gz # Update configure for aarch64 (bz #925923) Patch1: libvirt-cim-aarch64.patch + +# Patches 2 -> 10 were added as one submit for libvirt-cim.0.6.3-5. +# They are listed in the order they were added to the upstream +# libvirt-cim.git repository. Although Patch10 is the ultimate fix +# for BZ#1070346, the other patches were cumulative issues seen in +# since 0.6.3 was generated upstream and pulled into RHEL7. The only +# change not pulled in was commit id 'f18ba715' as it failed for the +# s390/s390x brew builds, perhaps due to $(SHELL) not being defined +# in whatever build environment is installed. + +# libvirt-cim.spec.in: Don't install open-pegasus' specific providers +# Author: Michal Privoznik +Patch2: libvirt-cim-0.6.3-19ffef8e.patch + +# libvirt-cim.spec.in: Uninstall open-pegasus-specific providers from sfcb +# Author: Ján Tomko +Patch3: libvirt-cim-0.6.3-ee74ebc1.patch + +# spec: Replace the path to the tar.gz file +# Author: John Ferlan +Patch4: libvirt-cim-0.6.3-3c3a541d.patch + +# spec: Fix capitalization for version check +# Author: John Ferlan +Patch5: libvirt-cim-0.6.3-5d2626f6.patch + +# build: Don't use /bin/sh unconditionally +# Author: Viktor Mihajlovski +Patch6: libvirt-cim-0.6.3-f18ba715.patch + +# build: Fix incorrect provider registration in upgrade path +# Author: Viktor Mihajlovski +Patch7: libvirt-cim-0.6.3-1c7dfda2.patch + +# build: Fix provider registration issues +# Author: Viktor Mihajlovski +Patch8: libvirt-cim-0.6.3-9c1d321b.patch + +# schema: Fix class removal with Pegasus +# Author: Viktor Mihajlovski +Patch9: libvirt-cim-0.6.3-95f0d418.patch + +# spec: Fix docs/*.html packaging issue +# Author: John Ferlan +Patch10: libvirt-cim-0.6.3-54778c78.patch + +# Use of root/interop instead of root/PG_InterOp +# Author: John Ferlan +Patch11: libvirt-cim-0.6.3-a8cfd7dc.patch + +# Patches 12 -> 15 were added as one submit for libvirt-cim.0.6.3-6. +# They are listed in order as there were added upstream. Since applying +# the changes without merge conflicts relies on previous changes being +# included, it was easier to make one submit for all 4 changes. Of the +# changes only Patch12 doesn't have an existing RHEL6* based bug, but +# it's an important enough change to be included. + +# get_dominfo: Use VIR_DOMAIN_XML_SECURE more wisely +# Author: Michal Privoznik +Patch12: libvirt-cim-0.6.3-7e164fbd.patch + +# Add dumpCore tag support to memory +# Author: Xu Wang +# Added to libvirt-cim.0.6.1-9 in RHEL 6.5 as part of BZ#1000937 +Patch13: libvirt-cim-0.6.3-de03c66f.patch + +# libxkutil: Improve domain.os_info cleanup +# Author: Viktor Mihajlovski +# Added to libvirt-cim.0.6.1-10 in RHEL 6.6 as BZ#1046280 +# Added to libvirt-cim.0.6.1-9.el6_5.1 in RHEL 6.5.z as BZ#1055626 +Patch14: libvirt-cim-0.6.3-0a742856.patch + +# VSSD: Add properties for arch and machine +# Author: Viktor Mihajlovski +# Added to libvirt-cim.0.6.1-10 in RHEL 6.6 as BZ#1046280 +# Added to libvirt-cim.0.6.1-9.el6_5.1 in RHEL 6.5.z as BZ#1055626 +Patch15: libvirt-cim-0.6.3-6024403e.patch + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root URL: http://libvirt.org/CIM/ Requires: libxml2 >= 2.6.0 @@ -17,6 +95,8 @@ Requires: libvirt >= 0.9.0 Requires: unzip # either tog-pegasus or sblim-sfcb should provide cim-server Requires: cim-server +BuildRequires: autoconf +BuildRequires: automake BuildRequires: libcmpiutil >= 0.5.4 BuildRequires: tog-pegasus-devel BuildRequires: libvirt-devel >= 0.9.0 @@ -47,6 +127,22 @@ platforms with a single provider. # Update configure for aarch64 (bz #925923) %patch1 -p1 +# Patches for installation issues (bz #1070346) +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 +%patch10 -p1 +%patch11 -p1 +# Patches for adding properties for arch and machine +%patch12 -p1 +%patch13 -p1 +%patch14 -p1 +%patch15 -p1 %build %configure --disable-werror @@ -201,6 +297,18 @@ fi %config(noreplace) %{_sysconfdir}/libvirt-cim.conf %changelog +* Thu Feb 27 2014 John Ferlan 0.6.3-6 +- Add properties for arch and machine bz#1070337 + +* Thu Feb 27 2014 John Ferlan 0.6.3-5 +- Use root/interop instead of root/PG_InterOp for tog-pegasus bz#1070346 + +* Fri Jan 24 2014 Daniel Mach - 0.6.3-4 +- Mass rebuild 2014-01-24 + +* Fri Dec 27 2013 Daniel Mach - 0.6.3-3 +- Mass rebuild 2013-12-27 + * Tue Aug 6 2013 John Ferlan 0.6.3-2 - Replace the path to the source tar.gz file