From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IzMst-0007Nt-B0 for qemu-devel@nongnu.org; Mon, 03 Dec 2007 20:47:39 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IzMsr-0007K2-Ja for qemu-devel@nongnu.org; Mon, 03 Dec 2007 20:47:38 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IzMsr-0007Jr-Fh for qemu-devel@nongnu.org; Mon, 03 Dec 2007 20:47:37 -0500 Received: from ug-out-1314.google.com ([66.249.92.173]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IzMsr-0003ms-Ak for qemu-devel@nongnu.org; Mon, 03 Dec 2007 20:47:37 -0500 Received: by ug-out-1314.google.com with SMTP id m2so2696uge for ; Mon, 03 Dec 2007 17:47:36 -0800 (PST) Message-ID: Date: Tue, 4 Dec 2007 02:47:36 +0100 From: "andrzej zaborowski" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: [Qemu-devel] Block device id's Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Qemu mailing list Hi, the -drive patch changed the name strings to for block devices to "drive", which carries about as much information as a serial number. With the previous naming the devices were easier to distinguish in the output of "info block" so I would like to change the naming and propose "" (for example "floppy0") for the devices that have only one bus and else "-" (for example "ide0-hd0"): --- a/vl.c +++ b/vl.c @@ -4844,6 +4844,8 @@ static int drive_init(const char *str, int snapshot, QEMUM achine *machine) { char buf[128]; char file[1024]; + char devname[128]; + const char *mediastr = ""; BlockInterfaceType interface; enum { MEDIA_DISK, MEDIA_CDROM } media; int bus_id, unit_id; @@ -4875,9 +4877,11 @@ static int drive_init(const char *str, int snapshot, QEMU Machine *machine) !strcmp(machine->name, "versatileab")) { interface = IF_SCSI; max_devs = MAX_SCSI_DEVS; + strcpy(devname, "scsi"); } else { interface = IF_IDE; max_devs = MAX_IDE_DEVS; + strcpy(devname, "ide"); } media = MEDIA_DISK; @@ -4900,6 +4904,7 @@ static int drive_init(const char *str, int snapshot, QEMUM achine *machine) } if (get_param_value(buf, sizeof(buf), "if", str)) { + strncpy(devname, buf, sizeof(devname)); if (!strcmp(buf, "ide")) { interface = IF_IDE; max_devs = MAX_IDE_DEVS; @@ -5057,7 +5062,10 @@ static int drive_init(const char *str, int snapshot, QEMU Machine *machine) /* init */ - snprintf(buf, sizeof(buf), "drive%d", nb_drives); + if (interface == IF_IDE || interface == IF_SCSI) + mediastr = (media == MEDIA_CDROM) ? "-cd" : "-hd"; + snprintf(buf, sizeof(buf), max_devs ? "%1$s%4$i%2$s%3$i" : "%s%s%i", + devname, mediastr, unit_id, bus_id); bdrv = bdrv_new(buf); drives_table[nb_drives].bdrv = bdrv; drives_table[nb_drives].interface = interface; I would like to commit this if there are no other propositions. Regards