Unverified Commit 60e0f368 authored by Franz Pletz's avatar Franz Pletz Committed by GitHub
Browse files

Merge pull request #191552 from Tasqa/libvirtd-zfs-storage

parents 241f31a0 a0f2ca21
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -12,6 +12,8 @@ import ./make-test-python.nix ({ pkgs, ... }: {

          libvirtd.enable = true;
        };
        boot.supportedFilesystems = [ "zfs" ];
        networking.hostId = "deadbeef"; # needed for zfs
        networking.nameservers = [ "192.168.122.1" ];
        security.polkit.enable = true;
        environment.systemPackages = with pkgs; [ virt-manager ];
@@ -37,6 +39,13 @@ import ./make-test-python.nix ({ pkgs, ... }: {
      virthost.succeed("virsh vol-create-as foo loop0p1 25MB")
      virthost.succeed("virsh vol-create-as foo loop0p2 50MB")

    with subtest("check if virsh zfs pools work"):
      virthost.succeed("fallocate -l100m /tmp/zfs; losetup /dev/loop1 /tmp/zfs;")
      virthost.succeed("zpool create zfs_loop /dev/loop1")
      virthost.succeed("virsh pool-define-as --name zfs_storagepool --source-name zfs_loop --type zfs")
      virthost.succeed("virsh pool-start zfs_storagepool")
      virthost.succeed("virsh vol-create-as zfs_storagepool disk1 25MB")

    with subtest("check if nixos install iso boots and network works"):
      virthost.succeed(
        "virt-install -n nixos --osinfo=nixos-unstable --ram=1024 --graphics=none --disk=`find ${nixosInstallISO}/iso -type f | head -n1`,readonly=on --import --noautoconsole"
+27 −0
Original line number Diff line number Diff line
From dc5e3df2fd29a547ef0f9545e190a0ce3a73c95c Mon Sep 17 00:00:00 2001
From: Tako Marks <me@github.tako.mx>
Date: Tue, 6 Sep 2022 20:19:26 +0200
Subject: [PATCH] substitute zfs and zpool commands

---
 src/storage/storage_backend_zfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/storage/storage_backend_zfs.c b/src/storage/storage_backend_zfs.c
index 2a5d74357d..460b3025c4 100644
--- a/src/storage/storage_backend_zfs.c
+++ b/src/storage/storage_backend_zfs.c
@@ -33,8 +33,8 @@
 
 VIR_LOG_INIT("storage.storage_backend_zfs");
 
-#define ZFS "zfs"
-#define ZPOOL "zpool"
+#define ZFS "@zfs@"
+#define ZPOOL "@zpool@"
 
 /*
  * Some common flags of zfs and zpool commands we use:
-- 
2.36.2
+6 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@
, readline
, rpcsvc-proto
, stdenv
, substituteAll
, xhtml1
, yajl
, writeScript
@@ -126,6 +127,11 @@ stdenv.mkDerivation rec {

  patches = [
    ./0001-meson-patch-in-an-install-prefix-for-building-on-nix.patch
    (substituteAll {
      src = ./0002-substitute-zfs-and-zpool-commands.patch;
      zfs = "${zfs}/bin/zfs";
      zpool = "${zfs}/bin/zpool";
    })
  ];

  # remove some broken tests