Re: [PATCH 00/11] Fixes for clang-13 plus tcg/ppc

2021-08-13 Thread Brad Smith

On 7/12/2021 5:55 PM, Richard Henderson wrote:

The goal here was to address Brad's report for clang vs ppc32.

Somewhere in between here and there I forgot about the ppc32 part,
needed a newer clang for gcc135, accidentally built master instead
of the clang-12 release branch, fixed a bunch of buggy looking
things, and only then remembered I was building ppc64 and wasn't
going to test what I thought I would.

So: Brad, could you double-check this fixes your problem?


Yes, this does. Thank you.


Others: Only patch 7 obviously should have been using the
variable indicated as unused.  But please double-check.


r~


Cc: Alex Bennée 
Cc: Brad Smith 
Cc: David Gibson 
Cc: Eric Blake 
Cc: Gerd Hoffmann 
Cc: Greg Kurz 
Cc: Jason Wang 
Cc: Laurent Vivier 
Cc: qemu-block@nongnu.org
Cc: qemu-...@nongnu.org
Cc: Vladimir Sementsov-Ogievskiy 


Richard Henderson (11):
   nbd/server: Remove unused variable
   accel/tcg: Remove unused variable in cpu_exec
   util/selfmap: Discard mapping on error
   net/checksum: Remove unused variable in net_checksum_add_iov
   hw/audio/adlib: Remove unused variable in adlib_callback
   hw/ppc/spapr_events: Remove unused variable from check_exception
   hw/pci-hist/pnv_phb4: Fix typo in pnv_phb4_ioda_write
   linux-user/syscall: Remove unused variable from execve
   tests/unit: Remove unused variable from test_io
   tcg/ppc: Replace TCG_TARGET_CALL_DARWIN with _CALL_DARWIN
   tcg/ppc: Ensure _CALL_SYSV is set for 32-bit ELF

  accel/tcg/cpu-exec.c |  3 ---
  hw/audio/adlib.c |  3 +--
  hw/pci-host/pnv_phb4.c   |  2 +-
  hw/ppc/spapr_events.c|  5 -
  linux-user/syscall.c |  3 ---
  nbd/server.c |  4 
  net/checksum.c   |  4 +---
  tests/unit/test-iov.c|  5 +
  util/selfmap.c   | 28 
  tcg/ppc/tcg-target.c.inc | 25 -
  10 files changed, 40 insertions(+), 42 deletions(-)





Re: [PATCH 1/7] migration: use GDateTime for formatting timestamp in snapshot names

2021-05-05 Thread Brad Smith

Thank you.

On 5/5/2021 6:36 AM, Daniel P. Berrangé wrote:

The GDateTime APIs provided by GLib avoid portability pitfalls, such
as some platforms where 'struct timeval.tv_sec' field is still 'long'
instead of 'time_t'. When combined with automatic cleanup, GDateTime
often results in simpler code too.

Signed-off-by: Daniel P. Berrangé 
---
  migration/savevm.c | 13 +
  1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/migration/savevm.c b/migration/savevm.c
index 52e2d72e4b..72848b946c 100644
--- a/migration/savevm.c
+++ b/migration/savevm.c
@@ -2775,8 +2775,7 @@ bool save_snapshot(const char *name, bool overwrite, 
const char *vmstate,
  QEMUFile *f;
  int saved_vm_running;
  uint64_t vm_state_size;
-qemu_timeval tv;
-struct tm tm;
+g_autoptr(GDateTime) now = g_date_time_new_now_local();
  AioContext *aio_context;
  
  if (migration_is_blocked(errp)) {

@@ -2836,9 +2835,8 @@ bool save_snapshot(const char *name, bool overwrite, 
const char *vmstate,
  memset(sn, 0, sizeof(*sn));
  
  /* fill auxiliary fields */

-qemu_gettimeofday();
-sn->date_sec = tv.tv_sec;
-sn->date_nsec = tv.tv_usec * 1000;
+sn->date_sec = g_date_time_to_unix(now);
+sn->date_nsec = g_date_time_get_microsecond(now) * 1000;
  sn->vm_clock_nsec = qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL);
  if (replay_mode != REPLAY_MODE_NONE) {
  sn->icount = replay_get_current_icount();
@@ -2849,9 +2847,8 @@ bool save_snapshot(const char *name, bool overwrite, 
const char *vmstate,
  if (name) {
  pstrcpy(sn->name, sizeof(sn->name), name);
  } else {
-/* cast below needed for OpenBSD where tv_sec is still 'long' */
-localtime_r((const time_t *)_sec, );
-strftime(sn->name, sizeof(sn->name), "vm-%Y%m%d%H%M%S", );
+g_autofree char *autoname = g_date_time_format(now,  
"vm-%Y%m%d%H%M%S");
+pstrcpy(sn->name, sizeof(sn->name), autoname);
  }
  
  /* save the VM state */




Re: [Qemu-block] [Qemu-devel] [PATCH v2 09/18] tests/vm/openbsd: Install Bash from the ports

2019-02-06 Thread Brad Smith

On 2/6/2019 3:25 PM, Alex Bennée wrote:


Brad Smith  writes:


On 2/5/2019 8:57 AM, Brad Smith wrote:


If someone could point me in the right direction as to how the image
is created
I could look at coming up with something newer. I would prefer that
over some
of the workarounds I've seen to date.

I started creating the image and then wondered what do I set the root
password
to? The instructions also talk about an SSH key but I don't know how
that would
work when this image is used for the VM test framework.

See tests/keys - basically we have a hard-wired testing key.

So the root password doesn't matter?

I updated the instructions on the Wiki to make use of VirtIO for both
the NIC and disk controller.

Can the OpenBSD kernel use virtio-net-pci and virtio-scsi-pci?

It's not super important for build testing but they are the most capable
variants of virtio. The virtio-pci gives nice discover-able hotplug and
I believe you need virtio-scsi-pci if you want to use funky options like
discard for thin provisioning.


Yes to both.



Re: [Qemu-block] [PATCH v2 09/18] tests/vm/openbsd: Install Bash from the ports

2019-02-06 Thread Brad Smith

On 2/5/2019 8:57 AM, Brad Smith wrote:

If someone could point me in the right direction as to how the image 
is created
I could look at coming up with something newer. I would prefer that 
over some

of the workarounds I've seen to date.


I started creating the image and then wondered what do I set the root 
password
to? The instructions also talk about an SSH key but I don't know how 
that would

work when this image is used for the VM test framework.

I updated the instructions on the Wiki to make use of VirtIO for both 
the NIC and

disk controller.




Re: [Qemu-block] [PATCH v2 09/18] tests/vm/openbsd: Install Bash from the ports

2019-02-05 Thread Brad Smith

On 2/5/2019 9:23 AM, Philippe Mathieu-Daudé wrote:


Hi Brad,

On 2/5/19 2:57 PM, Brad Smith wrote:

If someone could point me in the right direction as to how the image is
created
I could look at coming up with something newer. I would prefer that over
some
of the workarounds I've seen to date.

I'm not an OpenBSD user, so I'm more than happy if you can help the
upstream community to test QEMU codebase on this OS. Testing helps us to
avoid code rot.

What we currently use to run tests is the 'tests/vm/openbsd' script.
The script itself doesn't document how it was built, but looking at the
commit of his introduction fdfaa33291eb we have:

 The image is prepared following instructions as in:

 https://wiki.qemu.org/Hosts/BSD


Ok, well that brings me to my next question. How do I get access to the 
Wiki to update

the instructions?




Re: [Qemu-block] [PATCH v2 09/18] tests/vm/openbsd: Install Bash from the ports

2019-02-05 Thread Brad Smith
If someone could point me in the right direction as to how the image is 
created
I could look at coming up with something newer. I would prefer that over 
some

of the workarounds I've seen to date.

On 2/5/2019 8:42 AM, Philippe Mathieu-Daudé wrote:

Hi Peter,

On 2/5/19 2:20 PM, Peter Maydell wrote:

On Tue, 29 Jan 2019 at 17:57, Philippe Mathieu-Daudé  wrote:

Various iotests scripts (run via 'make check-block')  use bash
specific extentions.  OpenBSD comes with the Korn shell as default.
Install bash to be able to run those tests.

Signed-off-by: Philippe Mathieu-Daudé 
---
  tests/vm/openbsd | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/tests/vm/openbsd b/tests/vm/openbsd
index 6263c8956b..e9c2a3f2c8 100755
--- a/tests/vm/openbsd
+++ b/tests/vm/openbsd
@@ -45,6 +45,8 @@ class OpenBSDVM(basevm.BaseVM):
  self.wait_ssh()
  sys.stderr.write("Disabling W^X on the build partition...\n")
  self.ssh_root_check("sed -E -i 's_(/tmp\ ffs)\ ([^\ ]*)_\\1 
\\2,wxallowed_' /etc/fstab")
+sys.stderr.write("Installing bash...\n")
+
self.ssh_root_check("PKG_PATH=https://ftp.openbsd.org/pub/OpenBSD/6.1/packages/amd64 
pkg_add bash")
  self.ssh_root("shutdown -p now")
  self.wait()


Wouldn't it make more sense to just update the image to include
the necessary package, the same way we do with all QEMU's
other build dependencies ?

Instead of updating the image, Daniel asked if we could upgrade this
image to a more recent release (to remove SDL1), but IIRC the outcome
was there is no manpower for that. Meanwhile, this kludge seems the
simplest way.
BTW This command is run once at image creation.