mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 21:55:25 +00:00
tests: Fix PCI test data filenames for Windows
Windows doesn't allow : in filenames.
Commit 21685c955e
added files with a : in
their names. This broke git operations on Windows as git is not able to
create those files on clone or pull.
Replace : with - in the offending filenames and adapt the test case.
This commit is contained in:
parent
46a0737e13
commit
96f274a989
@ -320,16 +320,33 @@ pci_device_new_from_stub(const struct pciDevice *data)
|
|||||||
{
|
{
|
||||||
struct pciDevice *dev;
|
struct pciDevice *dev;
|
||||||
char *devpath;
|
char *devpath;
|
||||||
|
char *id;
|
||||||
|
char *c;
|
||||||
char *configSrc;
|
char *configSrc;
|
||||||
char tmp[32];
|
char tmp[32];
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
|
|
||||||
|
if (VIR_STRDUP_QUIET(id, data->id) < 0)
|
||||||
|
ABORT_OOM();
|
||||||
|
|
||||||
|
/* Replace ':' with '-' to create the config filename from the
|
||||||
|
* device ID. The device ID cannot be used directly as filename
|
||||||
|
* because it contains ':' and Windows does not allow ':' in
|
||||||
|
* filenames. */
|
||||||
|
c = strchr(id, ':');
|
||||||
|
|
||||||
|
while (c) {
|
||||||
|
*c = '-';
|
||||||
|
c = strchr(c, ':');
|
||||||
|
}
|
||||||
|
|
||||||
if (VIR_ALLOC_QUIET(dev) < 0 ||
|
if (VIR_ALLOC_QUIET(dev) < 0 ||
|
||||||
virAsprintfQuiet(&configSrc, "%s/virpcitestdata/%s.config",
|
virAsprintfQuiet(&configSrc, "%s/virpcitestdata/%s.config",
|
||||||
abs_srcdir, data->id) < 0 ||
|
abs_srcdir, id) < 0 ||
|
||||||
virAsprintfQuiet(&devpath, "%s/devices/%s", fakesysfsdir, data->id) < 0)
|
virAsprintfQuiet(&devpath, "%s/devices/%s", fakesysfsdir, data->id) < 0)
|
||||||
ABORT_OOM();
|
ABORT_OOM();
|
||||||
|
|
||||||
|
VIR_FREE(id);
|
||||||
memcpy(dev, data, sizeof(*dev));
|
memcpy(dev, data, sizeof(*dev));
|
||||||
|
|
||||||
if (virFileMakePath(devpath) < 0)
|
if (virFileMakePath(devpath) < 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user