Skip to content

Commit

Permalink
Merge pull request #564 from hannesm/FreeBSD14
Browse files Browse the repository at this point in the history
support FreeBSD14 in hvt
  • Loading branch information
dinosaure authored Feb 28, 2024
2 parents 3f83367 + e4c38e7 commit cc80d3a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
8 changes: 8 additions & 0 deletions tenders/hvt/hvt_freebsd_x86_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ int hvt_vcpu_loop(struct hvt *hvt)
{
struct hvt_b *hvb = hvt->b;
int ret;
#if __FreeBSD_version >= 1400000
struct vm_exit vmexit;
hvb->vmrun.vm_exit = &vmexit;
#endif

while (1) {
ret = ioctl(hvt->b->vmfd, VM_RUN, &hvb->vmrun);
Expand All @@ -178,7 +182,11 @@ int hvt_vcpu_loop(struct hvt *hvt)
if (handled)
continue;

#if __FreeBSD_version >= 1400000
struct vm_exit *vme = &vmexit;
#else
struct vm_exit *vme = &hvb->vmrun.vm_exit;
#endif

switch (vme->exitcode) {
case VM_EXITCODE_INOUT: {
Expand Down
3 changes: 0 additions & 3 deletions tenders/hvt/hvt_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,11 @@ int main(int argc, char **argv)
* which will be the ELF file to load. Stop if a "terminal" option such as
* --help is encountered.
*/
int argc1 = argc;
char **argv1 = argv;
while (*argv1 && *argv1[0] == '-') {
if (strcmp("--", *argv1) == 0)
{
/* Consume and stop option processing */
argc1--;
argv1++;
break;
}
Expand All @@ -169,7 +167,6 @@ int main(int argc, char **argv)
else if(strcmp("--version", *argv1) == 0)
version(prog);

argc1--;
argv1++;
}
if (*argv1 == NULL) {
Expand Down
3 changes: 0 additions & 3 deletions tenders/spt/spt_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,11 @@ int main(int argc, char **argv)
* which will be the ELF file to load. Stop if a "terminal" option such as
* --help is encountered.
*/
int argc1 = argc;
char **argv1 = argv;
while (*argv1 && *argv1[0] == '-') {
if (strcmp("--", *argv1) == 0)
{
/* Consume and stop option processing */
argc1--;
argv1++;
break;
}
Expand All @@ -162,7 +160,6 @@ int main(int argc, char **argv)
else if(strcmp("--version", *argv1) == 0)
version(prog);

argc1--;
argv1++;
}
if (*argv1 == NULL) {
Expand Down

0 comments on commit cc80d3a

Please sign in to comment.