summary refs log tree commit diff stats
path: root/hw/i386/microvm-dt.c
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2021-11-22 14:17:14 +0100
committerRichard Henderson <richard.henderson@linaro.org>2021-11-22 14:17:14 +0100
commit5d1f437fb42dbd520b81a834fb2b7939ec1a7860 (patch)
tree01048f86eb9e5cb4bf297ce8c6cf62f0f8ff9e06 /hw/i386/microvm-dt.c
parent49aaac3548bc5a4632a14de939d5312b28dc1ba2 (diff)
parentb9e5628ca5d42994cc6f82752d9bf0bc98f51f64 (diff)
downloadfocaccia-qemu-5d1f437fb42dbd520b81a834fb2b7939ec1a7860.tar.gz
focaccia-qemu-5d1f437fb42dbd520b81a834fb2b7939ec1a7860.zip
Merge tag 'fixes-20211122-pull-request' of git://git.kraxel.org/qemu into staging
fixes for 6.2: microvm, ui, modules.

# gpg: Signature made Mon 22 Nov 2021 01:39:53 PM CET
# gpg:                using RSA key A0328CFFB93A17A79901FE7D4CB6D8EED3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full]
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>" [full]
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full]

* tag 'fixes-20211122-pull-request' of git://git.kraxel.org/qemu:
  microvm: check g_file_set_contents() return value
  microvm: add missing g_free() call
  hw/i386/microvm: Reduce annoying debug message in dt_setup_microvm()
  migration: fix dump-vmstate with modules
  ui/vnc-clipboard: fix adding notifier twice
  ui/gtk: graphic_hw_gl_flushed after closing dmabuf->fence_fd
  ui: fix incorrect pointer position on highdpi with gtk
  ui: fix incorrect scaling on highdpi with gtk/opengl

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'hw/i386/microvm-dt.c')
-rw-r--r--hw/i386/microvm-dt.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/hw/i386/microvm-dt.c b/hw/i386/microvm-dt.c
index 875ba91963..9c3c4995b4 100644
--- a/hw/i386/microvm-dt.c
+++ b/hw/i386/microvm-dt.c
@@ -143,6 +143,8 @@ static void dt_add_pcie(MicrovmMachineState *mms)
     nr_pcie_buses = PCIE_ECAM_SIZE / PCIE_MMCFG_SIZE_MIN;
     qemu_fdt_setprop_cells(mms->fdt, nodename, "bus-range", 0,
                            nr_pcie_buses - 1);
+
+    g_free(nodename);
 }
 
 static void dt_add_ioapic(MicrovmMachineState *mms, SysBusDevice *dev)
@@ -327,12 +329,17 @@ void dt_setup_microvm(MicrovmMachineState *mms)
     dt_setup_sys_bus(mms);
 
     /* add to fw_cfg */
-    fprintf(stderr, "%s: add etc/fdt to fw_cfg\n", __func__);
+    if (debug) {
+        fprintf(stderr, "%s: add etc/fdt to fw_cfg\n", __func__);
+    }
     fw_cfg_add_file(x86ms->fw_cfg, "etc/fdt", mms->fdt, size);
 
     if (debug) {
         fprintf(stderr, "%s: writing microvm.fdt\n", __func__);
-        g_file_set_contents("microvm.fdt", mms->fdt, size, NULL);
+        if (!g_file_set_contents("microvm.fdt", mms->fdt, size, NULL)) {
+            fprintf(stderr, "%s: writing microvm.fdt failed\n", __func__);
+            return;
+        }
         int ret = system("dtc -I dtb -O dts microvm.fdt");
         if (ret != 0) {
             fprintf(stderr, "%s: oops, dtc not installed?\n", __func__);