提交 45464db8 编写于 作者: J Ján Tomko

conf: do not generate machine names ending with a dash

As of systemd commit:

commit d65652f1f21a4b0c59711320f34266c635393c89
Author:     Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
CommitDate: 2018-12-10 09:56:56 +0100

    Partially unify hostname_is_valid() and dns_name_is_valid()

Dashes are no longer allowed at the end of machine names.

Trim the trailing dashes from the generated name before passing
it to machined.

https://bugzilla.redhat.com/show_bug.cgi?id=1790409Signed-off-by: NJán Tomko <jtomko@redhat.com>
Reviewed-by: NErik Skultety <eskultet@redhat.com>
上级 fdd48f5b
......@@ -30472,6 +30472,9 @@ virDomainMachineNameAppendValid(virBufferPtr buf,
virBufferAddChar(buf, *name);
}
/* trailing dashes are not allowed */
virBufferTrimChars(buf, "-");
}
#undef HOSTNAME_CHARS
......
......@@ -740,6 +740,10 @@ mymain(void)
"qemu-7-123456789012345678901234567890123456789012345678901234567");
TEST_MACHINE("123456789012345678901234567890123456789012345678901234567890", 8,
"qemu-8-123456789012345678901234567890123456789012345678901234567");
TEST_MACHINE("kstest-network-device-default-httpks_(c9eed63e-981e-48ec-acdc-56b3f8c5f678)", 100,
"qemu-100-kstest-network-device-default-httpksc9eed63e-981e-48ec");
TEST_MACHINE("kstest-network-device-default-httpks_(c9eed63e-981e-48ec--cdc-56b3f8c5f678)", 10,
"qemu-10-kstest-network-device-default-httpksc9eed63e-981e-48ec");
# define TESTS_PM_SUPPORT_HELPER(name, function) \
do { \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册