qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Miguel Di Ciurcio Filho <miguel.filho@gmail.com>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: kwolf@redhat.com, armbru@redhat.com, qemu-devel@nongnu.org,
	lcapitulino@redhat.com, clalance@redhat.com, avi@redhat.com,
	anthony@codemonkey.org
Subject: Re: [Qemu-devel] [RFC] qcow2: Add snapshot inherantance and uuid identification
Date: Wed, 4 Aug 2010 09:56:18 -0300	[thread overview]
Message-ID: <AANLkTimKZQBbdRaA4M3qy749d8ZvRG6F3Rz_gFFPxtG5@mail.gmail.com> (raw)
In-Reply-To: <AANLkTikvjCNRBDikYeunOfYCyNJsH=RxjXkc=aoVOB--@mail.gmail.com>

On Tue, Aug 3, 2010 at 5:55 PM, Blue Swirl <blauwirbel@gmail.com> wrote:
>> +    if (strlen(current_snapshot_id) > 0) {
>> +        pstrcpy(sn->parent_id_str, sizeof(sn->parent_id_str), current_snapshot_id);
>> +    } else {
>> +        pstrcpy(sn->parent_id_str, sizeof(sn->parent_id_str), "00000000-0000-0000-0000-000000000000");
>> +    }
>> +
>> +    uuid_generate(uuid_buf);
>> +    uuid_unparse(uuid_buf, sn->id_str);
>
> We have qemu_uuid which is defined with command line switch, can you use that?
>

Didn't know that. It does the job, but there is some code inside
qemu_uuid_parse() that I'm not familiar with:

int qemu_uuid_parse(const char *str, uint8_t *uuid)
{
...
#ifdef TARGET_I386
    smbios_add_field(1, offsetof(struct smbios_type_1, uuid), 16, uuid);
#endif
    return 0;
}

I see that there are more uuid functions and spread in the code:

- block/vdi.c:
typedef unsigned char uuid_t[16];
void uuid_generate(uuid_t out);
int uuid_is_null(const uuid_t uu);
void uuid_unparse(const uuid_t uu, char *out);
- monitor.c:
do_info_uuid() does the conversion manually too, instead of using unparse/parse.

I think it would be better to cleanup this stuff and have a common code shaded.

Regards,

Miguel

  reply	other threads:[~2010-08-04 12:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-03 17:19 [Qemu-devel] [RFC] qcow2: Add snapshot inherantance and uuid identification Miguel Di Ciurcio Filho
2010-08-03 20:55 ` Blue Swirl
2010-08-04 12:56   ` Miguel Di Ciurcio Filho [this message]
2010-08-17 13:12 ` [Qemu-devel] " Miguel Di Ciurcio Filho

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=AANLkTimKZQBbdRaA4M3qy749d8ZvRG6F3Rz_gFFPxtG5@mail.gmail.com \
    --to=miguel.filho@gmail.com \
    --cc=anthony@codemonkey.org \
    --cc=armbru@redhat.com \
    --cc=avi@redhat.com \
    --cc=blauwirbel@gmail.com \
    --cc=clalance@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=lcapitulino@redhat.com \
    --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).