mirror of https://gitee.com/openkylin/libvirt.git
Fri Feb 23 14:32:54 IST 2007 Mark McLoughlin <markmc@redhat.com>
* qemud/conf.c: don't load config files unless they have a ".xml" suffix, e.g. backup files ... we spew a warning later if we do.
This commit is contained in:
parent
fbcd25d3a7
commit
fb9f90c942
|
@ -1,3 +1,9 @@
|
||||||
|
Fri Feb 23 14:32:54 IST 2007 Mark McLoughlin <markmc@redhat.com>
|
||||||
|
|
||||||
|
* qemud/conf.c: don't load config files unless they have
|
||||||
|
a ".xml" suffix, e.g. backup files ... we spew a warning
|
||||||
|
later if we do.
|
||||||
|
|
||||||
Fri Feb 23 12:49:11 IST 2007 Mark McLoughlin <markmc@redhat.com>
|
Fri Feb 23 12:49:11 IST 2007 Mark McLoughlin <markmc@redhat.com>
|
||||||
|
|
||||||
* qemud/libvirtd.in: add init script for libvirt_qemud
|
* qemud/libvirtd.in: add init script for libvirt_qemud
|
||||||
|
|
16
qemud/conf.c
16
qemud/conf.c
|
@ -1750,6 +1750,19 @@ compareFileToNameSuffix(const char *file,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
hasSuffix(const char *str,
|
||||||
|
const char *suffix)
|
||||||
|
{
|
||||||
|
int len = strlen(str);
|
||||||
|
int suffixlen = strlen(suffix);
|
||||||
|
|
||||||
|
if (len < suffixlen)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return strcmp(str + len - suffixlen, suffix) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
checkLinkPointsTo(const char *checkLink,
|
checkLinkPointsTo(const char *checkLink,
|
||||||
const char *checkDest)
|
const char *checkDest)
|
||||||
|
@ -1945,6 +1958,9 @@ int qemudScanConfigDir(struct qemud_server *server,
|
||||||
if (entry->d_name[0] == '.')
|
if (entry->d_name[0] == '.')
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (!hasSuffix(entry->d_name, ".xml"))
|
||||||
|
continue;
|
||||||
|
|
||||||
if (qemudMakeConfigPath(configDir, entry->d_name, NULL, path, PATH_MAX) < 0) {
|
if (qemudMakeConfigPath(configDir, entry->d_name, NULL, path, PATH_MAX) < 0) {
|
||||||
qemudLog(QEMUD_WARN, "Config filename '%s/%s' is too long",
|
qemudLog(QEMUD_WARN, "Config filename '%s/%s' is too long",
|
||||||
configDir, entry->d_name);
|
configDir, entry->d_name);
|
||||||
|
|
Loading…
Reference in New Issue