virtio-9p: Implement TXATTRCREATE
commit10b468bdc5335b58f610817215f30847c1429f24
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Thu, 2 Sep 2010 05:39:07 +0000 (2 11:09 +0530)
committerAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Wed, 8 Sep 2010 17:26:41 +0000 (8 22:56 +0530)
tree13f6e0fd20f79868bafc0e071f7090eb6063aab0
parentfa32ef88792a21b68f06c506c079560151fb5847
virtio-9p: Implement TXATTRCREATE

TXATTRCREATE:  Prepare a fid for setting xattr value on a file system object.

 size[4] TXATTRCREATE tag[2] fid[4] name[s] attr_size[8] flags[4]
 size[4] RXATTRWALK tag[2]

txattrcreate gets a fid pointing to xattr. This fid can later be
used to get set the xattr value.

flag value is derived from set Linux setxattr. The manpage says
"The flags parameter can be used to refine the semantics of the operation.
XATTR_CREATE specifies a pure create, which fails if the named attribute
exists already. XATTR_REPLACE specifies a pure replace operation, which
fails if the named attribute does not already exist. By default (no flags),
the extended attribute will be created if need be, or will simply replace
the value if the attribute exists."

The actual setxattr operation happens when the fid is clunked. At that point
the written byte count and the attr_size specified in TXATTRCREATE should be
same otherwise an error will be returned.

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
hw/file-op-9p.h
hw/virtio-9p-debug.c
hw/virtio-9p-local.c
hw/virtio-9p.c
hw/virtio-9p.h