From bc6cb9fca3e67087536f4dda5041a6ed39e560c768ca81bd0aa5848b779d385f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sat, 17 Aug 2013 13:11:12 +0000 Subject: [PATCH 1/4] Accepting request 195492 from home:a_faerber:branches:Virtualization Add patch to fix gdbstub for arm/m68k/ppc guests OBS-URL: https://build.opensuse.org/request/show/195492 OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=155 --- ...-gdbstub-Fix-gdb_register_coprocesso.patch | 93 +++++++++++++++++++ qemu-linux-user.changes | 5 + qemu-linux-user.spec | 2 + qemu.changes | 5 + qemu.spec | 2 + 5 files changed, 107 insertions(+) create mode 100644 0038-gdbstub-Fix-gdb_register_coprocesso.patch diff --git a/0038-gdbstub-Fix-gdb_register_coprocesso.patch b/0038-gdbstub-Fix-gdb_register_coprocesso.patch new file mode 100644 index 00000000..5b95d73f --- /dev/null +++ b/0038-gdbstub-Fix-gdb_register_coprocesso.patch @@ -0,0 +1,93 @@ +From 1fd884e9d531b5b5b3e021eb3277a8784714df2f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andreas=20F=C3=A4rber?= +Date: Mon, 12 Aug 2013 18:09:47 +0200 +Subject: [PATCH] gdbstub: Fix gdb_register_coprocessor() register counting +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Commit a0e372f0c49ac01faeaeb73a6e8f50e8ac615f34 reorganized the register +counting for GDB. While it seems correct not to let the total number of +registers skyrocket in an SMP scenario through a static variable, the +distinction between total register count and 'g' packet register count +(last_reg vs. num_g_regs) got lost among the way. + +Fix this by introducing CPUState::gdb_num_g_regs and using that in +gdb_handle_packet(). + +Reported-by: Aneesh Kumar K.V +Cc: qemu-stable@nongnu.org (stable-1.6) +Tested-by: Aneesh Kumar K.V +Tested-by: Max Filippov +Tested-by: Peter Maydell +Signed-off-by: Andreas Färber +--- + gdbstub.c | 6 ++++-- + include/qom/cpu.h | 2 ++ + qom/cpu.c | 2 +- + 3 files changed, 7 insertions(+), 3 deletions(-) + +diff --git a/gdbstub.c b/gdbstub.c +index 1af25a6..9d067d6 100644 +--- a/gdbstub.c ++++ b/gdbstub.c +@@ -621,6 +621,8 @@ void gdb_register_coprocessor(CPUState *cpu, + if (g_pos != s->base_reg) { + fprintf(stderr, "Error: Bad gdb register numbering for '%s'\n" + "Expected %d got %d\n", xml, g_pos, s->base_reg); ++ } else { ++ cpu->gdb_num_g_regs = cpu->gdb_num_regs; + } + } + } +@@ -902,7 +904,7 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf) + case 'g': + cpu_synchronize_state(s->g_cpu); + len = 0; +- for (addr = 0; addr < s->g_cpu->gdb_num_regs; addr++) { ++ for (addr = 0; addr < s->g_cpu->gdb_num_g_regs; addr++) { + reg_size = gdb_read_register(s->g_cpu, mem_buf + len, addr); + len += reg_size; + } +@@ -914,7 +916,7 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf) + registers = mem_buf; + len = strlen(p) / 2; + hextomem((uint8_t *)registers, p, len); +- for (addr = 0; addr < s->g_cpu->gdb_num_regs && len > 0; addr++) { ++ for (addr = 0; addr < s->g_cpu->gdb_num_g_regs && len > 0; addr++) { + reg_size = gdb_write_register(s->g_cpu, registers, addr); + len -= reg_size; + registers += reg_size; +diff --git a/include/qom/cpu.h b/include/qom/cpu.h +index 0d6e95c..3e49936 100644 +--- a/include/qom/cpu.h ++++ b/include/qom/cpu.h +@@ -152,6 +152,7 @@ struct kvm_run; + * @current_tb: Currently executing TB. + * @gdb_regs: Additional GDB registers. + * @gdb_num_regs: Number of total registers accessible to GDB. ++ * @gdb_num_g_regs: Number of registers in GDB 'g' packets. + * @next_cpu: Next CPU sharing TB cache. + * @kvm_fd: vCPU file descriptor for KVM. + * +@@ -188,6 +189,7 @@ struct CPUState { + struct TranslationBlock *current_tb; + struct GDBRegisterState *gdb_regs; + int gdb_num_regs; ++ int gdb_num_g_regs; + CPUState *next_cpu; + + int kvm_fd; +diff --git a/qom/cpu.c b/qom/cpu.c +index aa95108..e71e57b 100644 +--- a/qom/cpu.c ++++ b/qom/cpu.c +@@ -240,7 +240,7 @@ static void cpu_common_initfn(Object *obj) + CPUState *cpu = CPU(obj); + CPUClass *cc = CPU_GET_CLASS(obj); + +- cpu->gdb_num_regs = cc->gdb_num_core_regs; ++ cpu->gdb_num_regs = cpu->gdb_num_g_regs = cc->gdb_num_core_regs; + } + + static int64_t cpu_common_get_arch_id(CPUState *cpu) diff --git a/qemu-linux-user.changes b/qemu-linux-user.changes index 4adcc615..25aeb7ec 100644 --- a/qemu-linux-user.changes +++ b/qemu-linux-user.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sat Aug 17 12:12:57 UTC 2013 - afaerber@suse.de + +- Fix gdbstub for arm/m68k/ppc guests (from pending upstream pull) + ------------------------------------------------------------------- Fri Aug 16 23:36:12 UTC 2013 - afaerber@suse.de diff --git a/qemu-linux-user.spec b/qemu-linux-user.spec index 99b2c485..34bfab43 100644 --- a/qemu-linux-user.spec +++ b/qemu-linux-user.spec @@ -62,6 +62,7 @@ Patch0034: 0034-console-add-question-mark-escape-op.patch Patch0035: 0035-Make-char-muxer-more-robust-wrt-sma.patch Patch0036: 0036-linux-user-lseek-explicitly-cast-no.patch Patch0037: 0037-virtfs-proxy-helper-Provide-__u64-f.patch +Patch0038: 0038-gdbstub-Fix-gdb_register_coprocesso.patch # Please do not add patches manually here, run update_git.sh. # this is to make lint happy Source300: rpmlintrc @@ -151,6 +152,7 @@ run cross-architecture builds. %patch0035 -p1 %patch0036 -p1 %patch0037 -p1 +%patch0038 -p1 %build ./configure --prefix=%_prefix --sysconfdir=%_sysconfdir \ diff --git a/qemu.changes b/qemu.changes index 62de244c..53e23882 100644 --- a/qemu.changes +++ b/qemu.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sat Aug 17 12:12:57 UTC 2013 - afaerber@suse.de + +- Fix gdbstub for arm/m68k/ppc guests (from pending upstream pull) + ------------------------------------------------------------------- Fri Aug 16 23:36:12 UTC 2013 - afaerber@suse.de diff --git a/qemu.spec b/qemu.spec index 20944fc8..b6f10c8d 100644 --- a/qemu.spec +++ b/qemu.spec @@ -62,6 +62,7 @@ Patch0034: 0034-console-add-question-mark-escape-op.patch Patch0035: 0035-Make-char-muxer-more-robust-wrt-sma.patch Patch0036: 0036-linux-user-lseek-explicitly-cast-no.patch Patch0037: 0037-virtfs-proxy-helper-Provide-__u64-f.patch +Patch0038: 0038-gdbstub-Fix-gdb_register_coprocesso.patch # Please do not add patches manually here, run update_git.sh. # this is to make lint happy Source300: rpmlintrc @@ -211,6 +212,7 @@ This sub-package contains the guest agent. %patch0035 -p1 %patch0036 -p1 %patch0037 -p1 +%patch0038 -p1 %build ./configure --prefix=%_prefix --sysconfdir=%_sysconfdir \ From 1f80f762c882a25b63d7b481ae87f75ac1ba5d6ee1d4f8eb9b53a07e4bdb4ee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sat, 17 Aug 2013 19:01:06 +0000 Subject: [PATCH 2/4] Accepting request 195515 from home:a_faerber:branches:Virtualization Enable Xen support OBS-URL: https://build.opensuse.org/request/show/195515 OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=156 --- qemu.changes | 6 ++++++ qemu.spec | 6 ++++++ qemu.spec.in | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/qemu.changes b/qemu.changes index 53e23882..9c3d919d 100644 --- a/qemu.changes +++ b/qemu.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sat Aug 17 13:43:13 UTC 2013 - afaerber@suse.de + +- Enable Xen support to allow testing our QEMU in place of Xen's + This prepares for consolidating QEMU packaging further. + ------------------------------------------------------------------- Sat Aug 17 12:12:57 UTC 2013 - afaerber@suse.de diff --git a/qemu.spec b/qemu.spec index b6f10c8d..bcf20302 100644 --- a/qemu.spec +++ b/qemu.spec @@ -110,6 +110,9 @@ BuildRequires: python %if 0%{?suse_version} >= 1210 BuildRequires: vte2-devel %endif +%ifarch %ix86 x86_64 +BuildRequires: xen-devel +%endif BuildRequires: zlib-devel %if 0%{?suse_version} >= 1140 %ifarch %ix86 x86_64 @@ -250,6 +253,9 @@ This sub-package contains the guest agent. --enable-vnc-sasl \ --enable-vnc-tls \ --enable-vnc-ws \ +%ifarch %ix86 x86_64 + --enable-xen \ +%endif make %{?_smp_mflags} V=1 diff --git a/qemu.spec.in b/qemu.spec.in index e1f17185..c41b3bc7 100644 --- a/qemu.spec.in +++ b/qemu.spec.in @@ -73,6 +73,9 @@ BuildRequires: python %if 0%{?suse_version} >= 1210 BuildRequires: vte2-devel %endif +%ifarch %ix86 x86_64 +BuildRequires: xen-devel +%endif BuildRequires: zlib-devel %if 0%{?suse_version} >= 1140 %ifarch %ix86 x86_64 @@ -176,6 +179,9 @@ PATCH_EXEC --enable-vnc-sasl \ --enable-vnc-tls \ --enable-vnc-ws \ +%ifarch %ix86 x86_64 + --enable-xen \ +%endif make %{?_smp_mflags} V=1 From ea4edd89f2a206f49b45c08a4bf2d8ebdfa22cd5c43cfbab934c9cbe5e381fea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Mon, 26 Aug 2013 18:24:00 +0000 Subject: [PATCH 3/4] Accepting request 196347 from home:robverduijn:branches:Virtualization This patch enables usb-redirection. I've updated the changes file. usb-redirection can be used via a tcp-server or via spice. thus I put the BuildRequires in its alphabetical spot. Regards Rob OBS-URL: https://build.opensuse.org/request/show/196347 OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=158 --- qemu.changes | 5 +++++ qemu.spec | 6 ++++++ qemu.spec.in | 6 ++++++ 3 files changed, 17 insertions(+) diff --git a/qemu.changes b/qemu.changes index 9c3d919d..38fe20e8 100644 --- a/qemu.changes +++ b/qemu.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Aug 26 06:40:22 UTC 2013 - rob.verduijn@gmail.com + +- enabled usb-redirection + ------------------------------------------------------------------- Sat Aug 17 13:43:13 UTC 2013 - afaerber@suse.de diff --git a/qemu.spec b/qemu.spec index bcf20302..6b58e5bb 100644 --- a/qemu.spec +++ b/qemu.spec @@ -107,6 +107,9 @@ BuildRequires: makeinfo BuildRequires: ncurses-devel BuildRequires: pwdutils BuildRequires: python +%if 0%{?sles_version} != 11 +BuildRequires: usbredir-devel +%endif %if 0%{?suse_version} >= 1210 BuildRequires: vte2-devel %endif @@ -245,6 +248,9 @@ This sub-package contains the guest agent. %endif %else --disable-spice \ +%endif +%if 0%{?sles_version} != 11 + --enable-usb-redir \ %endif --enable-vde \ --enable-virtfs \ diff --git a/qemu.spec.in b/qemu.spec.in index c41b3bc7..edee7eea 100644 --- a/qemu.spec.in +++ b/qemu.spec.in @@ -70,6 +70,9 @@ BuildRequires: makeinfo BuildRequires: ncurses-devel BuildRequires: pwdutils BuildRequires: python +%if 0%{?sles_version} != 11 +BuildRequires: usbredir-devel +%endif %if 0%{?suse_version} >= 1210 BuildRequires: vte2-devel %endif @@ -171,6 +174,9 @@ PATCH_EXEC %endif %else --disable-spice \ +%endif +%if 0%{?sles_version} != 11 + --enable-usb-redir \ %endif --enable-vde \ --enable-virtfs \ From 8700365cb464cba704530a18d47a26aa55f489f1f2f12fc22666bfff5b540f13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= Date: Thu, 12 Sep 2013 09:58:36 +0000 Subject: [PATCH 4/4] Accepting request 198639 from home:RBrownCCB:branches:Virtualization Improved .changes to mention one of the benefits of a recent change. No code changes. Please accept and forward to factory ASAP, as gnome-boxes requires it to function, and gnome-boxes has been a featured application for our last few releases. Thanks OBS-URL: https://build.opensuse.org/request/show/198639 OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=159 --- qemu.changes | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qemu.changes b/qemu.changes index 38fe20e8..10c30ac4 100644 --- a/qemu.changes +++ b/qemu.changes @@ -1,7 +1,8 @@ ------------------------------------------------------------------- Mon Aug 26 06:40:22 UTC 2013 - rob.verduijn@gmail.com -- enabled usb-redirection +- Enabled usb-redirection +* Fixes starting VMs in gnome-boxes (bnc#839703) ------------------------------------------------------------------- Sat Aug 17 13:43:13 UTC 2013 - afaerber@suse.de