XAM Mandated Fields

In this post I look at what fields are mandated by the SNIA XAM v1.0 specification and write a small Java application to retrieve their default values using the XAM Reference VIM and EMC's Centera XAM VIM.

What is meant by a field in XAM? According to Section 3.1.5 of the XAM specification v1.0, Part 1, a field is
a piece of uniquely identifiable data that can be attached to an XSet, an XSystem, or a XAM Library.
More concretely, a field has a name, a number of attributes that describe how to interact with the object, and a value. Any XAM primary object, i.e. an XSystem, an XSet, or a XAM Library object can contain one or more fields.

Field names are case sentitive UTF-8 encoded strings with a maximum length of 512 bytes and no embedded NULL characters. To avoid namespace clashes, the field namespace is allocated between SNIA, XAM storage system vendors and XAM application vendors. The following table shows the currently reserved namespace for field names:
[table id=7 /]
To avoid field namespace clashes between XAM storage system vendors in the remaining unreserved namespace and aleviate the need for a central XAM field name registry, the first portion of a vendor field name shall be the vendor's domain name in reverse order, followed by the vendor-defined field name, e.g. com.emc.centera.xam.vim.version.

As mentionly previously a field can have attributes. The following four attributes are mandated by the XAM specification:
[table id=8 /]
Two distinct types of fields exist: a property and an XStream. For the purposes of this post, we are only interested in fields which are properties as defined in section 3.1.12 of the XAM specification, i.e
a field whose MIME type attribute is one of the XAM-defined simple types (stypes).

Here is a list of the specified XAM stypes:
[table id=9 /]
Turning now to the two objects that we are interested in, namely the XAM Library object and the XSystem object.

XAM Library properties are always nonbinding i.e. a change in the property value does not trigger the creation of a new XSet with a corresponding new XUID. Some may be readonly and intended to be only inspected by the application. Others such as .xam.log.level may be modifiable by a XAM application to effect a change in the behavior of the XAM Library object. Note however that changes are not persisted by the XAM Library.

Here is the list of the mandated properties for the XAM Library:
[table id=1 /]
An XSystem property is strongly typed to help XAM application interoperability. The stype is checked and the actual MIME type is set based on the specific method that the XAM application uses to create the field. A number of other field consistency checks are also done by an XSystem including checking that field names do not begin with a period, are a valid xam_string and do not have embedded NULLs. See section 6.3.5 of the XAM specification for a complete description of the field consistency checks.

Here is the list of mandated properties for an XSystem object:
[table id=2 /]
Here is a simple Java application which iterates over the list of available fields and output the fields which match the specified field prefix or all fields if no prefix is entered. It uses the XAM FieldIterator class to retrieve the requested fields from either the SNIA-XAM SDK reference VIM or a third party VIM such as the EMC Centera VIM.
import java.io.ByteArrayOutputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import java.util.Calendar;
import java.text.SimpleDateFormat;
import java.util.Properties;

import org.snia.xam.XAMLibrary;
import org.snia.xam.XAMLibraryObj;
import org.snia.xam.XAMException;
import org.snia.xam.XSystem;
import org.snia.xam.XSet;
import org.snia.xam.XIterator;
import org.snia.xam.toolkit.XAMXUID;
import org.snia.xam.util.XAMLibraryFactory;
import org.snia.xam.FieldContainer;

import org.snia.xam.XUID;
import org.snia.xam.base.XAMImplementation;
import org.snia.xam.util.SASLUtils;
import org.snia.xam.vim.reference.ReferenceAuthenticationStatus;
import org.snia.xam.vim.reference.utils.ReferenceSaslUtils;

public class XamFieldIterator {
private static XAMLibrary xamLib;
private static XSystem xSystem;
protected static String xri;

public static boolean IS_REFERENCE_VIM = false;
public static final String TEST_PROP_FILE = "xam.test.props";
public static final String XRI_PROP = "xam.test.xri";
public static final String CONFIG_PROP = "xam.test.vims";
public static final String USER_PROP = "xam.test.username";
public static final String PASS_PROP = "xam.test.password";
protected static final String DEFAULT_USER = "test";
protected static final String DEFAULT_PASS = "test";
protected static String s_pass;
protected static String s_user;

public static void initLibrary() throws Exception {
if (xamLib == null) {
System.out.println("\nInitializing VIM");
Properties props = new Properties();
String testPropFile = System.getProperty(TEST_PROP_FILE);
if (testPropFile == null)
testPropFile = TEST_PROP_FILE;

System.out.println("Loading test properties from file: " + testPropFile);
props.load(new FileInputStream(testPropFile));

xri = props.getProperty(XRI_PROP);
s_user = props.getProperty(USER_PROP, DEFAULT_USER);
s_pass = props.getProperty(PASS_PROP, DEFAULT_PASS);

// XAM Library loads the VIM name and associated Java implementation class
System.out.println("Loading the VIM using the Java XAM Library.");
System.out.println("VIM Configuration contained in file: " +
props.getProperty(CONFIG_PROP));
xamLib = new XAMImplementation(props.getProperty(CONFIG_PROP));
}
}

private static XSystem connectToVIM(String xri) throws Exception {
XSystem xsystem = null;
xsystem = xamLib.connect(xri);
return xsystem;
}

private static void authenticate(XSystem system) throws XAMException {
String defMech = system.getString(XSystem.XAM_XSYSTEM_AUTH_SASL_DEFAULT);
ByteArrayOutputStream response = new ByteArrayOutputStream(200);
byte[] inputData = null;
int retValue = 0;

if (defMech.equals(ReferenceSaslUtils.SASL_MECHANISM_ANONYMOUS)) {
retValue = system.authenticate(inputData, response);
} else if (defMech.equals(SASLUtils.SASL_PLAIN)) {
byte[] creds = ReferenceSaslUtils.encodeSASLPlain(null,
ReferenceAuthenticationStatus.TEST_USERNAME,
ReferenceAuthenticationStatus.TEST_PASSWORD);
retValue = system.authenticate(creds, response);
} else {
throw new XAMException("Unknown default SASL mechanism " + defMech);
}

// Validate return status value
if (retValue != XSystem.XAM_SASL_COMPLETE) {
throw new XAMException("Failed to authenticate.");
}
}

/* a FieldContainer is a XAM superclass for the 3 primary objects (XAMLibrary, XSystem, XSet) */
private static void iterateFields(FieldContainer fieldContainer, String prefix) throws XAMException {
String fieldName;
String fieldType;
String fieldValue;
String fieldBinding;
String fieldReadOnly;

XIterator xIterator = fieldContainer.openFieldIterator(prefix);
while (xIterator.hasNext()) {
fieldName = (String)xIterator.next();
fieldType = fieldContainer.getFieldType(fieldName);

fieldBinding = fieldContainer.getFieldBinding(fieldName) != true ? "NB" : "BI";
fieldReadOnly = fieldContainer.getFieldReadOnly(fieldName) != true ? "RW" : "RO";

if (fieldType.equals(XAMLibrary.STYPE_BOOLEAN_MIME_TYPE))
fieldValue = fieldContainer.getBoolean(fieldName) != true ? "false" : "true";
else if (fieldType.equals(XAMLibrary.STYPE_INT_MIME_TYPE))
fieldValue = Long.toString(fieldContainer.getLong(fieldName));
else if (fieldType.equals(XAMLibrary.STYPE_DOUBLE_MIME_TYPE))
fieldValue = Double.toString(fieldContainer.getDouble(fieldName));
else if (fieldType.equals(XAMLibrary.STYPE_XUID_MIME_TYPE))
fieldValue = fieldContainer.getXUID(fieldName).toString();
else if (fieldType.equals(XAMLibrary.STYPE_STRING_MIME_TYPE))
fieldValue = fieldContainer.getString(fieldName);
else if (fieldType.equals(XAMLibrary.STYPE_DATETIME_MIME_TYPE)) {
Calendar now = fieldContainer.getDateTime(fieldName);
int Y = now.get(Calendar.YEAR);
int M = now.get(Calendar.MONTH);
int D = now.get(Calendar.DAY_OF_MONTH);
int h = now.get(Calendar.HOUR_OF_DAY);
int m = now.get(Calendar.MINUTE);
int s = now.get(Calendar.SECOND);
fieldValue = Y + "-" + M + "-" + D + " " + h + ":" + m + ":" + s;
} else
fieldValue = fieldContainer.getFieldLength(fieldName) + " bytes";

System.out.println(String.format("%s (%s) %s %s \"%s\"",
fieldName, fieldType, fieldBinding, fieldReadOnly, fieldValue));
}
xIterator.close();
}

public static void main(String[] args) {
long exitCode = 0;

InputStreamReader inputReader = new InputStreamReader(System.in);
BufferedReader stdin = new BufferedReader(inputReader);

try {
/* simple check for command line option of "-r" */
if (args.length == 1 ) {
if (args[0].equals("-r"))
IS_REFERENCE_VIM = true;
}

if (IS_REFERENCE_VIM) {
initLibrary();
System.out.println("Connecting to XSystem " + xri + "\n");
xSystem = connectToVIM(xri);
authenticate(xSystem);
} else {
xri = "snia-xam://centera_vim!128.221.200.60?/home/fpm/xam/xamconnect.pea";
xamLib = XAMLibraryFactory.newXAMLibrary();
System.out.println("Connecting to XSystem " + xri + "\n");
xSystem = xamLib.connect(xri);
}

System.out.print("Enter prefix to filter results (blank for all): ");
String prefix = stdin.readLine();

iterateFields(xSystem, prefix);

xSystem.close();
System.out.println( "\nClosed connection to XSystem" );

} catch (XAMException xe) {
System.err.println("XAM ERROR: " + xe.getMessage());
exitCode = 1;
} catch (IllegalArgumentException e) {
System.out.println(e.getMessage());
e.printStackTrace();
exitCode = 1;
} catch (IOException e) {
System.err.println("IO ERROR: " + e.getMessage());
e.printStackTrace();
exitCode = 1;
} catch (Exception ex) {
ex.printStackTrace();
exitCode = 1;
}

System.exit((int) exitCode);
}
}

Here is the set of fields, i.e those fields which start with .xam. for the XAMLibrary object when the application is connected to an EMC Centera using EMC's XAM VIM. It is followed by the set of fields, i.e. those fields starting with .xsystem., for an XSystem object which we create using this XAMLibrary object.
$ java XamFieldIterator
Connecting to XSystem snia-xam://centera_vim!XXX.XXX.XXX.XXX?/home/fpm/xam/xamconnect.pea

Enter prefix to filter results (blank for all): .xam

.xam.log.component.filter (application/vnd.snia.xam.string) NB RW ""
.xam.log.message.filter (application/vnd.snia.xam.string) NB RW ""
.xam.log.max.rollovers (application/vnd.snia.xam.int) NB RW "1"
.xam.log.max.size (application/vnd.snia.xam.int) NB RW "1048576"
.xam.log.append (application/vnd.snia.xam.boolean) NB RW "false"
.xam.log.format (application/vnd.snia.xam.int) NB RW "1"
.xam.log.path (application/vnd.snia.xam.string) NB RW "xam.log"
.xam.log.verbosity (application/vnd.snia.xam.int) NB RW "0"
.xam.log.level (application/vnd.snia.xam.int) NB RW "0"

Closed connection to XSystem

$ java XamFieldIterator
Connecting to XSystem snia-xam://centera_vim!XXX.XXX.XXX.XXX?/home/fpm/xam/xamconnect.pea

Enter prefix to filter results (blank for all): .xsystem

.xsystem.auth.identity.authorization (application/vnd.snia.xam.string) NB RO "xam_challenge"
.xsystem.auth.identity.authentication (application/vnd.snia.xam.string) NB RO "xam_challenge"
.xsystem.limits.maxSizeOfXStream (application/vnd.snia.xam.int) NB RO "107374182400"
.xsystem.limits.maxFieldsPerXSet (application/vnd.snia.xam.int) NB RO "9223372036854775807"
.xsystem.identity (application/vnd.snia.xam.string) NB RO "EMC Centera, ID# 34372862-1dd2-11b2-aea0-f013836b5e75"
.xsystem.auth.SASLmechanism.list.ANONYMOUS (application/vnd.snia.xam.boolean) NB RO "true"
.xsystem.auth.SASLmechanism.list.PLAIN (application/vnd.snia.xam.boolean) NB RO "true"
.xsystem.auth.SASLmechanism.default (application/vnd.snia.xam.string) NB RO "ANONYMOUS"
.xsystem.time (application/vnd.snia.xam.datetime) NB RO "2009-5-28 15:10:42"
.xsystem.auth.granule.list.read (application/vnd.snia.xam.boolean) NB RO "true"
.xsystem.auth.granule.list.write-application (application/vnd.snia.xam.boolean) NB RO "true"
.xsystem.auth.granule.list.write-system (application/vnd.snia.xam.boolean) NB RO "true"
.xsystem.auth.granule.list.create (application/vnd.snia.xam.boolean) NB RO "true"
.xsystem.auth.granule.list.delete (application/vnd.snia.xam.boolean) NB RO "true"
.xsystem.auth.granule.list.job (application/vnd.snia.xam.boolean) NB RO "true"
.xsystem.auth.granule.list.job-commit (application/vnd.snia.xam.boolean) NB RO "false"
.xsystem.auth.granule.list.hold (application/vnd.snia.xam.boolean) NB RO "false"
.xsystem.auth.granule.list.retention-event (application/vnd.snia.xam.boolean) NB RO "true"
.xsystem.job.list.xam.job.query (application/vnd.snia.xam.boolean) NB RO "true"
.xsystem.auth.expiration (application/vnd.snia.xam.int) NB RO "-1"
.xsystem.access (application/vnd.snia.xam.boolean) NB RO "false"
.xsystem.job.commit.supported (application/vnd.snia.xam.boolean) NB RO "false"
.xsystem.job.xam.job.query.continuance.supported (application/vnd.snia.xam.boolean) NB RO "false"
.xsystem.job.xam.job.query.level2.supported (application/vnd.snia.xam.boolean) NB RO "false"
.xsystem.job.xam.job.query.level1.supported (application/vnd.snia.xam.boolean) NB RO "true"
.xsystem.deletion.autodelete (application/vnd.snia.xam.boolean) NB RO "false"
.xsystem.deletion.shred (application/vnd.snia.xam.boolean) NB RO "false"
.xsystem.management.policy.default (application/vnd.snia.xam.string) NB RO "default"
.xsystem.management.policy.list.default (application/vnd.snia.xam.string) NB RO "default"
.xsystem.retention.duration.policy.list.0seconds (application/vnd.snia.xam.string) NB RO "0seconds"
.xsystem.retention.duration.policy.list.10min (application/vnd.snia.xam.string) NB RO "10min"
.xsystem.retention.duration.policy.list.1day (application/vnd.snia.xam.string) NB RO "1day"
.xsystem.retention.duration.policy.list.1hr (application/vnd.snia.xam.string) NB RO "1hr"
.xsystem.retention.duration.policy.list.30days (application/vnd.snia.xam.string) NB RO "30days"
.xsystem.retention.duration.policy.list.60days (application/vnd.snia.xam.string) NB RO "60days"
.xsystem.retention.duration.policy.list.CBR_EMail (application/vnd.snia.xam.string) NB RO "CBR_EMail"
.xsystem.retention.duration.policy.list.CBR_Email (application/vnd.snia.xam.string) NB RO "CBR_Email"
.xsystem.retention.duration.policy.list.CBR_PACS (application/vnd.snia.xam.string) NB RO "CBR_PACS"
.xsystem.log.level (application/vnd.snia.xam.int) NB RW "0"
.xsystem.log.verbosity (application/vnd.snia.xam.int) NB RW "0"
.xsystem.log.path (application/vnd.snia.xam.string) NB RW "centera_vim.log"

Closed connection to XSystem
$

Here are the corresponding outputs when the application instead connects to the SNIA XAM-SDK reference VIM which incidently is written completely in Java; hence the need for two different factory methods in our application.
$ java XamFieldIterator -r
Initializing VIM
Loading test properties from file: xam.test.props
Loading the VIM using the Java XAM Library.
VIM Configuration contained in file: ../config/ReferenceVIM.config
Connecting to XSystem snia-xam://SNIA_Reference_VIM!localhost?dir=/home/fpm/xam/xam_storage

Enter prefix to filter results (blank for all): .xam
.xam.apiLevel (application/vnd.snia.xam.string) NB RW "01.00.00"
.xam.identity (application/vnd.snia.xam.string) NB RW "SNIA XAM Java Library v1.0"
.xam.log.append (application/vnd.snia.xam.boolean) NB RW "false"
.xam.log.level (application/vnd.snia.xam.int) NB RW "1"
.xam.log.max.rollovers (application/vnd.snia.xam.int) NB RW "1"
.xam.log.max.size (application/vnd.snia.xam.int) NB RW "10"
.xam.log.path (application/vnd.snia.xam.string) NB RW "SNIA-XAM.log"
.xam.log.verbosity (application/vnd.snia.xam.int) NB RW "1"
.xam.vim.list.SNIA_Reference_VIM (application/vnd.snia.xam.string) NB RW "SNIA_Reference_VIM"

Closed connection to XSystem

$ java XamFieldIterator -r

Initializing VIM
Loading test properties from file: xam.test.props
Loading the VIM using the Java XAM Library.
VIM Configuration contained in file: ../config/ReferenceVIM.config
Connecting to XSystem snia-xam://SNIA_Reference_VIM!localhost?dir=/home/fpm/xam/xam_storage

Enter prefix to filter results (blank for all): .xsystem
.xsystem.access (application/vnd.snia.xam.boolean) NB RO "true"
.xsystem.access.policy.list.read (application/vnd.snia.xam.string) NB RO "Read"
.xsystem.access.policy.list.write-application (application/vnd.snia.xam.string) NB RO "Write-application"
.xsystem.access.policy.list.write-system (application/vnd.snia.xam.string) NB RO "Write-system"
.xsystem.auth.SASLmechanism.default (application/vnd.snia.xam.string) NB RO "PLAIN"
.xsystem.auth.SASLmechanism.list.ANONYMOUS (application/vnd.snia.xam.boolean) NB RO "true"
.xsystem.auth.SASLmechanism.list.PLAIN (application/vnd.snia.xam.boolean) NB RO "true"
.xsystem.auth.expiration (application/vnd.snia.xam.int) NB RO "-1"
.xsystem.auth.granule.list.create (application/vnd.snia.xam.boolean) NB RO "true"
.xsystem.auth.granule.list.delete (application/vnd.snia.xam.boolean) NB RO "true"
.xsystem.auth.granule.list.hold (application/vnd.snia.xam.boolean) NB RO "true"
.xsystem.auth.granule.list.job (application/vnd.snia.xam.boolean) NB RO "true"
.xsystem.auth.granule.list.job-commit (application/vnd.snia.xam.boolean) NB RO "true"
.xsystem.auth.granule.list.read (application/vnd.snia.xam.boolean) NB RO "true"
.xsystem.auth.granule.list.retention-event (application/vnd.snia.xam.boolean) NB RO "true"
.xsystem.auth.granule.list.write-application (application/vnd.snia.xam.boolean) NB RO "true"
.xsystem.auth.granule.list.write-system (application/vnd.snia.xam.boolean) NB RO "true"
.xsystem.auth.identity.authentication (application/vnd.snia.xam.string) NB RO ""
.xsystem.auth.identity.authorization (application/vnd.snia.xam.string) NB RO ""
.xsystem.deletion.autodelete (application/vnd.snia.xam.boolean) NB RO "false"
.xsystem.deletion.shred (application/vnd.snia.xam.boolean) NB RO "false"
.xsystem.identity (application/vnd.snia.xam.string) NB RO "ultra.localdomain File System"
.xsystem.job.commit.supported (application/vnd.snia.xam.boolean) NB RO "false"
.xsystem.job.list.xam.job.query (application/vnd.snia.xam.boolean) NB RO "true"
.xsystem.job.xam.job.query.continuance.supported (application/vnd.snia.xam.boolean) NB RO "false"
.xsystem.job.xam.job.query.level1.supported (application/vnd.snia.xam.boolean) NB RO "true"
.xsystem.job.xam.job.query.level2.supported (application/vnd.snia.xam.boolean) NB RO "false"
.xsystem.limits.maxFieldsPerXSet (application/vnd.snia.xam.int) NB RO "10000"
.xsystem.limits.maxSizeOfXStream (application/vnd.snia.xam.int) NB RO "9223372036854775807"
.xsystem.management.policy.default (application/vnd.snia.xam.string) NB RO ".org.snia.refvim.default.mgmt.policy"
.xsystem.management.policy.list..org.snia.refvim.default.mgmt.policy (application/vnd.snia.xam.string) NB RO ".org.snia.refvim.default.mgmt.policy"
.xsystem.time (application/vnd.snia.xam.datetime) NB RO "2009-5-29 10:24:0"

Closed connection to XSystem
$
As you can see there are lots of interesting and potentially useful information available in the fields associated with a XAMLIbrary or XSystem object. Hopefully this post has improved your knowledge of the mandated fields and the field namespace.

Happy Independence Day!
 
I have finally taken the plunge and moved my blog to Wordpress on my own website.  I had intended doing this many months ago but work kept getting in the way.

The straw that broke the proverbial camel's back occurred yesterday when I wanted to change the theme of my blog to a more modern looking theme.  I followed Blogger's recommendations and exported all my posts and data to my desktop.  However it turns out that Blogger does not handle switching themes very well when you have a number of custom widgets.  Given that I was going to have to spend significant time fixing up things after a simple theme change, I decided that that time would be better spent switching to WordPress.

The URL for my blog is blog.fpmurphy.com.

It is a work in process at present  I have imported most posts from Blogger and will do the minor cleanup required as a result of this import starting at the newest post and working back to the oldest post.

I will continue to post a copy of my blog posts here because search engines seem to index this location more than my website.

XAM Canonical Format

One of the key requirements for achieving long term data persistence is the ability to move data between archiving systems or, in the language of the SNIA XAM (eXtensible Access Method) specification, moving XSets between XSystems.

The XAM v1.0 specification supports this requirement by providing support for exporting and importing Xsets.  It specifies the methods used to export an XSet from an XSystem, the resultant XSet canonical data interchange format (package) and the methods used to import an Xset into an Xsystem

This post assumes that you are somewhat familiar with XAM and how to program to that specification using Java.  It focuses on the format and content of the XSet canonical format package which consists of two main parts: an XML document which describes the policies, properties and streams of one or more XSets followed by the binary representation of the stream(s).

The package format conforms to the 2005 W3C XML-binary Optimized Packaging (XOP) recommendation. To quote from the recommendation:

XOP define a general purpose serialization mechanism for the XML Infoset with binary content that is not only applicable to SOAP and MIME packaging, but to any XML Infoset and any packaging mechanism.
If you are unfamiliar with XOP, and most people are, an article by Andrey Butov in the December 2005 issue of Doctor Dobb's Journal contained a good introduction.

More than one XSet can be contained in a package.  However the current XAM SDK reference implementation only supports one XSet.  The XML document (AKA the XSet manifest) is a valid and well-formed XML document whose root element is xsets.  It can be parsed and manipulated using XSLT and other XML tools.  Annex B of the XAM Architecture document contains an XML Schema Definition (XSD) for the XSet manifest.

In order to study the package format in more detail, I wrote a small Java application called StoreHelloWorld which creates a new XSet containing two XStreams.  The first Xstream contains the source code for the ubiquitous HelloWorld.java program.  The second XStream contains the binary object HelloWorld.class encoded to base64 and with a MIME type of application/base64.  Normally you should not encode an XStream but displaying binary files in a blog is problematic and hence the workaround.

Here is the source code for StoreHelloWorld.
import java.io.BufferedOutputStream;
import java.io.BufferedInputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.InputStream;
import java.util.Calendar;

import org.snia.xam.XAMException;
import org.snia.xam.XAMLibrary;
import org.snia.xam.XSet;
import org.snia.xam.XStream;
import org.snia.xam.XSystem;
import org.snia.xam.XUID;
import org.snia.xam.util.XAMLibraryFactory;

public class StoreHelloWorld {
private static XAMLibrary xamLib;
private static XSystem xSystem;
private static final int BUFFER_SIZE = 1024 * 128;

private static XUID storeExportFile(String filename) throws XAMException {
XUID xuid = null;

System.out.println("Create XSet ....");
XSet xSet = xSystem.createXSet(XSet.MODE_UNRESTRICTED);
xSet.createProperty("app.filename", true, "HelloWorld.");

try {
System.out.println("Create XStream 1 ....");
BufferedInputStream inputStream = new BufferedInputStream(new FileInputStream("HelloWorld.java"));
XStream xStream = xSet.createXStream("com.rhc.file.source", true, XAMLibrary.DEFAULT_MIME_TYPE);

byte[] buffer = new byte[BUFFER_SIZE];
long bytesRead = 0;

while((bytesRead = inputStream.read(buffer)) > 0) {
long bytesPos = 0;
while(bytesPos < bytesRead) {
long bytesWrite = xStream.write(buffer, bytesPos, bytesRead - bytesPos);
bytesPos += bytesWrite;
}
}
inputStream.close();
xStream.close();
} catch (FileNotFoundException fe) {
throw new IllegalArgumentException("Could not open HelloWorld.java for reading");
} catch (IOException ioe) {
System.err.println("Error reading from HelloWorld.java");
ioe.printStackTrace();
}

try {
System.out.println("Create XStream 2 ....");

InputStream inputStream = new Base64.InputStream(new FileInputStream("HelloWorld.class"), Base64.ENCODE | Base64.DO_BREAK_LINES);
XStream xStream = xSet.createXStream("com.rhc.file.binary", true, "application/base64");

byte[] buffer = new byte[BUFFER_SIZE];
long bytesRead = 0;

while((bytesRead = inputStream.read(buffer)) > 0) {
long bytesPos = 0;
while(bytesPos < bytesRead) {
long bytesWrite = xStream.write(buffer, bytesPos, bytesRead - bytesPos);
bytesPos += bytesWrite;
}
}
inputStream.close();
xStream.close();
} catch (FileNotFoundException fe) {
throw new IllegalArgumentException("Could not open HelloWorld.class for reading");
} catch (IOException ioe) {
System.err.println("Error reading from HelloWorld.class");
ioe.printStackTrace();
}

System.out.println("Commit XSet .... ");
xuid = xSet.commit();
System.out.println("Assigned XUID: " + xuid.toString());

System.out.println("Close XSet .... ");
xSet.close();

File saveFile = new File(filename);
try {
System.out.println("\nOpen XSet .... ");
xSet = xSystem.openXSet(xuid, XSet.MODE_READ_ONLY);

BufferedOutputStream outputStream = new BufferedOutputStream(new FileOutputStream(saveFile));

System.out.println("Open XStream for export ....");
XStream xStream = xSet.openExportXStream();

byte[] buffer = new byte[BUFFER_SIZE];
long bytesRead = 0;

System.out.println("Retrieve data .... ");
while((bytesRead = xStream.read(buffer)) > 0) {
outputStream.write(buffer, 0, (int)bytesRead);
}
xStream.close();
outputStream.close();

System.out.println("Close XSet .... ");
xSet.close();
} catch (IOException ioe) {
System.err.println("Error writing to " + saveFile);
ioe.printStackTrace();
}

return (xuid);
}

public static void main(String[] args) {
String xri = XRIstring.get();
long exitCode = 0;

InputStreamReader inputReader = new InputStreamReader(System.in);
BufferedReader stdin = new BufferedReader(inputReader);

try {
xamLib = XAMLibraryFactory.newXAMLibrary();

if (xri == null ) {
System.out.print("Enter Xsystem address: ");
String answer = stdin.readLine();
if (!answer.equals(""))
xri = answer;
else
System.exit(0);
}

System.out.println("Connecting to XSystem: " + xri );
xSystem = xamLib.connect(xri);

System.out.print("Name of export file: ");
String filename = stdin.readLine();
if (filename.equals(""))
System.exit(0);

XUID xuid = storeExportFile(filename);

xSystem.close();
System.out.println("\nClosed connection to XSystem");

inputReader.close();
stdin.close();

} catch (XAMException xe) {
exitCode = xe.getStatusCode();
System.err.println(
"XAM Error occured: " + xe.getMessage() + "(" + exitCode + ")");
} catch (IOException e) {
System.out.println("I/O Error occurred: " + e.getMessage());
e.printStackTrace();
exitCode = 1;
} catch (IllegalArgumentException e) {
System.out.println(e.getMessage());
e.printStackTrace();
exitCode = 1;
}

System.exit((int) exitCode);
}
}
Rather than hard code an XRI (XAM Resource Identifier) in each XAM application, I use a separate Java class (XRIstring) to read in the XRI from the standard XAM properties file xam.properties.

I know that this is not kosher according to the current XAM specification but, in my humble opinion, this is the natural location for storing this string as most people will not be connecting simultaneously to multiple XSystems.

Here is the source for that Java class.
import java.io.FileInputStream;
import java.io.IOException;
import java.io.FileNotFoundException;
import java.util.Properties;

public class XRIstring
{
private static Properties props;
private static String XRI = ".xam.config.xri";
private static String xri = null;

static {

props = new Properties();
try {
props.load(new FileInputStream("xam.properties"));

xri = props.getProperty(XRI);
if (xri != null)
System.out.println("XSystem Address: " + xri );

} catch (FileNotFoundException e) {
System.err.println("Could not find properties file. XSystem address must be manually entered");
} catch (IOException e) {
System.err.println("Could not access properties file. XSystem address must be manually entered");
}
}

public static String get()
{
return(xri);
}
}
This application also uses Robert Harder's popular Base64 class which is available here.  Assuming your CLASSPATH is set up correctly to find the XAM libraries, here is the output from StoreHelloWorld when you build and run it.
$ javac StoreHelloWorld.java XRIstring.java Base64.java

$ java StoreHelloWorld
Connecting to XSystem: snia-xam://centera_vim!XXX.XXX.XXX.XXX?/home/fpm/xam/xamconnect.pea
Name of export file: sample
Create XSet ....
Create XStream 1 ....
Create XStream 2 ....
Commit XSet ....
Assigned XUID: AAAEcwA9S8c0UTVHVDdRSDRSUU9VZUVWMkEyTTJGUUw2UUlHNDE0N1ZTMzFKTzFURkxWUjVKNkFDVEo2Ng==
Close XSet ....

Open XSet for export ....
Retrieve data ....
Close XSet ....

Closed connection to XSystem
$
Here is the contents of the export file (sample) which was created.
Content-Type: Multipart/Related;boundary="___EMC_XOP_BOUNDARY_START___1245537694___EMC_XOP_BOUNDARY_END___";
type="application/xop+xml";
start="<canonicalxset.xml@snia.org>";
start-info="text/xml"
Content-Description: EMC XSet Export Package

--___EMC_XOP_BOUNDARY_START___1245537694___EMC_XOP_BOUNDARY_END___
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: 8bit
Content-ID: <canonicalxset.xml@snia.org>

<xsets xmlns="http://www.snia.org/2007/xam/export"
xmlns:xop="http://www.w3.org/2004/08/xop/include"
xmlns:emcannotations="http://www.emc.com/2008/01/centera/emcannotations"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.snia.org/2007/xam/export XAMCanonicalXSetDefinition.xsd
http://www.w3.org/2004/08/xop/include http://www.w3.org/2004/08/xop/include
http://www.emc.com/2008/01/centera/emcannotations emcannotations.xsd ">
<version>1.0.0</version>

<policies>
<policy name=".xsystem.management.policy.list.default" type="application/vnd.snia.xam.string" readOnly="true" binding="false" length="7" >
<value>default</value>
</policy>
</policies>

<xset>
<properties>
<property name="app.filename" type="application/vnd.snia.xam.string" readOnly="false" binding="true" length="11" emcannotations:seqno="0" >
<value>HelloWorld.</value>
</property>
<property name=".xset.time.creation" type="application/vnd.snia.xam.datetime" readOnly="true" binding="true" length="24" emcannotations:seqno="3" >
<value>2009-06-20T22:20:19.000Z</value>
</property>
<property name=".xset.time.access" type="application/vnd.snia.xam.datetime" readOnly="true" binding="false" length="24" emcannotations:seqno="4" >
<value>2009-06-20T22:20:21.000Z</value>
</property>
<property name=".xset.time.commit" type="application/vnd.snia.xam.datetime" readOnly="true" binding="false" length="24" emcannotations:seqno="5" >
<value>2009-06-20T22:20:21.000Z</value>
</property>
<property name=".xset.time.residency" type="application/vnd.snia.xam.datetime" readOnly="true" binding="false" length="24" emcannotations:seqno="6" >
<value>2009-06-20T22:20:21.000Z</value>
</property>
<property name=".xset.xuid" type="application/vnd.snia.xam.xuid" readOnly="true" binding="false" length="61" emcannotations:seqno="7" >
<value>AAAEcwA9S8c0UTVHVDdRSDRSUU9VZUVWMkEyTTJGUUw2UUlHNDE0N1ZTMzFKTzFURkxWUjVKNkFDVEo2Ng==</value>
</property>
<property name=".xset.time.xuid" type="application/vnd.snia.xam.datetime" readOnly="true" binding="true" length="24" emcannotations:seqno="8" >
<value>2009-06-20T22:20:21.000Z</value>
</property>
<property name=".xset.retention.list.base" type="application/vnd.snia.xam.string" readOnly="true" binding="true" length="4" emcannotations:seqno="9" >
<value>base</value>
</property>
<property name=".xset.retention.base.enabled" type="application/vnd.snia.xam.boolean" readOnly="true" binding="true" length="1" emcannotations:seqno="10" >
<value>true</value>
</property>
<property name=".xset.retention.base.duration" type="application/vnd.snia.xam.int" readOnly="true" binding="true" length="8" emcannotations:seqno="11" >
<value>0</value>
</property>
<property name=".xset.retention.base.starttime" type="application/vnd.snia.xam.datetime" readOnly="true" binding="true" length="24" emcannotations:seqno="12" >
<value>2009-06-20T22:20:19.000Z</value>
</property>
<property name=".xset.hold" type="application/vnd.snia.xam.boolean" readOnly="true" binding="false" length="1" emcannotations:seqno="13" >
<value>false</value>
</property>
<property name=".xset.management.policy" type="application/vnd.snia.xam.string" readOnly="true" binding="false" length="7" emcannotations:seqno="14" >
<value>default</value>
</property>
<property name=".vnd.com.emc.centera.meta.standard.binding.creation.poolid" type="application/vnd.snia.xam.string" readOnly="true" binding="true" length="39" emcannotations:seqno="15" >
<value>34372862-1dd2-11b2-aea0-f013836b5e75-10</value>
</property>
<property name=".vnd.com.emc.centera.meta.standard.binding.retention.base.enabled" type="application/vnd.snia.xam.string" readOnly="true" binding="true" length="4" emcannotations:seqno="16" >
<value>true</value>
</property>
<property name=".vnd.com.emc.centera.meta.standard.binding.sdk.version" type="application/vnd.snia.xam.string" readOnly="true" binding="true" length="7" emcannotations:seqno="17" >
<value>4.0.672</value>
</property>
<property name=".vnd.com.emc.centera.meta.standard.binding.modification.poolid" type="application/vnd.snia.xam.string" readOnly="true" binding="true" length="39" emcannotations:seqno="18" >
<value>34372862-1dd2-11b2-aea0-f013836b5e75-10</value>
</property>
<property name=".vnd.com.emc.centera.meta.standard.binding.retention.period" type="application/vnd.snia.xam.string" readOnly="true" binding="true" length="1" emcannotations:seqno="19" >
<value>0</value>
</property>
<property name=".vnd.com.emc.centera.meta.standard.binding.type" type="application/vnd.snia.xam.string" readOnly="true" binding="true" length="11" emcannotations:seqno="20" >
<value>xam.binding</value>
</property>
<property name=".vnd.com.emc.centera.meta.standard.binding.name" type="application/vnd.snia.xam.string" readOnly="true" binding="true" length="29" emcannotations:seqno="21" >
<value>EMC Centera Binding XSet Clip</value>
</property>
<property name=".vnd.com.emc.centera.meta.standard.binding.creation.date" type="application/vnd.snia.xam.string" readOnly="true" binding="true" length="23" emcannotations:seqno="22" >
<value>2009.06.20 22:20:19 GMT</value>
</property>
<property name=".vnd.com.emc.centera.meta.standard.binding.modification.date" type="application/vnd.snia.xam.string" readOnly="true" binding="true" length="23" emcannotations:seqno="23" >
<value>2009.06.20 22:20:21 GMT</value>
</property>
<property name=".vnd.com.emc.centera.meta.standard.binding.creation.profile" type="application/vnd.snia.xam.string" readOnly="true" binding="true" length="13" emcannotations:seqno="24" >
<value>xam_challenge</value>
</property>
<property name=".vnd.com.emc.centera.meta.standard.binding.modification.profile" type="application/vnd.snia.xam.string" readOnly="true" binding="true" length="13" emcannotations:seqno="25" >
<value>xam_challenge</value>
</property>
<property name=".vnd.com.emc.centera.meta.standard.binding.numfiles" type="application/vnd.snia.xam.string" readOnly="true" binding="true" length="1" emcannotations:seqno="26" >
<value>2</value>
</property>
<property name=".vnd.com.emc.centera.meta.standard.binding.totalsize" type="application/vnd.snia.xam.string" readOnly="true" binding="true" length="3" emcannotations:seqno="27" >
<value>731</value>
</property>
<property name=".vnd.com.emc.centera.meta.standard.binding.refid" type="application/vnd.snia.xam.string" readOnly="true" binding="true" length="26" emcannotations:seqno="28" >
<value>6T90EGBR9LE5TFLVR5J6ACTJ66</value>
</property>
<property name=".vnd.com.emc.centera.meta.standard.binding.clusterid" type="application/vnd.snia.xam.string" readOnly="true" binding="true" length="36" emcannotations:seqno="29" >
<value>34372862-1dd2-11b2-aea0-f013836b5e75</value>
</property>
<property name=".vnd.com.emc.centera.meta.standard.binding.prev.clip" type="application/vnd.snia.xam.string" readOnly="true" binding="true" length="0" emcannotations:seqno="30" >
<value></value>
</property>
<property name=".vnd.com.emc.centera.meta.standard.binding.clip.naming.scheme" type="application/vnd.snia.xam.string" readOnly="true" binding="true" length="3" emcannotations:seqno="31" >
<value>MD5</value>
</property>
<property name=".vnd.com.emc.centera.meta.standard.binding.numtags" type="application/vnd.snia.xam.string" readOnly="true" binding="true" length="1" emcannotations:seqno="32" >
<value>3</value>
</property>
<property name=".vnd.com.emc.centera.hidden.nonbinding.clipid" type="application/vnd.snia.xam.string" readOnly="true" binding="false" length="4" emcannotations:seqno="33" >
<value>NULL</value>
</property>
<property name=".vnd.com.emc.centera.hidden.binding.clipid" type="application/vnd.snia.xam.string" readOnly="true" binding="true" length="53" emcannotations:seqno="34" >
<value>4Q5GT7QH4RQOUeEV2A2M2FQL6QIG4147VS31JO1TFLVR5J6ACTJ66</value>
</property>
</properties>
<xstreams>
<xstream name="com.rhc.file.source" type="application/octet-stream" readOnly="false" binding="true" length="156" emcannotations:seqno="1" >
<xop:Include href='cid:com.rhc.file.source' />
<emcannotations:emcannotation emcannotations:embedded="false" >
<emcannotations:emcblobannotation emcannotations:blobguid="1OROBIQ8CLBN3x8HRFRPNS7UV61G4147VS30JN0TFLVR5J6ACTJ66" emcannotations:offset="0" emcannotations:length="156" />
</emcannotations:emcannotation>
</xstream>
<xstream name="com.rhc.file.binary" type="application/base64" readOnly="false" binding="true" length="575" emcannotations:seqno="2" >
<xop:Include href='cid:com.rhc.file.binary' />
<emcannotations:emcannotation emcannotations:embedded="false" >
<emcannotations:emcblobannotation emcannotations:blobguid="09D943LSJ49S2xFF94NIQ5B10MGG4147VS31HG0TFLVR5J6ACTJ66" emcannotations:offset="0" emcannotations:length="575" />
</emcannotations:emcannotation>
</xstream>
</xstreams>
</xset>
</xsets>

--___EMC_XOP_BOUNDARY_START___1245537694___EMC_XOP_BOUNDARY_END___
Content-Type: text/text
Content-Transfer-Encoding: text
Content-ID: <TOC>

Offset of AAAEcwA9S8c0UTVHVDdRSDRSUU9VZUVWMkEyTTJGUUw2UUlHNDE0N1ZTMzFKTzFURkxWUjVKNkFDVEo2Ng==:com.rhc.file.source: 10955
Offset of AAAEcwA9S8c0UTVHVDdRSDRSUU9VZUVWMkEyTTJGUUw2UUlHNDE0N1ZTMzFKTzFURkxWUjVKNkFDVEo2Ng==:com.rhc.file.binary: 11285

--___EMC_XOP_BOUNDARY_START___1245537694___EMC_XOP_BOUNDARY_END___
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-ID: com.rhc.file.source

/*
* HelloWorld.java
*
*/

public class HelloWorld {
public static void main(String[] args){
System.out.println("Hello World!");
}
}

--___EMC_XOP_BOUNDARY_START___1245537694___EMC_XOP_BOUNDARY_END___
Content-Type: application/base64
Content-Transfer-Encoding: binary
Content-ID: com.rhc.file.binary

yv66vgAAADIAHQoABgAPCQAQABEIABIKABMAFAcAFQcAFgEABjxpbml0PgEAAygpVgEABENvZGUB
AA9MaW5lTnVtYmVyVGFibGUBAARtYWluAQAWKFtMamF2YS9sYW5nL1N0cmluZzspVgEAClNvdXJj
ZUZpbGUBAA9IZWxsb1dvcmxkLmphdmEMAAcACAcAFwwAGAAZAQAMSGVsbG8gV29ybGQhBwAaDAAb
ABwBAApIZWxsb1dvcmxkAQAQamF2YS9sYW5nL09iamVjdAEAEGphdmEvbGFuZy9TeXN0ZW0BAANv
dXQBABVMamF2YS9pby9QcmludFN0cmVhbTsBABNqYXZhL2lvL1ByaW50U3RyZWFtAQAHcHJpbnRs
bgEAFShMamF2YS9sYW5nL1N0cmluZzspVgAhAAUABgAAAAAAAgABAAcACAABAAkAAAAdAAEAAQAA
AAUqtwABsQAAAAEACgAAAAYAAQAAAAYACQALAAwAAQAJAAAAJQACAAEAAAAJsgACEgO2AASxAAAA
AQAKAAAACgACAAAACAAIAAkAAQANAAAAAgAO
--___EMC_XOP_BOUNDARY_START___1245537694___EMC_XOP_BOUNDARY_END___--
As you can see this export package is fairly large even though I am only storing two small XStreams in the XSet which I created.

The XSet manifest is everything between the <xsets> and </xsets> tags.  It appears to be a valid and well formed XML document although I have not formally checked it.

The first section, i.e. the <policies> section, lists the XSystem policies that are in effect for the included XSet(s).  Here the policy is set to the default policy for the Xsystem from which I exported the Xset.

It is followed by a section whose top element is <xset> which details the properties and XStream(s) for a single XSet.  Each XSet property element contains the following attributes: type, readonly, binding and length.  Each XStream is mapped to an <xstream> element which contains a child element <xop:include> which contains the content-id to the corresponding MIME part containing the actual contents of the XStream.

As you can see the actual contents of an XStream is included as a MIME attachment after the XSet manifest.  As an aside, note that there is no requirement for an XStream to verify that its contents actually match the declared MIME type. 

The first MIME attachment shown above (AKA the root MIME) lists the offsets of each of the two XStreams.  If an XSet does not contain an XStream, then there are no MIME attachments.  Other than the root MIME attachment the order of the MIME attachments is not significant.  The MIME attachments conform to the requirements of the MIME Multipart/Related Content-type specification (RFC 2387).

Here is the export package generated when StoreHelloWolld was targeted at the SNIA XAM reference VIM (Vendor Interface Module).
Content-Type: Multipart/Related;boundary="--SNIA_REFERENCE_VIM_MIME_BOUNDARY_2009-06-22T21:13:44.330-05:00.XZY_+";type="application/xop+xml";start="<canonicalxset.xml@snia.org>";start-info="text/xml"
Content-Description:Export of XSet: AAA6AwAePKwxMjQ1NzIzMjI0Mjc4ATTLJDRoe2iJ

----SNIA_REFERENCE_VIM_MIME_BOUNDARY_2009-06-22T21:13:44.330-05:00.XZY_+

Content-Type:application/xop+xml; charset="UTF-8"; type="text/xml"
Content-Transfer-Encoding:8bit
Content-ID:<canonicalxset.xml@snia.org>

<?xml version="1.0" encoding="UTF-8"?>
<xsets xsi:schemaLocation="http://www.snia.org/2007/xam/export/XAMCanonicalXSetDefinition.xsd" xmlns="http://www.snia.org/2007/xam/export" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xop="http://www.w3.org/2004/08/xop/include">
<version>1.0.0</version>
<xset>
<properties>
<property name=".xset.hold" type="application/vnd.snia.xam.boolean" binding="false" readOnly="true" length="1">
<boolean>false</boolean>
</property>
<property name=".xset.management.policy" type="application/vnd.snia.xam.string" binding="true" readOnly="true" length="36">
<string>.org.snia.refvim.default.mgmt.policy</string>
</property>
<property name=".xset.retention.base.enabled" type="application/vnd.snia.xam.boolean" binding="true" readOnly="true" length="1">
<boolean>true</boolean>
</property>
<property name=".xset.retention.base.starttime" type="application/vnd.snia.xam.datetime" binding="true" readOnly="true" length="29">
<string>2009-06-22T21:13:44.276-05:00</string>
</property>
<property name=".xset.retention.list.base" type="application/vnd.snia.xam.string" binding="true" readOnly="true" length="4">
<string>base</string>
</property>
<property name=".xset.retention.list.event" type="application/vnd.snia.xam.string" binding="true" readOnly="true" length="5">
<string>event</string>
</property>
<property name=".xset.time.access" type="application/vnd.snia.xam.datetime" binding="false" readOnly="true" length="29">
<string>2009-06-22T21:13:44.276-05:00</string>
</property>
<property name=".xset.time.commit" type="application/vnd.snia.xam.datetime" binding="false" readOnly="true" length="29">
<string>2009-06-22T21:13:44.276-05:00</string>
</property>
<property name=".xset.time.creation" type="application/vnd.snia.xam.datetime" binding="true" readOnly="true" length="29">
<string>2009-06-22T21:13:44.225-05:00</string>
</property>
<property name=".xset.time.xuid" type="application/vnd.snia.xam.datetime" binding="false" readOnly="true" length="29">
<string>2009-06-22T21:13:44.276-05:00</string>
</property>
<property name=".xset.xuid" type="application/vnd.snia.xam.xuid" binding="true" readOnly="true" length="30">
<xuid>AAA6AwAePKwxMjQ1NzIzMjI0Mjc4ATTLJDRoe2iJ</xuid>
</property>
<property name="app.filename" type="application/vnd.snia.xam.string" binding="true" readOnly="false" length="11">
<string>HelloWorld.</string>
</property>
</properties>
<xstreams>
<xstream name="com.rhc.file.binary" type="application/base64" binding="true" readOnly="false" length="575">
<org.snia.refvim.xstream_data>XStream_8508062132085140723.data</org.snia.refvim.xstream_data>
<xop:Include href="cid:com.rhc.file.binary@snia.org" xmlns:xop="http://www.w3.org/2004/08/xop/include"/>
</xstream>
<xstream name="com.rhc.file.source" type="application/octet-stream" binding="true" readOnly="false" length="156">
<org.snia.refvim.xstream_data>XStream_3869980320333904649.data</org.snia.refvim.xstream_data>
<xop:Include href="cid:com.rhc.file.source@snia.org" xmlns:xop="http://www.w3.org/2004/08/xop/include"/>
</xstream>
</xstreams>
</xset>
</xsets>
----SNIA_REFERENCE_VIM_MIME_BOUNDARY_2009-06-22T21:13:44.330-05:00.XZY_+

Content-Type:text/text
Content-Transfer-Encoding:text
Content-ID:<TOC>
Offset of AAA6AwAePKwxMjQ1NzIzMjI0Mjc4ATTLJDRoe2iJ:com.rhc.file.binary@snia.org:3948
Offset of AAA6AwAePKwxMjQ1NzIzMjI0Mjc4ATTLJDRoe2iJ:com.rhc.file.source@snia.org:4706

----SNIA_REFERENCE_VIM_MIME_BOUNDARY_2009-06-22T21:13:44.330-05:00.XZY_+

Content-Type:application/base64
Content-Transfer-Encoding:binary
Content-ID:<com.rhc.file.binary@snia.org>

yv66vgAAADIAHQoABgAPCQAQABEIABIKABMAFAcAFQcAFgEABjxpbml0PgEAAygpVgEABENvZGUB
AA9MaW5lTnVtYmVyVGFibGUBAARtYWluAQAWKFtMamF2YS9sYW5nL1N0cmluZzspVgEAClNvdXJj
ZUZpbGUBAA9IZWxsb1dvcmxkLmphdmEMAAcACAcAFwwAGAAZAQAMSGVsbG8gV29ybGQhBwAaDAAb
ABwBAApIZWxsb1dvcmxkAQAQamF2YS9sYW5nL09iamVjdAEAEGphdmEvbGFuZy9TeXN0ZW0BAANv
dXQBABVMamF2YS9pby9QcmludFN0cmVhbTsBABNqYXZhL2lvL1ByaW50U3RyZWFtAQAHcHJpbnRs
bgEAFShMamF2YS9sYW5nL1N0cmluZzspVgAhAAUABgAAAAAAAgABAAcACAABAAkAAAAdAAEAAQAA
AAUqtwABsQAAAAEACgAAAAYAAQAAAAYACQALAAwAAQAJAAAAJQACAAEAAAAJsgACEgO2AASxAAAA
AQAKAAAACgACAAAACAAIAAkAAQANAAAAAgAO

----SNIA_REFERENCE_VIM_MIME_BOUNDARY_2009-06-22T21:13:44.330-05:00.XZY_+

Content-Type:application/octet-stream
Content-Transfer-Encoding:binary
Content-ID:<com.rhc.file.source@snia.org>

/*
* HelloWorld.java
*
*/

public class HelloWorld {
public static void main(String[] args){
System.out.println("Hello World!");
}
}

----SNIA_REFERENCE_VIM_MIME_BOUNDARY_2009-06-22T21:13:44.330-05:00.XZY_+--
As you can see this export package is considerably more compact then the previous export package generated when I used the EMC Centera XAM VIM.

Well, that is about all for now.  Hopefully this post was useful to you if you are just coming up to speed on XAM and wondering how to import and export XSets.

BTW, Happy Father's Day to all dads who may be reading this post.
 

Fedora 11 New Extended File Attributes Namespace

I am experimenting with XAM (eXtensible Access Method), which is a storage standard developed by SNIA (Storage Networking Industry Association and have developed a first prototype of a VIM (Vendor Interface Module) for the ext4 file system based on adding another namespace to the current extended file attributes support.  Since other Linux developers might be interested in how to add an extended attributes namespace to a file system, I decided to publish this post as a guide.

Extended file attributes (EA) are extensions to the normal attributes which are associated with inodes in a file system.  They are simply name:value pairs associated with files and directories and whose purpose is to provide additional functionality which is either defined by the operating system or a user application.  An EA may be defined or undefined.  If an EA is defined, its value may be empty or non-empty.  Most of the initial work to support EAs in Linux was done by Andreas Gruenbacher in the 2001 to 2004 timeframe and is based on work done in the SGI XFS file system.

EAs are stored directly in inodes and on additional disk blocks if necessary.  Currently all EAs associated with a file must fit in an inode and one additional block.  Blocks that contain the identical set of EAs may be shared among several inodes.  EAs in inodes and on blocks have a different header followed by multiple entry descriptors.  Entry descriptors are sorted in disk blocks but are left unsorted in inodes.

EA names are zero-terminated strings and are always specified using a fully qualified namespace.attribute e.g. system.posix_acl_access or security.selinuxNamespaces are used to define different classes of EAs.  Different EA classes are required because the permissions and capabilities required for manipulating EAs in one namespace may differ from one to another.  Currently Linux supports EA namespaces for SELinux (security.), system (system.), trusted (trusted.) and user (user.).

Fedora 11 comes with EA support in the Linux kernel and hence it is the kernel which must be modified in order to add another EA namespace.  In my case I wanted to add an EA namespace called snia in order to support XAM XSet metadata (see below).

Here is the patch file for the Fedora 11 2.6.29.4-167.fc11 kernel which implements the snia namespace.  It should work for both 32-bit and 64-bit kernels but I have only tested it on a 64-bit kernel.
diff -uNrp kernel-2.6.29.orig/fs/ext4/Makefile kernel-2.6.29.new/fs/ext4/Makefile
--- kernel-2.6.29.orig/fs/ext4/Makefile 2009-06-14 22:07:12.191464615 -0400
+++ kernel-2.6.29.new/fs/ext4/Makefile 2009-06-14 22:06:20.009399924 -0400
@@ -8,6 +8,6 @@ ext4-y := balloc.o bitmap.o dir.o file.o
ioctl.o namei.o super.o symlink.o hash.o resize.o extents.o \
ext4_jbd2.o migrate.o mballoc.o

-ext4-$(CONFIG_EXT4_FS_XATTR) += xattr.o xattr_user.o xattr_trusted.o
+ext4-$(CONFIG_EXT4_FS_XATTR) += xattr.o xattr_user.o xattr_trusted.o xattr_snia.o
ext4-$(CONFIG_EXT4_FS_POSIX_ACL) += acl.o
ext4-$(CONFIG_EXT4_FS_SECURITY) += xattr_security.o
diff -uNrp kernel-2.6.29.orig/fs/ext4/xattr.c kernel-2.6.29.new/fs/ext4/xattr.c
--- kernel-2.6.29.orig/fs/ext4/xattr.c 2009-06-14 22:11:20.699475221 -0400
+++ kernel-2.6.29.new/fs/ext4/xattr.c 2009-06-14 22:09:48.242839367 -0400
@@ -107,6 +107,7 @@ static struct xattr_handler *ext4_xattr_
#ifdef CONFIG_EXT4_FS_SECURITY
[EXT4_XATTR_INDEX_SECURITY] = &ext4_xattr_security_handler,
#endif
+ [EXT4_XATTR_INDEX_SNIA] = &ext4_xattr_snia_handler,
};

struct xattr_handler *ext4_xattr_handlers[] = {
@@ -119,6 +120,7 @@ struct xattr_handler *ext4_xattr_handler
#ifdef CONFIG_EXT4_FS_SECURITY
&ext4_xattr_security_handler,
#endif
+ &ext4_xattr_snia_handler,
NULL
};
diff -uNrp kernel-2.6.29.orig/fs/ext4/xattr.h kernel-2.6.29.new/fs/ext4/xattr.h
--- kernel-2.6.29.orig/fs/ext4/xattr.h 2009-06-14 22:09:27.016464602 -0400
+++ kernel-2.6.29.new/fs/ext4/xattr.h 2009-06-14 22:07:44.887839381 -0400
@@ -21,6 +21,7 @@
#define EXT4_XATTR_INDEX_TRUSTED 4
#define EXT4_XATTR_INDEX_LUSTRE 5
#define EXT4_XATTR_INDEX_SECURITY 6
+#define EXT4_XATTR_INDEX_SNIA 7

struct ext4_xattr_header {
__le32 h_magic; /* magic number for identification */
@@ -70,6 +71,7 @@ extern struct xattr_handler ext4_xattr_t
extern struct xattr_handler ext4_xattr_acl_access_handler;
extern struct xattr_handler ext4_xattr_acl_default_handler;
extern struct xattr_handler ext4_xattr_security_handler;
+extern struct xattr_handler ext4_xattr_snia_handler;

extern ssize_t ext4_listxattr(struct dentry *, char *, size_t);
diff -uNrp kernel-2.6.29.orig/fs/ext4/xattr_snia.c kernel-2.6.29.new/fs/ext4/xattr_snia.c
--- kernel-2.6.29.orig/fs/ext4/xattr_snia.c 1969-12-31 19:00:00.000000000 -0500
+++ kernel-2.6.29.new/fs/ext4/xattr_snia.c 2009-06-14 13:37:02.551476954 -0400
@@ -0,0 +1,68 @@
+/*
+ * linux/fs/ext4/xattr_snia.c
+ * Handler for extended user attributes.
+ *
+ * Copyright (C) 2001 by Andreas Gruenbacher,
+ * Copyright (C) 2009 by Finnbarr P. Murphy,
+ */
+
+#include
+#include
+#include
+#include "ext4_jbd2.h"
+#include "ext4.h"
+#include "xattr.h"
+
+static size_t
+ext4_xattr_snia_list(struct inode *inode, char *list, size_t list_size,
+ const char *name, size_t name_len)
+{
+ const size_t prefix_len = XATTR_SNIA_PREFIX_LEN;
+ const size_t total_len = prefix_len + name_len + 1;
+
+#if FPM
+ if (!test_opt(inode->i_sb, XATTR_USER))
+ return 0;
+#endif
+
+ if (list && total_len <= list_size) {
+ memcpy(list, XATTR_SNIA_PREFIX, prefix_len);
+ memcpy(list+prefix_len, name, name_len);
+ list[prefix_len + name_len] = '\0';
+ }
+ return total_len;
+}
+
+static int
+ext4_xattr_snia_get(struct inode *inode, const char *name,
+ void *buffer, size_t size)
+{
+ if (strcmp(name, "") == 0)
+ return -EINVAL;
+#if FPM
+ if (!test_opt(inode->i_sb, XATTR_USER))
+ return -EOPNOTSUPP;
+#endif
+ return ext4_xattr_get(inode, EXT4_XATTR_INDEX_SNIA, name, buffer, size);
+}
+
+static int
+ext4_xattr_snia_set(struct inode *inode, const char *name,
+ const void *value, size_t size, int flags)
+{
+ if (strcmp(name, "") == 0)
+ return -EINVAL;
+#if FPM
+ if (!test_opt(inode->i_sb, XATTR_USER))
+ return -EOPNOTSUPP;
+#endif
+ return ext4_xattr_set(inode, EXT4_XATTR_INDEX_SNIA, name,
+ value, size, flags);
+}
+
+struct xattr_handler ext4_xattr_snia_handler = {
+ .prefix = XATTR_SNIA_PREFIX,
+ .list = ext4_xattr_snia_list,
+ .get = ext4_xattr_snia_get,
+ .set = ext4_xattr_snia_set,
+};
diff -uNrp kernel-2.6.29.orig/fs/xattr.c kernel-2.6.29.new/fs/xattr.c
--- kernel-2.6.29.orig/fs/xattr.c 2009-06-14 22:04:37.472464234 -0400
+++ kernel-2.6.29.new/fs/xattr.c 2009-06-14 22:05:56.759530990 -0400
@@ -42,6 +42,7 @@ xattr_permission(struct inode *inode, co
* on these is left to the underlying filesystem / security module.
*/
if (!strncmp(name, XATTR_SECURITY_PREFIX, XATTR_SECURITY_PREFIX_LEN) ||
+ !strncmp(name, XATTR_SNIA_PREFIX, XATTR_SNIA_PREFIX_LEN) ||
!strncmp(name, XATTR_SYSTEM_PREFIX, XATTR_SYSTEM_PREFIX_LEN))
return 0;

diff -uNrp kernel-2.6.29.orig/include/linux/xattr.h kernel-2.6.29.new/include/linux/xattr.h
--- kernel-2.6.29.orig/include/linux/xattr.h 2009-06-14 14:53:02.350464255 -0400
+++ kernel-2.6.29.new/include/linux/xattr.h 2009-06-14 14:51:07.585839446 -0400
@@ -33,6 +33,9 @@
#define XATTR_USER_PREFIX "user."
#define XATTR_USER_PREFIX_LEN (sizeof (XATTR_USER_PREFIX) - 1)

+#define XATTR_SNIA_PREFIX "snia."
+#define XATTR_SNIA_PREFIX_LEN (sizeof (XATTR_SNIA_PREFIX) - 1)
+
struct inode;
struct dentry;
I am going to assume that if you are still reading this post you know how to build, package and install a Linux kernel in Fedora.  If not, here is a good tutorial.  The only caveat I would make is to ignore the comment that "most text editors know how to break the hardlink correctly to avoid problems."  That is just plain wrong.  You need to have separate standalone copies of any source file that you intend modifying in both the original and new kernel source trees - not a single hard linked copy - before you start making changes in the new kernel source tree.

Once you are running on the new kernel, you can set and get EAs in the snia namespace as shown in this simple example.
$ touch testfile
$ setfattr -n snia.test -v "hello world" testfile
$ getfattr -n snia.test testfile
# file: testfile
snia.test="hello world"

$
In the next example I set and get the metadata (called fields in XAM terminology) for a sample XAM XSet.  A field has a name and a value, and the following standard attributes: type, length, binding and readonly.  The attributes and values roughly correspond to the fields outputted as an XML document to a persisted XSet by the ReferenceXSetClient example included with the XAM SDK which is available on the SNIA website.  For an introduction to the concepts of an XSystem and XSets a good starting place is Mark Carlson's blog.
$ cat xamtest
# file: testfile
snia.xset.hold.type="application/vnd.snia.xam.boolean"
snia.xset.hold.binding="false"
snia.xset.hold.readOnly="true"
snia.xset.hold.length="1"
snia.xset.hold="0"
snia.xset.management.policy.type="application/vnd.snia.xam.string"
snia.xset.management.policy.binding="true"
snia.xset.management.policy.readOnly="true"
snia.xset.management.policy.length="36"
snia.xset.management.policy="org.snia.refvim.default.mgmt.policy"
snia.xset.retention.base.enabled.type="application/vnd.snia.xam.boolean"
snia.xset.retention.base.enabled.binding="true"
snia.xset.retention.base.enabled.readOnly="true"
snia.xset.retention.base.enabled.length="1"
snia.xset.retention.base="1"
snia.xset.retention.base.starttime.type="application/vnd.snia.xam.datetime"
snia.xset.retention.base.starttime.binding="true"
snia.xset.retention.base.starttime.readOnly="true"
snia.xset.retention.base.starttime.length="29"
snia.xset.retention.base.starttime="2009-06-12T22:34:35.350-05:00"
snia.xset.retention.list.base.type="application/vnd.snia.xam.string"
snia.xset.retention.list.base.binding="true"
snia.xset.retention.list.base.readOnly="true"
snia.xset.retention.list.base.length="4"
snia.xset.retention.list.base="base"
snia.xset.retention.list.event.type="application/vnd.snia.xam.string"
snia.xset.retention.list.event.binding="true"
snia.xset.retention.list.event.readOnly="true"
snia.xset.retention.list.event.length="5"
snia.xset.retention.list.event="event"
snia.xset.time.access.type="application/vnd.snia.xam.datetime"
snia.xset.time.access.binding="false"
snia.xset.time.access.readOnly="true"
snia.xset.time.access.length="29"
snia.xset.time.access="2009-06-12T22:34:35.350-05:00"
snia.xset.time.commit.type="application/vnd.snia.xam.datetime"
snia.xset.time.commit.binding="false"
snia.xset.time.commit.readOnly="true"
snia.xset.time.commit.length="29"
snia.xset.time.commit="2009-06-12T22:34:35.350-05:00"
snia.xset.time.access.type="application/vnd.snia.xam.datetime"
snia.xset.time.access.binding="false"
snia.xset.time.access.readOnly="true"
snia.xset.time.access.length="29"
snia.xset.time.access="2009-06-12T22:34:35.350-05:00"
snia.xset.time.commit.type="application/vnd.snia.xam.datetime"
snia.xset.time.commit.binding="false"
snia.xset.time.commit.readOnly="true"
snia.xset.time.commit.length="29"
snia.xset.time.commit="2009-06-12T22:34:35.350-05:00"
snia.xset.time.creation.type="application/vnd.snia.xam.datetime"
snia.xset.time.creation.binding="true"
snia.xset.time.creation.readOnly="true"
snia.xset.time.creation.length="29"
snia.xset.time.creation="2009-06-12T22:34:35.331-05:00"
snia.xset.time.xuid.type="application/vnd.snia.xam.datetime"
snia.xset.time.xuid.binding="false"
snia.xset.time.xuid.readOnly="true"
snia.xset.time.xuid.length="29"
snia.xset.time.xuid="2009-06-12T22:34:35.331-05:00"
snia.xset.xuid.type="application/vnd.snia.xam.xuid"
snia.xset.xuid.binding="true"
snia.xset.xuid.readOnly="true"
snia.xset.xuid.length="30"
snia.xset.xuid="AAA6AwAeVG4xMjQ0ODY0MDc1MzU4AQWDedILNL7Q"

$ setfattr --restore=xamtest

$ getfattr -m snia. -d testfile
# file: testfile
snia.test="hello world"
snia.xset.hold="0"
snia.xset.hold.binding="false"
snia.xset.hold.length="1"
snia.xset.hold.readOnly="true"
snia.xset.hold.type="\"application/vnd.snia.xam.boolean\" "
snia.xset.management.policy="org.snia.refvim.default.mgmt.policy"
snia.xset.management.policy.binding="true"
snia.xset.management.policy.length="36"
snia.xset.management.policy.readOnly="true"
snia.xset.management.policy.type="application/vnd.snia.xam.string"
snia.xset.retention.base="1"
snia.xset.retention.base.enabled.binding="\"true\" "
snia.xset.retention.base.enabled.length="1"
snia.xset.retention.base.enabled.readOnly="true"
snia.xset.retention.base.enabled.type="application/vnd.snia.xam.boolean"
snia.xset.retention.base.starttime="2009-06-12T22:34:35.350-05:00"
snia.xset.retention.base.starttime.binding="true"
snia.xset.retention.base.starttime.length="29"
snia.xset.retention.base.starttime.readOnly="true"
snia.xset.retention.base.starttime.type="\"application/vnd.snia.xam.datetime\" "
snia.xset.retention.list.base="base"
snia.xset.retention.list.base.binding="true"
snia.xset.retention.list.base.length="4"
snia.xset.retention.list.base.readOnly="true"
snia.xset.retention.list.base.type="application/vnd.snia.xam.string"
snia.xset.retention.list.event="event"
snia.xset.retention.list.event.binding="true"
snia.xset.retention.list.event.length="5"
snia.xset.retention.list.event.readOnly="true"
snia.xset.retention.list.event.type="application/vnd.snia.xam.string"
snia.xset.time.access="2009-06-12T22:34:35.350-05:00"
snia.xset.time.access.binding="false"
snia.xset.time.access.length="29"
snia.xset.time.access.readOnly="true"
snia.xset.time.access.type="application/vnd.snia.xam.datetime"
snia.xset.time.commit="2009-06-12T22:34:35.350-05:00"
snia.xset.time.commit.binding="false"
snia.xset.time.commit.length="29"
snia.xset.time.commit.readOnly="true"
snia.xset.time.commit.type="application/vnd.snia.xam.datetime"
snia.xset.time.creation="2009-06-12T22:34:35.331-05:00"
snia.xset.time.creation.binding="true"
snia.xset.time.creation.length="29"
snia.xset.time.creation.readOnly="true"
snia.xset.time.creation.type="application/vnd.snia.xam.datetime"
snia.xset.time.xuid="2009-06-12T22:34:35.331-05:00"
snia.xset.time.xuid.binding="false"
snia.xset.time.xuid.length="29"
snia.xset.time.xuid.readOnly="true"
snia.xset.time.xuid.type="application/vnd.snia.xam.datetime"
snia.xset.xuid="AAA6AwAeVG4xMjQ0ODY0MDc1MzU4AQWDedILNL7Q"
snia.xset.xuid.binding="true"
snia.xset.xuid.length="30"
snia.xset.xuid.readOnly="true"
snia.xset.xuid.type="application/vnd.snia.xam.xuid"
$
Obviously this work is a proof-of-concept only.  The actual XAM namespace is org.snia.xam.* and not the shortened version, i.e. snia.*, which I used in the proof-of-concept.  I have not tested it sufficiently to discover boundary conditions or size limitations yet.  I suspect that it might be better to store the snia namespace attributes in their own block(s) rather than sharing an inode or block with the other four namespaces and this is what I intend to prototype next.

If anybody else is interested in working with me in this space I would welcome their involvement.
 

Fedora 11 nVidia Twinview Support

Fedora 11 (Leonidas) ships with the nouveau nVidia graphics driver preloaded by default if a nVidia graphics card is detected at install time.  Previous versions of Fedora used the older X.Org nv driver.

The nouveau project aims at producing Open Source 3D drivers for nVidia graphics cards.  According to the nouveau project Wiki

2D-support is in fairly good shape with EXA acceleration, Xv and Randr12 (think of dual-head, rotations, etc.). Randr12 should work for all cards up to, and including, Geforce 9000 series, although some issues with Geforce 8/9 laptops may still exist, for such issues bug reports should be submitted. Randr12 is now the default. Any 3D functionality that might exist is still unsupported, do not ask for instructions to try it. Also, VT switching while X is running is considered lucky."

Well, I certainly quickly ran into the VT switching issue!  It worked but not consistently.

Unfortunately the nouveau driver currently does not support nVidia TwinView functionality and I suspect that it will be a long time before it does if ever!

To use TwinView with Fedora 11, you have to load the correct nVidia drivers from rpmfusion.org.  I described how to do this in detail in a previous post so I will not repeat that information here.

You also need to modify your grub.conf file to include the nopat kernel boot option as shown below.
title Fedora (2.6.29.4-167.fc11.x86_64)
root (hd0,1)
kernel /vmlinuz-2.6.29.4-167.fc11.x86_64 ro root=/dev/mapper/vg_ultra-lv_root rhgb quiet nopat
initrd /initrd-2.6.29.4-167.fc11.x86_64.img
The nopat option is needed for this particular kernel (2.6.29.4) as it appears to still have broken PAT functionality.

For those readers who are unaware of what PAT is, here is a brief explanation.  Traditionally page caching was controlled by a CPU feature called Memory Type Range Registers (MTRR).  A CPU has a finite and limited set of MTRRs each of which control part of the physical address space.  To overcome this limitation and provide a more flexible architecture, Intel and other x86 CPU vendors added a set of bits to page table entries to control how a CPU does page caching.  These bits are called the Page Attribute Table (PAT).  Incidentally, the 2.6.26 kernel was the first Linux kernel to support PATs.

Unless you rebuild your initial ramdisk (initrd), the nouveau driver will remain loaded in the kernel.  I prefer not to have the nouveau driver loaded in my kernel if I am not using it so I added nouveau to the list of blacklisted drivers in /etc/modprobe.d/blacklist.conf and rebuild initrd.
# mv /boot/initrd-`uname -r`.img /boot/initrd-`uname -r`.img.backup
# mkinitrd -v /boot/initrd-`uname -r`.img `uname -r`
Creating initramfs
Looking for driver for /dev/mapper/vg_ultra-lv_root in /sys/block/dm-0
Found DeviceMapper component dm-0
Looking for deps of module scsi:t-0x00
Looking for deps of module pci:v00008086d00002922sv00008086sd00005442bc01sc06i01
Looking for driver for /dev/mapper/vg_ultra-lv_swap in /sys/block/dm-1
Found DeviceMapper component dm-1
Using modules:
Building initrd in /tmp/initrd.txR0Kd
/sbin/nash -> /tmp/initrd.txR0Kd/bin/nash
/usr/lib64/libnash.so.6.0.86 -> /tmp/initrd.txR0Kd/usr/lib64/libnash.so.6.0.86
/usr/lib64/libbdevid.so.6.0.86 -> /tmp/initrd.txR0Kd/usr/lib64/libbdevid.so.6.0.86
/lib64/libdevmapper.so.1.02 -> /tmp/initrd.txR0Kd/lib64/libdevmapper.so.1.02
/lib64/libparted-1.8.so.8 -> /tmp/initrd.txR0Kd/lib64/libparted-1.8.so.8
/lib64//libparted-1.8.so.8.0.0 -> /tmp/initrd.txR0Kd/lib64//libparted-1.8.so.8.0.0
/lib64/libblkid.so.1 -> /tmp/initrd.txR0Kd/lib64/libblkid.so.1
/lib64//libblkid.so.1.0 -> /tmp/initrd.txR0Kd/lib64//libblkid.so.1.0
/lib64/libselinux.so.1 -> /tmp/initrd.txR0Kd/lib64/libselinux.so.1
/lib64/libsepol.so.1 -> /tmp/initrd.txR0Kd/lib64/libsepol.so.1
/lib64/libuuid.so.1 -> /tmp/initrd.txR0Kd/lib64/libuuid.so.1
/lib64//libuuid.so.1.2 -> /tmp/initrd.txR0Kd/lib64//libuuid.so.1.2
/lib64/libpopt.so.0 -> /tmp/initrd.txR0Kd/lib64/libpopt.so.0
/lib64//libpopt.so.0.0.0 -> /tmp/initrd.txR0Kd/lib64//libpopt.so.0.0.0
/lib64/libresolv.so.2 -> /tmp/initrd.txR0Kd/lib64/libresolv.so.2
/lib64//libresolv-2.10.1.so -> /tmp/initrd.txR0Kd/lib64//libresolv-2.10.1.so
/lib64/libc.so.6 -> /tmp/initrd.txR0Kd/lib64/libc.so.6
/lib64//libc-2.10.1.so -> /tmp/initrd.txR0Kd/lib64//libc-2.10.1.so
/lib64/ld-linux-x86-64.so.2 -> /tmp/initrd.txR0Kd/lib64/ld-linux-x86-64.so.2
/lib64//ld-2.10.1.so -> /tmp/initrd.txR0Kd/lib64//ld-2.10.1.so
/lib64/libdl.so.2 -> /tmp/initrd.txR0Kd/lib64/libdl.so.2
/lib64//libdl-2.10.1.so -> /tmp/initrd.txR0Kd/lib64//libdl-2.10.1.so
/usr/lib64/libelf.so.1 -> /tmp/initrd.txR0Kd/usr/lib64/libelf.so.1
/usr/lib64//libelf-0.141.so -> /tmp/initrd.txR0Kd/usr/lib64//libelf-0.141.so
/usr/lib64/libnl.so.1 -> /tmp/initrd.txR0Kd/usr/lib64/libnl.so.1
/usr/lib64//libnl.so.1.1 -> /tmp/initrd.txR0Kd/usr/lib64//libnl.so.1.1
/lib64/libm.so.6 -> /tmp/initrd.txR0Kd/lib64/libm.so.6
/lib64//libm-2.10.1.so -> /tmp/initrd.txR0Kd/lib64//libm-2.10.1.so
/lib64/libgcc_s.so.1 -> /tmp/initrd.txR0Kd/lib64/libgcc_s.so.1
/lib64//libgcc_s-4.4.0-20090506.so.1 -> /tmp/initrd.txR0Kd/lib64//libgcc_s-4.4.0-20090506.so.1
/lib64/libreadline.so.5 -> /tmp/initrd.txR0Kd/lib64/libreadline.so.5
/lib64//libreadline.so.5.2 -> /tmp/initrd.txR0Kd/lib64//libreadline.so.5.2
/lib64/librt.so.1 -> /tmp/initrd.txR0Kd/lib64/librt.so.1
/lib64//librt-2.10.1.so -> /tmp/initrd.txR0Kd/lib64//librt-2.10.1.so
/lib64/libpthread.so.0 -> /tmp/initrd.txR0Kd/lib64/libpthread.so.0
/lib64//libpthread-2.10.1.so -> /tmp/initrd.txR0Kd/lib64//libpthread-2.10.1.so
/lib64/libtinfo.so.5 -> /tmp/initrd.txR0Kd/lib64/libtinfo.so.5
/lib64//libtinfo.so.5.7 -> /tmp/initrd.txR0Kd/lib64//libtinfo.so.5.7
/sbin/modprobe -> /tmp/initrd.txR0Kd/bin/modprobe
/sbin/rmmod -> /tmp/initrd.txR0Kd/bin/rmmod
resolving for MODULES
and that has items of
resolving for availmodules
and that has items of
/sbin/lvm -> /tmp/initrd.txR0Kd/bin/lvm
/etc/lvm -> /tmp/initrd.txR0Kd/etc/lvm
`/etc/lvm/lvm.conf' -> `/tmp/initrd.txR0Kd/etc/lvm/lvm.conf'
/etc/sysconfig/keyboard -> /tmp/initrd.txR0Kd/etc/sysconfig/keyboard
/bin/loadkeys -> /tmp/initrd.txR0Kd/bin/loadkeys
/lib/kbd/keymaps/i386/qwerty/us.map.gz -> /tmp/initrd.txR0Kd/lib/kbd/keymaps/i386/qwerty/us.map.gz
/lib/kbd/keymaps/i386/include/qwerty-layout.inc -> /tmp/initrd.txR0Kd/lib/kbd/keymaps/i386/include/qwerty-layout.inc
/lib/kbd/keymaps/i386/include/compose.inc -> /tmp/initrd.txR0Kd/lib/kbd/keymaps/i386/include/compose.inc
/lib/kbd/keymaps/include/compose.latin4 -> /tmp/initrd.txR0Kd/lib/kbd/keymaps/include/compose.latin4
/lib/kbd/keymaps/include/compose.8859_8 -> /tmp/initrd.txR0Kd/lib/kbd/keymaps/include/compose.8859_8
/lib/kbd/keymaps/include/compose.latin1 -> /tmp/initrd.txR0Kd/lib/kbd/keymaps/include/compose.latin1
/lib/kbd/keymaps/include/compose.latin3 -> /tmp/initrd.txR0Kd/lib/kbd/keymaps/include/compose.latin3
/lib/kbd/keymaps/include/compose.8859_7 -> /tmp/initrd.txR0Kd/lib/kbd/keymaps/include/compose.8859_7
/lib/kbd/keymaps/include/compose.latin2 -> /tmp/initrd.txR0Kd/lib/kbd/keymaps/include/compose.latin2
/lib/kbd/keymaps/include/compose.latin -> /tmp/initrd.txR0Kd/lib/kbd/keymaps/include/compose.latin
/lib/kbd/keymaps/i386/include/linux-with-alt-and-altgr.inc -> /tmp/initrd.txR0Kd/lib/kbd/keymaps/i386/include/linux-with-alt-and-altgr.inc
/lib/kbd/keymaps/i386/include/linux-keys-bare.inc -> /tmp/initrd.txR0Kd/lib/kbd/keymaps/i386/include/linux-keys-bare.inc
/lib/kbd/keymaps/i386/include/euro1.map.gz -> /tmp/initrd.txR0Kd/lib/kbd/keymaps/i386/include/euro1.map.gz
/etc/sysconfig/i18n -> /tmp/initrd.txR0Kd/etc/sysconfig/i18n
/bin/setfont -> /tmp/initrd.txR0Kd/bin/setfont
/lib/kbd/consolefonts/latarcyrheb-sun16.psfu.gz -> /tmp/initrd.txR0Kd/lib/kbd/consolefonts/latarcyrheb-sun16.psfu.gz
/lib/udev/console_init -> /tmp/initrd.txR0Kd/lib/udev/console_init
/lib64/libglib-2.0.so.0 -> /tmp/initrd.txR0Kd/lib64/libglib-2.0.so.0
/lib64//libglib-2.0.so.0.2000.1 -> /tmp/initrd.txR0Kd/lib64//libglib-2.0.so.0.2000.1
probing for modules for drm device card0
Adding graphics device card0
Looking for deps of module pci:v000010DEd00000640sv00003842sd0000C959bc03sc00i00: i2c-core nvidia
Adding module i2c-core
Adding module nvidia
resolving for GRAPHICSMODS
and that has items of i2c-core nvidia
Looking for deps of module i2c-core
Looking for deps of module nvidia: i2c-core
copy from `/lib/modules/2.6.29.4-167.fc11.x86_64/kernel/drivers/i2c/i2c-core.ko' [elf64-x86-64] to `/tmp/initrd.txR0Kd/lib/modules/2.6.29.4-167.fc11.x86_64/i2c-core.ko' [elf64-x86-64]
copy from `/lib/modules/2.6.29.4-167.fc11.x86_64/extra/nvidia-173xx/nvidia.ko' [elf64-x86-64] to `/tmp/initrd.txR0Kd/lib/modules/2.6.29.4-167.fc11.x86_64/nvidia.ko' [elf64-x86-64]
/sbin/plymouthd -> /tmp/initrd.txR0Kd/bin/plymouthd
........
........
Adding module scsi_wait_scan
copy from `/lib/modules/2.6.29.4-167.fc11.x86_64/kernel/drivers/scsi/scsi_wait_scan.ko' [elf64-x86-64] to `/tmp/initrd.txR0Kd/lib/modules/2.6.29.4-167.fc11.x86_64/scsi_wait_scan.ko' [elf64-x86-64]
This initrd uses dynamic shared objects.
Adding dynamic linker configuration files.
/etc/ld.so.conf -> /tmp/initrd.txR0Kd/etc/ld.so.conf
/etc/ld.so.conf.d/kernel-2.6.29.4-167.fc11.x86_64.conf -> /tmp/initrd.txR0Kd/etc/ld.so.conf.d/kernel-2.6.29.4-167.fc11.x86_64.conf
/etc/ld.so.conf.d/mysql-x86_64.conf -> /tmp/initrd.txR0Kd/etc/ld.so.conf.d/mysql-x86_64.conf
/etc/ld.so.conf.d/nvidia-lib64.conf -> /tmp/initrd.txR0Kd/etc/ld.so.conf.d/nvidia-lib64.conf
/etc/ld.so.conf.d/xulrunner-64.conf -> /tmp/initrd.txR0Kd/etc/ld.so.conf.d/xulrunner-64.conf
/etc/ld.so.conf.d/qt-x86_64.conf -> /tmp/initrd.txR0Kd/etc/ld.so.conf.d/qt-x86_64.conf
Running ldconfig
#
After rebooting your system, if you use dmesg or lsmod, you will see that the nvidia driver was loaded instead of the nouveau driver.

You will also see that for some reason Plymouth no longer runs with a graphical splash screen if it previously did so.  Plymouth is the replacement for the old RedHat Graphical Boot (RHGB).  It was written by Ray Strode, Kristian Hogsberg and Peter Jones of Redhat and first shipped in Fedora 10.

Finally, you do not need to modify your xorg.conf file for Fedora 11.  It should just work.