diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2010-09-02 11:09:07 +0530 |
---|---|---|
committer | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2010-09-08 22:56:41 +0530 |
commit | 10b468bdc5335b58f610817215f30847c1429f24 (patch) | |
tree | 13f6e0fd20f79868bafc0e071f7090eb6063aab0 /hw/virtio-9p-debug.c | |
parent | fa32ef88792a21b68f06c506c079560151fb5847 (diff) | |
download | qemu-10b468bdc5335b58f610817215f30847c1429f24.tar.gz qemu-10b468bdc5335b58f610817215f30847c1429f24.tar.bz2 qemu-10b468bdc5335b58f610817215f30847c1429f24.zip |
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>
Diffstat (limited to 'hw/virtio-9p-debug.c')
-rw-r--r-- | hw/virtio-9p-debug.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/hw/virtio-9p-debug.c b/hw/virtio-9p-debug.c index 4554eb6f6d..ad680545c6 100644 --- a/hw/virtio-9p-debug.c +++ b/hw/virtio-9p-debug.c @@ -588,6 +588,15 @@ void pprint_pdu(V9fsPDU *pdu) case P9_RXATTRWALK: fprintf(llogfile, "RXATTRWALK: ("); pprint_int64(pdu, 1, &offset, "xattrsize"); + case P9_TXATTRCREATE: + fprintf(llogfile, "TXATTRCREATE: ("); + pprint_int32(pdu, 0, &offset, "fid"); + pprint_str(pdu, 0, &offset, ", name"); + pprint_int64(pdu, 0, &offset, ", xattrsize"); + pprint_int32(pdu, 0, &offset, ", flags"); + break; + case P9_RXATTRCREATE: + fprintf(llogfile, "RXATTRCREATE: ("); break; default: fprintf(llogfile, "unknown(%d): (", pdu->id); |