[PATCH 0 of 7] #2 - Adopt get_() common look and feel to DevicePool and Adopted interface changes to assocs
by Heidi Eckhart
Adopted the get_() function look and feel to the DevicePool provider.
Updated the association providers that uses these functions.
Diff to patch set 1:
- patch #1 (svpc_types) - add Resource Pool types to svpc_types.h and map existing types to
base resource types
- patch #2 (DevicePool) - implement configurable enum_pools() function; adopt resource types
- patch #6 (EAFP) - adopt resource types; validate client given device ref
- patch #7 (AC) - adopt DevicePool interface changes; updated NOT_FOUND error message to be
consistent with others
16 years, 9 months
debugging providers with gdb
by Jay Gagnon
So we all know that it's annoying when your provider is running in sfcb
and it segfaults, because using gdb on a threaded app is not so fun.
Well, I re-visited the debugging sfcb section of sfcb's README, and I
guess something sunk in this time because I was able to put it into
practice. This seemed like the kind of thing to mention here for
posterity. Turns out it's pretty simple. (FYI, not sure how much of
this requires you to be root, I just did the easy way out and was root
for all of it.)
The first step is to recompile sfcb with debugging symbols:
CFLAGS=-g ./configure
make clean && make && make install
Then start up sfcbd and tell it which provider you want to debug:
SFCB_PAUSE_PROVIDER=Virt_VSMigrationService sfcbd # (of course put your
provider's name in here)
Now do whatever it is you need to do to get your provider to run
(wbemcli call, etc.), and you'll see something like this:
-#- Pausing for provider: Virt_VSMigrationService -pid: 13943
Now you can attach gdb. Open up a new terminal and run:
gdb sfcbd 13943 # whatever pid you just got
You're now attached to the thread; I'll summarize what state everything
is in. After gdb attaches, it pauses the thread. The thread itself is
in a loop that checks if a local variable (debug_break) is zero. If it
is zero, the thread sleeps for five seconds and checks again. We need
to get out of that loop so our provider can actually run. So we set a
breakpoint at the check. The check is in providerDrv.c; in sfcb-1.2.5,
it is line 2577. To double-check, just do a grep:
grep -n debug_break providerDrv.c
2569: int debug_break = 0;
2577: if (debug_break) break;
That if statement is the one we need. So at the gdb prompt, set the
breakpoint, then use "continue" to start the thread. You should hit the
breakpoint very quickly:
(gdb) break providerDrv.c:2577
Breakpoint 1 at 0x1c1c36: file providerDrv.c, line 2577.
(gdb) continue
Continuing.
[Switching to Thread -1208785216 (LWP 13943)]
Breakpoint 1, processProviderInvocationRequests (name=0x9e06300
"Virt_VSMigrationService") at providerDrv.c:2577
2577 if (debug_break) break;
Now we can set debug_break to nonzero so it will break out of the sleep
loop. This is also a convenient place to set breakpoints in your
provider if you wanted to. If you're just waiting for a segfault to hit
so you can do a backtrace, you shouldn't have to worry about that. For
the example, we'll just get out of the loop:
(gdb) set debug_break=1
(gdb) continue
And now your provider is running in gdb. For a little help with what
you can do with gdb, I found this to be a pretty good resource:
http://www.delorie.com/gnu/docs/gdb/gdb_toc.html#SEC_Contents
--
-Jay
16 years, 9 months
[PATCH] Fix install of VSMigrationService
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1204567099 28800
# Node ID 58da2f9d92e39567b75d8537a833aba0da994f92
# Parent 81d666eb81d9f63c5d066db9f1e5fd4386c2e1ae
Fix install of VSMigrationService
This moves VSMigrationService down in the list of providers, which seems
to fix it for me, but I have no idea why.
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r 81d666eb81d9 -r 58da2f9d92e3 src/Makefile.am
--- a/src/Makefile.am Mon Mar 03 08:25:00 2008 -0800
+++ b/src/Makefile.am Mon Mar 03 09:58:19 2008 -0800
@@ -55,12 +55,12 @@ provider_LTLIBRARIES = libVirt_ComputerS
libVirt_SettingsDefineState.la \
libVirt_ResourceAllocationFromPool.la \
libVirt_ElementAllocatedFromPool.la \
- libVirt_VSMigrationService.la \
libVirt_HostedService.la \
libVirt_ElementSettingData.la \
libVirt_VSMigrationCapabilities.la \
libVirt_VSMigrationSettingData.la \
libVirt_VirtualSystemSnapshotService.la \
+ libVirt_VSMigrationService.la \
libVirt_VirtualSystemSnapshotServiceCapabilities.la
libVirt_ComputerSystem_la_SOURCES = Virt_ComputerSystem.c
16 years, 9 months
[PATCH] Add VSMigrationSettingData.h to headers to avoid breaking dist build
by Dan Smith
# HG changeset patch
# User Dan Smith <danms(a)us.ibm.com>
# Date 1204561500 28800
# Node ID 81d666eb81d9f63c5d066db9f1e5fd4386c2e1ae
# Parent c2b12ba77830a97f961e55869921ddc9c9ab35d5
Add VSMigrationSettingData.h to headers to avoid breaking dist build
Signed-off-by: Dan Smith <danms(a)us.ibm.com>
diff -r c2b12ba77830 -r 81d666eb81d9 src/Makefile.am
--- a/src/Makefile.am Mon Mar 03 11:51:00 2008 +0100
+++ b/src/Makefile.am Mon Mar 03 08:25:00 2008 -0800
@@ -19,7 +19,8 @@ noinst_HEADERS = profiles.h svpc_types.h
Virt_VSMigrationService.h \
Virt_AllocationCapabilities.h \
Virt_VirtualSystemSnapshotService.h \
- Virt_VirtualSystemSnapshotServiceCapabilities.h
+ Virt_VirtualSystemSnapshotServiceCapabilities.h \
+ Virt_VSMigrationSettingData.h
XKUADD = $(top_builddir)/libxkutil/libxkutil.la
16 years, 9 months
[PATCH] Couple of MigrationIndication schema fixes
by Jay Gagnon
# HG changeset patch
# User Jay Gagnon <grendel(a)linux.vnet.ibm.com>
# Date 1204558449 18000
# Node ID c46cbe6df83682e9f1d762b4649f09a1daefe227
# Parent b5577ad78998fcf535b94ca0d2a1e8730720f3cf
Couple of MigrationIndication schema fixes
Turns out that pegasus needs things a bit more explicit than sfcb. Dan's changes are the first step to fixing it; this should be the rest.
Also, the description has been listing the wrong provider for way too long, so that's fixed here too.
Signed-off-by: Jay Gagnon <grendel(a)linux.vnet.ibm.com>
diff -r b5577ad78998 -r c46cbe6df836 schema/ComputerSystemMigrationIndication.mof
--- a/schema/ComputerSystemMigrationIndication.mof Thu Feb 28 10:30:05 2008 -0800
+++ b/schema/ComputerSystemMigrationIndication.mof Mon Mar 03 10:34:09 2008 -0500
@@ -1,15 +1,17 @@
// Copyright IBM Corp. 2007
[Description ("Xen_ComputerSystem migration status"),
- Provider("cmpi::Virt_ComputerSystemModificationIndication")
+ Provider("cmpi::Virt_ComputerSystemMigrationIndication")
]
class Xen_ComputerSystemMigrationIndication : CIM_InstModification
{
+ uint32 RaiseIndication([IN] CIM_InstModification REF TheIndication);
};
[Description ("KVM_ComputerSystem migration status"),
- Provider("cmpi::Virt_ComputerSystemModificationIndication")
+ Provider("cmpi::Virt_ComputerSystemMigrationIndication")
]
class KVM_ComputerSystemMigrationIndication : CIM_InstModification
{
+ uint32 RaiseIndication([IN] CIM_InstModification REF TheIndication);
};
16 years, 9 months
[PATCH] Fix missing braces in HD
by Kaitlin Rupert
# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1204315089 28800
# Node ID 9ca3b9b245f8af8f960a4d1e3557adf536daabee
# Parent b2f223ca9105b8f416ab768a1363df910d6815d4
Fix missing braces in HD.
Some missing braces cause host_to_vs() to exit before enumerating the instances.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r b2f223ca9105 -r 9ca3b9b245f8 src/Virt_HostedDependency.c
--- a/src/Virt_HostedDependency.c Fri Feb 29 13:04:15 2008 +0100
+++ b/src/Virt_HostedDependency.c Fri Feb 29 11:58:09 2008 -0800
@@ -75,11 +75,12 @@ static CMPIStatus host_to_vs(const CMPIO
goto out;
conn = connect_by_classname(_BROKER, CLASSNAME(ref), &s);
- if (conn == NULL)
+ if (conn == NULL) {
cu_statusf(_BROKER, &s,
CMPI_RC_ERR_NOT_FOUND,
"No such instance");
goto out;
+ }
ret = enum_domains(_BROKER, conn, NAMESPACE(ref), list);
if (!ret)
16 years, 9 months