-/* SPDX-License-Identifier: LGPL-2.1+ */
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <sys/file.h>
#include <sys/mount.h>
#include "bus-label.h"
#include "bus-polkit.h"
#include "copy.h"
+#include "discover-image.h"
#include "dissect-image.h"
#include "fd-util.h"
#include "fileio.h"
#include "image-dbus.h"
#include "io-util.h"
#include "loop-util.h"
-#include "machine-image.h"
#include "missing_capability.h"
#include "mount-util.h"
+#include "os-util.h"
#include "process-util.h"
#include "raw-clone.h"
#include "strv.h"
return 1;
}
- r = hashmap_ensure_allocated(&m->image_cache, &image_hash_ops);
- if (r < 0)
- return r;
-
if (!m->image_cache_defer_event) {
r = sd_event_add_defer(m->event, &m->image_cache_defer_event, image_flush_cache, m);
if (r < 0)
if (r < 0)
return r;
- r = image_find(IMAGE_MACHINE, e, &image);
+ r = image_find(IMAGE_MACHINE, e, NULL, &image);
if (r == -ENOENT)
return 0;
if (r < 0)
image->userdata = m;
- r = hashmap_put(m->image_cache, image->name, image);
+ r = hashmap_ensure_put(&m->image_cache, &image_hash_ops, image->name, image);
if (r < 0) {
image_unref(image);
return r;
if (!images)
return -ENOMEM;
- r = image_discover(IMAGE_MACHINE, images);
+ r = image_discover(IMAGE_MACHINE, NULL, images);
if (r < 0)
return r;