All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zkabelac@redhat.com>
To: lvm-devel@redhat.com
Subject: LVM2/liblvm lvm2app.h lvm_lv.c lvm_pv.c lvm_vg.c
Date: Mon, 19 Apr 2010 20:38:16 +0200	[thread overview]
Message-ID: <4BCCA318.6070803@redhat.com> (raw)
In-Reply-To: <20100419170628.GE4828@agk-dp.fab.redhat.com>

On 19.4.2010 19:06, Alasdair G Kergon wrote:
> On Mon, Apr 19, 2010 at 05:34:04PM +0200, Zdenek Kabelac wrote:
>> Either we should return   const char*  return vg->name;
> 
> But then we have to guarantee that vg->name remains const - which we are
> unable to do.  (We can't impose limits on vgrename.)
> 

I think we may state, that until next call of any lvm library function pointer
remains valid. Thus if user needs it for something later - he needs to make a
local copy.

We may be nicer if we list functions which could change this pointer (i.e. I
wouldn't expect any *_get_* function could ever change it) - but I think it's
not needed - major use case would be to check value for something
and eventually copy somewhere - thus const char* is perfectly usable in this
case. So I think any const char* is valid between lvm calls - and if they are
valid after - it's just pure luck....

Zdenek



  reply	other threads:[~2010-04-19 18:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-19 15:22 LVM2/liblvm lvm2app.h lvm_lv.c lvm_pv.c lvm_vg.c wysochanski
2010-04-19 15:34 ` Zdenek Kabelac
2010-04-19 17:06   ` Alasdair G Kergon
2010-04-19 18:38     ` Zdenek Kabelac [this message]
2010-04-19 18:47       ` Alasdair G Kergon
2010-04-19 19:34   ` Dave Wysochanski

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=4BCCA318.6070803@redhat.com \
    --to=zkabelac@redhat.com \
    --cc=lvm-devel@redhat.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.