aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2022-08-16 17:13:12 +0000
committerMark Johnston <markj@FreeBSD.org>2022-08-23 20:06:19 +0000
commit1579c6e2dc9bc9d6eefa519ec105f20b729a0f14 (patch)
tree5bf309090e516dfa0d94419001304a9e47c31f89
parent976ed044fbbbc876628e2819352a06178adfcd1d (diff)
downloadsrc-1579c6e2dc9bc9d6eefa519ec105f20b729a0f14.tar.gz
src-1579c6e2dc9bc9d6eefa519ec105f20b729a0f14.zip
bhyve: Sprinkle const qualifiers where appropriate
No functional change intended. Sponsored by: The FreeBSD Foundation (cherry picked from commit d06bf11c06a0c2a6f52ba23f9b5204912cfd6fc5)
-rw-r--r--usr.sbin/bhyve/acpi.c2
-rw-r--r--usr.sbin/bhyve/pci_emul.h2
-rw-r--r--usr.sbin/bhyve/pci_hda.c4
-rw-r--r--usr.sbin/bhyve/pci_hda.h2
-rw-r--r--usr.sbin/bhyve/rfb.c6
-rw-r--r--usr.sbin/bhyve/rfb.h3
6 files changed, 10 insertions, 9 deletions
diff --git a/usr.sbin/bhyve/acpi.c b/usr.sbin/bhyve/acpi.c
index 360191ac6c4d..c9583e3fa218 100644
--- a/usr.sbin/bhyve/acpi.c
+++ b/usr.sbin/bhyve/acpi.c
@@ -858,7 +858,7 @@ basl_compile(struct vmctx *ctx, int (*fwrite_section)(FILE *), uint64_t offset)
{
struct basl_fio io[2];
static char iaslbuf[3*MAXPATHLEN + 10];
- char *fmt;
+ const char *fmt;
int err;
err = basl_start(&io[0], &io[1]);
diff --git a/usr.sbin/bhyve/pci_emul.h b/usr.sbin/bhyve/pci_emul.h
index fff70530c66c..28f4fc422bee 100644
--- a/usr.sbin/bhyve/pci_emul.h
+++ b/usr.sbin/bhyve/pci_emul.h
@@ -51,7 +51,7 @@ struct memory_region;
struct vm_snapshot_meta;
struct pci_devemu {
- char *pe_emu; /* Name of device emulation */
+ const char *pe_emu; /* Name of device emulation */
/* instance creation */
int (*pe_init)(struct vmctx *, struct pci_devinst *,
diff --git a/usr.sbin/bhyve/pci_hda.c b/usr.sbin/bhyve/pci_hda.c
index e7c54f01159f..1a2a3844ab20 100644
--- a/usr.sbin/bhyve/pci_hda.c
+++ b/usr.sbin/bhyve/pci_hda.c
@@ -94,7 +94,7 @@ struct hda_bdle_desc {
};
struct hda_codec_cmd_ctl {
- char *name;
+ const char *name;
void *dma_vaddr;
uint8_t run;
uint16_t rp;
@@ -729,7 +729,7 @@ static inline void
hda_print_cmd_ctl_data(struct hda_codec_cmd_ctl *p)
{
#if DEBUG_HDA == 1
- char *name = p->name;
+ const char *name = p->name;
#endif
DPRINTF("%s size: %d", name, p->size);
DPRINTF("%s dma_vaddr: %p", name, p->dma_vaddr);
diff --git a/usr.sbin/bhyve/pci_hda.h b/usr.sbin/bhyve/pci_hda.h
index 65a85f6d603d..da473800bd80 100644
--- a/usr.sbin/bhyve/pci_hda.h
+++ b/usr.sbin/bhyve/pci_hda.h
@@ -70,7 +70,7 @@ struct hda_codec_inst {
};
struct hda_codec_class {
- char *name;
+ const char *name;
int (*init)(struct hda_codec_inst *hci, const char *play,
const char *rec);
int (*reset)(struct hda_codec_inst *hci);
diff --git a/usr.sbin/bhyve/rfb.c b/usr.sbin/bhyve/rfb.c
index dc728aa46b64..4a550bca975b 100644
--- a/usr.sbin/bhyve/rfb.c
+++ b/usr.sbin/bhyve/rfb.c
@@ -113,7 +113,7 @@ struct rfb_softc {
int width, height;
- char *password;
+ const char *password;
bool enc_raw_ok;
bool enc_zlib_ok;
@@ -795,7 +795,7 @@ rfb_handle(struct rfb_softc *rc, int cfd)
{
const char *vbuf = "RFB 003.008\n";
unsigned char buf[80];
- unsigned char *message = NULL;
+ unsigned const char *message;
#ifndef NO_OPENSSL
unsigned char challenge[AUTH_LENGTH];
@@ -1060,7 +1060,7 @@ sse42_supported(void)
}
int
-rfb_init(char *hostname, int port, int wait, char *password)
+rfb_init(const char *hostname, int port, int wait, const char *password)
{
int e;
char servname[6];
diff --git a/usr.sbin/bhyve/rfb.h b/usr.sbin/bhyve/rfb.h
index dae43b2ec395..5a5785af41b0 100644
--- a/usr.sbin/bhyve/rfb.h
+++ b/usr.sbin/bhyve/rfb.h
@@ -33,6 +33,7 @@
#define RFB_PORT 5900
-int rfb_init(char *hostname, int port, int wait, char *password);
+int rfb_init(const char *hostname, int port, int wait,
+ const char *password);
#endif /* _RFB_H_ */