From: Mike Snitzer <snitzer@redhat.com>
To: Jim Ramsay <jim_ramsay@dell.com>
Cc: dm-devel@redhat.com, "Shah, Parind" <Parind_Shah@dell.com>,
"Shamberger, Jason" <Jason_Shamberger@dell.com>,
"OKelley, Kevin" <Kevin_OKelley@dell.com>
Subject: Re: RFC: dm-switch target [v3]
Date: Thu, 27 Oct 2011 14:52:23 -0400 [thread overview]
Message-ID: <20111027185223.GA6444@redhat.com> (raw)
In-Reply-To: <20111021202253.GA27434@freewill.equallogic.com>
On Fri, Oct 21 2011 at 4:22pm -0400,
Jim Ramsay <jim_ramsay@dell.com> wrote:
> Note: This is a repost with a few important implementation improvements.
...
> - Added a sysfs file so userland applications can easily check the version of
> this module.
...
> static ssize_t sysfs_version_show(struct kobject *kobj,
> struct attribute *attr, char *buff)
> {
> return snprintf(buff, PAGE_SIZE, "%d.%d.%d\n",
> __g_switch_target.version[0],
> __g_switch_target.version[1],
> __g_switch_target.version[2]);
> }
>
> static ssize_t sysfs_version_store(struct kobject *kobj,
> struct attribute *attr, const char *buff,
> size_t size)
> {
> return -EINVAL;
> }
>
> static const struct _sysfs_attr_ops __g_sysfs_version = {
> .attr = {"version", 0444},
> .ops = {&sysfs_version_show, &sysfs_version_store}
> };
One would hope that this "version" file isn't needed. DM already
provides the ability to query the version of targets via the
DM_LIST_VERSIONS dm-ioctl. E.g.:
# dmsetup targets
thin-pool v1.0.0
thin v1.0.0
mirror v1.12.1
multipath v1.3.0
striped v1.4.0
linear v1.1.0
error v1.0.1
But we don't have the ability to ask for a specific target's version.
(lvm2's tools/dmsetup.c:_targets() illustrates how to collect the
targets and access their versions -- would require linking against
libdm).
But we could add a --target flag to dmsetup targets (like 'dmsetup ls'
allows), e.g.: dmsetup targets --target switch
Mike
next prev parent reply other threads:[~2011-10-27 18:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-21 20:22 RFC: dm-switch target [v3] Jim Ramsay
2011-10-27 18:52 ` Mike Snitzer [this message]
2011-11-02 16:36 ` Jim_Ramsay
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=20111027185223.GA6444@redhat.com \
--to=snitzer@redhat.com \
--cc=Jason_Shamberger@dell.com \
--cc=Kevin_OKelley@dell.com \
--cc=Parind_Shah@dell.com \
--cc=dm-devel@redhat.com \
--cc=jim_ramsay@dell.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.