Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/build-check_aarch64-rt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: aarch64-RT CI
on:
pull_request:
branches:
- '**'
- '!mainline'

jobs:
kernel-build-job:
runs-on:
labels: kernel-build-arm64
container:
image: rockylinux/rockylinux:10
env:
ROCKY_ENV: rocky10
ports:
- 80
options: --cpus 8
steps:
- name: Install tools and Libraries
run: |
dnf update -y
dnf install 'dnf-command(config-manager)' -y
dnf config-manager --set-enabled devel
dnf install --enablerepo=crb bc dwarves kernel-devel openssl-devel elfutils-libelf-devel -y
dnf groupinstall 'Development Tools' -y
dnf install openssl -y
- name: Checkout code
uses: actions/checkout@v4
with:
ref: "${{ github.event.pull_request.head.sha }}"
fetch-depth: 0
- name: Build the Kernel
run: |
git config --global --add safe.directory /__w/kernel-src-tree/kernel-src-tree
cp configs/kernel-aarch64-rt-rhel.config .config
make olddefconfig
make -j8
38 changes: 38 additions & 0 deletions .github/workflows/build-check_aarch64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: aarch64 CI
on:
pull_request:
branches:
- '**'
- '!mainline'

jobs:
kernel-build-job:
runs-on:
labels: kernel-build-arm64
container:
image: rockylinux/rockylinux:10
env:
ROCKY_ENV: rocky10
ports:
- 80
options: --cpus 8
steps:
- name: Install tools and Libraries
run: |
dnf update -y
dnf install 'dnf-command(config-manager)' -y
dnf config-manager --set-enabled devel
dnf install --enablerepo=crb bc dwarves kernel-devel openssl-devel elfutils-libelf-devel -y
dnf groupinstall 'Development Tools' -y
dnf install openssl -y
- name: Checkout code
uses: actions/checkout@v4
with:
ref: "${{ github.event.pull_request.head.sha }}"
fetch-depth: 0
- name: Build the Kernel
run: |
git config --global --add safe.directory /__w/kernel-src-tree/kernel-src-tree
cp configs/kernel-aarch64-rhel.config .config
make olddefconfig
make -j8
38 changes: 38 additions & 0 deletions .github/workflows/build-check_x86_64-rt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: x86_64-RT CI
on:
pull_request:
branches:
- '**'
- '!mainline'

jobs:
kernel-build-job:
runs-on:
labels: kernel-build
container:
image: rockylinux/rockylinux:10
env:
ROCKY_ENV: rocky10
ports:
- 80
options: --cpus 8
steps:
- name: Install tools and Libraries
run: |
dnf update -y
dnf install 'dnf-command(config-manager)' -y
dnf config-manager --set-enabled devel
dnf install --enablerepo=crb bc dwarves kernel-devel openssl-devel elfutils-libelf-devel -y
dnf groupinstall 'Development Tools' -y
dnf install openssl -y
- name: Checkout code
uses: actions/checkout@v4
with:
ref: "${{ github.event.pull_request.head.sha }}"
fetch-depth: 0
- name: Build the Kernel
run: |
git config --global --add safe.directory /__w/kernel-src-tree/kernel-src-tree
cp configs/kernel-x86_64-rt-rhel.config .config
make olddefconfig
make -j8
38 changes: 38 additions & 0 deletions .github/workflows/build-check_x86_64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: x86_64 CI
on:
pull_request:
branches:
- '**'
- '!mainline'

jobs:
kernel-build-job:
runs-on:
labels: kernel-build
container:
image: rockylinux/rockylinux:10
env:
ROCKY_ENV: rocky10
ports:
- 80
options: --cpus 8
steps:
- name: Install tools and Libraries
run: |
dnf update -y
dnf install 'dnf-command(config-manager)' -y
dnf config-manager --set-enabled devel
dnf install --enablerepo=crb bc dwarves kernel-devel openssl-devel elfutils-libelf-devel -y
dnf groupinstall 'Development Tools' -y
dnf install openssl -y
- name: Checkout code
uses: actions/checkout@v4
with:
ref: "${{ github.event.pull_request.head.sha }}"
fetch-depth: 0
- name: Build the Kernel
run: |
git config --global --add safe.directory /__w/kernel-src-tree/kernel-src-tree
cp configs/kernel-x86_64-rhel.config .config
make olddefconfig
make -j8
64 changes: 59 additions & 5 deletions tools/hv/hv_kvp_daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ enum {
};

static int in_hand_shake;
static int debug;

static char *os_name = "";
static char *os_major = "";
Expand Down Expand Up @@ -183,6 +184,20 @@ static void kvp_update_file(int pool)
kvp_release_lock(pool);
}

static void kvp_dump_initial_pools(int pool)
{
int i;

syslog(LOG_DEBUG, "===Start dumping the contents of pool %d ===\n",
pool);

for (i = 0; i < kvp_file_info[pool].num_records; i++)
syslog(LOG_DEBUG, "pool: %d, %d/%d key=%s val=%s\n",
pool, i + 1, kvp_file_info[pool].num_records,
kvp_file_info[pool].records[i].key,
kvp_file_info[pool].records[i].value);
}

static void kvp_update_mem_state(int pool)
{
FILE *filep;
Expand Down Expand Up @@ -270,6 +285,8 @@ static int kvp_file_init(void)
return 1;
kvp_file_info[i].num_records = 0;
kvp_update_mem_state(i);
if (debug)
kvp_dump_initial_pools(i);
}

return 0;
Expand Down Expand Up @@ -297,6 +314,9 @@ static int kvp_key_delete(int pool, const __u8 *key, int key_size)
* Found a match; just move the remaining
* entries up.
*/
if (debug)
syslog(LOG_DEBUG, "%s: deleting the KVP: pool=%d key=%s val=%s",
__func__, pool, record[i].key, record[i].value);
if (i == (num_records - 1)) {
kvp_file_info[pool].num_records--;
kvp_update_file(pool);
Expand All @@ -315,20 +335,36 @@ static int kvp_key_delete(int pool, const __u8 *key, int key_size)
kvp_update_file(pool);
return 0;
}

if (debug)
syslog(LOG_DEBUG, "%s: could not delete KVP: pool=%d key=%s. Record not found",
__func__, pool, key);

return 1;
}

static int kvp_key_add_or_modify(int pool, const __u8 *key, int key_size,
const __u8 *value, int value_size)
{
int i;
int num_records;
struct kvp_record *record;
int num_records;
int num_blocks;
int i;

if (debug)
syslog(LOG_DEBUG, "%s: got a KVP: pool=%d key=%s val=%s",
__func__, pool, key, value);

if ((key_size > HV_KVP_EXCHANGE_MAX_KEY_SIZE) ||
(value_size > HV_KVP_EXCHANGE_MAX_VALUE_SIZE))
(value_size > HV_KVP_EXCHANGE_MAX_VALUE_SIZE)) {
syslog(LOG_ERR, "%s: Too long key or value: key=%s, val=%s",
__func__, key, value);

if (debug)
syslog(LOG_DEBUG, "%s: Too long key or value: pool=%d, key=%s, val=%s",
__func__, pool, key, value);
return 1;
}

/*
* First update the in-memory state.
Expand All @@ -348,6 +384,9 @@ static int kvp_key_add_or_modify(int pool, const __u8 *key, int key_size,
*/
memcpy(record[i].value, value, value_size);
kvp_update_file(pool);
if (debug)
syslog(LOG_DEBUG, "%s: updated: pool=%d key=%s val=%s",
__func__, pool, key, value);
return 0;
}

Expand All @@ -359,15 +398,22 @@ static int kvp_key_add_or_modify(int pool, const __u8 *key, int key_size,
record = realloc(record, sizeof(struct kvp_record) *
ENTRIES_PER_BLOCK * (num_blocks + 1));

if (record == NULL)
if (!record) {
syslog(LOG_ERR, "%s: Memory alloc failure", __func__);
return 1;
}
kvp_file_info[pool].num_blocks++;

}
memcpy(record[i].value, value, value_size);
memcpy(record[i].key, key, key_size);
kvp_file_info[pool].records = record;
kvp_file_info[pool].num_records++;

if (debug)
syslog(LOG_DEBUG, "%s: added: pool=%d key=%s val=%s",
__func__, pool, key, value);

kvp_update_file(pool);
return 0;
}
Expand Down Expand Up @@ -1661,6 +1707,7 @@ void print_usage(char *argv[])
fprintf(stderr, "Usage: %s [options]\n"
"Options are:\n"
" -n, --no-daemon stay in foreground, don't daemonize\n"
" -d, --debug Enable debug logs(syslog debug by default)\n"
" -h, --help print this help\n", argv[0]);
}

Expand All @@ -1682,10 +1729,11 @@ int main(int argc, char *argv[])
static struct option long_options[] = {
{"help", no_argument, 0, 'h' },
{"no-daemon", no_argument, 0, 'n' },
{"debug", no_argument, 0, 'd' },
{0, 0, 0, 0 }
};

while ((opt = getopt_long(argc, argv, "hn", long_options,
while ((opt = getopt_long(argc, argv, "hnd", long_options,
&long_index)) != -1) {
switch (opt) {
case 'n':
Expand All @@ -1694,6 +1742,9 @@ int main(int argc, char *argv[])
case 'h':
print_usage(argv);
exit(0);
case 'd':
debug = 1;
break;
default:
print_usage(argv);
exit(EXIT_FAILURE);
Expand All @@ -1716,6 +1767,9 @@ int main(int argc, char *argv[])
*/
kvp_get_domain_name(full_domain_name, sizeof(full_domain_name));

if (debug)
syslog(LOG_INFO, "Logging debug info in syslog(debug)");

if (kvp_file_init()) {
syslog(LOG_ERR, "Failed to initialize the pools");
exit(EXIT_FAILURE);
Expand Down