qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Yehuda Sadeh Weinraub <yehudasa@gmail.com>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: ceph-devel@vger.kernel.org, Christian Brunner <chb@muc.de>,
	kvm@vger.kernel.org, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC PATCH 1/1] ceph/rbd block driver for qemu-kvm
Date: Thu, 20 May 2010 16:02:20 -0700	[thread overview]
Message-ID: <AANLkTinvwpG_7T2L8IvFuJZRTE8HvkAF3EOqOH8duaFH@mail.gmail.com> (raw)
In-Reply-To: <AANLkTimXqk7oa4mtcoHX1rKWzi_Nccb0FJu_QDtwJ-sP@mail.gmail.com>

On Thu, May 20, 2010 at 1:31 PM, Blue Swirl <blauwirbel@gmail.com> wrote:
> On Wed, May 19, 2010 at 7:22 PM, Christian Brunner <chb@muc.de> wrote:
>> The attached patch is a block driver for the distributed file system
>> Ceph (http://ceph.newdream.net/). This driver uses librados (which
>> is part of the Ceph server) for direct access to the Ceph object
>> store and is running entirely in userspace. Therefore it is
>> called "rbd" - rados block device.
...
>
> IIRC underscores here may conflict with system header use. Please use
> something like QEMU_BLOCK_RADOS_H.

This header is shared between the linux kernel client and the ceph
userspace servers and client. We can actually get rid of it, as we
only need it to define CEPH_OSD_TMAP_SET. We can move this definition
to librados.h.

>> diff --git a/block/rbd_types.h b/block/rbd_types.h
>> new file mode 100644
>> index 0000000..dfd5aa0
>> --- /dev/null
>> +++ b/block/rbd_types.h
>> @@ -0,0 +1,48 @@
>> +#ifndef _FS_CEPH_RBD
>> +#define _FS_CEPH_RBD
>
> QEMU_BLOCK_RBD?

This header is shared between the ceph kernel client, between the qemu
rbd module (and between other ceph utilities). It'd be much easier
maintaining it without having to have a different implementation for
each. The same goes to the use of __le32/64 and __u32/64 within these
headers.

>
>> +
>> +#include <linux/types.h>
>
> Can you use standard includes, like <sys/types.h> or <inttypes.h>? Are
> Ceph libraries used in other systems than Linux?

Not at the moment. I guess that we can take this include out.

>
>> +
>> +/*
>> + * rbd image 'foo' consists of objects
>> + *   foo.rbd      - image metadata
>> + *   foo.00000000
>> + *   foo.00000001
>> + *   ...          - data
>> + */
>> +
>> +#define RBD_SUFFIX             ".rbd"
>> +#define RBD_DIRECTORY           "rbd_directory"
>> +
>> +#define RBD_DEFAULT_OBJ_ORDER  22   /* 4MB */
>> +
>> +#define RBD_MAX_OBJ_NAME_SIZE  96
>> +#define RBD_MAX_SEG_NAME_SIZE  128
>> +
>> +#define RBD_COMP_NONE          0
>> +#define RBD_CRYPT_NONE         0
>> +
>> +static const char rbd_text[] = "<<< Rados Block Device Image >>>\n";
>> +static const char rbd_signature[] = "RBD";
>> +static const char rbd_version[] = "001.001";
>> +
>> +struct rbd_obj_snap_ondisk {
>> +       __le64 id;
>> +       __le64 image_size;
>> +} __attribute__((packed));
>> +
>> +struct rbd_obj_header_ondisk {
>> +       char text[64];
>> +       char signature[4];
>> +       char version[8];
>> +       __le64 image_size;
>
> Unaligned? Is the disk format fixed?

This is a packed structure that represents the on disk format.
Operations on it are being done only to read from the disk header or
to write to the disk header.


Yehuda

  parent reply	other threads:[~2010-05-20 23:02 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-19 19:22 [Qemu-devel] [RFC PATCH 1/1] ceph/rbd block driver for qemu-kvm Christian Brunner
2010-05-20 20:31 ` Blue Swirl
2010-05-20 21:18   ` Christian Brunner
2010-05-20 21:29     ` Anthony Liguori
2010-05-20 22:16       ` Christian Brunner
2010-05-21  5:28         ` Stefan Hajnoczi
2010-05-21  6:13           ` MORITA Kazutaka
2010-05-21  5:54         ` MORITA Kazutaka
2010-05-23 12:01       ` Avi Kivity
2010-05-24  7:12         ` MORITA Kazutaka
2010-05-24 11:05           ` Avi Kivity
2010-05-24 11:42             ` MORITA Kazutaka
2010-05-24 11:56               ` Avi Kivity
2010-05-24 12:07                 ` Cláudio Martins
2010-05-24 14:01                 ` MORITA Kazutaka
2010-05-24 19:07                   ` Christian Brunner
2010-05-24 19:38                     ` Anthony Liguori
2010-05-25  9:14                       ` Avi Kivity
2010-05-25 13:17                         ` Anthony Liguori
2010-05-25 13:25                           ` Avi Kivity
2010-05-25 13:29                             ` Anthony Liguori
2010-05-25 13:36                               ` Avi Kivity
2010-05-25 13:54                                 ` Anthony Liguori
2010-05-25 13:57                                   ` Avi Kivity
2010-05-25 14:02                                     ` Anthony Liguori
2010-05-26  8:44                                       ` Avi Kivity
2010-05-25 14:01                             ` Kevin Wolf
2010-05-25 16:21                               ` Avi Kivity
2010-05-25 17:12                                 ` Sage Weil
2010-05-26  5:24                                   ` MORITA Kazutaka
2010-05-26  8:46                                   ` Avi Kivity
2010-05-24 19:16                 ` Anthony Liguori
2010-05-25  9:19                   ` Avi Kivity
2010-05-25 13:26                   ` MORITA Kazutaka
2010-05-24  8:27         ` Stefan Hajnoczi
2010-05-24 11:03           ` Avi Kivity
2010-05-24 19:19             ` Anthony Liguori
2010-05-25  9:22               ` Avi Kivity
2010-05-25 11:02         ` Kevin Wolf
2010-05-25 11:25           ` Avi Kivity
2010-05-25 12:03             ` Christoph Hellwig
2010-05-25 12:13               ` Avi Kivity
2010-05-25 13:25             ` Anthony Liguori
2010-05-25 13:31               ` Avi Kivity
2010-05-25 13:35                 ` Anthony Liguori
2010-05-25 13:38                   ` Avi Kivity
2010-05-25 13:55                     ` Anthony Liguori
2010-05-25 14:01                       ` Avi Kivity
2010-05-25 14:05                         ` Anthony Liguori
2010-05-25 15:00                           ` Avi Kivity
2010-05-25 15:01                             ` Anthony Liguori
2010-05-25 16:16                               ` Avi Kivity
2010-05-25 16:21                                 ` Anthony Liguori
2010-05-25 16:27                                   ` Avi Kivity
2010-05-25 13:53               ` Kevin Wolf
2010-05-25 13:55                 ` Avi Kivity
2010-05-25 14:03                   ` Anthony Liguori
2010-05-25 15:02                     ` Avi Kivity
2010-05-25 14:09                   ` Kevin Wolf
2010-05-25 15:01                     ` Avi Kivity
2010-05-20 23:02   ` Yehuda Sadeh Weinraub [this message]
2010-05-23  7:59     ` Blue Swirl
2010-05-24  2:17       ` Yehuda Sadeh Weinraub
2010-05-25 20:13         ` Blue Swirl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTinvwpG_7T2L8IvFuJZRTE8HvkAF3EOqOH8duaFH@mail.gmail.com \
    --to=yehudasa@gmail.com \
    --cc=blauwirbel@gmail.com \
    --cc=ceph-devel@vger.kernel.org \
    --cc=chb@muc.de \
    --cc=kvm@vger.kernel.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).