Skip to contentSkip to conversation

domain uuid always change in xl list -l if no uuid in vm.cfg

DISCUSSION Zhigang Wang 2 participants 3 messages May 15, 2014

lore
Share & tools
lore
#0 lore raw

Hi,

xl list --long will return a random domain UUID if no UUID is specified in vm.cfg::

    # xl list -l |grep uuid
                "uuid": "bbf0c18e-3325-4fe9-b303-5fa1ef0751c5",
    # xl list -l |grep uuid
                "uuid": "4982f6e2-0e17-4c88-8fa1-1d333d9f1f6e",

In this case, the domain handle (uuid) is set as ffc51cf9-2fb2-4838-b757-bcd65ace42b6 and will not change.

I think we may need always return the domain handle as shown in xenstore::

    # xenstore-read /local/domain/1/vm
    /vm/ffc51cf9-2fb2-4838-b757-bcd65ace42b6

Related code tool/libxl/xl_cmdimpl.c:

static void parse_config_data(...

    if (!xlu_cfg_get_string (config, "uuid", &buf, 0) ) {
        if ( libxl_uuid_from_string(&c_info->uuid, buf) ) {
            fprintf(stderr, "Failed to parse UUID: %s\n", buf);
            exit(1);
        }
    }else{
        libxl_uuid_generate(&c_info->uuid);
    }

I don't think it's right to just get the domain handle here. We may need to refactor the logic a little.

If Wei or anyone else is working on related staff, please consider this.

Thanks,

Zhigang

#1 lore raw
Quoted 29 lines · Zhigang Wang

Hi,

xl list --long will return a random domain UUID if no UUID is specified in vm.cfg::

    # xl list -l |grep uuid
                "uuid": "bbf0c18e-3325-4fe9-b303-5fa1ef0751c5",
    # xl list -l |grep uuid
                "uuid": "4982f6e2-0e17-4c88-8fa1-1d333d9f1f6e",

In this case, the domain handle (uuid) is set as ffc51cf9-2fb2-4838-b757-bcd65ace42b6 and will not change.

I think we may need always return the domain handle as shown in xenstore::

    # xenstore-read /local/domain/1/vm
    /vm/ffc51cf9-2fb2-4838-b757-bcd65ace42b6

Related code tool/libxl/xl_cmdimpl.c:

static void parse_config_data(...

    if (!xlu_cfg_get_string (config, "uuid", &buf, 0) ) {
        if ( libxl_uuid_from_string(&c_info->uuid, buf) ) {
            fprintf(stderr, "Failed to parse UUID: %s\n", buf);
            exit(1);
        }
    }else{
        libxl_uuid_generate(&c_info->uuid);
    }
Quoted 4 lines

I don't think it's right to just get the domain handle here. We may need to refactor the logic a little.

If Wei or anyone else is working on related staff, please consider this.

My series already covers this. ;-)

Weil

Quoted 3 lines

Thanks,

Zhigang

#2 lore raw
Quoted 30 lines · Wei Liu
Quoted 29 lines · Zhigang Wang

Hi,

xl list --long will return a random domain UUID if no UUID is specified in vm.cfg::

    # xl list -l |grep uuid
                "uuid": "bbf0c18e-3325-4fe9-b303-5fa1ef0751c5",
    # xl list -l |grep uuid
                "uuid": "4982f6e2-0e17-4c88-8fa1-1d333d9f1f6e",

In this case, the domain handle (uuid) is set as ffc51cf9-2fb2-4838-b757-bcd65ace42b6 and will not change.

I think we may need always return the domain handle as shown in xenstore::

    # xenstore-read /local/domain/1/vm
    /vm/ffc51cf9-2fb2-4838-b757-bcd65ace42b6

Related code tool/libxl/xl_cmdimpl.c:

static void parse_config_data(...

    if (!xlu_cfg_get_string (config, "uuid", &buf, 0) ) {
        if ( libxl_uuid_from_string(&c_info->uuid, buf) ) {
            fprintf(stderr, "Failed to parse UUID: %s\n", buf);
            exit(1);
        }
    }else{
        libxl_uuid_generate(&c_info->uuid);
    }
Quoted 6 lines
Quoted 4 lines

I don't think it's right to just get the domain handle here. We may need to refactor the logic a little.

If Wei or anyone else is working on related staff, please consider this.

My series already covers this. ;-)

Excellent. Will read and test your patches later.

Zhigang