Consider start and end time when testing if a reservation can start

Use the will_run_data_t instead of leaving it NULL.

Before this would allow reservations to be created while jobs used the
needed resources. (Specifically gres)

If all the gpus on the cluster are used this should fail but didn't:
scontrol create reservation ... starttime=now duration=1 TRES=gres/gpu=1,cpu:1

Changelog: Fix issue where reservations may start while required GRES
 resources are still being used by jobs.
Ticket: 24004
diff --git a/src/slurmctld/reservation.c b/src/slurmctld/reservation.c
index f5ccc36..a71d650 100644
--- a/src/slurmctld/reservation.c
+++ b/src/slurmctld/reservation.c
@@ -420,6 +420,10 @@
 	job_record_t *job_ptr;
 	resv_exc_t resv_exc = { 0 };
 	int rc;
+	will_run_data_t will_run_data = {
+		.start = resv_desc_ptr->start_time,
+		.end = resv_desc_ptr->end_time,
+	};
 
 	xassert(avail_node_bitmap);
 	xassert(resv_desc_ptr);
@@ -440,11 +444,12 @@
 		job_ptr->details->max_nodes,
 		SELECT_MODE_WILL_RUN, NULL, NULL,
 		&resv_exc,
-		NULL);
+		&will_run_data);
 
 	free_core_array(&resv_exc.exc_cores);
 
-	if (rc != SLURM_SUCCESS) {
+	if (rc != SLURM_SUCCESS ||
+	    job_ptr->start_time > MAX(resv_desc_ptr->start_time, time(NULL))) {
 		return NULL;
 	}